‫In this lecture, we are going to discuss the process.
‫So what are the steps to a fully booted system?
‫Well, the bias is executed directly from Ron Read-Only memory, that is the actual biochip itself is
‫getting read from and executed in real time.
‫The bias loads our operating system bootloader into address.
‫067 see zero zero.
‫No, obviously this is hexadecimal number by here.
‫So if you convert that to decimal and that's the decimal value the so then execute our bootloader which
‫will then load the kernel and then obviously our kernel would load all the other essential pieces of
‫our operating system.
‫So that that's it in a nutshell.
‫Let's, let's go into a bit more detail.
‫So first things first.
‫What is a bootloader?
‫While a bootloader is basically a small program that is responsible for loading the kernel of an operating
‫system.
‫Now, the operating system developer will generally write this bootloader himself.
‫Microsoft have their own bootloader, for example.
‫Linux has grub.
‫So the boot load is there generally small programs and they're simply responsible for loading the operating
‫systems kernel.
‫So when the computer first boots, when a compatibility mode called real mode and real mode only gives
‫us access to one megabyte of memory.
‫It also runs only 16 bit code.
‫We're actually fairly limited at this stage.
‫So we have to load a little program called the Bootloader.
‫And the only response to be of our bootloader is to put us into what's known as protected mode, which
‫will give us access to four gigabytes of address space, and then we will be running three to code.
‫So the boot load is job.
‫Simply put, it loads our kernel into memory.
‫Switches the processor into 32 bit protective mode and then executes our kernel, the bootloader generally
‫uses functions available in the BIOS to assist itself, but we'll talk more about that later.
‫So all you need to know is the boat load, his job is to load our operating system, to load our colonel
‫and we write the bootloader so the bias loads the bootloader, the bootloader loads, the operating
‫system.
‫That's all you need to know for now.
‫So the bias gets executed directly from wrong.
‫So as soon as we turn on the PC, it'll start executing from the bias is from the bias or general load
‫itself into memory so that it's faster.
‫So the bias is also responsible for initializing mandatory hardware.
‫It'll it'll provide basic disk drivers to the hard disk and so on.
‫So when the bias is finished doing its thing, it will attempt to load our bootloader, as I've already
‫said.
‫And it does this by searching all storage mediums for a boot signature.
‫The 511 byte and the 512 byte should contain a boot signature, right?
‫If the bias finds that signature, it will load that sector.
‫Into address zero seven six zero zero.
‫And will then execute from that address running our bootloader.
‫So, for example, storage mediums could include USB sticks, floppy drives if you're going back in
‫the day, hard disks, right.
‫So it'll go through all of these devices.
‫It'll say, OK, load the first sector of the first hard disk.
‫And just to let you know, a sector is simply a block of storage.
‫So, for example, on most hard disks, we have 512 byte sectors.
‫So the first sector will basically mean that it will load from the first byte to the 512 byte.
‫Does that make sense?
‫What we can get more on that later.
‫This is just an overview to understand what's going on.
‫So the bias will load the first sector of the first hard disk and it will take a look at the five judge
‫level and five June 12 byte.
‫If those bytes match the signature zero x five five AA, then the BIOS has found a suitable medium and
‫obviously then it will load that into address seven zero zero, as I said, and it will start executing
‫from there.
‫So that's how that works.
‫If if the buyers can't find a suitable medium, then they can't do anything else, unfortunately.
‫So, you know, bootable mediums come in all shapes and sizes can be the USB pen drive.
‫It's only bootable if the first sector has a boot signature and all of a CIA boot.
‫Cintia is the last two bytes being zero five five Aiya.
‫So as I've said, once the boot sector is loaded, it will actually do an absolute jump to address six
‫seven six zero zero and begin executing our bootloader.
‫So another thing to note is the BIOS is almost like a kernel in itself.
‫It contains loads of routine's for our bootloader to be assisted with putting our kernel.
‫The bias is 16 bit code, which means that only when the process is in real mode.
‫The compatibility mode that I mentioned briefly a few minutes ago, will it be able to execute the bias
‫properly?
‫Because whilst it's in real mode, the processor is in a 16 bit state.
‫That means that it's working with 16 bit values only.
‫So, for example, if we work with a number, it will only be able to work with that number 16 bits
‫at a time.
‫And obviously 16 bits is only two bytes, which means we can only work with numbers up to sixty five
‫thousand five hundred thirty five at one time.
‫So the bias routines are generic and our standard.
‫So all biases follow a similar sort of interface so that they're compatible with each other.
‫That means that any code that talks with one US will be able to talk with another in the same way.
‫So that's that for this lecture.
‫I know that it's been a mouthful and you're probably confused, but you know, you're not going to learn
‫all this in one lecture.
‫This just covers basically what I'm going to be talking about while we start developing our kernel.
‫So this might seem like a lot to take in, but don't worry, you're not going to learn all of this in
‫one lecture.
‫I just needed to cover these things because as we progress through the course I like, Bob's going to
‫go over your head and you're going to be like, oh, that's what he meant.
‫That is how you're going to be thinking.
‫And it's going to be a great refresher for your mind.
‫So don't worry, if you're confused, keep following the course, those light bulbs to start appearing.
‫And if they don't, you can ask me a question at any time.