> Next is the 'disk drives'.... and this is where I'm a little lost. Current
> system uses the block drivers for disk access (presumably because the
> hardware is slow mechanical stuff) and registers interrupts for when data is
> ready (is this right?).

It doesn't have to

> The Psion SSD (memory cards) are accessed through a fast SIBO serial
> interface. The data is addressed mapped, to get at it you need to set the
> address and then read/write the byte of data.
> 
> What is the best way to approach implementing a driver?
> 
> Looking at block drivers a few seem to use a generic block read/write these
> seem to play with buffers, but that's as far as I got.

The kernel asks the block device to read/write buffers. You don't have to
use interrupts, you are allowed to complete the I/O when you get the request.

So
        save_flags(flags);
        cli();
        outb(some magic to select port)
        memcpy(foo, bar, length);
        restore_flags(flags);

is a completely valid way to implement the handling of a disk request.

Alan

Reply via email to