Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 9691 → Rev 9692

/kernel/trunk/build.bat
21,7 → 21,6
fasm -m 65536 kernel.asm kernel.mnt
fasm -m 65536 kernel.asm kernel.bin -dUEFI=1
if not %errorlevel%==0 goto :Error_FasmFailed
erase lang.inc
goto :eof
 
 
/kernel/trunk/core/dll.inc
1155,8 → 1155,8
test eax, eax
jz .fail_and_free_user
mov ebx, [current_slot_idx]
shl ebx, 5
mov edx, [TASK_TABLE+ebx+TASKDATA.pid]
shl ebx, BSF sizeof.APPDATA
mov edx, [SLOT_BASE + ebx + APPDATA.tid]
mov [eax+HDLL.pid], edx
push eax
call init_dlls_in_thread
/kernel/trunk/core/heap.inc
1397,8 → 1397,8
ja .fail
 
mov ebx, [current_slot_idx]
shl ebx, BSF sizeof.TASKDATA
mov ebx, [TASK_TABLE + ebx + TASKDATA.pid]
shl ebx, BSF sizeof.APPDATA
mov ebx, [SLOT_BASE + ebx + APPDATA.tid]
mov eax, sizeof.SMAP
 
call create_kernel_object
/kernel/trunk/core/memory.inc
1007,8 → 1007,8
ja .buffer_overflow ;esi<0 - not enough memory in buffer
 
mov dword [edi+4], ebx
mov eax, [TASK_BASE]
mov eax, [eax+TASKDATA.pid] ;eax - our PID
mov eax, [current_slot]
mov eax, [eax + APPDATA.tid] ;eax - our PID
add edi, edx
mov [edi], eax
mov ecx, [msg_size]
/kernel/trunk/core/sys32.inc
180,8 → 180,8
mov cl, 3 ; debug_message code=debug_exception
.notify:
push ebx ; debug_message data
mov ebx, [TASK_BASE]
push [ebx+TASKDATA.pid] ; PID
mov ebx, [current_slot]
push [ebx + APPDATA.tid] ; PID
push ecx ; debug_message code ((here: ecx==1/3))
mov cl, 12 ; debug_message size
call debugger_notify ;; only ONE using, inline ??? SEE: core/debug.inc
214,11 → 214,11
call fs_execute_from_sysdir_param
pop ebx
.no_ud:
mov edx, [TASK_BASE];not scratched below
mov edx, [current_slot];not scratched below
if lang eq sp
DEBUGF 1, "K : Proceso - terminado forzado PID: %x [%s]\n", [edx+TASKDATA.pid], [current_slot]
DEBUGF 1, "K : Proceso - terminado forzado PID: %x [%s]\n", [edx + APPDATA.tid], [current_slot]
else
DEBUGF 1, "K : Process - forced terminate PID: %x [%s]\n", [edx+TASKDATA.pid], [current_slot]
DEBUGF 1, "K : Process - forced terminate PID: %x [%s]\n", [edx + APPDATA.tid], [current_slot]
end if
cmp bl, 0x08
jb .l0
343,9 → 343,8
call mutex_lock
 
mov eax, [current_slot_idx]
shl eax, BSF sizeof.TASKDATA
add eax, TASK_TABLE+TASKDATA.pid
mov eax, [eax]
shl eax, BSF sizeof.APPDATA
mov eax, [eax + SLOT_BASE + APPDATA.tid]
 
mov [application_table_owner], eax
 
