diff options
Diffstat (limited to 'src/kernel/graphics')
-rw-r--r-- | src/kernel/graphics/font.c | 3 | ||||
-rw-r--r-- | src/kernel/graphics/vesa.c | 6 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/kernel/graphics/font.c b/src/kernel/graphics/font.c index 147eaff..3f55d01 100644 --- a/src/kernel/graphics/font.c +++ b/src/kernel/graphics/font.c @@ -10,7 +10,8 @@ void font_install() { - font = (struct font *) kmalloc(100000);; // High quality shit + font = (struct font *) paging_alloc_pages(25);; // High quality shit + paging_set_user((uint32_t) font, 25); uint8_t boot_drive_id = (uint8_t) (*((uint8_t *) 0x9000)); if (boot_drive_id != 0xE0) { diff --git a/src/kernel/graphics/vesa.c b/src/kernel/graphics/vesa.c index d673bde..c74b34b 100644 --- a/src/kernel/graphics/vesa.c +++ b/src/kernel/graphics/vesa.c @@ -190,11 +190,11 @@ void set_optimal_resolution() uint32_t fb_size = vbe_width * vbe_height * vbe_bpl; cursor_buffer = kmalloc(fb_size); + paging_set_user((uint32_t) fb, fb_size / 4096); for (uint32_t z = 0; z < fb_size; z += 4096) { - paging_map((uint32_t) fb + z, (uint32_t) fb + z, PT_PRESENT | PT_RW | PT_USED); + paging_map((uint32_t) fb + z, (uint32_t) fb + z, PT_PRESENT | PT_RW | PT_USED | PT_ALL_PRIV); paging_map((uint32_t) cursor_buffer + z, (uint32_t) cursor_buffer + z, PT_PRESENT | PT_RW | PT_USED); } - paging_set_user((uint32_t) fb, fb_size); serial_write_hex((int) &fb); serial_write("\n"); @@ -399,4 +399,4 @@ void vesa_set_color(uint32_t color) { vesa_convert_color(terminal_color, color); vesa_convert_color(terminal_background, default_background_color); -} +}
\ No newline at end of file |