<div style="font-family: Arial; font-size: 14px;">CPU: Intel x86 KabyLake. I'm using 5.17 Kernel built from upstream and GRUB 2.04</div><div style="font-family: Arial; font-size: 14px;"><br></div><div style="font-family: Arial; font-size: 14px;">When debugging the kernel initialization process I found out that there is a function <b>void main(void)</b> in the source file <b>arch/x86/boot/main.c</b> (source link: <span><a target="_blank" rel="noreferrer nofollow noopener" href="https://elixir.bootlin.com/linux/v5.17/source/arch/x86/boot/main.c#L134">https://elixir.bootlin.com/linux/v5.17/source/arch/x86/boot/main.c#L134</a>)</span> which seems to be the entry point which the boot loader is supposed to jump into.</div><div style="font-family: Arial; font-size: 14px;"><br></div><div style="font-family: Arial; font-size: 14px;">But <b>objdump</b>-ing the Kernel image shows that there is no such symbol as <b>main</b>. GDB attached to QEMU does not know about this symbol either.</div><div style="font-family: Arial; font-size: 14px;"><br></div><div style="font-family: Arial; font-size: 14px;">The earliest stage of Kernel Initialization I could manage to catch with GDB is <b>x86_64_start_kernel</b> (source link: <span><a target="_blank" rel="noreferrer nofollow noopener" href="https://elixir.bootlin.com/linux/v5.17/source/arch/x86/kernel/head64.c#L467">https://elixir.bootlin.com/linux/v5.17/source/arch/x86/kernel/head64.c#L467</a>)</span></div><div style="font-family: Arial; font-size: 14px;"><span><br></span></div><div style="font-family: Arial; font-size: 14px;">The question is what function GRUB actually jump into passing control to the Kernel code and what is the purpose of <span><b>arch/x86/boot/main.c::main</b></span>?</div><div class="protonmail_signature_block" style="font-family: Arial; font-size: 14px;">
</div>