6

I think I know but I am a bit confused.

Can someone please explain the difference between Kernel and rootfs in embedded system environment?

1
  • The kernel is RAM-resident executable code. The rootfs is the essential filesystem for the system (initially a ramfs or tmpfs) , but more often is used to refer to a collection of files in a filesystem of some type (e.g. ramfs, ext2/3/4, jffs2, ubifs) that consist of essential initialization and userspace programs. Both are needed to boot a Linux system.
    – sawdust
    Jun 29, 2015 at 4:02

2 Answers 2

3

rootfs is just an ununmountable ramfs/tmpfs. The kernel is a chunk of code that lives on a real filesystem.

4
  • Your first sentence implies that the rootfs has to be memory resident. That's false.
    – sawdust
    Jun 29, 2015 at 3:35
  • @sawdust: "Rootfs is a special instance of ramfs (or tmpfs, if that's enabled) ..." You can pivot another root filesystem over it, but the entity called "rootfs" is a memory-resident filesystem. Jun 29, 2015 at 3:38
  • But the most common and widespread use of "rootfs" (e.g. build a rootfs or install a rootfs in NAND) refers to contents of an essential filesystem, rather than that special instance. The kernel command-line parameter "root=" for specifying the "root filesystem" helps perpetuate this (mis)use.
    – sawdust
    Jun 29, 2015 at 3:55
  • "The kernel is a chunk of code that lives on a real filesystem." -- There is no requirement that the kernel be stored in a filesystem. The most widely used embedded boot program, U-Boot, can access raw flash. The convention for Atmel ARM is to store the Linux kernel in raw flash: at91.com/linux4sam/bin/view/Linux4SAM/… IIRC Allwinner may also be similar.
    – sawdust
    Jun 29, 2015 at 6:59
1

rootfs is a not-unmountable ramfs. (Not tmpfs.) The kernel is a chunk of code that can initially live whereever you want, your bootloader may load it over network, and then into memory. A filesystem may not actually be involved.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .