1 00:00:00,420 --> 00:00:06,360 In this section, we will talk about file system and write a simple module to parse the structure of file system 2 00:00:06,360 --> 00:00:06,880 . 3 00:00:07,290 --> 00:00:12,320 In the end, we will see how to run the programs in the console with the help of the file system. 4 00:00:13,050 --> 00:00:16,660 The file system we will use in the system is fat16. 5 00:00:17,340 --> 00:00:22,220 You may use the file system in the operating systems like DOS or windows 95. 6 00:00:22,930 --> 00:00:28,410 The reason we choose fat16 file system is that it’s easy to understand 7 00:00:28,410 --> 00:00:31,380 and implementing read operation is simple as well. 8 00:00:32,420 --> 00:00:39,320 Also, the operating system we use nowadays such as windows, linux and macos can recognize fat16 system 9 00:00:39,320 --> 00:00:44,870 and read and write data into the system, which makes the interaction with it more easily. 10 00:00:45,410 --> 00:00:50,420 For example, we build a program and drag and drop it to the fat16 image, 11 00:00:50,780 --> 00:00:54,650 then we can boot the image, find the program and run the program in our system 12 00:00:54,650 --> 00:00:55,370 . 13 00:00:56,210 --> 00:01:02,090 If we want to read a text from the file, we can achieve it by defining a string 14 00:01:02,090 --> 00:01:08,630 with the characters we want in the assembly code and assemble it to the binary file. Copy the file to the image 15 00:01:08,630 --> 00:01:09,790 and read the data from the file. 16 00:01:10,250 --> 00:01:13,550 The data we read from the file will be the characters we want. 17 00:01:15,110 --> 00:01:21,410 In the following lectures, we will go into details about these operations. The main goal of this section is 18 00:01:21,440 --> 00:01:28,100 to show you the process of parsing the file system structure and write a file module to add open, read operations 19 00:01:28,100 --> 00:01:35,030 so that the user programs can access the file system. We will also focus on 20 00:01:35,030 --> 00:01:39,800 how to combine the process module with file system to run the programs in the file image. 21 00:01:40,550 --> 00:01:46,550 Therefore, I will add some restrictions on the file module in our system to simplify the building process 22 00:01:46,850 --> 00:01:49,880 and direct your attention on the main goal of the section. 23 00:01:50,820 --> 00:01:57,300 Before we build the file module, there is one problem, that is, where our files are stored 24 00:01:57,300 --> 00:01:59,340 and how to access them. 25 00:01:59,350 --> 00:02:04,650 Normally, the files are stored in the disk. The operating system reads and writes files data into the disk. 26 00:02:05,130 --> 00:02:07,280 Unlike the data in the main memory, 27 00:02:07,290 --> 00:02:10,710 the data in the disk stays unchanged after we shut down the computer. 28 00:02:11,370 --> 00:02:17,310 But accessing the disk requires us to write a disk driver, which is not an easy task to do. 29 00:02:17,700 --> 00:02:20,490 So writing a driver is not an option for the moment. 30 00:02:20,970 --> 00:02:25,970 Instead, we will load all the data from disk into memory when we are in the boot process. 31 00:02:26,640 --> 00:02:33,400 Remember when we are in the real mode, we load the loader file and kernel file using bios service, 32 00:02:33,400 --> 00:02:39,630 and now we read the disk into memory using the same method, which means the entire file system is in the memory when our system runs. 33 00:02:40,020 --> 00:02:47,820 Since we haven’t created a fat16 image, we will see how to create one 34 00:02:47,820 --> 00:02:49,490 and inspect the fat16 image in the next video. 35 00:02:49,950 --> 00:02:51,200 So let's get started.