Subject: Re: Kernel startup and entry vectors
To: Dan Winship" , "Louis Gerbarg <gerbal@cs.rpi.edu>
From: Sanjay Lal <sanjayl@iqmail.net>
List: port-macppc
Date: 04/24/2001 09:08:09
----- Original Message -----
From: Tsubai Masanari <tsubai@iri.co.jp>
To: Dan Winship <danw@ximian.com>; Louis Gerbarg <gerbal@cs.rpi.edu>
Cc: <port-macppc@netbsd.org>
Sent: Tuesday, April 24, 2001 4:12 AM
Subject: Re: Kernel startup and entry vectors


> >> 4. Does the kernel expect to be in real-mode on entry
> >
> >Blah. Haven't looked at low-level ppc stuff in too long. Does "real
> >mode" mean no memory mapping? If so, then yes.
>
> No.  OF needs virtual-mode on PowerMac.
> So, the kernel must be in virtual-mode on startup too.
>
>

Well it depends on which way you look at it :-). Whatever the state
of the MSR on entry into the kernel, it saves the value into ofmsr, and
one of the 1st things it does is set it to 0.  This essentially turns off
all translation.

__start:
#ifdef  FIRMWORKSBUGS
    mfmsr   0
    andi.   0,0,PSL_IR|PSL_DR
    beq 1f

    bl  _C_LABEL(ofwr_init)
1:
#endif
    mfmsr   0
    lis 9,ofmsr@ha
    stw 0,ofmsr@l(9)

    li  0,0
    mtmsr   0           <===============  IR and DR are set to zero.
    isync

After this the kernel runs in real mode until it sets up the interrupt
vectors/BATS.

Regards
Sanjay