Fix kernel stack size and TASK_COUNT usage.

This commit is contained in:
Ivan Baravy 2020-05-10 09:21:20 +03:00
parent 10f97725c4
commit 532f440ec9
2 changed files with 7 additions and 7 deletions

View File

@ -138,9 +138,8 @@ include 'core/string.inc'
include 'core/malloc.inc'
include 'core/heap.inc'
include 'core/dll.inc'
;new_sys_threads equ __pew_pew
;include 'core/sched.inc'
include 'core/taskman.inc'
;restore new_sys_threads
include 'core/timers.inc'
include 'core/clipboard.inc'
include 'core/syscall.inc'
@ -339,7 +338,8 @@ proc umka_os uses ebx esi edi
call sched_add_thread
mov dword[CURRENT_TASK], 2
mov dword[TASK_COUNT], 3
mov dword[TASK_COUNT], 2
mov dword[TASK_BASE], CURRENT_TASK + 2*sizeof.TASKDATA
mov [current_slot], SLOT_BASE+256*2
; movi ebx, 1
@ -360,7 +360,7 @@ proc umka_os uses ebx esi edi
xor ecx, ecx
call sched_add_thread
mov dword[TASK_COUNT], 6
mov dword[TASK_COUNT], 5
stdcall umka_install_thread, [monitor_thread]
@ -431,10 +431,10 @@ change_task:
public umka_install_thread
proc umka_install_thread _func
stdcall kernel_alloc, RING0_STACK_SIZE
stdcall kernel_alloc, RING0_STACK_SIZE + 512 ; fpu_state
mov ebx, eax
; mov edx, SLOT_BASE+256*6
mov edx, [TASK_COUNT]
inc edx
shl edx, 8
add edx, SLOT_BASE
call setup_os_slot

View File

@ -25,7 +25,7 @@ void scheduler(int signo, siginfo_t *info, void *context) {
// printf("##### saved\n");
if (ctx->uc_mcontext.__gregs[REG_EFL] & (1 << 21)) {
kos_current_task += 1;
if (kos_current_task == kos_task_count) {
if (kos_current_task > kos_task_count) {
kos_current_task = 1;
}
} else {