Add createTask syscall (Not working in umode)

This commit is contained in:
pjht 2019-02-11 09:48:50 -06:00
parent 4f25ff7a09
commit b3e086e452
4 changed files with 11 additions and 2 deletions

View File

@ -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;
}

View File

@ -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");

View File

@ -4,3 +4,10 @@ void yield() {
int $80; \
");
}
void createTask(void* task) {
asm volatile(" \
mov $2, %%eax; \
int $80; \
"::"b"(task));
}

View File

@ -2,5 +2,6 @@
#define TASKING_H
void yield();
void createTask(void* task);
#endif