Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 2 days ago

2 Answers 2

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 2 days ago
    
@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 2 days ago
    
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 2 days ago
    
"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 2 days ago

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.