| plan 9 kernel history: overview | file list | diff list |
1991/0111/port/devroot.c (diff list | history)
| 1991/0111/sys/src/9/port/devroot.c:10,20 – 1991/0214/sys/src/9/port/devroot.c:10,25 (short | long | prev | next) | ||
| 1990/0227 | Qdir, Qbin, Qboot, | |
| 1991/0214 | Qcfs, | |
| 1990/0227 | Qdev, Qenv, Qproc, }; | |
| 1991/0214 | extern long cfslen; extern ulong *cfscode; | |
| 1990/0227 | Dirtab rootdir[]={ | |
| 1990/11211 | "bin", {Qbin|CHDIR}, 0, 0700, "boot", {Qboot}, 0, 0700, | |
| 1991/0111/sys/src/9/port/devroot.c:21,33 – 1991/0214/sys/src/9/port/devroot.c:26,41 | ||
| 1990/11211 | "dev", {Qdev|CHDIR}, 0, 0700, "env", {Qenv|CHDIR}, 0, 0700, "proc", {Qproc|CHDIR}, 0, 0700, | |
| 1991/0214 | "cfs", {Qcfs}, 0, 0700, | |
| 1990/0227 | }; #define NROOT (sizeof rootdir/sizeof(Dirtab)) | |
| 1991/0214 | int nroot; | |
| 1990/0227 | void rootreset(void) { | |
| 1991/0214 | nroot = (cfslen > 0) ? NROOT : NROOT-1; | |
| 1990/0227 | } void | |
| 1991/0111/sys/src/9/port/devroot.c:50,68 – 1991/0214/sys/src/9/port/devroot.c:58,76 | ||
| 1990/0227 | int rootwalk(Chan *c, char *name) { | |
| 1991/0214 | return devwalk(c, name, rootdir, nroot, devgen); | |
| 1990/0227 | } void rootstat(Chan *c, char *dp) { | |
| 1991/0214 | devstat(c, dp, rootdir, nroot, devgen); | |
| 1990/0227 | } Chan* rootopen(Chan *c, int omode) { | |
| 1991/0214 | return devopen(c, omode, rootdir, nroot, devgen); | |
| 1990/0227 | } void | |
| 1991/0111/sys/src/9/port/devroot.c:87,93 – 1991/0214/sys/src/9/port/devroot.c:95,101 | ||
| 1990/0227 | ||
| 1990/11211 | switch(c->qid.path & ~CHDIR){ | |
| 1990/0227 | case Qdir: | |
| 1991/0214 | return devdirread(c, buf, n, rootdir, nroot, devgen); | |
| 1990/0227 | case Qboot: /* boot */ if(c->offset >= sizeof bootcode) | |
| 1991/0111/sys/src/9/port/devroot.c:95,100 – 1991/0214/sys/src/9/port/devroot.c:103,116 | ||
| 1990/0227 | if(c->offset+n > sizeof bootcode) n = sizeof bootcode - c->offset; memcpy(buf, ((char*)bootcode)+c->offset, n); | |
| 1991/0214 | return n; case Qcfs: /* boot */ if(c->offset >= cfslen) return 0; if(c->offset+n > cfslen) n = cfslen - c->offset; memcpy(buf, ((char*)cfscode)+c->offset, n); | |
| 1990/0227 | return n; case Qdev: | |