aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/graphics
diff options
context:
space:
mode:
authorMarvin Borner2019-11-01 13:13:40 +0100
committerMarvin Borner2019-11-01 13:13:40 +0100
commit1994399448a298d3fc5474b3ca6272e1c699c7df (patch)
tree591e4f14fe2e8100343d7c80c04df31815509223 /src/kernel/graphics
parentef8652520516e9c8dfdf8c1030319ea9634975d5 (diff)
Fixed VGA buffer logging
Diffstat (limited to 'src/kernel/graphics')
-rw-r--r--src/kernel/graphics/vesa.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/src/kernel/graphics/vesa.c b/src/kernel/graphics/vesa.c
index 1cc508f..639ec2b 100644
--- a/src/kernel/graphics/vesa.c
+++ b/src/kernel/graphics/vesa.c
@@ -171,14 +171,16 @@ void set_optimal_resolution() {
vbe_set_mode(highest);
- vesa_draw_string(vga_buffer);
-
if (vbe_height > 1440) vesa_set_font(32);
else if (vbe_height > 720) vesa_set_font(24);
else vesa_set_font(16);
vesa_set_color(default_text_color);
vesa_clear();
+ vesa_set_color(vesa_blue);
+ vesa_draw_string(vga_buffer);
+ vesa_set_color(default_text_color);
+
info("Successfully switched to video mode!");
serial_write("Using mode: ");
@@ -335,21 +337,8 @@ void vesa_draw_string(const char *data) {
}
void vesa_draw_number(int n) {
- if (n == 0) vesa_draw_char('0');
- int acc = n;
- char c[32];
- int i = 0;
- while (acc > 0) {
- c[i] = '0' + acc % 10;
- acc /= 10;
- i++;
- }
- c[i] = 0;
- static char c2[32];
- c2[i--] = 0;
- int j = 0;
- while (i >= 0) c2[i--] = c[j++];
- vesa_draw_string(c2);
+ char string[16];
+ vesa_draw_string(itoa(n, string));
}
void vesa_set_color(uint32_t color) {