Base address at which the linux kernel is loaded Base address at which the linux kernel is loaded linux linux

Base address at which the linux kernel is loaded


for MIPS architecture

file Platform contain the field/variable "load-..." assigned with the location in physical address space.

example:

openwrt/build_dir/target-mips_mips32_musl-1.1.16/linux-brcm63xx_smp/linux-4.4.14/arch/mips/bcm63xx/Platform

## Broadcom BCM63XX boards#platform-$(CONFIG_BCM63XX)  += bcm63xx/cflags-$(CONFIG_BCM63XX)    +=                  \    -I$(srctree)/arch/mips/include/asm/mach-bcm63xx/load-$(CONFIG_BCM63XX)      := 0xffffffff80010000

for ARM architecture

file Makefile.boot contain the field/variable "zreladdr-y" assigned with the location in physical address space.

example:

openwrt/build_dir/target-mips_mips32_musl-1.1.16/linux-brcm63xx_smp/linux-4.4.14/arch/arm/mach-omap1/Makefile.boot

   zreladdr-y       += 0x10008000params_phys-y       := 0x10000100initrd_phys-y       := 0x10800000

for Microblaze architecture

file Makefile contain the field/variable "UIMAGE_LOADADDR" assigned with the location in physical address space (exported from Xilinx ISE).

example:

openwrt/build_dir/target-mips_mips32_musl-1.1.16/linux-brcm63xx_smp/linux-4.4.14/arch/microblaze/boot/Makefile

UIMAGE_LOADADDR = $(CONFIG_KERNEL_BASE_ADDR)


Kernel is loaded at physical address of 1MiB which is mapped on PAGE_OFFSET + 0x00100000 (virtual address). usually 8MiB of virtual space is reserved for kernel image starting from PAGE_OFFSET + 0x00100000


As other answer states that Kernel base address is fixed for particular architecture. But due to many security issues kernel development community decided to make it random. It is called ASLR (Address Space Layout Randomization).

By reading your question (or because I am reading it in 2017), you may be trying to find offset used in ASLR (or KASLR for kernel).

KASLR offset = address of symbol loaded in memory - address of symbol present in binary.

As your question states you already know address of symbol in memory from /proc/kallsyms.

We can find address of symbol in binary using nm utility and vmlinux file.

nm vmlinux | grep do_IPI

This will print address of symbol do_IPI in vmlinux file. Subtracting these two address will provide you KASLR offset.