Subject: Need help with hardware registers access
To: pm <port-mac68k@NetBSD.ORG>
From: Olivier GALIBERT <>
List: port-mac68k
Date: 02/17/1996 17:20:35
Since JPW is doing an excellent job at making ADB work
without mrg I thought it was time for me to start writing
the IDE driver for the 630 series. This way it should be
possible to boot with both disk and keyboard in some weeks :-)

But I have a weird problem : I can't access to the ATA hardware
registers. Base address for these registers under macos is 50f1a000,
so I try to access to them from IOBase+1a000. The point is that
any read or write access to them cause an unexpected trap, always
the same for a given kernel binary.

For example with volatile unsigned char *idebase=81a000 (1a000+IOBase)

return idebase[IDE_REG_ERROR]==0xff;

 lends to unexpected trap, vector offset 0x0 from 0x8bf30081


 lends to unexpected trap, vector offset 0xdec from 0xae84000b

etc...etc..., same for writes. The address and the vector offset
looks awfully like 040 code, which makes me think about a messed up
stack or a jump in nowhere, but the gcc-generated code is good and
0x8bf3 for example never appear in the kernel binary.

I checked the size of the IO vm zone, but it seems to be 800000-17ffff
which is more than enough. Are the MMU tables messed up somewhere,
declenching exceptions into oblivion ?

Idea, anyone ? I *really* wonder what happens...

Note: the debugger can't help me much since it is really difficult to use
      without a keyboard :-)


Like Ranma would say, "Nani sun da yo ?"