1
1
Fork 0

Printing stuff to screen

This commit is contained in:
Lauren Toivanen 2023-06-13 09:45:04 +03:00
parent f30433dd27
commit aaffd2351f
Signed by: jt
GPG key ID: 9151B109B73ECAD5
5 changed files with 180 additions and 37 deletions

View file

@ -1,12 +1,22 @@
#include "vga.h"
// static inline void outb(unsigned int port, unsigned char val) {
// asm volatile ("outb %0, %1" : : "a"(val), "Nd"(port) : "memory");
// }
void kmain (void) {
*((unsigned char *) 0xB8000) = 'H';
*((unsigned char *) 0xB8001) = 0x1F;
*((unsigned char *) 0xB8002) = 'E';
*((unsigned char *) 0xB8003) = 0x1F;
*((unsigned char *) 0xB8004) = 'L';
*((unsigned char *) 0xB8005) = 0x1F;
*((unsigned char *) 0xB8006) = 'L';
*((unsigned char *) 0xB8007) = 0x1F;
*((unsigned char *) 0xB8008) = 'O';
*((unsigned char *) 0xB8009) = 0x1F;
// Cursor disabling
// TODO: outb function
//outb(0x3D4, 0x0A);
//outb(0x3D5, 0x20);
//cls();
vga_init(VGA_COLOR_GREY, VGA_COLOR_BLACK);
vga_write_line("=== KoalemOS ===");
vga_write("Testing color writing... ");
vga_write_color("Yes", VGA_COLOR_BLACK, VGA_COLOR_GREEN);
vga_write_color("No", VGA_COLOR_BLACK, VGA_COLOR_RED);
vga_write_line("Execution finished. Halting CPU...");
}