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

Re: Significance of PAGE_OFFSET



Abhishek Nayani wrote:
> 
> Hi,
> 
>         The PAGE_OFFSET is used to give the Kernel
> exclusively the memory range above 3GB, but what is
> its use at bootstrap. In the provisional gdt at bootup
> time the first 4mb of linear addresses are mapped to
> the first 4mb physical addresses and from PAGE_OFFSET
> to PAGE_OFFSET + 4 mb also. why are we doing it ?
> 
>                        Bye,
>                                 Abhi.

Because the code that turns on paging (head.S) logically
relocates the kernel code from its boot-time location
to PAGE_OFFSET. That is, the code that loads
CR0 to turn on paging is executing at whatever
physical address it was loaded at, 9000h or something;
but as soon as that instruction completes, the
next instruction is executing at virtual address
PAGE_OFFSET+9000h (plus the instruction's offset
in the kernel text, naturally). So both of those
mappings have to be valid.


-- Joe


-- Joe Knapka
"You know how many remote castles there are along the gorges? You
 can't MOVE for remote castles!" -- Lu Tze re. Uberwald
// Linux MM Documentation in progress:
// http://home.earthlink.net/~jknapka/linux-mm/vmoutline.html
* Evolution is an "unproven theory" in the same sense that gravity is. *
-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/