Where is [kernel_base + 0x18]


#1

I’m reading the bootloader code and I see the jump into rust is done using

mov rax,  [kernel_base + 0x18]
jmp rax

This seems like magic. How does this work?


#2

That is the ELF entry point


#3
mov rax, [kernel_base + 0x18]

essentially means “load rax with the value in memory that starts 0x18 bytes after kernel_base”.
In other words, it reads entry point address from the ELF header.