OPS335
Week 3 Lecture 3
Last week review, we talked about harddrive, know what a sector, cylinder, head, calculate capacities, fdisk to partition the drive,
This week more detail about the booting,
• We began discussions on Linux boot up.
1. PC is turned on.
2. POST
3. ROM boot loader loads MBR code.
4. Code in MBR loads Linux kernel and initial ramdisk ( DRIVERS NEEDED BEFORE MOUNTING THE ROOT FILE SYSTEM)
If its ext3 you need a ext3 driver, once the root fs is mounted, before this you don’t have any drivers, you need some kind of a driver to mount the root fs, its small file and is brought in like the kernel the rbm code, the kernel has the basic drivers it needs to load the whole file system, one its done.
5. Kernel runs and does hardware detection(1st thing it does)
All devices accessible to I/O ports, when the kernel boots it will tell u all the things you have on your system, the kernel starts the init program, which starts all the services in your system.
6. Kernel mounts root file system. Driver in the camera be in here
Thousands of drivers on the FC7 DvD, now it has access.
7. init program runs (process ID=1). <-- First thing it runs PID
Init has no parent PID id, every other program has it plus a PPID,
8. init reads /etc/inittab and determines runlevel(state of the computer) (0-6).
7 run levels, 0 – halt, networking continues to work at level 0, RL 3 Multi-user Networking, RL 5 same as 3, but with graphics, . INIT TAB the init table tells us what init we want to go to. 5 Full Multi-user with networking and graphics. 1 is single user no network.
9. init calls the rc script. \
rc is a bash script, run command, this script is the one that calls all the scripts for all the subscripts, init calls rc, and rc calls all the scripts for all the subsystem.
/etc/rc.d, all start up scripts for you computer, /etc/rc.d/rc3.d> is for run level 3. Start and Kill.
10. rc executes startup scripts (/etc/rc.d).
11. System reaches desired runlevel.
Ps –ax all processes running
Ps –al long listing
More then one program occupying ram at the same time. All processes are in a tree,
tree ps -a /
Manage your process
Signal PID
Kill -9 4010
-9 is a hard kill
more /proc/cpuinfo
every program is run for mili second.
280,600,000,000,000
3.14159265^2
Lab#2 Focous on booting up the system
GRUB, Grand Unified Boot MANAGER (Loader)
LILO, Linux Loader
We are going to try both, lilo is old grub is new.
Linux kernel is on the fs /boot/vmlinux-2.6-22 the kernel itself is sitting on the fs, it could be ext2/ext3 , reiserfs , in order for the MBR to load the kernel, so the code in the MBR, we have to tell LILO where this file is ahead of time, which sector, when the LILO code tries to load in the kernel it will know the kernel starts at 1321, the lilo code will go out to sector and bring in the linux kernel, LILO does not know about fs,
What is a file system?
A file system is a filing system, there are different ones ext2, ext3, reiserfs all file-ing systems prepare the hard drive, to hold files differently, LILO itself does not care how its organizes he told LILO to start counting the files on the left and when you get to the physical sector it has to know where to go, somehow before we boot the system we have to install LILO we install lilo we put the LILO code in the MBR, along with the code you put the sector where the kernel is and the initial ram disk file.
Ls /boot, Z means its compress vmlinuz…read while its small and uncompress it in RAM more efficient way. For every kernel it has a corresponding initial RAM disk, this must be read by the drive by the LILO program. Four and half mb has to be loaded in by the boot loader..
In order to write the code to mbr we use the command lilo, /etc/lilo.conf the conf tells lilo where the kernel in ram disk is, once it knows this it figures out the sector, and writes the sector in the MBR, so when you boot you system you know where it is. What we do is we modify the file to suite our own needs.
Original MBR contains the GRUB code, the program when we save it is GRUB.
/mnt/sysimage
/etc/lilo.conf
No comments:
Post a Comment