M pc/devfloppy.c => pc/devfloppy.c +1 -1
@@ 633,7 633,7 @@ floppysense(void)
if(floppycmd() < 0)
return -1;
if(floppyresult() < 2){
-print("can't read sense response\n");
+/*print("can't read sense response\n");/**/
fl.confused = 1;
return -1;
}
M pc/mmu.c => pc/mmu.c +11 -2
@@ 297,6 297,7 @@ putmmu(ulong va, ulong pa, Page *pg)
ulong *pt;
Proc *p;
char err[64];
+ int x;
if(u==0)
panic("putmmu");
@@ 313,8 314,16 @@ putmmu(ulong va, ulong pa, Page *pg)
* into it.
*/
if(p->mmutop == 0){
- p->mmutop = mmugetpage(0);
- memmove((void*)p->mmutop->va, (void*)ktoppg.va, BY2PG);
+ /*
+ * N.B. The assignment to pg is neccessary.
+ * We can't assign to p->mmutop until after
+ * copying ktoppg into the new page since we might
+ * get scheded in this code and p->mmutop will be
+ * pointing to a bad map.
+ */
+ pg = mmugetpage(0);
+ memmove((void*)pg->va, (void*)ktoppg.va, BY2PG);
+ p->mmutop = pg;
}
top = (ulong*)p->mmutop->va;
M pc/trap.c => pc/trap.c +6 -2
@@ 173,11 173,15 @@ trap(Ureg *ur)
{
int v;
int c;
+ static int spuriousfloppy;
v = ur->trap;
if(v>=256 || ivec[v] == 0){
- panic("bad trap type %d %lux %lux %lux\n", v, ur->pc, int0mask, int1mask);
- return;
+ if(v == 10 && spuriousfloppy == 0){
+ v = Floppyvec;
+ spuriousfloppy = 1;
+ }else
+ panic("bad trap type %d %lux %lux %lux\n", v, ur->pc, int0mask, int1mask);
}
/*
M port/proc.c => port/proc.c +21 -20
@@ 534,26 534,27 @@ pexit(char *exitstr, int freemem)
else
wq->w.msg[0] = '\0';
- /* Find my parent */
- p = c->parent;
-
- lock(&p->exl);
- /* My parent still alive */
- if(p->pid == c->parentpid && p->state != Broken && p->nwait < 128) {
- p->nchild--;
- p->time[TCUser] += c->time[TUser] + c->time[TCUser];
- p->time[TCSys] += c->time[TSys] + c->time[TCSys];
-
- wq->next = p->waitq;
- p->waitq = wq;
- p->nwait++;
- unlock(&p->exl);
-
- wakeup(&p->waitr);
- }
- else {
- unlock(&p->exl);
- freewaitq(wq);
+ if(c->kp == 0) {
+ /* Find my parent */
+ p = c->parent;
+ lock(&p->exl);
+ /* My parent still alive */
+ if(p->pid == c->parentpid && p->state != Broken && p->nwait < 128) {
+ p->nchild--;
+ p->time[TCUser] += c->time[TUser] + c->time[TCUser];
+ p->time[TCSys] += c->time[TSys] + c->time[TCSys];
+
+ wq->next = p->waitq;
+ p->waitq = wq;
+ p->nwait++;
+ unlock(&p->exl);
+
+ wakeup(&p->waitr);
+ }
+ else {
+ unlock(&p->exl);
+ freewaitq(wq);
+ }
}
if(!freemem)
M port/segment.c => port/segment.c +0 -1
@@ 346,7 346,6 @@ ibrk(ulong addr, int seg)
newtop = PGROUND(addr);
newsize = (newtop-s->base)/BY2PG;
if(newtop < s->top) {
- print("down brk\n");
mfreeseg(s, newtop, (s->top-newtop)/BY2PG);
qunlock(&s->lk);
return 0;