This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: load data from floppy


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]