[comp.os.minix] MacMINIX, interrupts, and ACK register saving conventions

brad@gobi.jpl.nasa.gov (Brad Pickering) (05/29/91)

I've been reading through the source code for MacMINIX and I noticed that
interrupt handlers for I/O completion don't do anything like a "save" to
save the process context.  This makes sense to me only if certain registers
are not modified by the interrupt handler and if the same process that
was running when the interrupt occured runs after the interrupt has been
handled.  The second condition seems to be true but I would like to be
more convinced that the first condition is met.

So my question is: what are the register saving conventions of ACK?

Inside Mac says that you must preserve all registers other than a0,a1 and
d0-d2.

On another note: I will be slowly working to modify MINIX to remove its
dependence on the Mac OS.  If anybody would like to talk about how this
might be done please contact me.  So far I have been experimenting with
booting from a floppy before the Mac OS takes full control. I am working
on a mac II so I think most of the resources that I need are in ROM so there
should be no need to have a System File.

--
--
Brad Pickering
brad@gobi.jpl.nasa.gov
--

KENC@vaxb.acs.unt.edu (Ken Corey, CSCI Major...) (05/29/91)

>I've been reading through the source code for MacMINIX and I noticed that
>interrupt handlers for I/O completion don't do anything like a "save" to
>save the process context.  This makes sense to me only if certain registers
>are not modified by the interrupt handler and if the same process that
>was running when the interrupt occured runs after the interrupt has been
>handled.  The second condition seems to be true but I would like to be
>more convinced that the first condition is met.

I wonder if this is why most of the people who run MacMinix can't get uucp to
work properly for them?

>On another note: I will be slowly working to modify MINIX to remove its
>dependence on the Mac OS.  If anybody would like to talk about how this
>might be done please contact me.  So far I have been experimenting with
>booting from a floppy before the Mac OS takes full control. I am working
>on a mac II so I think most of the resources that I need are in ROM so there
>should be no need to have a System File.

Are you talking about a MacMinix that runs on the basic hardware, and not the
OS?  Cool! That would definitely increase system speed.  

I've got a couple of questions about that though...I've got an accelerator, and
it must be started up with an init.  If I can't run that, I'd have no
interest in non-MacOS MacMinix. (8Mhz would drive me batty...;)

Another point, I'm looking into the idea of converting the MINI-X suite of
functions into something that works off Mac graphics primitives, and that
requires the system to be resident, no?

How about instead of trying to handle all the interupts within Minix, to
handling the worst of the time-dependant ones with an init or two?  The serial
port, for sure, and possibly the printer port!

Let me know what you think about this....
                                         
\  Ken Corey, VAX/Unix Programmer/Operator  (And GOD am I confused...;)  /
 \          kenc@vaxb.acs.unt.edu  ken@isect.lonestar.org               /

brad@gobi.jpl.nasa.gov (Brad Pickering) (05/29/91)

> something about how certain interrupts don't cause a context switch might
> be related to the uucp problems

I don't know but I really doubt it.  The context switch to finish handling
the interrupt should happen fairly quickly anyways.

> questions about MacMINIX running on bare hardware.

Actually, what I had in mind is having MINIX take control a system startup
time before the system file and inits have been loaded (Sorry).  I think this
may only work on systems with the 256k roms because of the resources available
in these roms.  The only parts of the MacOS that I really want to get away
from are the file system and the window manager. I would like to see X Windows
running on MacMINIX also but I think it would be too slow.

> suggestions about handling time critical interrupts in MINIX but letting
> apple handle the rest.

sounds ok to me.  I think I'd be happy with apple handling all interrupts but
eventually I'd like to replace these with handlers written specifically for
MacMINIX.  These routines would be pretty machine specific though so I doubt
any such modification would ever but put in the mainline MINIX.

--
--
Brad Pickering
brad@gobi.jpl.nasa.gov
--

KENC@vaxb.acs.unt.edu (Ken Corey, CSCI Major...) (05/30/91)

>I don't know but I really doubt it.  The context switch to finish handling
>the interrupt should happen fairly quickly anyways.

Yeah, it SHOULD, but that's the point...it doesn't right now...8(  The pure
Minix processes work pretty well, but they don't like backgrounding with other
Mac Applications, no way!  However, MacMinix DOES work on my 25Mhz Plus with
system 7...(grin)

>Actually, what I had in mind is having MINIX take control a system startup
>time before the system file and inits have been loaded (Sorry).  I think this
>may only work on systems with the 256k roms because of the resources available
>in these roms.  The only parts of the MacOS that I really want to get away
>from are the file system and the window manager. I would like to see X Windows
>running on MacMINIX also but I think it would be too slow.

The file system, I can understand, but it would be the most difficult.

But why get away from the window manager?  It's much faster than a x-window
clone.  Matter of fact, How hard would it be to make a translater between the
two...sure, you'd have to re-invent the wheel in places, but for the most part,
it would be making this command a true Mac command, no?

>sounds ok to me.  I think I'd be happy with apple handling all interrupts but
>eventually I'd like to replace these with handlers written specifically for
>MacMINIX.  These routines would be pretty machine specific though so I doubt
>any such modification would ever but put in the mainline MINIX.

Naw, these inits could be written to be 100% Apple clean.  Matter of fact, I
figure that a cdev would be even better, as it does provide an interface. 
Then, since it was clean, it could be ported across the different machines.

Just a thought.

\  Ken Corey, VAX/Unix Programmer/Operator  (And GOD am I confused...;)  /
 \          kenc@vaxb.acs.unt.edu  ken@isect.lonestar.org               /