aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarvin Borner2019-11-23 17:45:47 +0100
committerMarvin Borner2019-11-23 17:45:47 +0100
commit06fc2c2af5db74ba938a65f72bf505baa5eec23b (patch)
tree50d0138c115ba0ec24c4d7c15318693d2b73ae4e
parent9702485247be55f092080a38e3fe3417ee6e6df3 (diff)
Some formatting
-rw-r--r--Makefile5
-rw-r--r--src/kernel/acpi/acpi.c3
-rw-r--r--src/kernel/fs/install.c2
-rw-r--r--src/kernel/paging/paging.c3
4 files changed, 7 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index e2b1411..cca3393 100644
--- a/Makefile
+++ b/Makefile
@@ -67,9 +67,12 @@ test: build debug
debug:
@rm -f qemu.log
@echo "Starting simulation"
- @echo "[SERIAL OUTPUT]"
@head -c 10485760 /dev/zero > ./build/hdd10M.img
+ @echo "[SERIAL OUTPUT]"
@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
+ @echo "[END OF CONNECTION]"
+ @printf "\n"
+ @echo "[SERIAL OUTPUT]"
@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]"
diff --git a/src/kernel/acpi/acpi.c b/src/kernel/acpi/acpi.c
index 6425449..919d0be 100644
--- a/src/kernel/acpi/acpi.c
+++ b/src/kernel/acpi/acpi.c
@@ -170,6 +170,7 @@ int acpi_install() {
}
void acpi_poweroff() {
+ asm volatile ("cli");
if (SCI_EN == 0) {
warn("ACPI shutdown is not supported\n");
return;
@@ -184,8 +185,6 @@ void acpi_poweroff() {
send_w(0x604, 0x2000); // QEMU
send_w(0x4004, 0x3400); // VirtualBox
}
-
- serial_write("Shutdown failed\n");
}
void reboot() {
diff --git a/src/kernel/fs/install.c b/src/kernel/fs/install.c
index 403d290..c098266 100644
--- a/src/kernel/fs/install.c
+++ b/src/kernel/fs/install.c
@@ -60,6 +60,6 @@ void install_melvix() {
kfree(kernel_e);
info("Installation successful!");
- serial_write("Installation successful!\nRebooting...\n\n");
+ serial_write("Installation successful!\nRebooting...\n");
acpi_poweroff();
} \ No newline at end of file
diff --git a/src/kernel/paging/paging.c b/src/kernel/paging/paging.c
index 7e2ca6b..09cbbc0 100644
--- a/src/kernel/paging/paging.c
+++ b/src/kernel/paging/paging.c
@@ -19,12 +19,11 @@ void paging_install() {
page_directory[i] = ((uint32_t) page_tables[i]) | PD_RW | PD_PRESENT;
}
- // TODO: Calculate max memory
paging_set_present(0, memory_get_all() >> 2); // /4
paging_set_used(0, ((uint32_t) ASM_KERNEL_END >> 12) + 1); // /4096
paging_enable();
- serial_write_dec(memory_get_all() / 1024);
+ serial_write_dec(memory_get_all() >> 10);
vga_log("Installed paging", 5);
}