0xAX/linux-insides

Bootloader transfers control to the kernel, The address calculation has a mistake.

YaowenGuo opened this issue · 0 comments

Describe the bug
The doc description bootloader jump to kernel at When the bootloader transfers control to the kernel, it starts at:

X + sizeof(KernelBootSector) + 1

I think it should not add ! It should be "X + sizeof(KernelBootSector)". The "MZ" magic is at address 0x10000, and the _start is offset 512 byte, which should add 0x200, So it's address should at 0x10200. By viewing memory data at 0x10200.

00010200: eb6a 4864 7253 0f02 0000 0000 0010 9442  .jHdrS.........B
00010210: b081 0080 0000 1000 0000 0000 0000 0000  ................
00010220: 0000 0000 00fe 0000 0000 0200 ffff ff7f  ................

The eb which is the _start: .byte 0xeb.

Screenshots
Data at 0x10200