Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 4104 → Rev 4105

/kernel/trunk/core/exports.inc
82,6 → 82,8
delete_keyboard, 'DelKeyboard', \
get_cpu_freq, 'GetCpuFreq', \
\
new_sys_threads, 'CreateThread', \ ; ebx, ecx, edx
\
srv_handler, 'ServiceHandler', \
fpu_save, 'FpuSave', \
fpu_restore, 'FpuRestore', \
/kernel/trunk/core/taskman.inc
924,10 → 924,17
ret
endp
 
;ebx = 1 - kernel thread
;ecx=thread entry point
;edx=thread stack pointer
;creation flags 0x01 - debugged
; 0x02 - kernel
 
align 4
proc new_sys_threads
locals
slot dd ?
flags dd ?
app_cmdline dd ? ;0x00
app_path dd ? ;0x04
app_eip dd ? ;0x08
935,8 → 942,8
app_mem dd ? ;0x10
endl
 
cmp ebx, 1
jne .failed ;other subfunctions
shl ebx, 1
mov [flags], ebx
 
xor eax, eax
mov [app_eip], ecx
943,8 → 950,7
mov [app_cmdline], eax
mov [app_esp], edx
mov [app_path], eax
;mov esi,new_process_loading
;call sys_msg_board_str
 
call lock_application_table
 
call get_new_process_place
998,10 → 1004,8
 
lea eax, [app_cmdline]
stdcall set_app_params , [slot], eax, dword 0, \
dword 0,dword 0
dword 0, [flags]
 
;mov esi,new_process_running
;call sys_msg_board_str ;output information about succefull startup
mov eax, [process_number] ;set result
call unlock_application_table
ret
1207,14 → 1211,13
mov [ebx+REG_EIP], eax;app_entry
mov [ebx+REG_CS], dword app_code
mov ecx, USER_PRIORITY
mov eax, [CURRENT_TASK]
shl eax, 8 ; created by kernel?
cmp [SLOT_BASE+eax+APPDATA.dir_table], sys_pgdir - OS_BASE
jnz @f
cmp [app_path], 0 ; it is a thread?
jnz @f
 
test byte [flags], 2
jz @F
 
mov [ebx+REG_CS], dword os_code ; kernel thread
mov ecx, MAX_PRIORITY
 
@@:
mov [ebx+REG_EFLAGS], dword EFL_IOPL1+EFL_IF
 
1238,8 → 1241,6
mov [CURRENT_TASK+ebx+TASKDATA.state], dl
lea edx, [SLOT_BASE+ebx*8]
call scheduler_add_thread
;mov esi,new_process_running
;call sys_msg_board_str ;output information about succefull startup
ret
endp
 
/kernel/trunk/kernel.asm
5568,13 → 5568,13
 
align 4
syscall_threads: ; CreateThreads
; eax=1 create thread
;
; ebx=thread start
; ecx=thread stack value
; ecx=thread entry point
; edx=thread stack pointer
;
; on return : eax = pid
 
xor ebx, ebx
call new_sys_threads
 
mov [esp+32], eax