diff options
author | Marvin Borner | 2020-04-29 23:26:51 +0200 |
---|---|---|
committer | Marvin Borner | 2020-04-29 23:26:51 +0200 |
commit | 8b52d7698e4a9a5abaf730c7da1c4f865cb78f8e (patch) | |
tree | 873f2ae99b369f4db809fe1cd2684ae0e60c6144 /src/kernel/memory/paging.c | |
parent | 0f54f0de1004c6e9a455c295dc76879ac37a408f (diff) |
Working framebuffer from userspace...
Well, it doesn't actually work. I disabled several security measures to
get this working and I'll try to fix these soon.
Diffstat (limited to 'src/kernel/memory/paging.c')
-rw-r--r-- | src/kernel/memory/paging.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/kernel/memory/paging.c b/src/kernel/memory/paging.c index 19ec11d..add400e 100644 --- a/src/kernel/memory/paging.c +++ b/src/kernel/memory/paging.c @@ -88,11 +88,12 @@ void paging_map(struct page_directory *dir, uint32_t phys, uint32_t virt) short id = virt >> 22; struct page_table *tab = paging_make_table(); - dir->tables[id] = ((struct page_table *)((uint32_t)tab | 3)); // RW + dir->tables[id] = ((struct page_table *)((uint32_t)tab | 3 | 4)); // RW for (int i = 0; i < 1024; i++) { tab->pages[i].frame = phys >> 12; tab->pages[i].present = 1; + tab->pages[i].user = 1; // TODO: Remove all-user paging! phys += 4096; } } @@ -104,8 +105,7 @@ void paging_map_user(struct page_directory *dir, uint32_t phys, uint32_t virt) dir->tables[id] = ((struct page_table *)((uint32_t)tab | 3 | 4)); // RW + usermode - int i; - for (i = 0; i < 1024; i++) { + for (int i = 0; i < 1024; i++) { tab->pages[i].frame = phys >> 12; tab->pages[i].present = 1; tab->pages[i].user = 1; |