fix: multitasking now works with correct timer
This commit is contained in:
@ -38,11 +38,10 @@ void clock_init(struct registers *regs)
|
|||||||
|
|
||||||
static void clock_handler(struct registers *regs)
|
static void clock_handler(struct registers *regs)
|
||||||
{
|
{
|
||||||
(void)regs;
|
|
||||||
if (scheduler_counter % 10 == 0)
|
|
||||||
scheduler((uint32_t *)regs);
|
|
||||||
scheduler_counter++;
|
scheduler_counter++;
|
||||||
sleep_counter--;
|
sleep_counter--;
|
||||||
|
if (scheduler_counter % 100 == 0)
|
||||||
|
scheduler((uint32_t *)regs);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sleep(uint64_t delay)
|
void sleep(uint64_t delay)
|
||||||
|
|||||||
@ -31,6 +31,14 @@
|
|||||||
#error "This tutorial needs to be compiled with a ix86-elf compiler"
|
#error "This tutorial needs to be compiled with a ix86-elf compiler"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static void uwu(void)
|
||||||
|
{
|
||||||
|
while (1) {
|
||||||
|
// sleep(1000);
|
||||||
|
kprintf("uwu\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void bozo(int int_code)
|
static void bozo(int int_code)
|
||||||
{
|
{
|
||||||
(void)int_code;
|
(void)int_code;
|
||||||
@ -47,6 +55,7 @@ void kernel_main(multiboot_info_t *mbd, uint32_t magic)
|
|||||||
terminal_initialize();
|
terminal_initialize();
|
||||||
create_process(1);
|
create_process(1);
|
||||||
create_thread(current_pcb, shell_init);
|
create_thread(current_pcb, shell_init);
|
||||||
|
create_thread(current_pcb, uwu);
|
||||||
toris();
|
toris();
|
||||||
while (true)
|
while (true)
|
||||||
;
|
;
|
||||||
|
|||||||
Reference in New Issue
Block a user