506,8 → 505,8
jb .loop
; get process PID
mov eax, esi
shl eax, BSF sizeof.TASKDATA
mov eax, [eax+TASK_TABLE+TASKDATA.pid]
shl eax, BSF sizeof.APPDATA
mov eax, [eax + SLOT_BASE + APPDATA.tid]
; compare current lock input with process PID
cmp eax, [PID_lock_input]
jne @f
578,12 → 577,12
; debuggee test
pushad
mov edi, esi
shl edi, BSF sizeof.TASKDATA
mov eax, [SLOT_BASE+edi*8+APPDATA.debugger_slot]
shl edi, BSF sizeof.APPDATA
mov eax, [SLOT_BASE + edi + APPDATA.debugger_slot]
test eax, eax
jz .nodebug
movi ecx, 8
push dword [TASK_TABLE+edi+TASKDATA.pid]; PID
push dword [SLOT_BASE + edi + APPDATA.tid]; PID
push 2
call debugger_notify
pop ecx
653,8 → 652,8
.dont_activate:
 
push esi ; remove hd1 & cd & flp reservation
shl esi, BSF sizeof.TASKDATA
mov esi, [esi+TASK_TABLE+TASKDATA.pid]
shl esi, BSF sizeof.APPDATA
mov esi, [esi + SLOT_BASE + APPDATA.tid]
cmp [cd_status], esi
jnz @f
call free_cd_channel
669,9 → 668,8
 
pusha ; remove all port reservations
mov edx, esi
shl edx, BSF sizeof.TASKDATA
add edx, TASK_TABLE
mov edx, [edx+TASKDATA.pid]
shl edx, BSF sizeof.APPDATA
mov edx, [edx + SLOT_BASE + APPDATA.tid]
 
rmpr0:
 
717,7 → 715,7
mov [edi+TASK_TABLE + TASKDATA.state], TSTATE_FREE
; debugger test - terminate all debuggees
mov eax, 2
mov ecx, SLOT_BASE+2*0x100+APPDATA.debugger_slot
mov ecx, SLOT_BASE+2*sizeof.APPDATA + APPDATA.debugger_slot
.xd0:
cmp eax, [thread_count]
ja .xd1
731,7 → 729,7
popad
@@:
inc eax
add ecx, 0x100
add ecx, sizeof.APPDATA
jmp .xd0
.xd1:
;release slot
/kernel/trunk/core/taskman.inc
476,8 → 476,6
get_pid:
mov eax, [current_slot]
mov eax, [eax+APPDATA.tid]
mov eax, [TASK_BASE] ; delete
mov eax, [eax+TASKDATA.pid] ;
ret
 
pid_to_slot:
502,12 → 500,10
;ebx = maximum permitted offset
cmp [TASK_TABLE+ecx+TASKDATA.state], TSTATE_FREE
jz .endloop ;skip empty slots
cmp [TASK_TABLE+ecx+TASKDATA.pid], eax;check PID
jz .pid_found
;cmp [ecx+SLOT_BASE+APPDATA.state], TSTATE_FREE
;jz .endloop ;skip empty slots
;cmp [ecx+SLOT_BASE+APPDATA.pid], eax;check PID
;jz .pid_found
cmp [ecx*8 + SLOT_BASE + APPDATA.tid], eax;check PID
jz .pid_found
.endloop:
add ecx, sizeof.TASKDATA
;add ecx, sizeof.APPDATA
997,11 → 993,7
; set window state to 'normal' (non-minimized/maximized/rolled-up) state
mov [ebx+window_data+WDATA.fl_wstate], WSTATE_NORMAL
mov [ebx+window_data+WDATA.fl_redraw], 1
add ebx, TASK_TABLE ;ebx - pointer to information about process
 
mov eax, [process_number] ; delete
mov [ebx+TASKDATA.pid], eax ;set PID ;
 
;set draw data to full screen
xor eax, eax
mov [ecx+0], dword eax
/kernel/trunk/fs/iso9660.inc
57,8 → 57,8
reserve_ok2:
push eax
mov eax, [current_slot_idx]
shl eax, 5
mov eax, [eax+TASK_TABLE+TASKDATA.pid]
shl eax, BSF sizeof.APPDATA
mov eax, [eax + SLOT_BASE + APPDATA.tid]
mov [cd_status], eax
pop eax
sti
/kernel/trunk/gui/event.inc
68,10 → 68,8
;scratched: ebx,ecx,esi,edi
mov ebx, [current_slot]
add ebx, APP_OBJ_OFFSET
;mov edx, [cyrrent_slot]
;mov edx, [edx+APPDATA.tid]
mov edx, [TASK_BASE]
mov edx, [edx+TASKDATA.pid]
mov edx, [current_slot]
mov edx, [edx+APPDATA.tid]
pushfd
cli
;--------------------------------------
/kernel/trunk/kernel.asm
1182,11 → 1182,7
list_add_tail ebx, ecx
 
