/How It Works!

How It Works!

Peace upon u all

I’m Menna Essa , Hope u are all doing well :)….

U’ll probably find it easy to understand this, But I think it’s important to know.

The few minutes that pass from the moment you press the power button until the whole OS is in front of you … do you know what happens ?

Well ,Here’s a brief explanation :

1-BIOS:

Once you press power the power supply will start , The fans are usually louder at this point once there is enough power in the processor it’ll start “this is when u hear the beep if u r on a pc!”

When the processor is switched on, it always jumps to a fixed address in its address space which is 0xFFFF0 which is an address in the ROM.

.This is when the BOIS comes ; it’ll do a combined sanity check and initialisation of the computer’s hardware , The BIOS scans the components in the system, executing any initialisation actions that

Finally , the BOIS well check your drives (HD,CD/DV/Floppy..) for a boot loader that will be in the very first sector of the drive “called MBR (Master Boot Record)” it’s only 512 Bytes distributed as follows -if it’s a hard disk-:

-446 bytes for bootloader
-64 bytes for partition table
-2 bytes for magic number

The bootstrapping procedure is different for every device and this depends on your BIOSes capability to bootstrap your system from those devices.

——————————————————————————————————-
2-Boot Loader :


A boot loader is a program that is responsible for loading you OS Linux’s loader is called “GRUB” (Grand Unified Bootloader). But GRUB is too big to be placed in only one sector , IIRC, GRUB was divided into two parts, that was ages ago. It’s now divided into 3 parts

The Great thing about GRUB is that i sees -almost- any OS including Windows , It’ll let u choose which OS to run.

——————————————————————————————————
3-The Kernel :

The Bootloader will load the Kernel into the memory
-the kernel will scan your hardware configurations and initializes your devices .
-takes the CPU to a protected mode with virtual memory
-Mount root file system (read only mode).
-Once these are finished user processes  /sbin/init  will be loaded that’s responsible for any other process.

——————————————————————————————————-
4-SysV init :

As I said it’s responsible for running all other process , It Have the id 1 and will keep runing until your system is halted.
It’ll propably look for /etc/inittab for instructions and to know which shell scripts and programs to execute however, Now there is what’s know as Sysv Upstart that doesn’t use this file instead it uses it configuration files in /etc/init.

What happens then need a topic by it self , so briefly the SysV init will move on the default run level , executing

necessary commands , shell scripts.

——————————————————————————————————

5-RunLevels

U’ll understand Run Levels just by reading them:

0-halt
1-single mode without Nts
2-Text mode without Nts
3-Text mode with Nts
4-unused
5-full mode
6-reboot

——————————————————————————————————
6-X- Windows :

Now here’s something confusing I know there are 6 runlevels but a week ago I read that the one with GUI is a 7th “I thought It was the 5th ”..So let it be , considering u’ll run on level 7. a GUI login screen will appear and It’s done .

If it doesnt like what happened when I first used backtrack , I wont go to GUI unless u write the command  startx.

And there you go the OS is Alive :)….

Note: for more details see the  documentation in your distro usually in  in /usr/share/program or
/usr/share/doc.