diff options
author | dzwdz | 2022-07-16 23:08:50 +0200 |
---|---|---|
committer | dzwdz | 2022-07-16 23:08:50 +0200 |
commit | 4c10db944ca18c8001848c7e4e8ef51876bbe094 (patch) | |
tree | 38db3ebb7dc18c0640223561378b897b9dc3dabd | |
parent | a251c14f1a745f3388ce73a5a45ebc73cd1782b5 (diff) |
amd64: all tests pass
-rw-r--r-- | src/kernel/arch/amd64/pagedir.c | 10 | ||||
-rw-r--r-- | src/user/app/main.c | 5 |
2 files changed, 5 insertions, 10 deletions
diff --git a/src/kernel/arch/amd64/pagedir.c b/src/kernel/arch/amd64/pagedir.c index 2075aac..6d0546a 100644 --- a/src/kernel/arch/amd64/pagedir.c +++ b/src/kernel/arch/amd64/pagedir.c @@ -122,14 +122,10 @@ get_entry(struct pagedir *dir, const void __user *virt) { } void *pagedir_unmap(struct pagedir *dir, void __user *virt) { - (void)dir; (void)virt; - panic_unimplemented(); - /* unset the present bit - void *phys = pagedir_virt2phys(dir, virt, false, false); - struct pagetable_entry *page = get_entry(dir, virt); + pe_generic_t *page = get_entry(dir, virt); + if (!page) return NULL; page->present = false; - return phys; - */ + return addr_extract(*page); } void pagedir_map(struct pagedir *dir, void __user *virt, void *phys, diff --git a/src/user/app/main.c b/src/user/app/main.c index eff953a..6672344 100644 --- a/src/user/app/main.c +++ b/src/user/app/main.c @@ -63,13 +63,12 @@ int main(void) { printf("couldn't open /kdev/com1\n"); _syscall_exit(1); } - //termcook(); + termcook(); shell_loop(); _syscall_exit(1); } - if (!fork()) { if (!file_reopen(stdout, "/vga_tty", 0)) { printf("couldn't open /vga_tty\n"); // TODO borked @@ -79,7 +78,7 @@ int main(void) { printf("couldn't open /keyboard\n"); _syscall_exit(1); } - //termcook(); + termcook(); shell_loop(); _syscall_exit(1); |