Re: questions..

From: Andrew Valencia <vandys_at_nospam.org>
Date: Fri Sep 02 1994 - 08:44:14 PDT

[Tim Newsham <newsham@uhunix.uhcc.Hawaii.Edu> writes:]

>Ok. The big question is... data is moving between when main()
>starts up and when the mmu is turned on. Before turning on the
>MMU data is the page following text. After turning on the MMU
>it is at 4megs. What exactly does GCC put into the data segment?
>Is this data just avoided up until the MMU is started?

boot.exe running from DOS sets up page tables and enables the MMU (including
paging) before it jumps into VSTa's startup code. So data accesses are fine
from the initial instruction in the VSTa kernel. See vsta/boot/ptes.c,
especially the treatment of the first (l1[0]) and second (l1[1]) entries in
the first level PTEs.

These page tables (and, in fact, the GDT itself) are *replaced* by VSTa
with ones it creates. But the mapping puts data at 4 meg, and VSTa leaves
it there when it replaces the page tables with its own.

>smaller questions.. What is the 8-12meg mapping for? It points
>back to the top level (level 1) table. What effect does this
>have?

It makes it easy to reference your level 1 PTEs, since it auto-magically
creates a virtual address for all of the first level PTEs (which, note, take
up a max of 4 megs). See how vtop() works, especially the use of l2ptmap.

>The first page of text is invalid according to the MMU. It appears
>that text starts at 4K rather than 0K. Is this correct? Does
>the linker usually load to this address or is this requested
>specially?

The linker does this, it was like this for the DOS djgpp C compiler, and I
left it this way since it catches NULL pointer dereferences.

                                                Regards,
                                                Andy
Received on Fri Sep 2 07:35:43 1994

This archive was generated by hypermail 2.1.8 : Thu Sep 22 2005 - 15:11:45 PDT