Subject: Re: Mac m68k booting process?
To: Peter <pb@ludd.luth.se>
From: Tony Mantler <nicoya@apia.dhs.org>
List: port-mac68k
Date: 09/04/2000 14:01:12
At 1:45 PM -0500 9/4/2000, Peter wrote:
>Tony Mantler wrote:
[...]
>>First off, there's the interesting challenge that the state that the mac is
>>in before MacOS gets loaded off the disk is hideously buggy and entirely
>>undocumented.
>
>What about debug the already existing code. Not necessarly by
>disassembling the
>code but rather run the ROM/MacOS in an emulator. And log all I/O access.
>I have done this with a scanner software for win3.11 once.
>(to make a *bsd driver)

You can try if you like.


[...]
>Well one could rely on that the there are not so many cards used. Ie if you
>use an unsupported card, it won't boot.
>Anyway, when MacOS (ROM's) is booting it must have some way of turning of
>those
>interrrupts. So I guess the answers to all this can be found in those ROM's.

There's 2 important calls to the onboard driver that the system can use to
control the interrupts. The first is the slot int ack call, which handles
an interrupt from the slot when it comes in, and the second is the slot int
set call, which switches the interrupts on the card on and off.
Unfortunatley, under normal circumstances, the MacOS *never* calls the slot
int set function, so many drivers never implemented this function, or have
broken implementations.

MacOS, of course, is perfectly happy to just call the slot int ack function
to service the interrupts it gets. Unfortunatley, the slot int ack function
is allowed to access any part of MacOS it pleases, so calling it from
within another OS is not worth the trouble.


[...]
>Isn't NuBus quite more clever than ISA/MCA anyway ?, maybe even better than
>PCI?

I'd say PCI has a leg up on NuBus, but yes, it's much much nicer than ISA
or MCA. Unfortunatley, apple's implementation royally sucks ass. They never
supported DMA transfers, and they wired all the slot interrupts together
onto a single interrupt pin on VIA 2 without any sort of interrupt
controller inbetween.

That's why slot interrupts lock hard when you have a card without a driver
sending out ints. The interrupt gets asserted, but can never be cleared,
because there's no interrupt controller, and you don't know how to talk to
the card in whatever obsfucated manner the manufacturer thought up while
smoking something funny all those dozen years ago.


Cheers - Tony 'Nicoya' Mantler :)


--
Tony "Nicoya" Mantler - Renaissance Nerd Extraordinaire - nicoya@apia.dhs.org
Winnipeg, Manitoba, Canada           --           http://nicoya.feline.pp.se/