[kernel] Add test mode, controlled by manifest
The manifest can now supply a list of boot flags, including "test". Those get turned into the bootproto::args::flags field by the bootloader. The kernel takes those and uses the test flag to control enabling syscalls with the new "test" attribute, like the new test_finish syscall, which lets automated tests call back to the kernel to shut down the system.
This commit is contained in:
@@ -36,6 +36,14 @@ noop()
|
||||
return j6_status_ok;
|
||||
}
|
||||
|
||||
[[ noreturn ]] j6_status_t
|
||||
test_finish(uint32_t exit_code)
|
||||
{
|
||||
// Tell QEMU to exit
|
||||
asm ( "out %0, %1" :: "a"(exit_code), "Nd"(0xf4) );
|
||||
while (1) asm ("hlt");
|
||||
}
|
||||
|
||||
j6_status_t
|
||||
system_get_log(system *self, void *buffer, size_t *buffer_len)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user