How Does Linux Boot Process Work?

  Рет қаралды 541,513

ByteByteGo

ByteByteGo

6 ай бұрын

Get a Free System Design PDF with 158 pages by subscribing to our weekly newsletter: bytebytego.ck.page/subscribe
Animation tools: Adobe Illustrator and After Effects.
Checkout our bestselling System Design Interview books:
Volume 1: amzn.to/3Ou7gkd
Volume 2: amzn.to/3HqGozy
The digital version of System Design Interview books: bit.ly/3mlDSk9
ABOUT US:
Covering topics and trends in large-scale system design, from the authors of the best-selling System Design Interview series.

Пікірлер: 287
@DK-ox7ze
@DK-ox7ze 6 ай бұрын
This is a good summary, but it seems like there's a lot going on behind the scenes in all of these process, especially systemD. Would be nice to cover that in a future video :)
@nid274
@nid274 6 ай бұрын
That would require a 1000 page book,...may be 10000 pages!
@kurtmueller2089
@kurtmueller2089 6 ай бұрын
systemD is a disgrace and as UNIX-like as it gets. Its functioning should never be covered nor should its name even be uttered more than strictly necessary
@nishantdalvi9470
@nishantdalvi9470 6 ай бұрын
​@@nid274hey bro in which domain you are studying right now?
@dayanandhn
@dayanandhn 6 ай бұрын
@@nid274try reading Abraham Silberschatz OS concepts book
@yaroslavpanych2067
@yaroslavpanych2067 6 ай бұрын
Yeah, pretty much "what does Kernel at boot" and "what does process with pid=1 at boot before enters configured runlevel" should have been content of the video, not detecting devices, running EFI, and rest of irrelevant shit.
@nelumertyk6
@nelumertyk6 5 ай бұрын
Bravo si multumesc.E simplu,frumos pe intelesul tuturor...fara explicatii savante.CHIAR UN TUTORIAL...GENIAL DE SIMPLU!!!La mai multe inainte !!!
@ethanmye-rs
@ethanmye-rs 6 ай бұрын
Good overview, but missing a discussion of ACPI, initramfs/initrd.
@thecataclysm
@thecataclysm 6 ай бұрын
agreed, initramfs is a crucial part to be included in a boot process video IMHO
@p0358
@p0358 4 ай бұрын
@@thecataclysmexactly, especially that the title mentions Linux specifically
@death_parade
@death_parade Ай бұрын
All I know about ACPI is that it got FUBARd in my laptop and now the lspci doesn't even show my wireless lan card. Don't know what started it, but I guess it was some power cycling malfunction because it started after I woke the PC up from sleep. I've done fresh linux install and it doesn't work. So most likely will need to flash BIOS :(
@danholli123
@danholli123 5 ай бұрын
There's a bit of a misconception about BIOS. MBR is limited to 2TB, but a BIOS doesn't need to be restricted to MBR, it could've moved to a different (likely proprietary) format... it's just that GPT and EFI were more flexible and the groundwork was already completed
@ggattsr
@ggattsr 12 күн бұрын
One of the best boot process summary's on KZbin. Thanks for all the work and graphics.
@eliottmax8454
@eliottmax8454 6 ай бұрын
I was expecting that you would really be talking about the kernal boot process and not everything around. But in the end, I never saw an exhaustive explanation about the boot process in the first place so I am that to know that I did not miss out anything.
@coderdojoAN
@coderdojoAN 5 ай бұрын
Great summary and visualization of the entire boot process. Very well done mate!!!!
@nicholasmaniccia1005
@nicholasmaniccia1005 6 ай бұрын
Great content, always helpful and always impressive. Thank you very much for taking the time to make these.
@trueriver1950
@trueriver1950 5 ай бұрын
As has already been said, there is a lot going on in each of these steps. My major criticism is that step 5 simplifies away the usual mechanism of running some code from an initial ramdisk: this is done so that the kernel does not have to contain all the device drivers needed to load whatever modules it needs before the final root partition becomes readable. That also means that an earlier step needed to load the initial ram disk into memory and tell the kernel where to find it. Grub (or some other boot program like Lilo) will have done this already, so the Grub step should mention that it loads a filesystem containing drivers as well as libraries into ram before passing control to the kernel. And then, in my opinion, you need an extra step between 4 and 5 for the initial ram stage, that is used to get the system able to actually read the code it needs off the disks. While it does that the kernel only needs to know how to read the initial ramdisk. More detail follows... There are two exceptions to what i just said 1. If you compile your own kernel you can arrange that the kernel has all the drivers it needs built in (Gentoo users might do this, knowing in advance exactly what filesystem and hardware will hold the operating system) 2. Puppy (and most Live Disk systems) boot into the ramdisk and never leave it. For different reasons, both these exceptions slow down system loading (because either the kernel or the ramdisk is huge) but often speeds up running once the boot is complete because the kernel has what it needs in memory at all times, one way or another.
@maitreerimthong
@maitreerimthong 4 ай бұрын
Great visualization of the entire boot process, Thank you.
@qoopdata
@qoopdata 6 ай бұрын
That’s beautiful and enormous work! Great thanks.
@irvingirving6275
@irvingirving6275 5 ай бұрын
I was looking for something like this. This is great thank you!
@dcn4lyf
@dcn4lyf 6 ай бұрын
Best Summary of the Boot process
@Zolodar
@Zolodar 2 ай бұрын
This is incredibly well explained and illustrated! Thank you so much!
@marioduarte7658
@marioduarte7658 5 ай бұрын
Wow, I just loved it - I am recomending to my felow IT guys who ignore those initial steps. Regards from Brazil and keep posting!
@avimehenwal
@avimehenwal 6 ай бұрын
Have never such a visually stunning explanation of a boot process. Amazing video Thankyou so so much for sharing. Piece of art with tons of knowledge
@reasoningCode
@reasoningCode 4 ай бұрын
KUDOS! I've never seen such nicer explanation for this.
@baronhelmut2701
@baronhelmut2701 6 ай бұрын
Very nicely explained and beautifully visualized presentation. I have to ask tho, would you like to make that same presentation again but for a Secured and TPM measured bootgraph ? If so, please do it, people and especially the linux community would need this in order to understand why the TPM makes booting so much more secure. I would even offer my help understanding a measured boot process (which I am pretty sure you would have no trouble understanding on your own).
@GranZhadu
@GranZhadu 5 ай бұрын
Excellent presentation. Thank you for posting it.
@xuedi
@xuedi 5 ай бұрын
Very lovely & professional made
@_soundwave_
@_soundwave_ 5 ай бұрын
One of the best channels in last few years
@jobautomation
@jobautomation 6 ай бұрын
Thanks! Loud and clear
@yeshayavarghese350
@yeshayavarghese350 3 ай бұрын
Nicely done! Good visual aids too
@hansvetter8653
@hansvetter8653 5 ай бұрын
Great presentation! Thanks!
@nalipapaiah8384
@nalipapaiah8384 3 ай бұрын
I was looking something like this and kind of explanation thanks man😊
@b00gi3
@b00gi3 2 ай бұрын
This channel is absolutely brilliant. I am blown away! 0__0 wow
@HN-oq3gf
@HN-oq3gf 4 ай бұрын
thanks for the explanation! this helps!
@Kevin_Long
@Kevin_Long 4 ай бұрын
This was excellent, well done.
@sadeksadaoui8371
@sadeksadaoui8371 4 ай бұрын
Awsome, great job. thanks a lot for your time. excellent explanation!
@BerniesBastelBude
@BerniesBastelBude 5 ай бұрын
thank your for this helpful explanation!
@prabinlamsal74
@prabinlamsal74 5 ай бұрын
I sept yesterday learning all this by myself and today, youtube recommended me this. If I had found this video, maybe I would have learned all that in 5 minutes.
@Crusaderon
@Crusaderon 3 ай бұрын
Great descriptions... 😊
@bmiller949
@bmiller949 4 ай бұрын
Great overview. I think is good background info for any OS.
@mth469
@mth469 Ай бұрын
Thank you sir. Nice diagrams too.
@hasansalim1868
@hasansalim1868 5 ай бұрын
Nice explanation and great graphics.
@animeshsarkar295
@animeshsarkar295 6 ай бұрын
Sir, thank you for such creative tutorials please make one on Spark
@user-mc7kr5lm8q
@user-mc7kr5lm8q 3 ай бұрын
Excellent demo
@cristobalortizortiz
@cristobalortizortiz 5 ай бұрын
nice explanation best so far :)
@jijuntang509
@jijuntang509 5 ай бұрын
Thanks, it's a very good summary video with a good global presentation
@chyldstudios
@chyldstudios 4 ай бұрын
Well done!
@Tsundaere
@Tsundaere 5 ай бұрын
This is my favourite new channel.
@lalpremi
@lalpremi 6 ай бұрын
Thank you, well done. :-)
@duzhuo
@duzhuo 6 ай бұрын
Thanks for sharing
@LinuxLoader1287
@LinuxLoader1287 5 ай бұрын
Nice video good explanation and presentation 👍
@FerdausAlAmin
@FerdausAlAmin 3 ай бұрын
Great video.. I could not have done this better like you Though I am a Linux user for the last 15 years.. Thank you
@Nightowl_IT
@Nightowl_IT 18 күн бұрын
More detail please. A series would be good describing each and every nook and cranny.
@rishiraj2548
@rishiraj2548 6 ай бұрын
Great thanks
@MartinCharles
@MartinCharles 4 ай бұрын
The information density here is very high
@Sabulany
@Sabulany 4 ай бұрын
this is awesome, the same core idea when develop embedded firmware as well
@DaengRosanda
@DaengRosanda 4 ай бұрын
very nice video... loved it...
@VasaMusic438
@VasaMusic438 5 ай бұрын
Great !!! more please !!
@user-fc7th5rw1z
@user-fc7th5rw1z Ай бұрын
very very nice. excellent animation. forcing us to view compulsorily immediately though we have plenty of pending works. it is like movie attracts us. go ahead.
@tekforge
@tekforge 2 ай бұрын
I love your presentations! Which tool do you use to create or generate them with such a beautiful animation?
@davidoflight1313
@davidoflight1313 5 ай бұрын
Excellent presentation and narration; whats' used for your animations?
@raj_kundalia
@raj_kundalia 5 ай бұрын
thank you!
@TheRealOrlandoG
@TheRealOrlandoG Ай бұрын
Linux newbie here 🤓 Very nice video.
@Codigger-br2rt
@Codigger-br2rt 3 ай бұрын
When Linux chooses to support initramfs boot, and selects the rootfs path to be packaged in the initramfs source file, it will try to boot in initramfs mode. In this way, the rootfs will be compressed and packaged in the same image file as the Linux kernel. Then uboot will load the whole image file into memory when the system is loaded. In this way, the rootfs cannot be modified in flash, and will be lost when the power is lost.
@jali-cj5zq
@jali-cj5zq 3 ай бұрын
Thanks this is really informative
@Codigger-br2rt
@Codigger-br2rt 3 ай бұрын
@@jali-cj5zq Thanks for reading my comments!! I hope everyone’s got vim on their resolutions for 2024
@midjhelins8383
@midjhelins8383 6 ай бұрын
excellent!
@samyakjain2193
@samyakjain2193 6 ай бұрын
Always impressive.
@AlbertXuY
@AlbertXuY 6 ай бұрын
Missing initrd or initramfs part?
@MrPepyaker
@MrPepyaker 4 ай бұрын
Right, this part is missing
@piratestreasure2009
@piratestreasure2009 4 ай бұрын
also it is possible to use GPT without using UEFI boot ... so this is kind of useless, at least for me.
@hammerheadcorvette4
@hammerheadcorvette4 3 ай бұрын
systemd-boot is great. No fuss just straight to the point !
@pandacongolais
@pandacongolais 5 ай бұрын
Nice and simple ! But you're missing the loading of initrd. I admit I can't remember from the top of my head when exactly it occurs. Would be a nice addition to your explanation.
@trueriver1950
@trueriver1950 5 ай бұрын
In the classic Grub or Lilo bootloader, the initrd or initram (NB they are different!) is loaded after the kernel but before control is passed. There are also the kernel parameters (append details in some boot loaders) that the boot loader has to make available to the kernel. These can be flags or switches to the kernel, to systemd, or to other programs run later on.
@connecttolanconnlan-2991
@connecttolanconnlan-2991 3 ай бұрын
Great job! It looks clean, straightforward, and easy to understand. Could you tell me what software you used to create this video? I'm interested in making my own technical videos in the same manner.
@piratestreasure2009
@piratestreasure2009 4 ай бұрын
It is possible to use gpt partitions without needing UEFI. Even old motherboards with intel 775 socket will boot using gpt partitions without UEFI: "Yes, it is possible to use GPT (GUID Partition Table) partitions without UEFI (Unified Extensible Firmware Interface). GPT is a partitioning scheme for formatting and partitioning hard drives, and it's independent of the firmware interface being used (UEFI or BIOS). However, the ability to boot from a GPT-partitioned disk depends on the firmware of your system. Most modern systems use UEFI firmware to boot, and UEFI is compatible with both GPT and the older MBR (Master Boot Record) partitioning scheme. If your system uses the older BIOS (Basic Input/Output System) firmware instead of UEFI, it may have limitations when it comes to booting from GPT disks. Some BIOS systems can boot from GPT disks using a compatibility support module (CSM), while others may not support GPT booting at all. So, in summary, while you can use GPT partitions without UEFI, the ability to boot from a GPT disk depends on the firmware capabilities of your system."
@dsp976
@dsp976 6 ай бұрын
Спасибо, добрый человек.
@guna6751
@guna6751 5 ай бұрын
wow amazing, which tool you use for graphical representation in your explanations? ill try for my students too. please tell me if you can
@riigel
@riigel 4 ай бұрын
how do do you do these animations? its nice and clean!
@jairunet
@jairunet 5 ай бұрын
Thank you for the information, as a follow-up will be great to take a step back and have instructions on how to identify if our system (desktop, laptop, mini PC, or server) supports UEFI for a faster boot, better functionality, and security. Thank you again!
@MichaelAbramo
@MichaelAbramo 5 ай бұрын
That should be something you can look up based on your OS version and your motherboard model.
@Ali-wf9ef
@Ali-wf9ef 5 ай бұрын
awww I thought you're gonna go into more detail about primary and secondary boot loader
@user-hd3pz2ow1b
@user-hd3pz2ow1b 3 ай бұрын
thanks
@AndriiKuftachov
@AndriiKuftachov 4 ай бұрын
I bought your books 📚, but haven't had time to read, by I hope I will do soon.
@roastyou666
@roastyou666 6 ай бұрын
I anticipate to implement a service daemon manager in my operating system soon! Currently it just handles the transferred ownership from my kernel and does nothing but outputting in tty mode
@marcdunivan2436
@marcdunivan2436 5 ай бұрын
What about the SPI flash? Coreboot/DepthCharge or uBoot and TowBoot? What about the details of gdm3 and starting the graphical shell?
@zeppelinmexicano
@zeppelinmexicano 4 ай бұрын
Very nice.
@brolinofvandar
@brolinofvandar Ай бұрын
This seems more like a brief description of how *any* OS boots on a PC, just using the linux names for the later steps where it'll differ. Up to the boot loader step, there's not even an OS involved. And Windows uses a boot loader as well, it's just not called that and tends to be hidden from view for most people. Still, the same process. Code the hardwired system can find that loads the actual operating system. And whatever OS it is, the first step will usually be getting the kernel of the system going, drivers, etc. Same basic flow for any OS. Aside from the names used in those last steps, nothing here specific to linux. An actual OS specific discussion of the boot process would start with the kernel loading. It's from that point that OS's diverge. The boot loader itself can be setup to point to different kernels and/or different OSs itself, which is how a dual boot works.
@steve6375
@steve6375 5 ай бұрын
Doesn't grub also load an initrd image as well as the kernel? Where does squashfs fit in?
@chbrules
@chbrules 6 ай бұрын
2TiB drives was NOT a limitation of the BIOS firmware. If you had a very late version of a BIOS with the proper hardware, you could easily support sizes > 2TiB.
@ByteByteGo
@ByteByteGo 6 ай бұрын
You made a fair point. The video refers to the 2TB limit of the master boot record (MBR). We should have been more precise in our language.
@shy-watcher
@shy-watcher 5 ай бұрын
Exactly, as soon as they conflated MBR/GPT with BIOS/UEFI I knew this channel was mostly fluff. I think it's the second or third time this channel tricked me with an attractive topic and pretty graphic over lluminaughti-level writing. Too bad, a properly presented boot summary in 5 (or even 10) minutes would be pretty cool.
@kcvinu
@kcvinu 6 ай бұрын
High quality animation. Thank you for the effort. Can you make a video about Windows booting ?
@callisoncaffrey
@callisoncaffrey 5 ай бұрын
Fire and explosions are covered in physics class.
@ab3lsec
@ab3lsec 6 ай бұрын
Hey, can you do the same for Windows?
@brettgmonroe
@brettgmonroe 6 ай бұрын
I would have appreciated more time being given to the transition between the boot loader and systemd (the kernel initialization).
@OtterSwims
@OtterSwims 5 ай бұрын
Same, i wonder what the name of the first process that runs within the kernel is. Is there some sort of entry point within the kernel like a main function or something that eventually calls systemd?
@user-sl4th2pu1z
@user-sl4th2pu1z 4 ай бұрын
No way. I just guessed it right. I told exact same on my interview 😂.
@dharundeepak
@dharundeepak 6 ай бұрын
If initramfs also coved in this video then this could be the best one...
@williambaldwin9346
@williambaldwin9346 5 ай бұрын
Today I read chapter 5 on How Linux Works by press starch. You took about 30 pages and summarized them in 4:43 minutes, except the book of course went in more detail at each step. Plus it had all the different boot loaders listed, even ones that are dead and gone. Do you have a System D VS Wayland video yet?
@danielindictor4272
@danielindictor4272 5 ай бұрын
Systemd and wayland do different things. Systemd is simply the first program that the Linux kernel executes. When it starts, it reads a bunch of configuration files to figure out which other programs need to be run for the system to function, such as a network firewall or database like Mysql/Postgres. It also boots a program responsible for showing you the login screen. It's this login program (formally, a display manager) that figures out how to boot your desktop environment, which may use the Wayland protocol (it is not a program) or X11 protocol to communicate with the Wayland server or the X11 server, respectively. The Wayland and X11 servers are also simply programs that do the job of interfacing with the linux kernel (and by extension the hardware) to allow clients (i.e., your window manager like Gnome or your browser like Firefox) to be able to draw to the screen in a hardware-independent way (i.e., not worrying about whether you're running AMD/Nvidia/Intel graphics). All that's necessary to run a graphical program is for it to speak the Wayland protocol to a running Wayland server process. It just so happens that Systemd is responsible for starting the X11 and Wayland servers, because the init system is the most natural way to manage long-running processes upon which many other processes depend.
@qlx-i
@qlx-i 5 ай бұрын
Although a thing to point out is that you don't need a boot loader now, you can just expose the kernel to UEFI and write flags directly into boot record.
@trueriver1950
@trueriver1950 5 ай бұрын
Can you please post a link to a "how to" on skipping the "grub" phase of booting? And if you do that do you have to avoid using an initial ramdisk in the usual Linux way? I can't see how the boot flags alone can properly load the ramdisk (which might of course be my ignorance, hence my question)
@sewsheederg
@sewsheederg 4 ай бұрын
@@trueriver1950 use an efistub and efibootmgr to make uefi entry with kernel args pointing to initrd
@newsnetworkz
@newsnetworkz 6 ай бұрын
Nice
@davidruedeman9990
@davidruedeman9990 5 ай бұрын
Where is initrd or initramfs? It is present in most if not all Linux system? Seems like you missed something.
@sarveshsawant7232
@sarveshsawant7232 6 ай бұрын
Great
@miguelangeldeblas9013
@miguelangeldeblas9013 5 ай бұрын
Graet video!
@johnnylin0924
@johnnylin0924 6 ай бұрын
Coreboot for the win
@hainshj
@hainshj 5 ай бұрын
Muito bom!
@Treviath
@Treviath 4 ай бұрын
I think this video could have extended itself to include the graphical boot process. The display manager which boots up the desktop environment.
@saulgoodman6710
@saulgoodman6710 5 ай бұрын
Prior to boot loader what is the software that controls all these? Also how does a boot loader identify all the available kernals? like how does it know? is there already a software that reads this?
@Michaelno
@Michaelno 19 күн бұрын
Ok you got me.
@OK-iw5im
@OK-iw5im 6 ай бұрын
Amazing channel
@user-vsdf82fd9s
@user-vsdf82fd9s 12 күн бұрын
Hey, thanks for the video lol
@ArchonLicht
@ArchonLicht 5 ай бұрын
UEFI was in Macs for years. "New kid", right.
@martinmarusinec6204
@martinmarusinec6204 6 ай бұрын
and loading the filesystem image?
@TheEmperorXavier
@TheEmperorXavier 2 ай бұрын
This question might not get answered but I’ll try anyway. What program do you use to generate those cool animations for your videos?
@ThePlayerOfGames
@ThePlayerOfGames 5 ай бұрын
1:40 actual Linux boot process begins at that time stamp, preceding this is just a general description of BIOS/UEFI basics
@trueriver1950
@trueriver1950 5 ай бұрын
Yes and no. No: The video answers the question "what happens when you boot a Linux machine from cold", so quite correctly included the BIOS/UEFI stages. Yes: if you are only looking to understand the part that Linux plays in the boot process start at that timestamp. Both are legitimate ways of using this informative video
@terrorgen
@terrorgen 6 ай бұрын
Wonder why there is a stage 1 (initrd) and stage 2 in the Linux boot process
@mikhailbrest6385
@mikhailbrest6385 6 ай бұрын
initrd used to be a ext2/ext3 partition that can be mounted as loop device, now it's just a compressed a cpio archive, usually distro kernel is light and doesn't have network/disk/fs drivers so when the kernel is pushed to memory by grub it can't recognize hw and even mount fs. All needed drivers are stored in initrd image. More over linux thin clients mount root via nfs or nbd and again drivers and glue shell code is stored in initrd. And so called second stage is a chain load when a real hd init process is started and a root pivot is happening.
Linux File System/Structure Explained!
15:59
DorianDotSlash
Рет қаралды 4 МЛН
Top 8 Most Popular Network Protocols Explained
6:25
ByteByteGo
Рет қаралды 253 М.
Climbing to 18M Subscribers 🎉
00:32
Matt Larose
Рет қаралды 27 МЛН
We Got Expelled From Scholl After This...
00:10
Jojo Sim
Рет қаралды 41 МЛН
Они убрались очень быстро!
00:40
Аришнев
Рет қаралды 3,2 МЛН
Как быстро замутить ЭлектроСамокат
00:59
ЖЕЛЕЗНЫЙ КОРОЛЬ
Рет қаралды 14 МЛН
Caching Pitfalls Every Developer Should Know
6:41
ByteByteGo
Рет қаралды 108 М.
Making Simple Windows Driver in C
7:26
Nir Lichtman
Рет қаралды 322 М.
18 Commands That Will Change The Way You Use Linux Forever
29:50
Akamai Developer
Рет қаралды 1,2 МЛН
What is a kernel - Gary explains
9:50
Android Authority
Рет қаралды 949 М.
HOW TRANSISTORS REMEMBER DATA
16:58
Core Dumped
Рет қаралды 165 М.
The mind behind Linux | Linus Torvalds | TED
21:31
TED
Рет қаралды 6 МЛН
How does an OS boot? //Source Dive// 001
50:22
Low Byte Productions
Рет қаралды 381 М.
Linux File System Explained!
5:16
ByteByteGo
Рет қаралды 171 М.
The Linux Filesystem Explained | How Each Directory is Used
14:08
Akamai Developer
Рет қаралды 220 М.
The Linux Boot Process (Linux+ Objective 1.1.2)
26:33
Shawn Powers
Рет қаралды 29 М.
Climbing to 18M Subscribers 🎉
00:32
Matt Larose
Рет қаралды 27 МЛН