aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarvin Borner2019-11-23 12:55:59 +0100
committerMarvin Borner2019-11-23 12:55:59 +0100
commit9702485247be55f092080a38e3fe3417ee6e6df3 (patch)
tree20d30dcd756232270beda490946be9e17f7d4e17
parent945d1c9eb7a6520429ebf2f988ac6cc1d12ec75d (diff)
Fixed vesa, acpi and installation!
-rw-r--r--Makefile3
-rw-r--r--src/kernel/acpi/acpi.c2
-rw-r--r--src/kernel/fs/install.c4
-rw-r--r--src/kernel/graphics/vesa.c2
-rw-r--r--src/kernel/kernel.c6
-rw-r--r--src/kernel/paging/paging.c2
6 files changed, 13 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 9ebee6c..e2b1411 100644
--- a/Makefile
+++ b/Makefile
@@ -69,7 +69,8 @@ debug:
@echo "Starting simulation"
@echo "[SERIAL OUTPUT]"
@head -c 10485760 /dev/zero > ./build/hdd10M.img
- @qemu-system-x86_64 -no-reboot -M accel=kvm:tcg -vga std -serial stdio -rtc base=localtime -d int,in_asm -D qemu.log -m 128M -cdrom ./build/melvix.iso -hda ./build/hdd10M.img
+ @qemu-system-x86_64 -no-reboot -M accel=kvm:tcg -vga std -serial stdio -rtc base=localtime -m 128M -cdrom ./build/melvix.iso -drive file=./build/hdd10M.img,format=raw
+ @qemu-system-x86_64 -no-reboot -M accel=kvm:tcg -vga std -serial stdio -rtc base=localtime -m 128M -drive file=./build/hdd10M.img,format=raw
@echo "[END OF CONNECTION]"
.PHONY: build clean cross test debug \ No newline at end of file
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 <kernel/fs/iso9660/iso9660.h>
#include <kernel/fs/atapi_pio.h>
#include <mlibc/stdlib.h>
+#include <kernel/acpi/acpi.h>
+#include <kernel/io/io.h>
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() {