How to boot with bzImage ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, 
	I would like to know about the memory layout of kernel when it boots with 
bzImage [i.e Big kernel]. I understand the following things :- 
 
1. Boot loader code [512 bytes] is loaded at 07c0:0000 address [i.e. 0x7c00 
Physical address] using int 0x19 by the BIOS after POST thing. 
2. Boot loader code [here I assume that it's Linux Kernel Legacy bootloader and not 
any other LILO or Grub] then moves itself to location 0x90000. 
3. Then it loades the setup code at 0x90200 location.  
4. After this, bool loader loades compressed kernel image [zImage] at address 
0x10000 and then jumps to address 0x90200 [i.e at setup code].  
5. Setup code then moves kernel from 0x10000 to 0x1000 location overwriting 
firmware code previously present there. Now setup code changes real mode to 
protected mode and transfers control to 0x1000. 
6. Now, you have compressed kernel Image at location 0x1000 whose intial code is 
head.S code. This code uncompresses the kernel at location 0x100000 and starts 
executing from there. 
 
FYI the above explaination is about zImage whose size can't be more than 512 KB. 
Can anyone tell me what happens in case of bzImage. 
 
What I understand is bzImage can't be loaded at location 0x10000 by the bootloader 
code [Explained in step 4], as we have limited space available only from 0x10000 to 
0x90000 [i.e 512 KB], but generally the size of bzImage is > 512 KB. So it can't be 
loaded there completely. 
Moreover, bootloader can't load kernel at high memory [0x100000] because CPU is 
running in real mode. 
 
Is bzImage partially loaded at 0x10000 and then this partial bzImage is moved to 
0x100000 instead of 0x1000 by setup code [after changing to real mode] ? If it is 
so, then there should be some code in head.S or misc.c [Which are the heads of 
bzImage] to load the rest portion of the bzImage, but I don't see this. 
 
Anyone please clear this doubt related to booting with bzImage. 
 
Thanks in advance. 
Sumit Sharma. 

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux