Classic confusion: initrd-initramfs

Classic confusion: initrd-initramfs

am 08.10.2009 05:19:27 von Rajat Jain

Hi,

OK, I know enough has already been discussed on this topic and I think
that I'm just not able to put pieces in place. So I understand the basic
difference between an initrd (having a filesystem on a block /loopback
device and mounting it on a ramdisk) and initramfs (Having a compressed
cpio archieve included in the kernel image and weaving a file system
directly on RAM to see the contents of this cpio). I assume this
discussion is not limited to x86 architectures and initrd / initram fs
can be used on all the other architectures also?

1) Firstly, are initramfs and initrd mutually exclusive techniques to
achieve the same goal (providing initial drivers)? Does enabling one
disable the other OR they complement / help each other? Conceptually,
the former should be true, but browsing through the kernel config, the
latter seems true.

2) The initrd image CANNOT be combined with kernel image to produce a
single image, and the initramfs image cannot be seperated out from
kernel image and later provided at boot time as a separate image, right?

3) I understand in case of initramfs, kernel does everything including
loading of initramfs image (since it is included in kernel image only).
But in case of initrd image, who loads the initrd image into memory? The
bootloader I assume ... Because grub and lilo have a "initrd" line in
their config file. But then how is it communicated to the kernel where
in RAM (at which address) is the initrd loaded?=20

4) How about non-X86 architectures that don't have lilo / grub? Who
loads initrd image into memory in that case and how is it communicated
to kernel?=20

5) What does the "initrd=3D" kernel command line parameter mean, and is =
it
applicable only for x86?

6) Is there a unified way of loading initrd on all architectures? Most
of the online text suggestes to make entry into lilo or grub, which are
not available else where...

Thanks & Best Regards,

Rajat Jain


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ

Re: Classic confusion: initrd-initramfs

am 08.10.2009 08:22:01 von ajit mote

--000e0cd2bd3a3618870475667ba5
Content-Type: text/plain; charset=ISO-8859-1

On Thu, Oct 8, 2009 at 8:49 AM, Rajat Jain wrote:

>
> Hi,
>
> OK, I know enough has already been discussed on this topic and I think
> that I'm just not able to put pieces in place. So I understand the basic
> difference between an initrd (having a filesystem on a block /loopback
> device and mounting it on a ramdisk) and initramfs (Having a compressed
> cpio archieve included in the kernel image and weaving a file system
> directly on RAM to see the contents of this cpio).



> I assume this
> discussion is not limited to x86 architectures and initrd / initram fs
> can be used on all the other architectures also?
>
>
As per my understanding, this should work for other architectures but not
sure.

1) Firstly, are initramfs and initrd mutually exclusive techniques to
> achieve the same goal (providing initial drivers)? Does enabling one
> disable the other OR they complement / help each other? Conceptually,
> the former should be true, but browsing through the kernel config, the
> latter seems true.
>
> All 2.6 Linux kernels contain a gzipped "cpio" format archive, which is
extracted into rootfs when the kernel boots up. After extracting, the
kernel
checks to see if rootfs contains a file "init", and if so it executes it as
PID
1. If found, this init process is responsible for bringing the system the
rest of the way up, including locating and mounting the real root device (if
any). If rootfs does not contain an init program after the embedded cpio
archive is extracted into it, the kernel will fall through to the older code
to locate and mount a root partition, then exec some variant of /sbin/init
out of that.
Reference: Kernel Documentation
file(~/linux-2.6.18/Documentation/filesystems/ramfs-rootfs-i nitramfs.txt).


> 2) The initrd image CANNOT be combined with kernel image to produce a
> single image, and the initramfs image cannot be seperated out from
> kernel image and later provided at boot time as a separate image, right?
>
>



> 3) I understand in case of initramfs, kernel does everything including
> loading of initramfs image (since it is included in kernel image only).
> But in case of initrd image, who loads the initrd image into memory? The
> bootloader I assume ... Because grub and lilo have a "initrd" line in
> their config file. But then how is it communicated to the kernel where
> in RAM (at which address) is the initrd loaded?
>
>
initrd is loaded by BIOS. BIOS handles all the work of loading it into
memory.
Quick search gave me :
http://www.alexonlinux.com/opening-and-modifying-the-initrd

The bootloader will load the kernel and initrd image into memory and then
start the kernel, passing in the memory address of the initrd
http://en.wikipedia.org/wiki/Initrd

4) How about non-X86 architectures that don't have lilo / grub? Who
> loads initrd image into memory in that case and how is it communicated
> to kernel?
>
> 5) What does the "initrd=" kernel command line parameter mean, and is it
> applicable only for x86?
>
> 6) Is there a unified way of loading initrd on all architectures? Most
> of the online text suggestes to make entry into lilo or grub, which are
> not available else where...
>
> Thanks & Best Regards,
>
> Rajat Jain
>
>
> --
> To unsubscribe from this list: send an email with
> "unsubscribe kernelnewbies" to ecartis@nl.linux.org
> Please read the FAQ at http://kernelnewbies.org/FAQ
>
>


--
Thanks & Regards,
Ajit Subhash Mote

--000e0cd2bd3a3618870475667ba5
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable


On Thu, Oct 8, 2009 at 8:49 AM, Rajat Jain <=
span dir=3D"ltr"><Rajat.Jain@=
infogain.com
> wrote:
le=3D"border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex;=
padding-left: 1ex;">


Hi,



OK, I know enough has already been discussed on this topic and I think

that I'm just not able to put pieces in place. So I understand the basi=
c

difference between an initrd (having a filesystem on a block /loopback

device and mounting it on a ramdisk) and initramfs (Having a compressed

cpio archieve included in the kernel image and weaving a file system

directly on RAM to see the contents of this cpio).
=A0 v>
, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> I assume this<=
br>

discussion is not limited to x86 architectures and initrd / initram fs

can be used on all the other architectures also?



   As per my understanding, this should work =
for other architectures but not sure.

ail_quote" style=3D"border-left: 1px solid rgb(204, 204, 204); margin: 0pt =
0pt 0pt 0.8ex; padding-left: 1ex;">

1) Firstly, are initramfs and initrd mutually exclusive techniques to

achieve the same goal (providing initial drivers)? Does enabling one

disable the other OR they complement / help each other? Conceptually,

the former should be true, but browsing through the kernel config, the

latter seems true.


All 2.6 Linux kernels contain a gzipped "cpio&qu=
ot; format archive, which is
extracted into rootfs when the kernel boots=
up.=A0 After extracting, the kernel
checks to see if rootfs contains a =
file "init", and if so it executes it as PID

1.=A0 If found, this init process is responsible for bringing the system th=
e
rest of the way up, including locating and mounting the real root devi=
ce (if
any).=A0 If rootfs does not contain an init program after the emb=
edded cpio

archive is extracted into it, the kernel will fall through to the older cod=
e
to locate and mount a root partition, then exec some variant of /sbin/=
init
out of that.
Reference: Kernel Documentation file(~/linux-2.6.18=
/Documentation/filesystems/ramfs-rootfs-initramfs.txt).

=A0
rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
2) The initrd image CANNOT be combined with kernel image to produce a

single image, and the initramfs image cannot be seperated out from

kernel image and later provided at boot time as a separate image, right? >



=A0
yle=3D"border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex=
; padding-left: 1ex;">
3) I understand in case of initramfs, kernel does everything including

loading of initramfs image (since it is included in kernel image only).

But in case of initrd image, who loads the initrd image into memory? The >
bootloader I assume ... Because grub and lilo have a "initrd" lin=
e in

their config file. But then how is it communicated to the kernel where

in RAM =A0(at which address) is the initrd loaded?



initrd is loaded by BIOS. BIOS handles all the wo=
rk of loading it into memory.
Quick search gave me : ww.alexonlinux.com/opening-and-modifying-the-initrd">http:// www.alexonlinux=
..com/opening-and-modifying-the-initrd



The bootloader will load the kernel and initrd image into memory and
then start the kernel, passing in the memory address of the initrd
=A0 href=3D"http://en.wikipedia.org/wiki/Initrd">http://en.wikip edia.org/wiki/=
Initrd

eft: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left:=
1ex;">

4) How about non-X86 architectures that don't have lilo / grub? Who

loads initrd image into memory in that case and how is it communicated

to kernel?



5) What does the "initrd=3D" kernel command line parameter mean, =
and is it

applicable only for x86?



6) Is there a unified way of loading initrd on all architectures? Most

of the online text suggestes to make entry into lilo or grub, which are

not available else where...



Thanks & Best Regards,



Rajat Jain





--

To unsubscribe from this list: send an email with

"unsubscribe kernelnewbies" to ..org">ecartis@nl.linux.org

Please read the FAQ at blank">http://kernelnewbies.org/FAQ






--
Thanks & Reg=
ards,
Ajit Subhash Mote



--000e0cd2bd3a3618870475667ba5--

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