fix: multitasking now works with correct timer

This commit is contained in:
0x35c
2025-11-11 14:00:30 +01:00
parent 0d7db61fb1
commit e4f5a377a3
2 changed files with 11 additions and 3 deletions

View File

@ -38,11 +38,10 @@ void clock_init(struct registers *regs)
static void clock_handler(struct registers *regs)
{
(void)regs;
if (scheduler_counter % 10 == 0)
scheduler((uint32_t *)regs);
scheduler_counter++;
sleep_counter--;
if (scheduler_counter % 100 == 0)
scheduler((uint32_t *)regs);
}
void sleep(uint64_t delay)

View File

@ -31,6 +31,14 @@
#error "This tutorial needs to be compiled with a ix86-elf compiler"
#endif
static void uwu(void)
{
while (1) {
// sleep(1000);
kprintf("uwu\n");
}
}
static void bozo(int int_code)
{
(void)int_code;
@ -47,6 +55,7 @@ void kernel_main(multiboot_info_t *mbd, uint32_t magic)
terminal_initialize();
create_process(1);
create_thread(current_pcb, shell_init);
create_thread(current_pcb, uwu);
toris();
while (true)
;