This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: load data from floppy
- From: Nick Garnett <nickg at ecoscentric dot com>
- To: davidw at dedasys dot com (David N. Welton)
- Cc: eCos discussion <ecos-discuss at sources dot redhat dot com>
- Date: 05 Aug 2003 18:35:21 +0100
- Subject: Re: [ECOS] load data from floppy
- References: <87fzlkm263.fsf@dedasys.com> <m3d6govu7p.fsf@miso.calivar.com><873chillr6.fsf@dedasys.com> <m3vfueve9h.fsf@miso.calivar.com><87el0fdcdm.fsf@dedasys.com> <m3he5b4wod.fsf@miso.calivar.com><87ispljwnh.fsf@dedasys.com> <m3vftkgv27.fsf@miso.calivar.com><87ptjlo0gg.fsf@dedasys.com> <m33cgh9vi2.fsf@miso.calivar.com><87smogjgqs.fsf@dedasys.com>
davidw@dedasys.com (David N. Welton) writes:
> 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?
No, all in sectors.
>
> That will certainly offload some work onto program authors, who will
> need to the twiddling in order to get exactly the bytes they need.
>
Well, usually, the clients of this code will be filesystems, which
already work in sectors or blocks, so mostly the issue doesn't arise.
> 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).
That might be the way to go. Another thought is to put it into a
second driver layer, or into a "filesystem" that just presents raw
access to some underlying block device. It is certainly a good idea to
separate the low-level driver, which should work in sectors, from any
higher level semantics we might want to layer on top of it.
--
Nick Garnett eCos Kernel Architect
http://www.ecoscentric.com The eCos and RedBoot experts
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss