Subject: Re: processor mode?
To: None <campbel@istar.ca>
From: Masami and Ken Nakata <masami@fa2.so-net.or.jp>
List: port-mac68k
Date: 03/09/1997 08:37:31
On Sat, 8 Mar 1997 13:31:38 -0500,
campbel@istar.ca (Steven Campbell) wrote:
> Hi.  The answers to my question about memory locations piqued my curiosity
> now.  I know that under MacOS, the processor always runs in Supervisor
> mode.  Under NetBSD, does it run in User Mode until an interrupt is called
> to give protected memory?

All the user code runs in user mode and all the kernel code runs in
kernel mode (= "supervisor mode" in Motorola's term).

> My next question is: Are ROM Toolbox calls made under NetBSD without
> breaking the pre-emptive multitasking of UNIX?

It could.  If you let ROM Toolbox run too long, it can interfere the
multitasking because the kernel cannot switch contexts while ROM
routine is running.  This is true not only for ROM routines but also
for all kernel routines.  Kernel routines give up CPU cycles when
they block (e.g. waiting for I/O completion), but ROM routines have
no knowledge of the kernel sleep() call, so you lose.

Of course, all this (except about Mac Toolbox calls) is much better
explained in the Daemon Book...

> I'm just trying to get an idea of how the memory map and set-up of the
> processor for running NetBSD may affect how some machines may behave under
> NetBSD, notably machines with weird configurations or undocumented video
> hardware, such as the LC 475, Q 605, Q 950, IIfx, et al.
> Would setting up future kernels to use Apple's memory maps under NetBSD
> break NetBSD completely, or would minor source changes fix the chaos?

I'm not up to answering this question.  Sorry.

Ken