Skip to contentSkip to conversation

Resurrecting mkLinux

DISCUSSION Benjamin Herrenschmidt 2 participants 2 messages Apr 7, 1999

lore
Share & tools
lore
#0 lore raw
Quoted 7 lines · a sun

once a working boot loader is done, it actually shouldn't be too difficult to get things working. the hairiest part will probably be the tweaking that head.S needs. however, the apus code actually fiddles with the exception table and copies its virttophys constant into a specific memory location. i think we should be able to do something similar with the nubus powermac code as well to deal with memory holes if need be.

I think I'll finally have to dive into this now ;-)

So basically, I'll keep BootX behaviour similar, but the device-tree pointer in the boot-infos will be 0, and I'll add a couple of fields (machine ID and memory ranges extracted from MacOS nanokernel). I'll make sure the internal video is located at 1MB phys instead of 0.

Just a question: Where should I place the kernel ? Current BootX copies the kernel pages at 0 (physical). Should I do the same with a hole in the kernel, should I do the same without a hole (overriding video memory: the screen will display garbage during boot), or should I put the kernel in the first large enough physically contiguous piece of memory I find and let it relocate itself ?

BootX can do any kind of relocation quite easily before entering the kernel, the little "bootstrap" that I run when switching to supervisor and before entering the kernel will, after disabling the MMU, execute a list of page copy operations, this list is pre-built by BootX, and so can easily be adapted to make the necessary hole.

What is the APUS bootloader doing ? (Will it load the kernel at a fixed address ?)

For those who didn't follow earlier discussions, there are actually two problems with the memory mappings:

- The on-board video uses the in-RAM framebuffer at either 0 or 1Mb
(physical). I know how to change it from 0 to 1Mb if MacOS sets it to 0.

- The memory banks are generally not physically contiguous. Depending on
the motherboard and the organisation and population of the SIMM slots (each SIMM bank resides at a fixed address, and I think on-board soldered RAM lives at 0).

I'm working on BootX now (still those problems with boards still doing DMA while the kernel is beeing copied), I'll try to find some time to put some basic code for NuBus this week. Stay tuned.

Signature · 11 lines
           E-Mail: <mailto:[email protected]>
BenH.      Web   : <http://calvaweb.calvacom.fr/bh40/>





[[ This message was sent via the linuxppc-dev mailing list.  Replies are ]]
[[ not  forced  back  to the list, so be sure to Cc linuxppc-dev if your ]]
[[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting.   ]]
#1 lore raw

Just a question: Where should I place the kernel ? Current BootX copies the kernel pages at 0 (physical). Should I do the same with a hole in the kernel, should I do the same without a hole (overriding video memory: the screen will display garbage during boot), or should I put the kernel in the first large enough physically contiguous piece of memory I find and let it relocate itself ?

hmm. i think we're going to have to know about relocations anyway and where the start of the kernel really is. so, i would go for the last option. the first option would essentially duplicate some of the code that's in head.S already. we still need the kernel start address though. assuming that there are enough registers lying around, we could always do a -ffixed-# and store it there to make things easier. the apus code would benefit from that as well. if not, we can do the apus thing and choose a memory location.

so, how about just sticking the kernel somewhere contiguous and passing in the start of the kernel as part of the boot info struct? that way, the decision on how to handle things can be left to head.S.

back to the question of registers, how do people feel about allocating a fixed register in the kernel for the nubus powermacs and apus machines to store the phystovirt mapping? having things in a register would simplify things a bit.

-a
although, the second option would be humourous.

[[ This message was sent via the linuxppc-dev mailing list. Replies are ]] [[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]] [[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting. ]]