9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Steve Simon" <steve@quintile.net>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] implementing 9p read
Date: Fri,  6 Jul 2007 15:43:34 +0100	[thread overview]
Message-ID: <93f71afb320e8cd61cd2ff3f9f08ebbe@quintile.net> (raw)
In-Reply-To: <468D8253.9030400@wmipf.in-berlin.de>

> This probably also means that Read returns in
> most cases less bytes than requested, just as much as needed for the
> current line up to \n. The server likely has to keep some information
> like the next read-offset expected, and the next line number, so that it
> can check whether the next read-request actually asks for the next line
>  -- if it doesn't ignore seek/offsets at all, which also seems practicable.

You cannot do this, the usual idiom is that if read returns less
than the app expected this is treated as EOF. in my library the low level
function generates line at a time data, the library then performs multiple
reads to satisfy the apps read request filling its buffer and rembembering
the partial line for the next read request.

> I suppose this is adequate for control files waiting for commands. One
> can leave the fd open, and send one line after the other as needed.

I don't generally find this is nescessary, the fileserver/device driver holds
internal state so multiple writes mearly modify this state, thusly:

	echo 'cts=1' > /dev/uart/ctl
	echo 'baud=115200' > /dev/uart/ctl

We get a real win using the everything is a file idea in embedded as most of our products
contain multiple PCBs and each PCB has a CPU (to load its xilinxes if nothing else).
Given the remote file protocol running over a a couple of wires (the link layer
distantly related to datakit) we can monitor any cpu from any other cpu and
upgrade all flash files from the cpu that has ethernet.

Its a shame that we didn't have the guts and skill to make it
real plan9 from the begining - hindsignt is a wonderful thing.

-Steve


  parent reply	other threads:[~2007-07-06 14:43 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-05 18:51 Michael Teichgräber
2007-07-05 18:59 ` Sape Mullender
2007-07-05 19:14   ` Steve Simon
2007-07-05 23:44     ` Michael Teichgräber
2007-07-06  0:01       ` erik quanstrom
2007-07-07 10:57         ` [9fans] kvm matt
2007-07-07 12:19           ` Paweł Lasek
2007-07-07 14:35             ` matt
2007-07-07 19:20               ` Paweł Lasek
2007-07-08 15:22                 ` Paweł Lasek
2007-07-06 14:43       ` Steve Simon [this message]
2007-07-06 14:54         ` [9fans] implementing 9p read ron minnich
2007-07-06 21:58           ` Steve Simon
2007-07-06 22:03             ` Charles Forsyth
2007-07-06 14:57         ` C H Forsyth
2007-07-05 19:58   ` ron minnich
2007-07-05 23:32   ` Michael Teichgräber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=93f71afb320e8cd61cd2ff3f9f08ebbe@quintile.net \
    --to=steve@quintile.net \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).