diff options
author | Marvin Borner | 2019-10-03 16:33:05 +0200 |
---|---|---|
committer | Marvin Borner | 2019-10-03 16:33:05 +0200 |
commit | 2f6c52b6e1f92339f97c25f7da8ab7ec2bee8273 (patch) | |
tree | b02bc2f991d3a2756a399aa76a23268d099416bb | |
parent | dc7f3bccef43d1483a8a234df85f67f6869e75ba (diff) |
Improved some things
-rw-r--r-- | Makefile | 5 | ||||
-rw-r--r-- | src/kernel/boot.asm | 10 | ||||
-rw-r--r-- | src/kernel/grub.cfg | 7 | ||||
-rw-r--r-- | src/kernel/kernel.c | 16 |
4 files changed, 23 insertions, 15 deletions
@@ -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 |