2

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 ?

Neha Karanjkar
  • 3,390
  • 2
  • 29
  • 48

2 Answers2

4

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.

David Hoelzer
  • 15,862
  • 4
  • 48
  • 67
0

Nowadays there are some changes are going on in upcoming Linux kernel version to make it configurable to place kernel image anywhere.

Latest information can be found kernel mailing list.

Similar discussion is here.

Sam Protsenko
  • 14,045
  • 4
  • 59
  • 75
Pradeep Goswami
  • 1,785
  • 1
  • 15
  • 24