[ECOS] load data from floppy
David N. Welton
davidw@dedasys.com
Tue Aug 5 14:55:00 GMT 2003
Nick Garnett <nickg@ecoscentric.com> writes:
> > > It would certainly be worth looking at. We also need to make
> > > sure that way you are using it matches with the (currently very
> > > vague) ideas I have about how block devices should work.
> > Which are?
> See my exchange with Gary on the maintainers list.
Actually, it was the -devel list.
It's search engine is kind of touchy, and isn't very helpful.
As an additional aside: the 'browse other lists at this site' link is
broken:
http://ecos.sourceware.org/lists.html#eCos
> > I have another question. The underlying Minix code that I am working
> > on top of doesn't want to deal with read/write sizes or positions that
> > are not multiples of 512 (SECTOR_SIZE).
> > I think a good interface should hide that, but on the other hand, that
> > might force some uglies. If, for instance, you want to read less than
> > a full 512, the driver is going to have to allocate a full 512 itself,
> > and then copy it over. That seems kind of wasteful, especially if the
> > size is much larger.
> > Any thoughts on how to get around that kind of limitation? I'm going
> > to keep hacking at it myself... I've got a few ideas.
> Fixing it to operate solely in 512 byte sectors is the simplest and
> most straightforward approach. I see no need to jump through hoops
> to pretend that it works in any other way. Disks are too big these
> days for a 32bit byte offset to work, and I would prefer to avoid
> too much use of 64 bit values -- especially where we might have to
> do arithmetic to extract sector offsets/sizes.
I read the thread on the -devel list, and I would like to be very
certain before I go ripping out the code that I have been adding:
cyg_io_bread(cyg_io_handle_t handle, void *buf,
cyg_uint32 *len, cyg_uint32 pos)
*len == buffer length in 512 byte sectors.
pos == position in 512 byte sectors.
Or will *len be in bytes?
That will certainly offload some work onto program authors, who will
need to the twiddling in order to get exactly the bytes they need.
Idle thought: I wonder if it would be possible to put a sectors->bytes
/ bytes->sectors conversion layer into a small library, or if it's too
specific / would be too wasteful (require copying and replicating lots
of memory).
--
David N. Welton
Consulting: http://www.dedasys.com/
Personal: http://www.dedasys.com/davidw/
Free Software: http://www.dedasys.com/freesoftware/
Apache Tcl: http://tcl.apache.org/
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss
More information about the Ecos-discuss
mailing list