signals: handle SIGBUS, SIGSEGV, SIGILL etc

This commit is contained in:
Matheus
2024-05-29 11:06:15 -03:00
parent d689766a44
commit c81bdac897
4 changed files with 33 additions and 4 deletions
+3 -2
View File
@@ -363,8 +363,9 @@ bool vmm_pagefault(void *addr, bool user, int actions) {
page_t *res = NULL;
int error = vmmcache_getpage(range->vnode, range->offset + mapoffset, &res);
if (error == ENXIO) {
// TODO if error returned == ENXIO, raise an urgent SIGBUS on the calling thread
__assert(!"TODO: sigbus");
// address is past the last page of the file
signal_signalthread(_cpu()->thread, SIGBUS, true);
status = true;
} else if (error) {
printf("vmm: error on vmmcache_getpage(): %d\n", error);
status = false;