Building an OS - 2 - Reading from the disk
YouTube transcript, YouTube translate
A quick preview of the first subtitles so you know what the video covers.
hello and welcome this is part two of the building and operating system series today we'll learn how to load stuff from a floppy disk before talking about today's topic i would like to correct some mistakes i made in the first episode first of all i said that the movie instruction moves from the left to the right which is incorrect move moves from right to left you can think of it as an assignment in c the destination is on the left side and the source is on the right side also in the referencing a memory location section i said that when the segment is not specified ds is used by default this is mostly correct however as the viewer pointed out when the base register is bp ss will be the default so far we've been limited to the first sector of a floppy disk which is 512 bytes this is very little space but after today's episode we won't be far from it so our number one priority is to implement some code which will load the rest of the operating system into memory what this means is that we will have to split our operating system in two modules the first one will load the second one all operating system the first module is called a bootloader and generally speaking it has several functions it loads the most essential components of the operating system into memory it puts the computer in the state that the kernel expects it to be in and it collects some basic information about the system depending on the operating system the bootloader can be very simple or very complex older operating systems like ms-dos run in 16-bit real mode the mode we're using right now so the bootloader's job was quite simple to just load some binary and run it more modern operating systems typically expect the bootloader to make the switch to 32-bit protected mode for them and also collect some system information we haven't talked a lot about 32-bit protected mode yet but we will get there i promise however one of its main limitations is that the bios functions that we talked about in part one can no longer be used some of these functions are really important as they provide us with critical information for example there is a function which shows us the memory layout