[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

harddisc device drivers, how to read/write data?



 Hi there,

 I've been experimenting with writing a device driver for harddiscs. Well,
bascially I want something which gives me /dev/sd0a entries and such. I've
already written a routine to analyze an AHDI partitioned harddisc. I've not
yet done the code to install a device for each partition, but that shouldn't
be the problem.

 My simple question is: How should read/write be done on such raw devices? I
don't have a Linux box or anything else to look how it's done there, but I
assume the following possibilities:

 1) Use the DEVDRV read/write calls but watch out that data is always aligned
to 512 byte boundaries.

 2) Use the read/write calls but give the size argument a completely different
meaning: It doesn't say bytes, but sectors instead. The size of the device
would therefore not represent the partition size in bytes, but in sectors
instead.

 3) Use ioctl() calls to read/write and make the DEVDRV read/write calls
become dummies. If so, which ioctl numbers should be used?

 As I said I don't know about how other systems do it, so I would be
pleased if someone could give me information about this.

 Note that the current code still uses physical Rwabs() calls to access the
drive - with all known problems with it - but first even with this one it
would already be possible to access partitions which are not of type GEM or
BGM, and second it shouldn't be difficult to implement real SCSI (or ACSI)
code like Erling Henangers (hi Erling! :) stuff in it.

 I don't know what exactly EH`s SCSI driver does because I still wasn't
able to get through to a.a.u.e and didn't find it anywhere on any mirror,
but I doubt it already implements partition orientated devices.

 BTW: Does the ICD package (seems to be the other big package worth to be
mentioned) *only* implement a different ACSI/SCSI driver, or does it *also*
implement a different partitioning scheme? Nobody ever said the AHDI one is
very clever, but if there are many different ones it would complicate things.

ciao,
TeSche
--
Torsten Scherer (Schiller, TeSche...), itschere@techfak.uni-bielefeld.de
Faculty of Technology, University of Bielefeld, Germany, Europe, Earth...
| Use any of "finger itschere@129.70.131.2-15                           |
| Last updated: 31. July 1994                                           |