Add createTask syscall (Not working in umode)
This commit is contained in:
parent
4f25ff7a09
commit
b3e086e452
@ -167,6 +167,8 @@ void isr_handler(registers_t r) {
|
||||
case 80:
|
||||
if (r.eax==1) {
|
||||
tasking_yield();
|
||||
} else if (r.eax==2) {
|
||||
tasking_createTask((void*)r.ebx);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
#include "../cpu/cpu_init.h"
|
||||
#include "../cpu/i386/ports.h"
|
||||
#include "../cpu/i386/tasking.h"
|
||||
#include "../drivers/vga.h"
|
||||
#include <grub/text_fb_info.h>
|
||||
#include <stdlib.h>
|
||||
@ -57,7 +56,7 @@ void kmain(multiboot_info_t* header) {
|
||||
port_byte_out(0xe9,'!');
|
||||
port_byte_out(0xe9,'\n');
|
||||
vga_write_string("Task create\n");
|
||||
tasking_createTask(task);
|
||||
createTask(task);
|
||||
vga_write_string("Task switch\n");
|
||||
yield();
|
||||
vga_write_string("Back in main\n");
|
||||
|
@ -4,3 +4,10 @@ void yield() {
|
||||
int $80; \
|
||||
");
|
||||
}
|
||||
|
||||
void createTask(void* task) {
|
||||
asm volatile(" \
|
||||
mov $2, %%eax; \
|
||||
int $80; \
|
||||
"::"b"(task));
|
||||
}
|
||||
|
@ -2,5 +2,6 @@
|
||||
#define TASKING_H
|
||||
|
||||
void yield();
|
||||
void createTask(void* task);
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user