Subject: Re: IDE Support ? [Sorry, a bit long...]
To: SamMaEl <rimsky@teleport.com>
From: Gwenole Beauchesne <gwenole.beauchesne@iname.com>
List: port-mac68k
Date: 03/04/1998 13:43:48
> A little off-topic question, but just how many Mac systems come with IDE
> drives?

At least the 630 series, and some powerbooks.

<off-topic ON>
BTW, I have been told that PowerMac 5200 series were to be supported
by the MkLinux DR3 release. Does someone have any news about it ? I am
asking this because, it appears that, according to the Developper Notes,
the 630 series and 5200 series use the same chipset : "F108 memory
controller and I/O support IC". In fact, "The Power Macintosh 5200 and
6200 computers are electrically similar to the Macintosh Quadra 630 and
LC 630."
<off-topic OFF>

Just wondering... ;-)


> Where would be a good place to find this info? I'd also be interested in
> taking a crack at it...

You mean Apple Developer Note ? If so, a series of documents can be
found at : <ftp://ftp.apple.com/devworld/Technical_Documentation/>
in Developer_Note directory.


> > > [There, I thought .ATDrvr would be ATA Driver ?]
> > Maybe.

Finaly, I checked in the Apple Developer Note "Mac LC 630 &Quadra 630" :
"The IDE hard disk device driver has a driver reference number of -54
(decimal) and a driver name of .ATDrvr."

 
> > what's going on (assuming that you understand m68k assembly, which really
> > isn't all that difficult once you get used to it).  Presumably, the base

I also posted this request on the MacLinux mailing-list. And here is a
feed-back. Any good ?

------- Begin Forwarded Message -------

Subject:     Re: IDE Support & How to find the base address ?
From:        Mikael Forselius <mikaelf@comenius.se>
To:          <linux-mac68k@wwaves.com>
Date:        Wed, 4 Mar 1998 09:46:16 +0100

[...]

Ah, you're looking the driver header - not the "real" code.

A driver consists of two parts. A driver header that
contains information about the driver and the offsets
into the second part, the routines that do all the
dirty work.

The structure of a driver, and what we have above, is:

Offset,     Name
decimal

0           drvrFlags     - info
2           drvrDelay     - - // -
4           drvrEMask     - - // -
6           drvrMenu      - - // -
8           drvrOpen      - offset from base to Open routine
10          drvrPrime     - offset from base to Prime routine
12          drvrCtl       - offset from base to Control routine
14          drvrStatus    - offset from base to Status routine
16          drvrClose     - offset from base to Close routine
18          drvrName      - Pascal string, name of driver (".ATDrvr")

All drivers share this structure, some of the fields are not
used for certain drivers but they all have the same header.
And all drivers must implement the Open, Prime, Control,
Status and Close routines (almost, this can be overridden but
the header with the offsets will be the same).

>From the dump above, we have:

  drvrFlags    : 0x6F00
  drvrDelay    : 0x0000
  drvrEMask    : 0x0000
  drvrMenu     : 0x0000
  drvrOpen     : 0x0028
  drvrPrime    : 0x00AA
  drvrCtl      : 0x004C
  drvrStatus   : 0x005C
  drvrClose    : 0x003C
  drvrName     : 0x072E 0x4154 0x4472 0x7672 0x4450 (".ATDrvr")

Given the base address of the driver dump above, 0x0000994E,
the "work" routines starts at:

  Open         : 0x0000994E + 0x0028 = 0x00009976
  Prime        : 0x0000994E + 0x00AA = 0x000099F8
  Ctl          : 0x0000994E + 0x004C = 0x0000999A
  Status       : 0x0000994E + 0x005C = 0x000099AA
  Close        : 0x0000994E + 0x003C = 0x0000998A

These are the addresses that would be of interest
if you're going to disassemble the driver. Note that
the base address, 0x0000994E, is subject to change since
this driver is loaded into RAM at MacOS boot time, i.e.
you'll have to perform the calculation again if the
.ATDrvr base address is not 0x0000994E when you're about
to do the disassembly.

BTW, ".EDisk" is the MacOS RAM disk driver.
BTW 2, The driver is RAM based, patched, I would
not worry that it's not in ROM. Apple had a lot
of problems with their IDE drivers.

-------- End Forwarded Message --------

--
Gwenole Beauchesne