diff options
Diffstat (limited to 'asm')
| -rw-r--r-- | asm/asm_task.s | 4 | ||||
| -rw-r--r-- | asm/asm_usermode.s | 3 | ||||
| -rw-r--r-- | asm/asm_x86.h | 3 |
3 files changed, 7 insertions, 3 deletions
diff --git a/asm/asm_task.s b/asm/asm_task.s index bf80025..77712ba 100644 --- a/asm/asm_task.s +++ b/asm/asm_task.s @@ -4,9 +4,9 @@ task_pusha: pushf push $0x8 // code segment - push $userfunc + push $scheduler_func - push $0x666 + push $0x666 // random value to hold place for potential return val push $0x0 pusha diff --git a/asm/asm_usermode.s b/asm/asm_usermode.s index 71ecc1d..147dfe5 100644 --- a/asm/asm_usermode.s +++ b/asm/asm_usermode.s @@ -20,7 +20,8 @@ asm_usermode: mov %esp, %eax pushl $0x23 // user data segment - pushl $0x8fff000-3*32 //%eax // current stack + //pushl $0x8fff000-3*32 //%eax // current stack + pushl $0xe0000000-3*32 //%eax // current stack (3 values will be poped) pushf // // http://x86.renejeschke.de/html/file_module_x86_id_145.html diff --git a/asm/asm_x86.h b/asm/asm_x86.h index 529a6c2..ec9ebd0 100644 --- a/asm/asm_x86.h +++ b/asm/asm_x86.h @@ -91,6 +91,9 @@ void x86_set_cr(uint8_t num, uint32_t value); /** Set the address of the page directory. This is required **before** enabling paging */ static inline void x86_set_page_directory(uint32_t pdir_addr) {x86_set_cr(3,pdir_addr);} +/** Get the address of the page directory. */ +static inline uint32_t x86_get_page_directory() {return x86_get_cr(3);} + /** Enable paging */ static inline void x86_paging_enable() {x86_set_cr(0,x86_get_cr(0)| 0x80000000);} |
