aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/system.c
diff options
context:
space:
mode:
authorMarvin Borner2019-11-10 19:50:14 +0100
committerMarvin Borner2019-11-10 19:50:14 +0100
commit7e06dfe06a0f7847eed105bc4f7ccb22df5228fc (patch)
tree446f7eeeb998b93da221d6bf14adca9df63dba69 /src/kernel/system.c
parenta30a9b21c3e0af7996a551381a8f41075bada7ad (diff)
Added semi-working bootloader
Diffstat (limited to 'src/kernel/system.c')
-rw-r--r--src/kernel/system.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/kernel/system.c b/src/kernel/system.c
index 688b0b1..303fc83 100644
--- a/src/kernel/system.c
+++ b/src/kernel/system.c
@@ -5,7 +5,15 @@
char *vga_buffer = (char *) 0x500;
+void vga_clear() {
+ uint16_t *terminal_buffer = (uint16_t *) 0xB8000;
+ for (size_t y = 0; y < 25; y++)
+ for (size_t x = 0; x < 80; x++)
+ terminal_buffer[y * 80 + x] = 0 | (uint16_t) 0x700;
+}
+
void vga_log(char *msg, int line) {
+ if (line == 0) vga_clear();
uint16_t *terminal_buffer = (uint16_t *) 0xB8000;
for (size_t i = 0; i < strlen(msg); i++)
terminal_buffer[line * 80 + i] = (uint16_t) msg[i] | (uint16_t) 0x700;