yes, here is a console... buts quite hacky:

        strcpy(buf, "end");
        for(;;){
                outin("cwfscmd", buf, sizeof buf);
                if(strlen(buf) > 0)
                        fprint(p[0], "%s\n", buf);
                if(strcmp(buf, "end")==0)
                        break;
                buf[0] = 0;
        }

p[0] is our end of the pipe to cwfs stdin.  if you do nothing or hit
enter it just writes "end" and starts to connect to the fs.  but you
could type cwfs command then this becomes something like a console
input loop.  stdout and stderr of cwfs go to the cpuservers console.

hmmm...  as i'm thinking of it...  this is broken...  if for example
you want to do a devopy, you always have to type end before it starts
doing its work right?  but init will continue and try to mount it wich
will fail in this case panic the kernel.

maybe a better way is this:

        /* ask for cwfs config mode, will timeout in 15 seconds and continue 
mounting */
        strcpy(buf, "No");
        outin("config mode", buf, sizeof buf);
        if(buf[0]=='Y' || buf[0]=='y'){
                for(;;)
                        if((i = read(0, buf, sizeof buf)) > 0)
                                write(p[0], buf, i);
        }
        fprint(p[0], "end\n");

--
cinap
--- Begin Message ---
> used the cphist program from http://www.quanstro.net/plan9/history.pdf
> and wrote a /dev/(bin)time faking fileserver
> (/n/sources/contrib/cinap_lenrek/delorean) that fools cwfs and replica
> about the current time, but does not confuse cron and fossil.  you

very sneaky!  i love it.
thanks for the write up.

> cwfs needs to be halted correctly as it has no jurnaling or softupdates.

mmm.  i have not had any trouble with unexpected shutdowns.
and i have had a few.  maybe not enough.

i could have just been lucky, but i suspect that ken was much
craftier than that.  i suspect, but haven't taken the time to verify,
that ken rolls up to the root so while one may write unfinished
garbage to the cache device, you won't see corruption.  unless
your fancy disk has reorderd writes in a bad way. :-)

you may wish to take the change that the diskless fs code has
to the cache on-disk layout.  by going column wise one can
eliminate the seek between every successive block.  you will
need a cache big enough to never resize.  what you give up
is the ability to add cache during startup.  (is there even a
console at startup with cwfs?)

- erik

--- End Message ---

Reply via email to