Add createTaskCr3
This commit is contained in:
parent
1efc0bff19
commit
f34d5029df
@ -185,6 +185,8 @@ void isr_handler(registers_t r) {
|
|||||||
tasking_send_msg(r.ebx,(void*)r.ecx,r.edx);
|
tasking_send_msg(r.ebx,(void*)r.ecx,r.edx);
|
||||||
} else if (r.eax==8) {
|
} else if (r.eax==8) {
|
||||||
r.ebx=(uint32_t)paging_new_address_space();
|
r.ebx=(uint32_t)paging_new_address_space();
|
||||||
|
} else if (r.eax==9) {
|
||||||
|
tasking_createTaskCr3((void*)r.ebx,(void*)r.ecx);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
void tasking_init();
|
void tasking_init();
|
||||||
void tasking_yield();
|
void tasking_yield();
|
||||||
Task* tasking_createTask(void* eip);
|
Task* tasking_createTask(void* eip);
|
||||||
|
Task* tasking_createTaskCr3(void* eip,void* cr3);
|
||||||
char isPrivleged(uint32_t pid);
|
char isPrivleged(uint32_t pid);
|
||||||
void tasking_send_msg(uint32_t pid,void* msg,uint32_t size);
|
void tasking_send_msg(uint32_t pid,void* msg,uint32_t size);
|
||||||
void* tasking_get_msg(uint32_t* sender);
|
void* tasking_get_msg(uint32_t* sender);
|
||||||
|
BIN
initrd/init
BIN
initrd/init
Binary file not shown.
@ -29,3 +29,10 @@ void send_msg(uint32_t pid,void* msg,uint32_t size) {
|
|||||||
int $80; \
|
int $80; \
|
||||||
"::"b"(pid),"c"(msg),"d"(size));
|
"::"b"(pid),"c"(msg),"d"(size));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void createTaskCr3(void* task,void* cr3) {
|
||||||
|
asm volatile(" \
|
||||||
|
mov $9, %%eax; \
|
||||||
|
int $80; \
|
||||||
|
"::"b"(task),"c"(cr3));
|
||||||
|
}
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
void yield();
|
void yield();
|
||||||
void createTask(void* task);
|
void createTask(void* task);
|
||||||
|
void createTaskCr3(void* task,void* cr3);
|
||||||
char isPrivleged(uint32_t pid);
|
char isPrivleged(uint32_t pid);
|
||||||
void send_msg(uint32_t pid,void* msg,uint32_t size);
|
void send_msg(uint32_t pid,void* msg,uint32_t size);
|
||||||
void* get_msg(uint32_t* sender);
|
void* get_msg(uint32_t* sender);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user