hello experts,, I am starting out and heavily *confused* for the part of linux kernel boot:: *(plz. do rectify me at all the wrong places)* when bootloader in bios executes its code, it do POST and other things...then as I read from somewhere kernel does initrd to load some basic modules so as to mount the root file system and then removes itself..... 1.how does kernel do initrd as the kernel(vmlinuz) itself is present on the harddisk ....i mean how the control is transferrred to the kernel(present in hdd) from the bios???? --at initial point drivers(i mean the protocol to access the harddisk) is not known then how the MBR is accessed ?? 2.can we put the kernel (even though very small part of it) in the bios itself?? Regards saurabh shandilya
*** when bootloader in bios executes its code, it do POST and other things...then as I read from somewhere kernel does initrd to load some basic modules so as to mount the root file system and then removes the initrd fs..... (srry my mistake)
On Sun, Mar 4, 2012 at 2:46 AM, beyond.hack <beyond.hack@gmail.com> wrote:
*** when bootloader in bios executes its code, it do POST and other things...then as I read from somewhere kernel does initrd to load some basic modules so as to mount the root file system and then removes the initrd fs..... (srry my mistake) _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Quoting from Understanding the Linux Kernel: The LILO boot loader is too large to fit into a single sector, thus it is broken into two parts. The MBR or the partition boot sector includes a small boot loader, which is loaded into RAM starting from address 0x00007c00 by the BIOS. This small program moves itself to the address 0x00096a00, sets up the Real Mode stack (ranging from 0x00098000 to 0x000969ff), loads the second part of the LILO boot loader into RAM starting from address 0x00096c00, and jumps into it. The LILO boot loader, which relies on BIOS routines, performs essentially the following operations: 1. Invokes a BIOS procedure to display a "Loading" message. 2. Invokes a BIOS procedure to load an initial portion of the kernel image from disk: the first 512 bytes of the kernel image are put in RAM at address 0x00090000, while the code of the setup( ) function is put in RAM starting from address 0x00090200. 3. Invokes a BIOS procedure to load the rest of the kernel image from disk and puts the image in RAM starting from either low address 0x00010000 (for small kernel images compiled with make zImage) or high address 0x00100000 (for big kernel images compiled with make bzImage). We say that the kernel image is "loaded low" or "loaded high" in RAM, respectively. 4. Jumps to the setup( ) code. So, you see the init routine is run only after the kernel has been loaded in RAM. -- Manavendra Nath Manav
I guess this is wot u r looking for ..not sure thou.. initial RAM filesystem is bsasically a ramfs which is loaded by the boot loader (loadlin or lilo) and that is mounted as root before the normal boot procedure is done and is typically used to load modules needed to mount the original root file system,[[[Documentation/initrd.txt]]]] If BLK_DEV_RAM is also included it also enables initial RAM disk (initrd) support and adds 15 Kbytes (more on some other architectures) to the kernel size. On Sun, Mar 4, 2012 at 3:15 AM, Manavendra Nath Manav <mnm.kernel@gmail.com>wrote:
On Sun, Mar 4, 2012 at 2:46 AM, beyond.hack <beyond.hack@gmail.com> wrote:
*** when bootloader in bios executes its code, it do POST and other things...then as I read from somewhere kernel does initrd to load some basic modules so as to mount the root file system and then removes the initrd fs..... (srry my mistake) _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Quoting from Understanding the Linux Kernel:
The LILO boot loader is too large to fit into a single sector, thus it is broken into two parts. The MBR or the partition boot sector includes a small boot loader, which is loaded into RAM starting from address 0x00007c00 by the BIOS. This small program moves itself to the address 0x00096a00, sets up the Real Mode stack (ranging from 0x00098000 to 0x000969ff), loads the second part of the LILO boot loader into RAM starting from address 0x00096c00, and jumps into it.
The LILO boot loader, which relies on BIOS routines, performs essentially the following operations: 1. Invokes a BIOS procedure to display a "Loading" message. 2. Invokes a BIOS procedure to load an initial portion of the kernel image from disk: the first 512 bytes of the kernel image are put in RAM at address 0x00090000, while the code of the setup( ) function is put in RAM starting from address 0x00090200. 3. Invokes a BIOS procedure to load the rest of the kernel image from disk and puts the image in RAM starting from either low address 0x00010000 (for small kernel images compiled with make zImage) or high address 0x00100000 (for big kernel images compiled with make bzImage). We say that the kernel image is "loaded low" or "loaded high" in RAM, respectively. 4. Jumps to the setup( ) code.
So, you see the init routine is run only after the kernel has been loaded in RAM.
-- Manavendra Nath Manav
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
@Vladimir Murzin--thnx. for the link..really interesting it is.. @Santosh sir, Quoting from: http://www.ibm.com/developerworks/linux/library/l-initrd/index.html *The initial RAM disk (initrd) is an initial root file system that is mounted prior to when the real root file system is available. The initrd is bound to the kernel and loaded as part of the kernel boot procedure. The kernel then mounts this initrd as part of the two-stage boot process to load the modules to make the real file systems available and get at the real root file system.* We were just at BIOS->MBR->bootloader at MBR(GRUB/LILO)-.... 1.does GRUB/LILO understand/see the filesystems???? --so that it mounts the initrd image or the kernel image bcz. they both are in /boot(harddisk filesystems) 2.does the kernel mounts initrd as root filesystem??? or the bootloader does this task??
Hi On Mon, Mar 5, 2012 at 3:58 PM, beyond.hack <beyond.hack@gmail.com> wrote:
@Vladimir Murzin--thnx. for the link..really interesting it is..
@Santosh sir,
Quoting from: http://www.ibm.com/developerworks/linux/library/l-initrd/index.html
The initial RAM disk (initrd) is an initial root file system that is mounted prior to when the real root file system is available. The initrd is bound to the kernel and loaded as part of the kernel boot procedure. The kernel then mounts this initrd as part of the two-stage boot process to load the modules to make the real file systems available and get at the real root file system.
We were just at BIOS->MBR->bootloader at MBR(GRUB/LILO)-....
1.does GRUB/LILO understand/see the filesystems???? --so that it mounts the initrd image or the kernel image bcz. they both are in /boot(harddisk filesystems) 2.does the kernel mounts initrd as root filesystem??? or the bootloader does this task??
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
1. Yes, they understand filesystems. They provide their own (may be simplified) support for access to filesystem. 2. Yes, kernel mounts rootfs from initrd as a root mount point, later it overwrote with actual root file system
So can i say that after the initiallisation that the bios do, the bios code can access all the peripherals completely??? 1..I mean that from the bios code only,, can i acess the harddisk completely..specifically the kernel bcz. If i have accessed the MBR in harddisk, so can i access the remaining part of it too ?? 2..if not. Then is it possible to extend the size of MBR so as to fit the kernel in it(it will initiallise all the peripherals and other things ) thus removing the bootloadr??
Hi! Have a look at Coreboot project [1]. I think you'll find it interesting ;-) [1] www.coreboot.org Best wishes, Vladimir Murzin -----Original Message----- From: "beyond.hack" <beyond.hack@gmail.com> Sender: kernelnewbies-bounces@kernelnewbies.org Date: Sun, 4 Mar 2012 19:17:12 To: <kernelnewbies@kernelnewbies.org> Subject: Re: kernel boot procedure _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
participants (4)
-
beyond.hack -
Manavendra Nath Manav -
SaNtosh kuLkarni -
Vladimir Murzin