aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile5
-rw-r--r--src/kernel/boot.asm10
-rw-r--r--src/kernel/grub.cfg7
-rw-r--r--src/kernel/kernel.c16
4 files changed, 23 insertions, 15 deletions
diff --git a/Makefile b/Makefile
index caac245..0b4db7b 100644
--- a/Makefile
+++ b/Makefile
@@ -69,10 +69,9 @@ cross:
make install-target-libgcc; \
cd "$${DIR}/.." || exit;
-test: build
- qemu-system-x86_64 -soundhw pcspk -enable-kvm -cdrom ./build/melvix.iso
+test: build debug
debug:
- qemu-system-x86_64 -soundhw pcspk -enable-kvm -cdrom ./build/melvix.iso
+ qemu-system-x86_64 -soundhw pcspk -enable-kvm -d cpu_reset -D qemu.log -vga std -cdrom ./build/melvix.iso
.PHONY: build clean cross test debug \ No newline at end of file
diff --git a/src/kernel/boot.asm b/src/kernel/boot.asm
index 9fc06ed..d7d78fd 100644
--- a/src/kernel/boot.asm
+++ b/src/kernel/boot.asm
@@ -11,9 +11,9 @@ mboot:
; Multiboot macros
MULTIBOOT_PAGE_ALIGN equ 1<<0
MULTIBOOT_MEMORY_INFO equ 1<<1
- MULTIBOOT_AOUT_KLUDGE equ 1<<16
+ MULTIBOOT_VIDEO_MODE equ 1<<2
MULTIBOOT_HEADER_MAGIC equ 0x1BADB002
- MULTIBOOT_HEADER_FLAGS equ MULTIBOOT_PAGE_ALIGN | MULTIBOOT_MEMORY_INFO | MULTIBOOT_AOUT_KLUDGE
+ MULTIBOOT_HEADER_FLAGS equ MULTIBOOT_PAGE_ALIGN | MULTIBOOT_MEMORY_INFO | MULTIBOOT_VIDEO_MODE
MULTIBOOT_CHECKSUM equ -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS)
EXTERN code, bss, end
@@ -29,6 +29,12 @@ mboot:
dd end
dd start
+ ; Request linear graphics mode
+ dd 0
+ dd 640 ; width
+ dd 480 ; height
+ dd 32 ; bpp
+
; Endless loop
stublet:
extern kernel_main
diff --git a/src/kernel/grub.cfg b/src/kernel/grub.cfg
index 1029549..4058318 100644
--- a/src/kernel/grub.cfg
+++ b/src/kernel/grub.cfg
@@ -1,6 +1,7 @@
-set timeout = 0
-set default = 0
-
+set timeout = 1
+set default = "0"
menuentry "Melvix" {
multiboot /boot/melvix.bin
+set gfxpayload=640x480x32
+boot
} \ No newline at end of file
diff --git a/src/kernel/kernel.c b/src/kernel/kernel.c
index f6ec4df..8c0b875 100644
--- a/src/kernel/kernel.c
+++ b/src/kernel/kernel.c
@@ -13,10 +13,10 @@ void init() {
idt_install();
isrs_install();
irq_install();
- // terminal_initialize(); // TODO: Re[ace VGA functions with VESA
+ // terminal_initialize(); // TODO: Replace VGA functions with VESA
init_kheap();
page_init();
- keyboard_install();
+ // keyboard_install();
// mouse_install();
asm volatile ("sti");
}
@@ -24,15 +24,17 @@ void init() {
void kernel_main(void) {
set_optimal_resolution();
init();
- info("Melvix loaded successfully!");
- info("Loading VESA...");
+ // info("Melvix loaded successfully!");
+ // info("Loading VESA...");
- if (vesa_available) {
+ /* if (vesa_available) {
info("Loaded VESA!");
} else {
warn("VESA loading failed!");
- }
+ } */
// __asm__ ("div %0" :: "r"(0)); // Exception testing x/0
- for (;;);
+ loop:
+ asm volatile ("hlt");
+ goto loop;
} \ No newline at end of file