/kernel/trunk/core/debug.inc |
---|
21,7 → 21,7 |
; destroys eax |
mov eax, [CURRENT_TASK] |
shl eax, 8 |
mov [eax+0x80000+APPDATA.dbg_event_mem], ebx |
mov [eax+SLOT_BASE+APPDATA.dbg_event_mem], ebx |
ret |
get_debuggee_slot: |
37,7 → 37,7 |
shl eax, 5 |
push ebx |
mov ebx, [CURRENT_TASK] |
cmp [0x80000+eax*8+APPDATA.debugger_slot], ebx |
cmp [SLOT_BASE+eax*8+APPDATA.debugger_slot], ebx |
pop ebx |
jnz .ret_bad |
; clc ; automatically |
51,7 → 51,7 |
; destroys eax,ebx |
call get_debuggee_slot |
jc .ret |
and dword [eax*8+0x80000+APPDATA.debugger_slot], 0 |
and dword [eax*8+SLOT_BASE+APPDATA.debugger_slot], 0 |
call do_resume |
.ret: |
sti |
227,7 → 227,7 |
call get_debuggee_slot |
jc .errret |
mov ebp, eax |
lea eax, [eax*8+0x80000+APPDATA.dbg_regs] |
lea eax, [eax*8+SLOT_BASE+APPDATA.dbg_regs] |
; [eax]=dr0, [eax+4]=dr1, [eax+8]=dr2, [eax+C]=dr3 |
; [eax+10]=dr7 |
add edx, std_application_base_address |
358,7 → 358,7 |
.1: |
mov eax, ebp |
shl eax, 8 |
mov edx, [0x80000+eax+APPDATA.dbg_event_mem] |
mov edx, [SLOT_BASE+eax+APPDATA.dbg_event_mem] |
test edx, edx |
jz .ret |
; read buffer header |
414,7 → 414,7 |
; new debug event |
mov eax, ebp |
shl eax, 8 |
or byte [0x80000+eax+APPDATA.event_mask+1], 1 ; set flag 100h |
or byte [SLOT_BASE+eax+APPDATA.event_mask+1], 1 ; set flag 100h |
.ret: |
ret |
432,7 → 432,7 |
; set DRx registers for task and continue |
mov eax, [CURRENT_TASK] |
shl eax, 8 |
add eax, 0x80000+APPDATA.dbg_regs |
add eax, SLOT_BASE+APPDATA.dbg_regs |
mov ecx, [eax+0] |
mov dr0, ecx |
mov ecx, [eax+4] |
455,7 → 455,7 |
cli |
mov eax, [CURRENT_TASK] |
shl eax, 8 |
mov eax, [0x80000+eax+APPDATA.debugger_slot] |
mov eax, [SLOT_BASE+eax+APPDATA.debugger_slot] |
test eax, eax |
jnz .debug |
sti |
/kernel/trunk/core/dll.inc |
---|
156,12 → 156,12 |
.wait: |
mov ebx,[CURRENT_TASK] |
shl ebx,8 |
test dword [ebx+PROC_BASE+0xA8],EVENT_NOTIFY |
test dword [ebx+SLOT_BASE+0xA8],EVENT_NOTIFY |
jz @f |
and dword [ebx+PROC_BASE+0xA8], not EVENT_NOTIFY |
and dword [ebx+SLOT_BASE+0xA8], not EVENT_NOTIFY |
mov edi, [p_ev] |
mov dword [edi], EV_INTR |
mov eax, [ebx+PROC_BASE+APPDATA.event] |
mov eax, [ebx+SLOT_BASE+APPDATA.event] |
mov dword [edi+4], eax |
ret |
@@: |
998,7 → 998,7 |
mov ecx,[CURRENT_TASK] |
shl ecx,8 |
add ecx, PROC_BASE+APP_OBJ_OFFSET |
add ecx, SLOT_BASE+APP_OBJ_OFFSET |
pushfd |
cli |
/kernel/trunk/core/fpu.inc |
---|
57,7 → 57,7 |
jne .save |
.copy: |
shl eax, 8 |
mov esi, [eax+PROC_BASE+APPDATA.fpu_state] |
mov esi, [eax+SLOT_BASE+APPDATA.fpu_state] |
mov ecx, 512/4 |
cld |
rep movsd |
72,7 → 72,7 |
mov [fpu_owner], eax |
shl ecx, 8 |
mov ecx, [ecx+PROC_BASE+APPDATA.fpu_state] |
mov ecx, [ecx+SLOT_BASE+APPDATA.fpu_state] |
bt [cpu_caps], CAPS_SSE |
jnc .no_SSE |
117,7 → 117,7 |
ret |
.copy: |
shl eax, 8 |
mov edi, [eax+PROC_BASE+APPDATA.fpu_state] |
mov edi, [eax+SLOT_BASE+APPDATA.fpu_state] |
mov ecx, 512/4 |
cld |
rep movsd |
139,7 → 139,7 |
je .exit |
shl ebx, 8 |
mov eax, [ebx+PROC_BASE+APPDATA.fpu_state] |
mov eax, [ebx+SLOT_BASE+APPDATA.fpu_state] |
bt [cpu_caps], CAPS_SSE |
jnc .no_SSE |
147,7 → 147,7 |
mov ebx, [CURRENT_TASK] |
mov [fpu_owner], ebx |
shl ebx, 8 |
mov eax, [ebx+PROC_BASE+APPDATA.fpu_state] |
mov eax, [ebx+SLOT_BASE+APPDATA.fpu_state] |
fxrstor [eax] |
.exit: |
restore_ring3_context |
158,7 → 158,7 |
mov ebx, [CURRENT_TASK] |
mov [fpu_owner], ebx |
shl ebx, 8 |
mov eax, [ebx+PROC_BASE+APPDATA.fpu_state] |
mov eax, [ebx+SLOT_BASE+APPDATA.fpu_state] |
frstor [eax] |
restore_ring3_context |
iret |
186,7 → 186,7 |
mov ebx, [ss:CURRENT_TASK] |
shl ebx, 8 |
mov eax, [ss:ebx+PROC_BASE+APPDATA.fpu_handler] |
mov eax, [ss:ebx+SLOT_BASE+APPDATA.fpu_handler] |
test eax, eax |
jz .default |
230,7 → 230,7 |
mov ebx, [ss:CURRENT_TASK] |
shl ebx, 8 |
mov eax, [ss:ebx+PROC_BASE+APPDATA.sse_handler] |
mov eax, [ss:ebx+SLOT_BASE+APPDATA.sse_handler] |
test eax, eax |
jz .default |
/kernel/trunk/core/heap.inc |
---|
616,20 → 616,20 |
mov ebx,[CURRENT_TASK] |
shl ebx,8 |
mov eax, [PROC_BASE+APPDATA.heap_top+ebx] |
mov eax, [SLOT_BASE+APPDATA.heap_top+ebx] |
test eax, eax |
jz @F |
sub eax,[PROC_BASE+APPDATA.heap_base+ebx] |
sub eax,[SLOT_BASE+APPDATA.heap_base+ebx] |
sub eax, 4096 |
ret |
@@: |
mov esi, [PROC_BASE+APPDATA.mem_size+ebx] |
mov esi, [SLOT_BASE+APPDATA.mem_size+ebx] |
add esi, 4095 |
and esi, not 4095 |
mov [PROC_BASE+APPDATA.mem_size+ebx], esi |
mov [SLOT_BASE+APPDATA.mem_size+ebx], esi |
mov eax, HEAP_TOP |
mov [PROC_BASE+APPDATA.heap_base+ebx], esi |
mov [PROC_BASE+APPDATA.heap_top+ebx], eax |
mov [SLOT_BASE+APPDATA.heap_base+ebx], esi |
mov [SLOT_BASE+APPDATA.heap_top+ebx], eax |
sub eax, esi |
add esi, new_app_base |
653,8 → 653,8 |
mov ebx, [CURRENT_TASK] |
shl ebx, 8 |
mov esi, dword [ebx+PROC_BASE+APPDATA.heap_base]; heap_base |
mov edi, dword [ebx+PROC_BASE+APPDATA.heap_top]; heap_top |
mov esi, dword [ebx+SLOT_BASE+APPDATA.heap_base]; heap_base |
mov edi, dword [ebx+SLOT_BASE+APPDATA.heap_top]; heap_top |
add esi, new_app_base |
add edi, new_app_base |
l_0: |
695,7 → 695,7 |
mov ebx, [alloc_size] |
add ebx, 0xFFF |
and ebx, not 0xFFF |
add ebx, [PROC_BASE+APPDATA.mem_size+edx] |
add ebx, [SLOT_BASE+APPDATA.mem_size+edx] |
call update_mem_size |
mov eax, esi |
752,9 → 752,9 |
.not_used: |
mov edx, [CURRENT_TASK] |
shl edx, 8 |
mov esi, dword [edx+PROC_BASE+APPDATA.heap_base]; heap_base |
mov edi, dword [edx+PROC_BASE+APPDATA.heap_top]; heap_top |
sub ebx, [edx+PROC_BASE+APPDATA.mem_size] |
mov esi, dword [edx+SLOT_BASE+APPDATA.heap_base]; heap_base |
mov edi, dword [edx+SLOT_BASE+APPDATA.heap_top]; heap_top |
sub ebx, [edx+SLOT_BASE+APPDATA.mem_size] |
neg ebx |
call update_mem_size |
add esi, new_app_base |
/kernel/trunk/core/memory.inc |
---|
458,10 → 458,10 |
mov edx,[CURRENT_TASK] |
shl edx,8 |
cmp [PROC_BASE+APPDATA.heap_base+edx],0 |
cmp [SLOT_BASE+APPDATA.heap_base+edx],0 |
jne .exit |
mov esi, [PROC_BASE+APPDATA.mem_size+edx] |
mov esi, [SLOT_BASE+APPDATA.mem_size+edx] |
add esi, 4095 |
and esi, not 4095 |
562,10 → 562,10 |
; ebx = new memory size |
; destroys eax,ecx,edx |
mov [PROC_BASE+APPDATA.mem_size+edx],ebx |
mov [SLOT_BASE+APPDATA.mem_size+edx],ebx |
;search threads and update |
;application memory size infomation |
mov ecx,[PROC_BASE+APPDATA.dir_table+edx] |
mov ecx,[SLOT_BASE+APPDATA.dir_table+edx] |
mov eax,2 |
.search_threads: |
579,9 → 579,9 |
cmp word [CURRENT_TASK+edx+TASKDATA.state],9 ;if slot empty? |
jz .search_threads_next |
shl edx,3 |
cmp [PROC_BASE+edx+APPDATA.dir_table],ecx ;if it is our thread? |
cmp [SLOT_BASE+edx+APPDATA.dir_table],ecx ;if it is our thread? |
jnz .search_threads_next |
mov [PROC_BASE+edx+APPDATA.mem_size],ebx ;update memory size |
mov [SLOT_BASE+edx+APPDATA.mem_size],ebx ;update memory size |
.search_threads_next: |
inc eax |
jmp .search_threads |
838,7 → 838,7 |
mov eax,[CURRENT_TASK] |
shl eax,8 |
add eax, PROC_BASE |
add eax, SLOT_BASE |
pushf |
cli |
mov [eax+0xA0],ebx ;set fields in extended information area |
876,7 → 876,7 |
mov [dst_slot], eax |
shl eax,8 |
mov edi,[eax+PROC_BASE+0xa0] ;is ipc area defined? |
mov edi,[eax+SLOT_BASE+0xa0] ;is ipc area defined? |
test edi,edi |
jz .no_ipc_area |
885,10 → 885,10 |
and ebx, 0xFFF |
mov [dst_offset], ebx |
mov esi, [eax+PROC_BASE+0xa4] |
mov esi, [eax+SLOT_BASE+0xa4] |
mov [buf_size], esi |
stdcall map_mem, [ipc_tmp], [PROC_BASE+eax+0xB8],\ |
stdcall map_mem, [ipc_tmp], [SLOT_BASE+eax+0xB8],\ |
edi, esi |
mov edi, [dst_offset] |
942,7 → 942,7 |
mov eax, [dst_slot] |
shl eax, 8 |
or [eax+PROC_BASE+0xA8],dword 0x40 |
or [eax+SLOT_BASE+0xA8],dword 0x40 |
cmp dword [check_idle_semaphore],20 |
jge .ipc_no_cis |
1039,8 → 1039,8 |
ja @f |
mov ecx, [CURRENT_TASK] |
shl ecx, 8 |
mov eax, [ecx+PROC_BASE+APPDATA.fpu_handler] |
mov [ecx+PROC_BASE+APPDATA.fpu_handler], ebx |
mov eax, [ecx+SLOT_BASE+APPDATA.fpu_handler] |
mov [ecx+SLOT_BASE+APPDATA.fpu_handler], ebx |
mov [esp+36], eax |
ret |
@@: |
1066,8 → 1066,8 |
ja @f |
mov ecx, [CURRENT_TASK] |
shl ecx, 8 |
mov eax, [ecx+PROC_BASE+APPDATA.sse_handler] |
mov [ecx+PROC_BASE+APPDATA.sse_handler], ebx |
mov eax, [ecx+SLOT_BASE+APPDATA.sse_handler] |
mov [ecx+SLOT_BASE+APPDATA.sse_handler], ebx |
mov [esp+36], eax |
ret |
@@: |
/kernel/trunk/core/sys32.inc |
---|
10,7 → 10,6 |
idtreg: |
dw 8*0x41-1 |
dd idts+8 |
;label idts at 0xB100-8 |
build_process_gdt_tss_pointer: |
122,7 → 121,7 |
cli |
mov eax, [CURRENT_TASK] |
shl eax, 8 |
mov eax, [0x80000+eax+APPDATA.debugger_slot] |
mov eax, [SLOT_BASE+eax+APPDATA.debugger_slot] |
test eax, eax |
jnz .debug |
sti |
582,7 → 581,7 |
push esi ;save .slot |
shl esi, 8 |
cmp [PROC_BASE+esi+APPDATA.dir_table], 0 |
cmp [SLOT_BASE+esi+APPDATA.dir_table], 0 |
jne @F |
add esp, 4 |
ret |
601,7 → 600,7 |
mov esi, [.slot] |
shl esi,8 |
add esi, PROC_BASE+APP_OBJ_OFFSET |
add esi, SLOT_BASE+APP_OBJ_OFFSET |
@@: |
mov eax, [esi+APPOBJ.fd] |
test eax, eax |
619,7 → 618,7 |
@@: |
mov eax, [.slot] |
shl eax, 8 |
mov eax,[PROC_BASE+eax+APPDATA.dir_table] |
mov eax,[SLOT_BASE+eax+APPDATA.dir_table] |
stdcall destroy_app_space, eax |
mov esi, [.slot] |
627,7 → 626,7 |
jne @F |
mov [fpu_owner],1 |
mov eax, [256+PROC_BASE+APPDATA.fpu_state] |
mov eax, [256+SLOT_BASE+APPDATA.fpu_state] |
clts |
bt [cpu_caps], CAPS_SSE |
jnc .no_SSE |
732,7 → 731,7 |
pushad |
mov edi, esi |
shl edi, 5 |
mov eax, [0x80000+edi*8+APPDATA.debugger_slot] |
mov eax, [SLOT_BASE+edi*8+APPDATA.debugger_slot] |
test eax, eax |
jz .nodebug |
push 8 |
747,13 → 746,13 |
mov ebx, [.slot] |
shl ebx, 8 |
mov ebx,[PROC_BASE+ebx+APPDATA.pl0_stack] |
mov ebx,[SLOT_BASE+ebx+APPDATA.pl0_stack] |
stdcall kernel_free, ebx |
mov edi, [.slot] |
shl edi,8 |
add edi,0x80000 |
add edi,SLOT_BASE |
mov eax, 0x20202020 |
stosd |
stosd |
763,7 → 762,7 |
rep stosd |
; activate window |
movzx eax, word [0xC000 + esi*2] |
movzx eax, word [WIN_STACK + esi*2] |
cmp eax, [TASK_COUNT] |
jne .dont_activate |
pushad |
771,7 → 770,7 |
dec eax |
cmp eax, 1 |
jbe .nothing_to_activate |
lea esi, [0xc400+eax*2] |
lea esi, [WIN_POS+eax*2] |
movzx edi, word [esi] ; edi = process |
shl edi, 5 |
cmp [CURRENT_TASK + edi + TASKDATA.state], byte 9 ; skip dead slots |
870,7 → 869,7 |
mov [edi+CURRENT_TASK + TASKDATA.state],byte 9 |
; debugger test - terminate all debuggees |
mov eax, 2 |
mov ecx, 0x80000+2*0x100+APPDATA.debugger_slot |
mov ecx, SLOT_BASE+2*0x100+APPDATA.debugger_slot |
.xd0: |
cmp eax, [TASK_COUNT] |
ja .xd1 |
/kernel/trunk/core/syscall.inc |
---|
54,7 → 54,7 |
push eax |
mov eax, [ss:CURRENT_TASK] |
shl eax, 8 |
mov eax, [ss:PROC_BASE + eax + APPDATA.pl0_stack] |
mov eax, [ss:SLOT_BASE + eax + APPDATA.pl0_stack] |
lea esp, [ss:eax + RING0_STACK_SIZE] ; configure ESP |
mov eax, [ss:sysenter_stack - 4] ; eax - original eax, from app |
sti |
99,7 → 99,7 |
mov [ss:sysenter_stack - 4], eax |
mov eax, [ss:CURRENT_TASK] |
shl eax, 8 |
mov eax, [ss:PROC_BASE + eax + APPDATA.pl0_stack] |
mov eax, [ss:SLOT_BASE + eax + APPDATA.pl0_stack] |
lea esp, [ss:eax + RING0_STACK_SIZE] ; configure ESP |
mov eax, [ss:sysenter_stack - 4] ; eax - original eax, from app |
sti |
/kernel/trunk/core/taskman.inc |
---|
159,7 → 159,7 |
mov [slot], eax |
shl eax, 8 |
add eax, PROC_BASE |
add eax, SLOT_BASE |
mov [slot_base], eax |
mov edi, eax |
_clear_ 256 ;clean extended information about process |
487,7 → 487,7 |
mov esi, [CURRENT_TASK] |
mov ebx, esi |
shl esi,8 |
mov [PROC_BASE+esi+0xB8],eax |
mov [SLOT_BASE+esi+0xB8],eax |
imul ebx,tss_step |
add ebx,tss_data |
mov [ebx+28], eax |
531,7 → 531,7 |
cmp byte [CURRENT_TASK+ecx+0xa],9 ;if process running? |
jz @f ;skip empty slots |
shl ecx,3 |
cmp [PROC_BASE+ecx+0xB8],ebx ;compare page directory addresses |
cmp [SLOT_BASE+ecx+0xB8],ebx ;compare page directory addresses |
jnz @f |
inc edx ;thread found |
@@: |
635,7 → 635,7 |
cmp word [CURRENT_TASK+eax+0xa],0 |
jnz .failed |
shl eax,3 |
mov eax,[PROC_BASE+eax+0xb8] |
mov eax,[SLOT_BASE+eax+0xb8] |
test eax,eax |
jz .failed |
738,7 → 738,7 |
add ebx, new_app_base |
push ecx |
stdcall map_memEx, [proc_mem_map],\ |
[PROC_BASE+eax+0xB8],\ |
[SLOT_BASE+eax+0xB8],\ |
ebx, ecx |
pop ecx |
804,7 → 804,7 |
add ebx, new_app_base |
push ecx |
stdcall map_memEx, [proc_mem_map],\ |
[PROC_BASE+eax+0xB8],\ |
[SLOT_BASE+eax+0xB8],\ |
ebx, ecx |
pop ecx |
868,12 → 868,12 |
mov esi,[CURRENT_TASK] |
shl esi,8 |
add esi,PROC_BASE |
add esi,SLOT_BASE |
mov ebx,esi ;ebx=esi - pointer to extended information about current thread |
mov edi, eax |
shl edi,8 |
add edi,PROC_BASE |
add edi,SLOT_BASE |
mov edx,edi ;edx=edi - pointer to extended infomation about new thread |
mov ecx,256/4 |
xor eax, eax |
950,9 → 950,9 |
mov ebx, eax |
shl eax, 8 |
mov [eax+PROC_BASE+APPDATA.fpu_state], edi |
mov [eax+PROC_BASE+APPDATA.fpu_handler], 0 |
mov [eax+PROC_BASE+APPDATA.sse_handler], 0 |
mov [eax+SLOT_BASE+APPDATA.fpu_state], edi |
mov [eax+SLOT_BASE+APPDATA.fpu_handler], 0 |
mov [eax+SLOT_BASE+APPDATA.sse_handler], 0 |
mov esi, fpu_data |
mov ecx, 512/4 |
963,18 → 963,18 |
inc dword [TASK_COUNT] ;update number of processes |
.noinc: |
shl ebx,8 |
lea edx, [ebx+PROC_BASE+APP_EV_OFFSET] |
mov [PROC_BASE+APPDATA.fd_ev+ebx],edx |
mov [PROC_BASE+APPDATA.bk_ev+ebx],edx |
lea edx, [ebx+SLOT_BASE+APP_EV_OFFSET] |
mov [SLOT_BASE+APPDATA.fd_ev+ebx],edx |
mov [SLOT_BASE+APPDATA.bk_ev+ebx],edx |
add edx, APP_OBJ_OFFSET-APP_EV_OFFSET |
mov [PROC_BASE+APPDATA.fd_obj+ebx],edx |
mov [PROC_BASE+APPDATA.bk_obj+ebx],edx |
mov [SLOT_BASE+APPDATA.fd_obj+ebx],edx |
mov [SLOT_BASE+APPDATA.bk_obj+ebx],edx |
mov ecx, [def_cursor] |
mov [PROC_BASE+APPDATA.cursor+ebx],ecx |
mov [SLOT_BASE+APPDATA.cursor+ebx],ecx |
mov eax, [pl0_stack] |
mov [PROC_BASE+APPDATA.pl0_stack+ebx],eax |
mov [SLOT_BASE+APPDATA.pl0_stack+ebx],eax |
shr ebx,3 |
mov eax, new_app_base |
990,7 → 990,7 |
add eax, 256 |
jc @f |
cmp eax, [PROC_BASE+APPDATA.mem_size+ebx*8] |
cmp eax, [SLOT_BASE+APPDATA.mem_size+ebx*8] |
ja @f |
add edx, new_app_base |
1003,7 → 1003,7 |
mov eax, edx |
add eax, 1024 |
jc @f |
cmp eax, [PROC_BASE+APPDATA.mem_size+ebx*8] |
cmp eax, [SLOT_BASE+APPDATA.mem_size+ebx*8] |
ja @f |
add edx, new_app_base |
stdcall k_strncpy, edx, [app_path], 1024 |
1050,7 → 1050,7 |
;set cr3 register in TSS of application |
mov ecx, [slot] |
shl ecx, 8 |
mov eax,[PROC_BASE+ecx+APPDATA.dir_table] |
mov eax,[SLOT_BASE+ecx+APPDATA.dir_table] |
mov [edi+TSS._cr3],eax |
mov esi,[params] |
1104,7 → 1104,7 |
jz .no_debug |
mov [CURRENT_TASK+ebx+0xa],byte 1 ;set process state - suspended |
mov eax,[CURRENT_TASK] |
mov [PROC_BASE+ebx*8+0xac],eax ;set debugger PID - current |
mov [SLOT_BASE+ebx*8+0xac],eax ;set debugger PID - current |
.no_debug: |
mov esi,new_process_running |
call sys_msg_board_str ;output information about succefull startup |