Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I think I know but I am a bit confused.

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

share|improve this question
    
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 '15 at 4:02

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

share|improve this answer
    
Your first sentence implies that the rootfs has to be memory resident. That's false. – sawdust Jun 29 '15 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. – Ignacio Vazquez-Abrams Jun 29 '15 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 '15 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 '15 at 6:59

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.

share|improve this answer

You must log in to answer this question.

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