Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

[ Kernel ] [ Documentation ] [ Links ] [ Books ]
next up previous contents index
Next: The User Acts Up: Starting to Use Your Previous: Power to the Computer

Takes Over

 

Before reading this section, you should know that nothing in it is needed to actually use Linux. It is only here for your own enjoyment and interest, but if you find it boring or overly technical, skip over it!

After the BIOS  passes control to LILO , LILO passes control to Linux. (This is assuming you have configured to boot by default. It is also possible for LILO to call DOS  or some other PC operating system.) The first thing that does once it starts executing is to change to protected mode.protected mode The 80386gif CPU that controls your computer has two modes (for our purposes) called real modereal mode and protected mode. DOS  runs in real mode, as does the BIOS.  However, for more advanced operating systems, it is necessary to run in protected mode. Therefore, when Linux boots, it discardes the BIOS.

Linux then looks at the type of hardware it's running on. It wants to know what type of hard disks you have, whether or not you have a bus mouse, whether or not you're on a network, and other bits of trivia like that. Linux can't remember things between boots, so it has to ask these questions each time it starts up. Luckily, it isn't asking you these questions--it is asking the hardware! During boot-up, the kernel will print variations on several messages. You can read about the messages in Section 3.3.

The kernel merely manages other programs, so once it is satisfied everything is okay, it must start another program to do anything useful. The program the kernel starts is called init  . (Notice the difference in font. Things in that font are usually the names of programs, files, directories, or other computer related items.) After the kernel starts init , it never starts another program. The kernel becomes a manager and a provider, not an active program.

So to see what the computer is doing after the kernel boots up, we'll have to examine init . init  goes through a complicated startup sequence that isn't the same for all computers. For there are many versions of init , and each does things its own way. It also matters whether your computer is on a network, or what distribution you used to install . Some things that might happen once init  is started:

  • The file system might be checked. What is a file system, you might ask? A file system is the layout of files on the hard disk. It let's Unix know which parts of the disk are already used, and which aren't. Unfortunately, due to various factors such as power losses, what the file system information thinks is going on in the rest of the disk and the actually layout of the rest of the disk are in conflict. A special program, called fsck, can find these situations and hopefully correct them.
  • Special routingroute programs for networksnetwork are run.
  • Temporary files left by some programs may be deleted.
  • The system clock can be correctly updated. This is trickier then one might think, since Unix, by default, wants the time in GMT and your CMOS clock, a battery powered clock in your computer, is probably set on local time.

After init  is finished with its duties at boot-up, it goes on to its regularly scheduled activities. init   can be called the parent of all processes  process on a Unix system. A process is simple a running program; since any one program can be running more than once, there can be two or more processes for any particular program. (Processes can also be sub-programs, but that isn't important right now.) There are as many processes operating as there are programs.

In Unix, a process , an instance of a program, is created by a system call, a service provided by the kernel, called fork  . init  forks a couple of processes, which in turn fork some of their own. On your system, what init runs are several instances of a program called getty.  getty will be covered in...


next up previous contents index
Next: The User Acts Up: Starting to Use Your Previous: Power to the Computer

Converted on:
Mon Apr 1 08:59:56 EST 1996
Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.