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

Re: harddisc device drive



To: mint@atari.archive.umich.edu

  Itschere@techfak.Uni-Biel,
  In a message on 22 August, to Mint@atari.Archive.Umich., wrote :

id>  Hi there,
id> 
id>  I've been experimenting with writing a device driver for harddiscs. Well
id> bascially I want something which gives me /dev/sd0a entries and such. I'v
id> already written a routine to analyze an AHDI partitioned harddisc. I've n
id> yet done the code to install a device for each partition, but that should
id> be the problem.
id> 
id>  My simple question is: How should read/write be done on such raw devices
id> don't have a Linux box or anything else to look how it's done there, but 
id> assume the following possibilities:
id> 
id>  1) Use the DEVDRV read/write calls but watch out that data is always ali
id> to 512 byte boundaries.

I would go for this solution. Keep a 512 byte buffer in your driver, so
read/writes not fitting 512 byte boundaries comes/goes to this buffer.
You could look at the cdrom device in ehscsi if you ever get into a.a.
This does the same thing for cdroms as ps0 does for floppies.
(except that it cannot write, of course :-)

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

I don't like that one.

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

Could be a solution.
Ioctl numbers is something I am also conserned about. Ie, I just grabbed
some random numbers to use for the tape-device in ehscsi, but this will
probably crash with something else sooner or later.
Anyone have any standard docs on this, like mtio.h or something ?

id> BGM, and second it shouldn't be difficult to implement real SCSI (or ACSI
id> code like Erling Henangers (hi Erling! :) stuff in it.

(Hi yourself :)

What do you use to get the partition info ?
The pun structure (from ahdi > 3.x), or do you read sector 0 on each disk ?

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

Correct.
Email me private, and I'll send the stuff to you.
Or try msdos.archive.u.e/mac.archive.u.e/amiga.archive.u.e....

Don't know anything about ICD though, so I'll leave that for others to
answer.

Cheers,

Erling  
---
 ~ ATP/Unix 1.40 ~ This is my tagline.