• Notice regarding image hosts and attachments. See here.

Learning more about how Linux actually works

Associate
Joined
30 Jan 2019
Posts
1,123
I've spent many years using Linux and trying out many different Linux Distros but I never really dug deep enough to find out how they actually work...

From what I currently understand you have the Boot Loader and then a kernel which I'm assuming are the foundations of a Linux OS like DOS on Windows and then you have a terminal plus a desktop environment and its got me wondering about building my own Linux Distro using an existing bootloader & kernel or even bringing back one of the older Distros like GOS which was Ubuntu based and was around in 2008/09 I quite liked that although it would be horribly outdated now. I thought maybe doing an experiment using an old desktop environment but with a modern kernel and security updates with the ability to run modern browsers and Linux applications.

The only thing I currently know about Linux kernels are that older kernels don't support SSD drives. What is a kernel and what does it do exactly?

I would be interested in learning more about a Linux OS from the ground up.
 
Last edited:
If you want to properly understand things I would highly recommend a LFS Project - you'll build and compile pretty much everything from scratch and piece it together.


A big difference from 2008/2009 era distros was the init system, most mainstream distros now use SystemD, whereas back then it was lots of sysvinit. You can run older environments, most of them have some kind of maintained fork, most of them have been updated and most of them can still be built, you'll just have to deal with any dependencies.
 
I came across this book - not started reading it yet - but it seems like it might be what you're after.

 
If I was you I’d learn top down, brings Linux certified engineer for over 10 years top down is a good approach

By this I mean
Understand the golder structure
etc bin home usr etc

Understand the how services load either service files how they interact

Then learn what the kernel does

If you start at kernel you’ll have tons of questions kernel is complex and you’ll have many questions which will already be answered if you done it backwards


For a quick easy way you could ask ai to create your a learning path and if a visual learner create diagrams of how it all fits together

One way to think of the kernel is a motherboard.

Kernel is a system of built in drivers/controllers to talk to hardware the same way motherboard has ports to interact with hardware

Or

Think of your computer as a big team:


  • ‍ You → tell the computer what you want
  • ️ Apps → ask the computer to do things
  • Linux kernel → the boss in the middle
  • ⚙️ Hardware → CPU, RAM, GPU, SSD, keyboard, Wi-Fi, etc.

The Linux kernel is the core part of Linux that talks directly to the hardware.


For example:


You open Minecraft → Minecraft needs the CPU → Minecraft asks Linux → the kernel gives Minecraft CPU time.


I personally like to think of it as octopus which each arm controlling and answering requests

Systems calls
Networking
Drivers
Memory management
CPU scheduling
I/O interactions
Security
 
Last edited:
Use it.
Troubleshoot it.

The question you have to ask yourself is what you need a deeper understanding for and why.

I fully get the intrigue and desire to understand it in detail but to what degree depends on the above. Do you want to start coding pull requests for merges yourself? Just want to daily drive it and troubleshoot it? Want a professional involvement?

The bootloader is just the mechanism to start the OS. There are lots of them and which you use will depend on preference and requirements (Secure Boot, UEFI, GPT or MBR etc)

The kernel is the heart of initialising and exposing your hardware. There are lots of modern developments that make dealing with the kernel easier. For example, DKMS will let you load out of tree drivers which will survive kernel updates without manual intervention each time.
 
Last edited:
100% do the use it and troubleshoot it method

other suggestion is try and follow the Gentoo handbook if it still lets you do a stage1 install (might be in the that dumb don't do it pile by now so give a stage 3 install a go), was generally a simpler to understand/follow version of Linux From Scratch install, which is also a good way to get to grips with what Linux is and isn't.
 
Back
Top Bottom