1
1
Fork 0

Stuff. And thing. Yeaaaaah!

This commit is contained in:
Lauren Toivanen 2023-06-14 20:06:27 +03:00
parent 3d7140b3fc
commit 968ea605d8
Signed by: jt
GPG key ID: 9151B109B73ECAD5
3 changed files with 37 additions and 25 deletions

View file

@ -41,7 +41,7 @@ void kmain (unsigned int mbootmagick, multiboot_info_t* mbootinfo) {
//outb(0x3D5, 0x20);
//cls();
vga_init(VGA_COLOR_GREY, VGA_COLOR_BLACK);
vga_init(VGA_COLOR_BLACK, VGA_COLOR_GRAY);
vga_write_line("=== KoalemOS ===");
vga_write("Checking multiboot loader: ");
@ -51,26 +51,32 @@ void kmain (unsigned int mbootmagick, multiboot_info_t* mbootinfo) {
vga_write_color("INVALID MAGIC", VGA_COLOR_BLACK, VGA_COLOR_RED);
return;
}
vga_write((char *)mbootinfo->boot_loader_name);
if (mbootinfo->flags & MULTIBOOT_INFO_BOOT_LOADER_NAME)
vga_write((char *)mbootinfo->boot_loader_name);
else
vga_write_color("Unknown", VGA_COLOR_BLACK, VGA_COLOR_ORANGE);
vga_write("\nMultiboot flags: ");
vga_write(itoa(mbootinfo->flags, 2));
// Check videomode
vga_write("\nVideomode: 0x");
vga_write(itoa(mbootinfo->vbe_mode, 16));
vga_write(": ");
switch (mbootinfo->vbe_mode) {
case MULTIBOOT_FRAMEBUFFER_TYPE_INDEXED:
vga_write("Indexed");
break;
case MULTIBOOT_FRAMEBUFFER_TYPE_RGB:
vga_write("RGB");
break;
case MULTIBOOT_FRAMEBUFFER_TYPE_EGA_TEXT:
vga_write("EGA TEXT");
break;
default:
vga_write_color("UNKNOWN", VGA_COLOR_BLACK, VGA_COLOR_RED);
return;
vga_write("\nVideomode: ");
if (mbootinfo->flags & MULTIBOOT_INFO_VBE_INFO) {
vga_write("VBE 0x");
vga_write(itoa(mbootinfo->vbe_mode, 16));
} else if (mbootinfo->flags & MULTIBOOT_INFO_FRAMEBUFFER_INFO) {
vga_write("Framebuffer");
vga_write("\nVideo address: 0x");
vga_write(itoa(mbootinfo->framebuffer_addr, 16));
unsigned long long *vmem = &mbootinfo->framebuffer_addr;
*vmem = 0xff00ff;
} else {
vga_write_color("Not available", VGA_COLOR_BLACK, VGA_COLOR_RED);
return;
}
vga_write_line("\nExecution finished, halting...");
*(unsigned char *)0xb8000 = '!';
}