aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/graphics
diff options
context:
space:
mode:
authorMarvin Borner2019-10-03 00:39:11 +0200
committerMarvin Borner2019-10-03 00:39:11 +0200
commitdc7f3bccef43d1483a8a234df85f67f6869e75ba (patch)
tree4f88e994c33c5cfc0062e16a2f99a79236da95f8 /src/kernel/graphics
parent7e81739528577c2e7f92b42b2d186b63fdd3d6d5 (diff)
Began replacement of VGA functions
Why does VGA/VESA not work when running on real hardware?
Diffstat (limited to 'src/kernel/graphics')
-rw-r--r--src/kernel/graphics/vesa.c10
-rw-r--r--src/kernel/graphics/vesa.h2
2 files changed, 7 insertions, 5 deletions
diff --git a/src/kernel/graphics/vesa.c b/src/kernel/graphics/vesa.c
index 9ea83aa..120ff15 100644
--- a/src/kernel/graphics/vesa.c
+++ b/src/kernel/graphics/vesa.c
@@ -1,19 +1,16 @@
#include "vesa.h"
-#include "graphics.h"
-#include "../input/input.h"
#include "../system.h"
#include "../lib/lib.h"
void switch_to_vga() {
+ vesa_available = 0;
regs16_t regs;
regs.ax = 0x0003;
int32(0x10, &regs);
- init();
- terminal_write_line("FAILED!");
- keyboard_install();
}
struct vbe_mode_info *vbe_set_mode(unsigned short mode) {
+ vesa_available = 0;
regs16_t regs;
regs.ax = 0x4F02;
regs.bx = mode | (1 << 14);
@@ -47,6 +44,8 @@ struct vbe_mode_info *vbe_set_mode(unsigned short mode) {
regs.ax = 0x0003;
int32(0x10, &regs);
+ vesa_available = 1;
+
return vbe_info;
} else {
switch_to_vga();
@@ -57,6 +56,7 @@ struct vbe_mode_info *vbe_set_mode(unsigned short mode) {
}
void set_optimal_resolution() {
+ vesa_available = 0;
struct vbe_info *info = (struct vbe_info *) 0x2000;
struct vbe_mode_info *mode_info = (struct vbe_mode_info *) 0x3000;
diff --git a/src/kernel/graphics/vesa.h b/src/kernel/graphics/vesa.h
index eff74ea..83c6ad2 100644
--- a/src/kernel/graphics/vesa.h
+++ b/src/kernel/graphics/vesa.h
@@ -4,6 +4,8 @@
#include <stdint.h>
#include "../system.h"
+int vesa_available;
+
/**
* The CPUs response to the 0x4F00 call
* Used to receive the supported video modes