diff options
author | Marvin Borner | 2019-11-23 00:36:28 +0100 |
---|---|---|
committer | Marvin Borner | 2019-11-23 00:36:28 +0100 |
commit | 45d9495e77dba212551ae9bc8e09b51e9ed6d324 (patch) | |
tree | 1e8ead9a55b41fa009c28823ca7a9ac0b1b5b2fe /src/kernel/graphics | |
parent | 4b178c0feb4c415be36be0e4c0def8c447ed42af (diff) |
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
Diffstat (limited to 'src/kernel/graphics')
-rw-r--r-- | src/kernel/graphics/vesa.c | 21 |
1 files changed, 6 insertions, 15 deletions
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 <kernel/lib/lib.h> #include <kernel/paging/paging.h> #include <kernel/system.h> -#include <kernel/lib/alloc.h> +#include <mlibc/stdlib.h> #include <kernel/commands/command.h> 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; |