mov [edx+APPDATA.wnd_number], dh
mov byte [edx+APPDATA.tid], dh ;?
mov eax, edx
shr eax, 3
add eax, TASK_TABLE - (SLOT_BASE shr 3)
mov byte [eax+TASKDATA.pid], dh
mov byte [edx+APPDATA.tid], dh
 
ret
endp
1923,8 → 1919,6
pusha
mov edx, [current_slot]
mov edx, [edx+APPDATA.tid]
mov edx, [TASK_BASE] ; delete
mov edx, [edx+TASKDATA.pid] ;
call socket_process_end
popa
;--------------------------------------
2050,7 → 2044,7
ja noprocessterminate
mov eax, [thread_count]
shl ecx, BSF sizeof.TASKDATA
mov edx, [ecx+TASK_TABLE+TASKDATA.pid]
mov edx, [ecx*8 + SLOT_BASE + APPDATA.tid]
add ecx, TASK_TABLE+TASKDATA.state
cmp byte [ecx], TSTATE_FREE
jz noprocessterminate
2659,7 → 2653,6
 
; +30: PID/TID
mov eax, [ecx*8 + SLOT_BASE + APPDATA.tid]
mov eax, [ecx+TASK_TABLE+TASKDATA.pid]
stosd
 
; window position and size
3616,10 → 3609,8
mov [RESERVED_PORTS], eax
shl eax, 4
add eax, RESERVED_PORTS
;mov ebx, [current_slot]
;mov ebx, [ebx+APPDATA.tid]
mov ebx, [TASK_BASE]
mov ebx, [ebx+TASKDATA.pid]
mov ebx, [current_slot]
mov ebx, [ebx+APPDATA.tid]
mov [eax], ebx
mov [eax+4], ecx
mov [eax+8], edx
3633,10 → 3624,8
mov eax, [RESERVED_PORTS]; no reserved areas ?
test eax, eax
jz frpal2
;mov ebx, [current_slot]
;mov ebx, [ebx+APPDATA.tid]
mov ebx, [TASK_BASE]
mov ebx, [ebx+TASKDATA.pid]
mov ebx, [current_slot]
mov ebx, [ebx+APPDATA.tid]
frpal3:
mov edi, eax
shl edi, 4
4420,10 → 4409,8
jnz @f
; get current PID
mov eax, [current_slot_idx]
shl eax, 5
mov eax, [eax+TASK_TABLE+TASKDATA.pid]
;shl eax, 8
;mov eax, [eax+SLOT_BASE+APPDATA.tid]
shl eax, BSF sizeof.APPDATA
mov eax, [eax+SLOT_BASE+APPDATA.tid]
; set current PID for lock input
mov [PID_lock_input], eax
@@:
4437,10 → 4424,8
jz @f
; get current PID
mov ebx, [current_slot_idx]
shl ebx, 5
mov ebx, [ebx+TASK_TABLE+TASKDATA.pid]
;shl ebx, 8
;mov ebx, [ebx+SLOT_BASE+APPDATA.tid]
shl ebx, BSF sizeof.APPDATA
mov ebx, [ebx+SLOT_BASE+APPDATA.tid]
; compare current lock input with current PID
cmp ebx, eax
jne @f
/kernel/trunk/network/socket.inc
679,8 → 679,8
jz .invalid
 
; Change sockets thread owner ID to that of the current thread
mov ebx, [TASK_BASE]
mov ebx, [ebx + TASKDATA.pid]
mov ebx, [current_slot]
mov ebx, [ebx + APPDATA.tid]
mov [eax + SOCKET.TID], ebx
 
