[Home] [Credit Search] [Category Browser] [Staff Roll Call] | The LINUX.COM Article Archive |
Originally Published: Thursday, 19 July 2001 | Author: Subhasish Ghosh |
Published to: learn_articles_firststep/General | Page: 5/6 - [Printable] |
Bootstrapping a Linux system - An Analysis
Ever wonder what happens between powering on your system and the logon prompt? You see all the screen messages, but what do they mean? Linux.com writer Subhasish Ghosh wondered the same thing, and went to find out in Bootstrapping a Linux System.
|
<< Page 5 of 6 >> | |
The startup_32( ) function - 1st function. What does it do?Okay, let's get to the confusing parts straight away. There are two functions called startup_32( ). Though both these two startup_32( ) functions are assembly language functions and are required for bootstrap process they are totally different functions. The one we refer to here is coded in the/usr/src/linux-2.4.2/arch/i386/boot/compressed/head.S file. After setup( ) code is executed this function has been moved either to physical address 0x00100000 or to physical address 0x00001000, depending on whether the Kernel Image was loaded "high" or "low" in RAM.
When executed this function performs the following operations:
Now, after this 4th operation code execution is taken over by the other startup_32( ) function. In other words, the second one takes over the bootstrapping process. The startup_32( ) function - 2nd function. What does it do?The decompressed Linux kernel image begins with another startup_32( ) function. This function exists in the/usr/src/linux-2.4.2/arch/i386/kernel/head.S file.
At this point you might be tempted to ask: Hey, using two different functions having the same name... Doesn't this cause problem? The answer is: Well, no it doesn't at all. Both functions are executed by jumping to their initial physical addresses and hence they are executed in their own execution environments. No problem at all! Now, let's look at the second startup_32( ) function's functionality. What does it do? When executed this function essentially sets up the execution environment for the first Linux process (process 0). The function performs the following operations:
| |
<< Page 5 of 6 >> |