ref: ec252421166a37efd0753188ee19aa13149474ec
parent: e81c54ba2ecc673a4d5f8aed0e9b52841fe07b0d
author: 9ferno <[email protected]>
date: Sat Nov 13 14:51:55 EST 2021
fixed kwstat bug in waserror() usage It is trapping the exit(""), which is used to exit the prog
--- a/os/init/disinit.b
+++ b/os/init/disinit.b
@@ -40,6 +40,7 @@
sys->bind("#m","/dev",sys->MAFTER); # pointer/mouse
sys->bind("#p", "/prog", sys->MREPL); # prog device
sys->bind("#r", "/dev", sys->MAFTER); # rtc
+ sys->bind("#s", "/chan", sys->MREPL); # server registry
sys->bind("#t", "/dev", sys->MAFTER); # serial line
# sys->bind("#v","/dev",sys->MAFTER); # VGA
sys->bind("#I0", "/net", sys->MAFTER); # IP
--- a/os/pc64/trap.c
+++ b/os/pc64/trap.c
@@ -253,7 +253,7 @@
print(" CS %4.4zux DS %4.4ux ES %4.4ux FS %4.4ux GS %4.4ux\n",
ureg->cs & 0xFFFF, ureg->ds & 0xFFFF, ureg->es & 0xFFFF,
ureg->fs & 0xFFFF, ureg->gs & 0xFFFF);
- print(" R8 %4.4zux R9 %4.4zzux R10 %4.4zux R11 %4.4zux R12 %4.4zux\n",
+ print(" R8 %8.8zux R9 %8.8zzux R10 %8.8zux R11 %8.8zux R12 %8.8zux\n",
ureg->r8, ureg->r9, ureg->r10, ureg->r11, ureg->r12);
}
--- a/os/port/proc.c
+++ b/os/port/proc.c
@@ -1022,7 +1022,6 @@
}
}
-/* we set the errlab[NERR-1] to know where the error was raised(?) */
void
error(char *err)
{
@@ -1032,10 +1031,13 @@
if(up->nerrlab >= NERR)
panic("error stack too deep");
- kstrcpy(up->env->errstr, err, ERRMAX);
- if(err[0] == '\0'){
+ if(emptystr(err) == 1){
+ DBG("error nil error err %s caller 0x%p\n", err, getcallerpc(&err));
+ up->env->errstr[0] = '\0';
up->env->errpc = 0;
+ /* showerrlabs(); */
}else{
+ kstrcpy(up->env->errstr, err, ERRMAX);
up->env->errpc = getcallerpc(&err);
/* proactively show issues */
/* print("up->nerrlab %d error %s raised by 0x%zx\n",
@@ -1042,7 +1044,6 @@
up->nerrlab, err, getcallerpc(&err)); */
/* showerrlabs(); */
}
- setlabel(&up->errlab[NERR-1]); /* to store the location where error() was raised(?) */
nexterror();
}
--- a/os/port/sysfile.c
+++ b/os/port/sysfile.c
@@ -1287,9 +1287,6 @@
long l;
int namelen;
- if(waserror())
- return -1;
-
validstat(buf, n);
c = namec(path, Aaccess, 0, 0);
if(waserror()){