It looks like head.S does the decompression and
gives the control to the new kernel and this
feature inturn appears to be a functionality of the
bootloader. But, is head.S file something like primary
bootloader ? If so, it should give the control to the
bootloader, but it is giving control to the kernel .
Where does it lie in the memory ?
Further, what is the use of the startup code in
head.S file ? Any ideas ?
Thx in advans,
Karthik Balaguru
I got some interesting links that clarified me of the above queries.
It seems that head.S is part of the kernel and acts as one of the
initial part of the kernel. From the linux HOW-TO html's name
'Kernel_head.html',
i think that it can also be termed as Kernel Head. The head.S is used
along with the 'main C routine' after decompression to initialize
all parts of the kernel which inturn will show lot of messages and
finally the 'init' process or the first 'linuxrc' variant on an
initial
RAM disk will be started.
Bootloaders do not give the control to the head.S in first hand.
It seems that the control is given directly to setup.S in first hand.
Bootloaders should load bzImage into memory and setup
"real-mode kernel header", esp. type_of_loader, then pass
control to bsetup/setup.S directly. setup.S is responsible for
getting
the system data from the BIOS and putting them into appropriate
places in system memory.
bootsect.S comes into picture only if it has to be done via diskette.
The below link clearly states the parts of bootloader
and the parts of the linux kernel.
http://www.xs4all.nl/~lennartb/bootloaders/node3.html
Other references -
http://tldp.org/HOWTO/Linux-i386-Boot-Code-HOWTO/setup.html
http://tldp.org/HOWTO/Linux-i386-Boot-Code-HOWTO/kernel_head.html
http://tldp.org/HOWTO/Linux-i386-Boot-Code-HOWTO/bootsect.html
Karthik Balaguru