diff --git a/exportfs/exportfs.c b/exportfs/exportfs.c index 8dfefeb..f3f1630 100644 --- a/exportfs/exportfs.c +++ b/exportfs/exportfs.c @@ -28,7 +28,7 @@ exportfs(int fd, int msgsz) { char buf[ERRMAX], ebuf[ERRMAX]; Fsrpc *r; - int n; + int i, n; char *dbfile, *srv, *file; ulong initial; @@ -85,11 +85,21 @@ exportfs(int fd, int msgsz) DEBUG(DFD, "read9p..."); n = read9pmsg(netfd, r->buf, messagesize); if(n <= 0) - fatal(nil); + fatal("eof: n=%d %r", n); - if(convM2S(r->buf, n, &r->work) == 0) + if(convM2S(r->buf, n, &r->work) == 0){ + iprint("convM2S %d byte message\n", n); + for(i=0; ibuf[i]); + if(i%16 == 15) + iprint("\n"); + } + if(i%16) + iprint("\n"); fatal("convM2S format error"); + } +//iprint("<- %F\n", &r->work); DEBUG(DFD, "%F\n", &r->work); (fcalls[r->work.type])(r); } @@ -110,6 +120,7 @@ reply(Fcall *r, Fcall *t, char *err) else t->type = r->type + 1; +//iprint("-> %F\n", t); DEBUG(DFD, "\t%F\n", t); data = malloc(messagesize); /* not mallocz; no need to clear */ @@ -117,7 +128,7 @@ reply(Fcall *r, Fcall *t, char *err) fatal(Enomem); n = convS2M(t, data, messagesize); if((m=write(netfd, data, n))!=n){ - fprint(2, "wrote %d got %d (%r)\n", n, m); + iprint("wrote %d got %d (%r)\n", n, m); fatal("write"); } free(data); diff --git a/kern/devcons.c b/kern/devcons.c index d60d100..322c5a1 100644 --- a/kern/devcons.c +++ b/kern/devcons.c @@ -147,33 +147,6 @@ putstrn0(char *str, int n, int usewrite) qiwrite(kprintoq, str, n); }else if(screenputs != nil) screenputs(str, n); - - if(serialoq == nil){ - uartputs(str, n); - return; - } - - while(n > 0) { - t = memchr(str, '\n', n); - if(t && !kbd.raw) { - m = t-str; - if(usewrite){ - qwrite(serialoq, str, m); - qwrite(serialoq, "\r\n", 2); - } else { - qiwrite(serialoq, str, m); - qiwrite(serialoq, "\r\n", 2); - } - n -= m+1; - str = t+1; - } else { - if(usewrite) - qwrite(serialoq, str, n); - else - qiwrite(serialoq, str, n); - break; - } - } } void