ref: d920d42c8bad0719f8a91f5121d5f7c080e2a332
parent: 74d480c1e8fcf5817fa2963d504d90ccc478ffc2
author: Russ Cox <rsc@swtch.com>
date: Tue Oct 18 14:19:23 EDT 2005
Less or better chatter.
--- a/exportfs/exportfs.c
+++ b/exportfs/exportfs.c
@@ -28,7 +28,7 @@
{
char buf[ERRMAX], ebuf[ERRMAX];
Fsrpc *r;
- int n;
+ int i, n;
char *dbfile, *srv, *file;
ulong initial;
@@ -85,11 +85,21 @@
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; i<n; i++){
+ iprint(" %.2ux", r->buf[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 @@
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 @@
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);
--- a/kern/devcons.c
+++ b/kern/devcons.c
@@ -147,33 +147,6 @@
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