aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarvin Borner2019-11-07 22:03:47 +0100
committerMarvin Borner2019-11-07 22:03:47 +0100
commitdd8c010755a3044f0832c7e732e1e3cdedb4a2ac (patch)
tree2005342185fb3d8e726e260dd7f70457eaff0638
parent5af71e142c32bfbeb8a0861e67a319313d54cf9a (diff)
Some improvements
Artifacts still not fixed though
-rw-r--r--src/kernel/graphics/vesa.c8
-rw-r--r--src/kernel/input/ps2/keyboard.c2
-rw-r--r--src/kernel/input/ps2/mouse.c1
3 files changed, 6 insertions, 5 deletions
diff --git a/src/kernel/graphics/vesa.c b/src/kernel/graphics/vesa.c
index 24f3311..a43d486 100644
--- a/src/kernel/graphics/vesa.c
+++ b/src/kernel/graphics/vesa.c
@@ -6,7 +6,6 @@
#include <kernel/system.h>
#include <kernel/lib/alloc.h>
#include <kernel/commands/command.h>
-#include <kernel/timer/timer.h>
void switch_to_vga() {
serial_write("Force switch to VGA!\n");
@@ -92,6 +91,7 @@ struct vbe_mode_info *vbe_get_mode_info(uint16_t mode) {
}
void set_optimal_resolution() {
+ asm volatile ("sti");
vga_log("Switching to graphics mode", 9);
vga_log("Trying to detect available modes", 10);
uint16_t *video_modes = vbe_get_modes();
@@ -346,10 +346,10 @@ int prev_coords[2] = {};
void vesa_draw_cursor(int x, int y) {
// Reset previous area
- char *reset = (char *) &fb[prev_coords[0] * vbe_bpl + prev_coords[1] * vbe_pitch];
if (prev != 0) {
+ char *reset = (char *) &fb[prev_coords[0] * vbe_bpl + prev_coords[1] * vbe_pitch];
for (int cy = 0; cy <= 19; cy++) {
- for (int cx = 0; cx <= 12 + 1; cx++) {
+ for (int cx = 0; cx <= 12; cx++) {
reset[vbe_bpl * cx] = prev[vbe_bpl * cx];
reset[vbe_bpl * cx + 1] = prev[vbe_bpl * cx + 1];
reset[vbe_bpl * cx + 2] = prev[vbe_bpl * cx + 2];
@@ -366,7 +366,7 @@ void vesa_draw_cursor(int x, int y) {
prev_coords[0] = x;
prev_coords[1] = y;
for (int cy = 0; cy <= 19; cy++) {
- for (int cx = 0; cx <= 12 + 1; cx++) {
+ for (int cx = 0; cx <= 12; cx++) {
// Performance issue?
prev[vbe_bpl * cx] = draw[vbe_bpl * cx];
prev[vbe_bpl * cx + 1] = draw[vbe_bpl * cx + 1];
diff --git a/src/kernel/input/ps2/keyboard.c b/src/kernel/input/ps2/keyboard.c
index 7e01af5..e7f789a 100644
--- a/src/kernel/input/ps2/keyboard.c
+++ b/src/kernel/input/ps2/keyboard.c
@@ -101,5 +101,5 @@ void keyboard_rate() {
void keyboard_install() {
keyboard_rate();
irq_install_handler(1, keyboard_handler);
- vga_log("Installed keyboard handler", 5);
+ info("Installed keyboard handler");
}
diff --git a/src/kernel/input/ps2/mouse.c b/src/kernel/input/ps2/mouse.c
index 015c1a5..016b8b0 100644
--- a/src/kernel/input/ps2/mouse.c
+++ b/src/kernel/input/ps2/mouse.c
@@ -95,4 +95,5 @@ void mouse_install() {
// Setup the mouse handler
irq_install_handler(12, mouse_handler);
+ info("Installed mouse handler");
}