[Prev][Next][Index][Thread]

Re: Loading the kernel.



>> The multiboot standard says that the processor is *not* allowed to be
>> in paging mode on kernel entry; so the complete multiboot standard would
>> not be usable anyway in this case...
>
>I suppose that is true, but I think the goal is figure out how to make the
>kernel run under the conditions set forth by the poster. The multiboot init
>code provides a wealth of information on that topic.

Yes, that's true.  However, I remain of the opinion that if you write your
own loader, then either you make it multiboot compliant or use your own
boot system.
But don't let my opinions deter anybody from implementing this sort of stuff ;)

>Its also debatable whether the part of the multiboot spec that says the
>processor is *not* allowed to be in paging mode makes a great deal of sense
>in all cases (all classes of problems and target hardware) ...

About target hardware, multiboot was aimed at x86 only, AFAIK.  Doing
multiboot on other architectures would require modifications to the
standard, anyway.  As for whether it's a good idea to specify that the
processor is not allowed to be in paging mode on entry, I think it's pretty
important.  The initialisation of a multiboot kernel may (and usually
does!) make assumptions on the state of the system.  If the system were in
paging mode, my multiboot kernel (which isn't written using the OSKit)
would not work.  It would put pagetables in the memory, attempt to switch,
and then crash because it's trying to load a virtual address into the PDBR.
Or it might also overwrite the existing pagetables... who knows... you
can't just leave the decision to initialise paging to the bootloader; a
standard needs to have these issues fully specified, so no
misunderstandings can occur.

This doesn't mean I'm against turning on paging in the bootloader... it's
just that it either has to be done that way in *all* cases, or in none.
Booting with paging off, however, does make more sense to me as it requires
less logic in the bootloader (not only the turning-paging-on logic can be
removed, but don't forget that if you turn on paging in the loader the
loader would have to pass *all* information about the paging to the guest
kernel.)

just my 2ct..

-- Ramon