3

I am a hardware engineer working with Microcontrollers and analog circuits.

To understand the software part, I have been reading the materials available online.

I came across various terminologies like operating system, kernel and bootloader.

I looked up the definition of all those but I want to understand where each is used and in what context it should be understood.

Please help me understand the below terms (if possible, their origin also would help) :

  1. Kernel
  2. Bootloader
  3. Operating System

An analogy or a simple explanation would help a lot. Please keep it simple as I am a hardware person with little software knowledge

Thanks

EDIT :

Thank you for the answers. I still don't get some points in your answer. But I forgot to show my work. I think if I show my level of understanding through my work,it would be better to tailor your answers with respect to my level of understanding and also whether my understanding is correct or not.

My understanding :

enter image description here

From what I learnt through the electronics stackexchange and other online notes, I understood that, some configuration is already stored in the NOR Flash mentioned in the above image. (I don't know what the configuration they are talking about)

Upon power-up, the configuration gets loaded from the NOR Flash to the processor (or from any other interface to the processor, depending upon the resistor configuration R1,R2 and like that)

Once, the configuration is loaded into the processor, the configuration tells then, to get the codes that are stored in the NAND Flash and then bring them to the RAM Memory (DDR) for random and quick access.

Is my above understand is correct? And if its correct, please tell me where is the bootloader stored and where is the kernel located? Since, both together are the parts of the Operating system, where will the code for the operating system be located in the IC ?

2 Answers 2

5

In addition to the three you listed a fourth part of the system also plays an important role. The BIOS.

Each piece of software transitions a computer from power off to a functional system starting from the lowest level and progressing toward the software interface that you interact with. The order of execution is:

  1. BIOS (Basic Input Output System) - This software is said to be close to the metal or hardware (GPU, RAM, hard drive, etc...). It runs checks on all these components and prepares them for use by the higher level software. The BIOS is firmware which is to say that it typically resides in a computer chip and not on your hard drive. It is not part of the Operating System. It does not care if you are booting Linux, Windows, or mac OS.
  2. Bootloader - When the BIOS finishes it's work it looks for and passes control to the bootloader which resides on your hard drive. The bootloader then looks for bootable Kernels which are also on your hard drive (we'll get to this). It may find more than one and it typically gives you the option to choose which one you want to boot. The bootloader is part of the Operating System. The most commonly used bootloader in the Linux community is GRUB. Even though bootloaders are part of the operating system they often have the capability of booting other operating systems.
  3. Kernel - The kernel handles the interface between the software that you use and the hardware resources that the software uses. It manages the use of the CPU to ensure that multiple tasks can be executed in parallel, it also deals with writing and reading data from your RAM and hard drive, the GPU for rendering to your monitor, etc...
  4. Operating System - The Bootloader, Kernel, drivers that the kernel uses to talk to your specific hardware, software that is used in the background (automated backup, power management, virus scanners, etc..), and all of the software that you use in your day to day work or pleasure.

EDIT: On a laptop and desktop computer the BIOS is typically stored on a non-volatile ROM chip which would roughly be the equivalent of the NOR flash in your diagram. It's reasonable to think that the NOR flash in your microcontroller diagram would contain the equivalent of the BIOS (if necessary) and bootloader. The kernel and remaining software would be loaded from the NAND flash into RAM for execution by the processor. The NAND flash in this scenario is roughly the equivalent of a hard disk drive (HDD) or solid state drive (SSD) in a laptop or desktop computer. To answer your question regarding loading the OS desktop, once the kernel finishes the boot process it triggers a startup process that takes care of loading the background processes and ultimately the desktop or other user interface.

1
  • thank u for the detailed answer for the clear definitions and the context of usage. I have edited my question. Please see my work. And when u say BIOS, is it the "configuration" that is stored in the NOR Flash? It would be helpful if u could edit your answer to provide some sort of analogy for easy understanding on which come first and why/where will it be located? And could u be kind enough to clear my below query? Like, if we start a windows OS on a PC, we don't get immediately to our desktop,right? Something runs in the back. What happens till we get to our desktop screen?
    – Newbie
    Dec 27, 2019 at 3:26
4

First I'll simplify your question Because Kernel and Bootloader are both parts of the Operating System.

First, let's talk about Kernel: To understand work of kernel I'll assume you've basic knowledge about how computer works I mean How it processes 0 and 1. Because CPU of Computer only understands Binary 0 and 1. I'll assume you know the C language and you're familiar with how to compile your human-readable program to Binary. and Memory Management. Now a little more how program works: You store a program in Disk but when you run it uses RAM(Temporary Memory), This is where Kernel a heart of OS comes in place which decides which portion of memory(Bits) to allocate to run a certain program, In short Kernal handles Memory allocation, Processor scheduling and Input/Output management in layman's term it works as interpreter which converts all your commands/actions to Binary.

Now Let's talk about Bootloader, Again as I said when your computer is turned off your program is stored in the specific place of Hard Disk, When you start computers that program(Kernel) have to use RAM memory to execute the program, Boot process just simply tells a computer the location of the program(Kernel). Normally it's a tiny bootstrap program.

Here is Simple OS architecture which you'll understand which one play their role at where: enter image description here

3
  • You beat me to it! Hopefully multiple answers from multiple angles will be useful for a question like this. Dec 26, 2019 at 17:33
  • @Raj , thank you for the answer. Really cleared a few doubts for me. Would you please look into my question edit and edit your answer to clear my doubts mentioned in the question? And in your answer, when you say that the program(kernel) require some memory to execute, where is the kernel and bootloader stored initially, like within the processor or some IC Chips like NOR Flash? And when you say the kernel requires some memory to execute, the memory required is for the running code or for storing and processing the result output of the code? Please edit your answer to include my queries
    – Newbie
    Dec 27, 2019 at 3:17
  • @Newbie Best answer would be just watching this basic overview of Computer science from Harward This will give you a basic overview: cs50.harvard.edu/college/weeks/0
    – Raj
    Dec 27, 2019 at 18:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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