RE: 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.

Hi,
While loading bzImage the kernel does memory transfer from low memory to high memory (64K chunks) .
see setup.S line 836


also see 2.4 kernel internals
 http://www.faqs.org/docs/kernel_2_4/lki-1.html#ss1.2

Moreover, bootloader can't load kernel at high memory [0x100000] because CPU is
running in real mode.
NOTE: In real mode we can access the 4G address space . It in known as Unreal Mode.
and grub runs in Protected mode. It contains code to switch itself to protected mode and switch back when reqd.


regards manish

_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail



-- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/


[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