A library for implementing kernel panics.
- An
stddef.h
which definessize_t
. - A
putchar()
-equivalent. It does not need to have any specific name.- Accepts a single
int
and, presumably, prints it (after casting to anunsigned char
). - The return value isn't used, but I recommend following the POSIX/C standards.
- Accepts a single
#include <flail.h> /* Note: flail.h uses stddef.h. */
// Operating system information to include in the panic message.
const char *info_str = "Some Operating System v1.0";
int custom_putchar(int c) {
// Implement me!
return c; // It "worked."
}
void kernel_main() {
flail_init(info_str, &custom_putchar);
flail_panic("oh no");
}
The code is available as open source under the terms of the MIT License.