From 9702485247be55f092080a38e3fe3417ee6e6df3 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sat, 23 Nov 2019 12:55:59 +0100 Subject: Fixed vesa, acpi and installation! --- src/kernel/acpi/acpi.c | 2 +- src/kernel/fs/install.c | 4 ++++ src/kernel/graphics/vesa.c | 2 +- src/kernel/kernel.c | 6 ++++-- src/kernel/paging/paging.c | 2 +- 5 files changed, 11 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/kernel/acpi/acpi.c b/src/kernel/acpi/acpi.c index efa6fcf..6425449 100644 --- a/src/kernel/acpi/acpi.c +++ b/src/kernel/acpi/acpi.c @@ -148,7 +148,7 @@ int acpi_install() { SCI_EN = 1; acpi_enable(); - vga_log("Installed ACPI", 5); + vga_log("Installed ACPI", 4); success = 1; } // Else: \_S5 parse error diff --git a/src/kernel/fs/install.c b/src/kernel/fs/install.c index dfe3009..403d290 100644 --- a/src/kernel/fs/install.c +++ b/src/kernel/fs/install.c @@ -4,6 +4,8 @@ #include #include #include +#include +#include void install_melvix() { info("You're booting from a CD, Melvix will only run after an install"); @@ -58,4 +60,6 @@ void install_melvix() { kfree(kernel_e); info("Installation successful!"); + serial_write("Installation successful!\nRebooting...\n\n"); + acpi_poweroff(); } \ No newline at end of file diff --git a/src/kernel/graphics/vesa.c b/src/kernel/graphics/vesa.c index becc5ff..6193401 100644 --- a/src/kernel/graphics/vesa.c +++ b/src/kernel/graphics/vesa.c @@ -268,7 +268,7 @@ void vesa_draw_rectangle(int x1, int y1, int x2, int y2, const uint32_t color[3] } void vesa_clear() { - vesa_draw_rectangle(0, 0, vbe_width, vbe_height, terminal_background); + vesa_draw_rectangle(0, 0, vbe_width - 1, vbe_height - 1, terminal_background); terminal_x = 0; terminal_y = 0; } diff --git a/src/kernel/kernel.c b/src/kernel/kernel.c index 94d1c20..20a7199 100644 --- a/src/kernel/kernel.c +++ b/src/kernel/kernel.c @@ -19,8 +19,8 @@ void kernel_main() { memory_init(); gdt_install(); init_serial(); + acpi_install(); paging_install(); - // acpi_install(); idt_install(); isrs_install(); irq_install(); @@ -62,5 +62,7 @@ void kernel_main() { */ // asm volatile ("div %0" :: "r"(0)); // Exception testing x/0 - halt_loop(); + loop: + asm volatile ("hlt"); + goto loop; } diff --git a/src/kernel/paging/paging.c b/src/kernel/paging/paging.c index a08d253..7e2ca6b 100644 --- a/src/kernel/paging/paging.c +++ b/src/kernel/paging/paging.c @@ -25,7 +25,7 @@ void paging_install() { paging_enable(); serial_write_dec(memory_get_all() / 1024); - vga_log("Installed paging", 4); + vga_log("Installed paging", 5); } void paging_disable() { -- cgit v1.2.3