[task] um, cooperative multi-tasking? that's good, right?
This commit is contained in:
parent
ee04a7271d
commit
3ee67c75e3
@ -74,11 +74,11 @@ void
|
||||
irq_handler(struct regs *r) {
|
||||
void (*handler)(struct regs *r);
|
||||
handler = irq_routines[r->int_no - 32];
|
||||
if (handler) {
|
||||
handler(r);
|
||||
}
|
||||
if (r->int_no >= 40) {
|
||||
outportb(0xA0, 0x20);
|
||||
}
|
||||
outportb(0x20, 0x20);
|
||||
if (handler) {
|
||||
handler(r);
|
||||
}
|
||||
}
|
||||
|
@ -20,8 +20,8 @@ timer_handler(
|
||||
++timer_ticks;
|
||||
if (timer_ticks % 18 == 0) {
|
||||
++ticker;
|
||||
switch_task();
|
||||
}
|
||||
//switch_task();
|
||||
}
|
||||
|
||||
void timer_install() {
|
||||
|
@ -118,7 +118,7 @@ int main(struct multiboot *mboot_ptr, uint32_t mboot_mag, uintptr_t esp)
|
||||
}
|
||||
__asm__ __volatile__ ("sti");
|
||||
|
||||
start_shell();
|
||||
//start_shell();
|
||||
|
||||
/*
|
||||
* Aw man...
|
||||
@ -126,15 +126,14 @@ int main(struct multiboot *mboot_ptr, uint32_t mboot_mag, uintptr_t esp)
|
||||
|
||||
uint32_t child = fork();
|
||||
|
||||
uint32_t i = getpid();
|
||||
while (1) {
|
||||
__asm__ __volatile__ ("cli");
|
||||
uint32_t i = getpid();
|
||||
if (i == 1) {
|
||||
putch('A');
|
||||
} else {
|
||||
putch('B');
|
||||
}
|
||||
__asm__ __volatile__ ("sti");
|
||||
switch_task();
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user