BIOS (Basic Input Output System)
|
|
Bootable Device :HD, Floppy, CD-ROM ?
|
Hard Disk (MBR)
|
MBR (Master Boot Record)
--Program code
--partition info
|
Grub, Lilo, SPFdisk?
|
< filesystem driver
|
OS menu list: Windows (hide other WinOS partition), Linux ?
|
|
**Linux
--1.root : /boot partion location
--2.kernel filename
(在grub的/boot/grub/menu.lst中設定/boot檔案系統所在partition,是否與/在同一個partition,而寫不在同一partition,不用加/boot/vmxxx, 在同一partion,要加/boot,如kernel /vmlinuz-2.4.20-8.1 root=/dev/hda6
)
(在lilo的/etc/lilo.conf中設定都要加/boot,如initrd=/boot/initrd-2.4.20-8.img)
--3.initrd 檔名及位置
|
|
kernel got the information of
--CPU,RAM
--Hardware (io,irq,DMA & driver name with options) </etc/conf.modules
>$(dmesg)
|
initrd (put outside kernel module in Ram)
|
|
Linuxrc
|
|
init < /etc/inittab
|
|
/etc/rc.d/sysinit > tty# "Welcome to Linux"
|
|
/etc/rc.d/rc #
KxxxServicename Kill Service
SxxxServicename Start Service
--/etc/rc.d/init.d
|
|
/sbin/mingetty (prepare login)
|
|
/etc/rc.local
|
|
/etc/profile (during login)
|
|
~/.bash_prfile (after login, everytime login)
|
|
~/.bashrc (everytime start shell)
|
|
etc/bashrc
|
|
Now you see the prompt of $ or #
:wink: :wink: :wink: :wink: :wink
若要更改shell prompt 請在~/.bashrc或~/.bash_profile改
# \A = current time HH:MM in 24-hour format
# \u = current user
# \h = hostname upt to the first "."
# \w = full path current working directory.
PS1="<\A \u@\h \w>$ "
當windows後灌,搶走mbr時:
-linux rescue
-mkdir /mnt/sysimg
-mount /dev/hda6 mnt/sysimg #/dev/hda6 is where the /(root) location
-chroot /mnt/sys
-mount /dev/hda5 /boot #/dev/hda5 is where the /boot fs location
-lilo
-exit
-exit