; Return socket number to caller
925,8 → 925,8
jne @f
 
; Change PID to that of current process
mov ebx, [TASK_BASE]
mov ebx, [ebx + TASKDATA.pid]
mov ebx, [current_slot]
mov ebx, [ebx + APPDATA.tid]
mov [eax + SOCKET.PID], ebx
mov [eax + SOCKET.TID], ebx ; currently TID = PID in kolibrios :(
@@:
1114,8 → 1114,8
jne @f
 
; Change PID to that of current process
mov ebx, [TASK_BASE]
mov ebx, [ebx + TASKDATA.pid]
mov ebx, [current_slot]
mov ebx, [ebx + APPDATA.tid]
mov [eax + SOCKET.PID], ebx
mov [eax + SOCKET.TID], ebx ; currently TID = PID in kolibrios :(
@@:
1862,9 → 1862,10
push edx
mov edx, [TASK_BASE]
mov [edx + TASKDATA.state], TSTATE_RUN_SUSPENDED
mov edx, [current_slot]
 
; Remember the thread ID so we can wake it up again
mov edx, [edx + TASKDATA.pid]
mov edx, [edx + APPDATA.tid]
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_block: suspending thread: %u\n", edx
mov [eax + SOCKET.TID], edx
pop edx
1902,12 → 1903,15
jz .error2
xor ecx, ecx
inc ecx
mov esi, TASK_DATA
;mov esi, TASK_DATA
mov esi, SLOT_BASE + sizeof.APPDATA
.next:
cmp [esi + TASKDATA.pid], ebx
;cmp [esi + TASKDATA.pid], ebx
cmp [esi + APPDATA.tid], ebx
je .found
inc ecx
add esi, sizeof.TASKDATA
;add esi, sizeof.TASKDATA
add esi, sizeof.APPDATA
cmp ecx, [thread_count]
jbe .next
 
1927,7 → 1931,7
 
; Socket and thread exists and socket is of non blocking type.
; We'll try to flag an event to the thread.
shl ecx, 8
shl ecx, BSF sizeof.APPDATA
or [SLOT_BASE + ecx + APPDATA.occurred_events], EVENT_NETWORK
 
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_notify: poking thread %u!\n", ebx
1939,7 → 1943,8
; Socket and thread exists and socket is of blocking type
; We'll try to unblock it.
and [eax + SOCKET.state], not SS_BLOCKED ; Clear the 'socket is blocked' flag
mov [esi + TASKDATA.state], TSTATE_RUNNING ; Run the thread
shl ecx, BSF sizeof.TASKDATA
mov [ecx + TASK_TABLE + TASKDATA.state], TSTATE_RUNNING ; Run the thread
 
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_notify: Unblocked socket!\n"
pop esi ecx ebx
2009,8 → 2014,8
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_alloc: number=%u\n", edi
 
; Fill in PID
mov ebx, [TASK_BASE]
mov ebx, [ebx + TASKDATA.pid]
mov ebx, [current_slot]
mov ebx, [ebx + APPDATA.tid]
mov [eax + SOCKET.PID], ebx
mov [eax + SOCKET.TID], ebx ; currently TID = PID in kolibrios :(
 
2323,8 → 2328,8
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_check_owner: %x\n", eax
 
push ebx
mov ebx, [TASK_BASE]
mov ebx, [ebx + TASKDATA.pid]
mov ebx, [current_slot]
mov ebx, [ebx + APPDATA.tid]
cmp [eax + SOCKET.PID], ebx
pop ebx
 
/kernel/trunk/video/cursors.inc
423,8 → 423,6
push edi
 
mov eax, [current_slot_idx]
;shl eax, 5
;mov eax, [TASK_TABLE+eax+TASKDATA.pid]
shl eax, 8
mov eax, [eax + SLOT_BASE + APPDATA.tid]
mov ebx, [src]