aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/kernel/acpi/acpi.c3
-rw-r--r--src/kernel/fs/install.c2
-rw-r--r--src/kernel/paging/paging.c3
3 files changed, 3 insertions, 5 deletions
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);
}