Re: [Prex-devel] Use of phys_to_virt()
Status: Beta
Brought to you by:
kohtani
From: Kohsuke O. <ko...@us...> - 2007-04-25 14:12:41
|
Giovanni Visciano wrote: > 1) Why does loader_main() [boot/common/main.c] use "phys_to_virt" to get > the > "kernel_entry" (address of kernel_start()) ? We have to translate address to the physical address until we enable paging. Please check locore.S in i386 kernel. > 2) Why does elf_load() [boot/common/elf.c] get the initial load address by > taking > the virtual address from "p_paddr" (Physical address) field of the > Elf_Program_Header > instead of taking it from "p_vaddr" (Virtual address in memory image) ? p_paddr of the kernel module is just used to point the kernel load address. So, we can put the kernel anywhere regardless of p_vaddr if it's needed. - Kohsuke |