Fix kstop and kreset.

This commit is contained in:
4lDO2
2024-03-07 15:03:01 +01:00
parent b97e733d94
commit 8e19da338b
5 changed files with 40 additions and 33 deletions
-20
View File
@@ -50,26 +50,6 @@ pub fn exit(status: usize) -> ! {
context.id
};
// TODO: Find a better way to implement this, perhaps when the init process calls exit.
if pid == ContextId::from(1) {
println!("Main kernel thread exited with status {:X}", status);
extern "C" {
fn kreset() -> !;
fn kstop() -> !;
}
if status == SIGTERM {
unsafe {
kreset();
}
} else {
unsafe {
kstop();
}
}
}
// Files must be closed while context is valid so that messages can be passed
for (_fd, file_opt) in close_files.into_iter().enumerate() {
if let Some(file) = file_opt {