/* This is the loader object that loads the actual master. When it is
loaded, no error messages are available, so you better don't break it. */
#include "/sys/driver_hook.h"
#define PRIVILEGED_UID 0
void boot() {
set_driver_hook(H_RUNTIME_ERROR, "runtime_error");
set_driver_hook(H_COMPILE_ERROR, "compile_error");
call_other("/kernel/master", "");
set_driver_hook(H_PRIVILEGED_UID, PRIVILEGED_UID);
"/kernel/master"->inaugurate_master();
}
void runtime_error(int code) {
string m;
switch(code) {
default:
m = sprintf("error %d\n", code);
}
write_file("/log/RUNTIME_ERROR", m);
}
void compile_error(int code) {
string m;
switch(code) {
default:
m = sprintf("error %d\n", code);
}
write_file("/log/COMPILE_ERROR", m);
}