From 45d9495e77dba212551ae9bc8e09b51e9ed6d324 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sat, 23 Nov 2019 00:36:28 +0100 Subject: Tried implementing memory based paging... Also did many other fixes/improvements. While I think I did most things correct, the ACPI doesn't work anymore (triple fault) and the resolution detection fails with 0x2... :c --- src/kernel/graphics/vesa.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) (limited to 'src/kernel/graphics') diff --git a/src/kernel/graphics/vesa.c b/src/kernel/graphics/vesa.c index a43d486..9048469 100644 --- a/src/kernel/graphics/vesa.c +++ b/src/kernel/graphics/vesa.c @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include void switch_to_vga() { @@ -22,9 +22,7 @@ struct edid_data get_edid() { regs.bx = 0x1; // BL regs.es = 0; regs.di = 0x7E00; - paging_disable(); - int32(0x10, ®s); - paging_enable(); + v86(0x10, ®s); if ((regs.ax & 0xFF) != 0x4F) { warn("No EDID available!"); @@ -40,9 +38,7 @@ void vbe_set_mode(unsigned short mode) { regs.ax = 0x4F02; regs.bx = mode; regs.bx |= 0x4000; - paging_disable(); - int32(0x10, ®s); - paging_enable(); + v86(0x10, ®s); if (regs.ax != 0x004F) switch_to_vga(); @@ -57,9 +53,7 @@ uint16_t *vbe_get_modes() { regs.ax = 0x4F00; regs.es = 0; regs.di = 0x7E00; - paging_disable(); - int32(0x10, ®s); - paging_enable(); + v86(0x10, ®s); struct vbe_info *info = (struct vbe_info *) info_address; @@ -79,9 +73,7 @@ struct vbe_mode_info *vbe_get_mode_info(uint16_t mode) { regs.cx = mode; regs.es = 0; regs.di = 0x7E00; - paging_disable(); - int32(0x10, ®s); - paging_enable(); + v86(0x10, ®s); struct vbe_mode_info *mode_info = (struct vbe_mode_info *) 0x7E00; @@ -337,8 +329,7 @@ void vesa_draw_string(const char *data) { } void vesa_draw_number(int n) { - char string[16]; - vesa_draw_string(itoa(n, string)); + vesa_draw_string(itoa(n)); } char *prev = 0; -- cgit v1.2.3