Search code examples
linux-kernelsparc

Does linux kernel assume that it is located at a particular physical address?


Can the bootloader place the kernel at an arbitrary physical address in memory ? Does the linux kernel assume that it has been placed at a particular address ?

For example, in Sparc, the kernel _start symbol is located at virtual address=0xf0004000, and typically placed at physical address=0x00004000. Can the bootloader place the kernel at an arbitrary physical address, say 0x10004000, provided its mapped correctly in the bootloader's page tables ? If not, is the assumed physical location of the kernel architecture-specific ?


Solution

  • The kernel does expect to be at a specific location. That location is architecture specific. You can reconfigure and recompile the kernel to adjust this.

    I was actually researching this recently for x86/x86_64, which is well documented. I would expect to find Sparc documentation there, though it doesn't jump out at me. Some information can be found here, though.

    The relevant bit seems to be:

    The boot sector that gets loaded is what you find in /boot/first.b in your Linux-Sparc system, and is a bare 512 bytes. It is loaded to address 0x4000 and its role is retrieving from disk /boot/second.b and putting it to address 0x280000 (2.5 megs); the address has been chosen because the Sparc specifications state that at least three megabytes of RAM are mapped at boot time.