/kernel/trunk/core/mem.inc |
---|
238,8 → 238,8 |
;eax = current slot of process |
mov ecx,eax |
shl ecx,5 |
cmp byte [second_base_address+0x3000+ecx+0xa],0 ;if process running? |
jnz .next ;slot empty or process is terminating - go to next slot |
cmp byte [second_base_address+0x3000+ecx+0xa],9 ;if process running? |
jz .next ;skip empty slots |
shl ecx,3 |
cmp [second_base_address+0x80000+ecx+0xB8],ebx ;compare page directory addresses |
jnz .next |
/kernel/trunk/core/newproce.inc |
---|
292,7 → 292,7 |
call get_app_params ;parse header fields |
cmp esi,0 |
jz .failed |
jz .cleanfailed |
mov eax,[new_process_place] |
call create_app_cr3_table ;create page directory for new process |
/kernel/trunk/core/sched.inc |
---|
36,12 → 36,21 |
mov [edi+0x14], eax |
mov ebx,[0x3000] |
mov [prev_slot], ebx |
cmp [0xffff], byte 1 |
je .do_not_change_task |
.waiting_for_termination: |
.waiting_for_reuse: |
.waiting_for_event: |
cmp ebx, [0x3004] |
jb @f |
mov edi, 0x3000 |
xor ebx, ebx |
@@: |
add edi,0x20 |
inc ebx |
53,15 → 62,21 |
cmp al, 9 |
je .waiting_for_reuse |
cmp ebx,[0x3004] |
jbe @f |
mov ebx,1 |
mov edi,0x3020 |
@@: |
mov [0x3000],ebx |
mov [0x3010],edi |
cmp al, 5 |
jne .noevents |
call get_event_for_app |
test eax, eax |
jz .waiting_for_event |
mov [event_sched], eax |
mov [edi+0xA], byte 0 |
cmp ebx, [prev_slot] |
sete [0xffff] |
.noevents: |
.do_not_change_task: |
call _rdtsc |
92,6 → 107,7 |
uglobal |
align 4 |
far_jump: |
.offs dd ? |
.sel dw ? |
98,6 → 114,8 |
context_counter dd ? ;noname & halyavin |
next_usage_update dd ? |
timer_ticks dd ? |
prev_slot dd ? |
event_sched dd ? |
endg |