Regd head.S

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Hi,

Eager to know the use of head.S file.
As far i understand by looking into the head.S
file, it does the following -
- head.S contains the 32-bit startup code.
- Clear BSS
- Do the decompression, and jump to the new kernel

But, how head.S file is related with the bootloader
and where does it lie in the memory ?
It looks like head.S does the decompression and
gives the control to the new kernel. It looks like
it does the functionality of the bootloader.
Further, what is the use of the startup code in
head.S file ? Any ideas ?

Thx in advans,
Karthik Balaguru

Re: Regd head.S
Quoted text here. Click to load it

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

Lemme know if you have some other thoughts.

Karthik Balaguru

Site Timeline