Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions common/cmdline.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ bool_cmd("fpu", opt_fpu);
bool opt_qemu_console = false;
bool_cmd("qemu_console", opt_qemu_console);

bool opt_poweroff = true;
bool_cmd("poweroff", opt_poweroff);

const char *kernel_cmdline;

void __text_init cmdline_parse(const char *cmdline) {
Expand Down
3 changes: 2 additions & 1 deletion common/kernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ void kernel_main(void) {
#endif

#ifdef KTF_ACPICA
acpi_power_off();
if (opt_poweroff)
acpi_power_off();
#endif
echo_loop();
}
2 changes: 1 addition & 1 deletion grub/boot/grub/grub.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ terminal_input --append serial
terminal_output --append serial

menuentry "kernel64" {
multiboot /boot/kernel64.bin param1 param2 param3
multiboot /boot/kernel64.bin poweroff=1
boot
}
1 change: 1 addition & 0 deletions include/cmdline.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ extern bool opt_apic_timer;
extern bool opt_hpet;
extern bool opt_fpu;
extern bool opt_qemu_console;
extern bool opt_poweroff;
extern const char *kernel_cmdline;

extern void cmdline_parse(const char *cmdline);
Expand Down