0

So I recently acquired Ingenic SoC based RS-97 game, which runs MIPS instruction set. The vendor vaguely provided instruction on how to compile the linux kernel for the target SoC. So based on vendor instructions and online search the following are needed to have an image of the embedded linux for the platform.

  1. Compile the toolchain (mipsel for mips based architecture)
  2. Compile the linux kernel with given drivers/BSP using the toolchain
  3. Compile the root file system - Busybox suggested (dont know why)
  4. Compile uBoot for target SoC
  5. Partition the storage such as sd with target specific partition table
  6. Flash the whole image into sd

So the questions are, why root file system is separate from kernel image? What role does busybox play in generating file system? Also if the linux image is compiled without root file system how to merge the two to have drivers in /sys directory in the root file system?

  • 1
    How linux works is a massive undertaking, separation of the kernel and root file system are "because they decided to do it that way". If you dont already know the answers to your question then you need to find a platform that has a working set of howtos/instructions. should be many tutorials that use qemu or other emulator. there is a very short list of "tools" like busybox, and others that are in part the latest fad and in part generic/portable enough to be used to target various platforms. saving the user years worth of research. – old_timer Feb 9 at 2:16
  • and nothing about any of these questions has anything to do with the EE site. – old_timer Feb 9 at 2:17
  • @old_timer +1 for pointing out that separation is design decision by default. I thought it is only separated for embedded devices for maybe lower footprint. – GENIVI-LEARNER Feb 9 at 9:37
  • 1
    designing an building an engine is separate than the cars/trucks you eventually put around it. and if done right you can choose to build different vehicles that use that same engine design. and in the future you can change your mind again and build yet another vehicle with that same engine. does the linux kernel have to be tied to the filesystem choices? look at linux over time, we already know this answer, no they change their minds periodically as well as there are different camps on where things go in the filesystem. – old_timer Feb 9 at 16:27
  • 2
    I'm voting to close this question as off-topic because it is only related to programming toolchains – Ariser - reinstate Monica Feb 10 at 11:17
0

These are very big questions, I'll try to summarize as simply as I can.

why root file system is separate from kernel image?

The kernel image is an executable provided by kernel.org (you can modify it if you want but most people don't) which provides the framework for your embedded Linux project. The root file system is where YOUR code and configuration goes: the kernel loads the root file system.

What role does busybox play in generating file system?

Busybox is an application that provides lots of useful functions such as a command line interface, listing files, listing processes, copying files etc. The function of Busybox changes according to how it is named: you rename the application and it performs a different function. This is a very efficient way of packing a lot of utilities into a small file system.

Also if the linux image is compiled without root file system how to merge the two to have drivers in /sys directory in the root file system

There are parameters you can give to the kernel to tell it where to find its root file system. You want to set the root parameter. See The kernel’s command-line parameters.

| improve this answer | |
  • Quite nicely explained. So Busybox is essential set of standard libraries for basic functions. I thought that Busybox has a role in creating rootfs. – GENIVI-LEARNER Feb 19 at 11:03
  • Also when you mentioned YOUR code and configuration what exactly is configuration? – GENIVI-LEARNER Feb 19 at 11:05
  • 1
    @GENIVI-LEARNER configuration of Linux based services (DHCP or Apache to name two out of hundreds) is done by files, generally under /etc. The executables for these services also live on the root file system. – Chris St John Feb 19 at 14:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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