aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/graphics/vesa.c
diff options
context:
space:
mode:
authorMarvin Borner2019-09-25 22:57:33 +0200
committerMarvin Borner2019-09-25 22:57:33 +0200
commit8ebf584bbb43584b671b79d5166e00268a7c9661 (patch)
tree466abea4e6da201e7b432d7394e1bf21cbbe1d98 /src/kernel/graphics/vesa.c
parent16b8a48d1de16a5982cf983a282832fd4ed01f85 (diff)
Fixed several TTY bugs and improved VESA detection
Diffstat (limited to 'src/kernel/graphics/vesa.c')
-rw-r--r--src/kernel/graphics/vesa.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/src/kernel/graphics/vesa.c b/src/kernel/graphics/vesa.c
index cab6c70..35e96c6 100644
--- a/src/kernel/graphics/vesa.c
+++ b/src/kernel/graphics/vesa.c
@@ -1,11 +1,16 @@
#include "vesa.h"
#include "graphics.h"
-#include "../sound/sound.h"
#include "../lib/lib.h"
-#include "../acpi/acpi.h"
+#include "../input/input.h"
+#include "../system.h"
void switch_to_vga() {
- terminal_initialize();
+ regs16_t regs;
+ regs.ax = 0x0003;
+ int32(0x10, &regs);
+ init();
+ terminal_write_line("FAILED!");
+ keyboard_install();
}
vbe_mode_info *vbe_set_mode(unsigned short mode) {
@@ -54,9 +59,8 @@ vbe_mode_info *vbe_set_mode(unsigned short mode) {
void set_optimal_resolution() {
extern vbe_info *vbe_init_structure;
regs16_t regs;
- regs.ax = 0x4F01;
- regs.cx = vbe_init_structure;
- regs.di = 0x0000;
+ regs.ax = 0x4F00;
+ regs.di = vbe_init_structure;
regs.es = 0xA000;
int32(0x10, &regs);
@@ -65,11 +69,14 @@ void set_optimal_resolution() {
}
vbe_info *vbe_modes = (vbe_info *) 0xA0000;
+
if (strcmp(vbe_modes->signature, "VESA") == 0) {
- loop:
- asm volatile ("hlt");
- goto loop;
+ init();
+ terminal_write_string("SUCCESS!\n");
+ keyboard_install();
} else {
- acpi_poweroff();
+ init();
+ terminal_write_string("FAILED!\n");
+ keyboard_install();
}
} \ No newline at end of file