Тёмный

How Does Linux Boot Process Work? 

ByteByteGo
Подписаться 842 тыс.
Просмотров 537 тыс.
50% 1

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.

Опубликовано:

 

11 дек 2023

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 284   
@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 5 месяцев назад
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.
@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
@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 :(
@ggattsr
@ggattsr 10 дней назад
One of the best boot process summary's on RU-vid. Thanks for all the work and graphics.
@nicholasmaniccia1005
@nicholasmaniccia1005 6 месяцев назад
Great content, always helpful and always impressive. Thank you very much for taking the time to make these.
@coderdojoAN
@coderdojoAN 5 месяцев назад
Great summary and visualization of the entire boot process. Very well done mate!!!!
@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.
@trueriver1950
@trueriver1950 4 месяца назад
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.
@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
@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).
@irvingirving6275
@irvingirving6275 5 месяцев назад
I was looking for something like this. This is great thank you!
@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!
@dcn4lyf
@dcn4lyf 6 месяцев назад
Best Summary of the Boot process
@reasoningCode
@reasoningCode 4 месяца назад
KUDOS! I've never seen such nicer explanation for this.
@GranZhadu
@GranZhadu 5 месяцев назад
Excellent presentation. Thank you for posting it.
@b00gi3
@b00gi3 2 месяца назад
This channel is absolutely brilliant. I am blown away! 0__0 wow
@xuedi
@xuedi 5 месяцев назад
Very lovely & professional made
@yeshayavarghese350
@yeshayavarghese350 3 месяца назад
Nicely done! Good visual aids too
@nalipapaiah8384
@nalipapaiah8384 3 месяца назад
I was looking something like this and kind of explanation thanks man😊
@sadeksadaoui8371
@sadeksadaoui8371 4 месяца назад
Awsome, great job. thanks a lot for your time. excellent explanation!
@bmiller949
@bmiller949 4 месяца назад
Great overview. I think is good background info for any OS.
@animeshsarkar295
@animeshsarkar295 6 месяцев назад
Sir, thank you for such creative tutorials please make one on Spark
@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.
@_soundwave_
@_soundwave_ 5 месяцев назад
One of the best channels in last few years
@jobautomation
@jobautomation 5 месяцев назад
Thanks! Loud and clear
@jijuntang509
@jijuntang509 5 месяцев назад
Thanks, it's a very good summary video with a good global presentation
@Kevin_Long
@Kevin_Long 4 месяца назад
This was excellent, well done.
@HN-oq3gf
@HN-oq3gf 4 месяца назад
thanks for the explanation! this helps!
@tekforge
@tekforge Месяц назад
I love your presentations! Which tool do you use to create or generate them with such a beautiful animation?
@Nightowl_IT
@Nightowl_IT 15 дней назад
More detail please. A series would be good describing each and every nook and cranny.
@BerniesBastelBude
@BerniesBastelBude 5 месяцев назад
thank your for this helpful explanation!
@hansvetter8653
@hansvetter8653 5 месяцев назад
Great presentation! Thanks!
@hasansalim1868
@hasansalim1868 5 месяцев назад
Nice explanation and great graphics.
@mth469
@mth469 Месяц назад
Thank you sir. Nice diagrams too.
@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.
@davidoflight1313
@davidoflight1313 5 месяцев назад
Excellent presentation and narration; whats' used for your animations?
@Crusaderon
@Crusaderon 3 месяца назад
Great descriptions... 😊
@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.
@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
@cristobalortizortiz
@cristobalortizortiz 5 месяцев назад
nice explanation best so far :)
@Sabulany
@Sabulany 4 месяца назад
this is awesome, the same core idea when develop embedded firmware as well
@LinuxLoader1287
@LinuxLoader1287 5 месяцев назад
Nice video good explanation and presentation 👍
@Tsundaere
@Tsundaere 5 месяцев назад
This is my favourite new channel.
@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
@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 4 месяца назад
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.
@MartinCharles
@MartinCharles 4 месяца назад
The information density here is very high
@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.
@lalpremi
@lalpremi 6 месяцев назад
Thank you, well done. :-)
@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."
@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 2 месяца назад
@@jali-cj5zq Thanks for reading my comments!! I hope everyone’s got vim on their resolutions for 2024
@hammerheadcorvette4
@hammerheadcorvette4 3 месяца назад
systemd-boot is great. No fuss just straight to the point !
@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?
@roastyou666
@roastyou666 5 месяцев назад
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
@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.
@user-mc7kr5lm8q
@user-mc7kr5lm8q 3 месяца назад
Excellent demo
@Ali-wf9ef
@Ali-wf9ef 5 месяцев назад
awww I thought you're gonna go into more detail about primary and secondary boot loader
@DaengRosanda
@DaengRosanda 4 месяца назад
very nice video... loved it...
@dsp976
@dsp976 5 месяцев назад
Спасибо, добрый человек.
@duzhuo
@duzhuo 6 месяцев назад
Thanks for sharing
@riigel
@riigel 4 месяца назад
how do do you do these animations? its nice and clean!
@TheRealOrlandoG
@TheRealOrlandoG Месяц назад
Linux newbie here 🤓 Very nice video.
@AndriiKuftachov
@AndriiKuftachov 4 месяца назад
I bought your books 📚, but haven't had time to read, by I hope I will do soon.
@VasaMusic438
@VasaMusic438 5 месяцев назад
Great !!! more please !!
@steve6375
@steve6375 5 месяцев назад
Doesn't grub also load an initrd image as well as the kernel? Where does squashfs fit in?
@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.
@kcvinu
@kcvinu 5 месяцев назад
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.
@brettgmonroe
@brettgmonroe 5 месяцев назад
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?
@rishiraj2548
@rishiraj2548 6 месяцев назад
Great thanks
@chyldstudios
@chyldstudios 4 месяца назад
Well done!
@ab3lsec
@ab3lsec 6 месяцев назад
Hey, can you do the same for Windows?
@davidruedeman9990
@davidruedeman9990 5 месяцев назад
Where is initrd or initramfs? It is present in most if not all Linux system? Seems like you missed something.
@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.
@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 4 месяца назад
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
@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?
@midjhelins8383
@midjhelins8383 6 месяцев назад
excellent!
@samyakjain2193
@samyakjain2193 6 месяцев назад
Always impressive.
@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.
@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.
@raj_kundalia
@raj_kundalia 5 месяцев назад
thank you!
@dharundeepak
@dharundeepak 6 месяцев назад
If initramfs also coved in this video then this could be the best one...
@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?
@user-sl4th2pu1z
@user-sl4th2pu1z 4 месяца назад
No way. I just guessed it right. I told exact same on my interview 😂.
@user-hd3pz2ow1b
@user-hd3pz2ow1b 3 месяца назад
thanks
@zrajm
@zrajm 5 месяцев назад
How does this relate to hibernate and suspend? I.e. I assume some of the steps involved in boot would also have to happen after a wakeup from suspend/hibernate, but other things do not. What are the differences and similarities between a boot from scratch, and waking up from suspend/hibernate?
@rsable
@rsable 5 месяцев назад
Mostly same. On a very high level its just that when you hibernate, the contents of your RAM are temporarily stored to your hard disk and during the boot process the kernel will pull these contents and use them instead of starting new process.
@SurprisedDivingBoard-vu9rz
@SurprisedDivingBoard-vu9rz Месяц назад
How to run two kernel at the same time. Can you ever switch processor type. Two clocks.
@zeppelinmexicano
@zeppelinmexicano 4 месяца назад
Very nice.
@martinmarusinec6204
@martinmarusinec6204 6 месяцев назад
and loading the filesystem image?
@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.
@WagnerSilvaHeadbrother
@WagnerSilvaHeadbrother 3 дня назад
Nice, U can activate Dubbing to PT-BR ? Thanks !
@apivovarov2
@apivovarov2 4 месяца назад
GRUB2 can be replaced by SystemD-boot too...
@cvabds
@cvabds 4 месяца назад
Can you do s video like that but about templeOS?
@user-uo6ym4ts3m
@user-uo6ym4ts3m 3 месяца назад
Anyone.. Which software is used to make this video (animations)?
@Lightbearer616
@Lightbearer616 11 дней назад
Have you got a full list how Linux boots because mine changes randomly over boots. The last boot event it decided to turn off my GUI, another time it decided to turn off the internet, another time is stopped using my drive sub-directories. How did Linux build that random booting sequence in and why?
@user-vsdf82fd9s
@user-vsdf82fd9s 9 дней назад
Hey, thanks for the video lol
@Dr.Kananga
@Dr.Kananga 2 месяца назад
My linux mint struggles to start on its own despite having only one ssd and it's the main bootable device, it works well when I start it in safety mode but won't boot straight after I power my pc.
@miguelangeldeblas9013
@miguelangeldeblas9013 5 месяцев назад
Graet video!
Далее
The Linux Boot Process (Linux+ Objective 1.1.2)
26:33
Top 8 Most Popular Network Protocols Explained
6:25
Просмотров 251 тыс.
ОБЗОР ТРЕЙЛЕРА STANDOFF 2 0.29.0 FUN&SUN
13:13
Smart Sigma Kid #funny #sigma #comedy
00:19
Просмотров 7 млн
Caching Pitfalls Every Developer Should Know
6:41
Просмотров 107 тыс.
Linux File System/Structure Explained!
15:59
Просмотров 4 млн
Why is JWT popular?
5:14
Просмотров 276 тыс.
Linux File System Explained!
5:16
Просмотров 170 тыс.
Making Simple Windows Driver in C
7:26
Просмотров 320 тыс.
Top 10 Linux Job Interview Questions
16:04
Просмотров 2,3 млн