From mboxrd@z Thu Jan 1 00:00:00 1970 Message-Id: <200102080221.VAA17000@smtp2.fas.harvard.edu> To: 9fans@cse.psu.edu Subject: Re: [9fans] Re: So, once I've got the OS up how do I... From: "Russ Cox" MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Date: Wed, 7 Feb 2001 21:21:31 -0500 Topicbox-Message-UUID: 5cf8796e-eac9-11e9-9e20-41e7f4b1d025 Regarding Plan 9 <-> Unix as far as file systems, Plan 9 has an NFS server that Unix systems may use to mount Plan 9 file systems. It works pretty well. We had someone working almost exclusively over the NFS server two summers ago. U9fs is a 9P server that Plan 9 systems may use to mount Unix file systems. It too works pretty well. As I type this, I have two such file systems mounted in my namespace. I'm also booting a Plan 9 box entirely over an ethernet with a FreeBSD machine serving as both file and authentication server. I'm using u9fs (rewritten for 9P2000 but pretty much the same) for file service and a port of auth.srv for authentication. It works. Neither is blazingly fast, but that's not the goal. They work well for providing interoperability. The amazing thing is how simple they are. 1527 3657 27203 u9fs/u9fs.c 326 792 6457 9auth/9authsrv.c The rest is mostly supporting routines pulled in from the Plan 9 C library, like doprint and convM2S. That's a full file server in 1500 lines of code, and an authentication server in 300. The reason this works is that 9P is so simple. If you want to drive the point home, put up the rot13fs below (inspired by a French intro to Plan 9 that appeared a few years ago; I'd credit further except not knowing French, I got by reading only the examples). The whole guts of the filter is right here: while(n=sizeof buf, getS(rd, buf, &f, &n) == nil){ if(f.type == Ropen) isdir[f.fid] = f.qid.path&CHDIR; if((f.type == Twrite || f.type == Rread) && !isdir[f.fid]) rot13(f.data, f.count); n = convS2M(&f, wbuf); write(wr, wbuf, n); } and that's it. 9P is simple. Compare this with the hoops being jumped through to do encrypted file systems on Unix by having fake NFS servers or kernel vnode-layer replacements or what-have-you. Russ #include #include #include #include #include void rot13(char *p, int n) { char *ep; for(ep=p+n; p