em07]Hehe, everyone, actually this is very simple! I remember when I first got in touch with computers, I always wanted to make an operating system! But no one taught me back then, and I was very depressed! But I didn't want everyone to keep being depressed like that, otherwise our operating system would never come out, hehe!
OK, now I'll tell you how to implement an operating system!
The first step, everyone's most confused thing might be how to implement a self-booting program?! Actually, the principle of self-booting is very simple. Write 55AA (hexadecimal) in the last 2 bytes of sector 1, track 0 of the floppy disk, and then write machine code in the preceding bytes, and then the computer will execute it! Note that when calling interrupts, don't call DOS soft interrupts, otherwise the computer will crash, because at this time we are independent of any operating system, and those interrupts we haven't filled in yet, hehe!
The second step, of course, is to design a disk file system format by yourself, so as to manage the disk! Beginners, pay attention! Folders are actually designed as pointers, because on the disk file system, folders are a dynamically changing structure, and each folder stores many pointers, pointing to the addresses of other files or folders!
Third, how to implement process calls! Actually, in real mode, it's very simple. You can get the machine code from the disk file, then load it into memory (remember the memory address at this time, including CS, IP), and then use the PUSH instruction and RET instruction, and the code will be loaded into memory. If it's not an illegal instruction, it will execute smoothly, hehe!
OK, the most important things of the operating system have been implemented, namely the file system and the process loader! Actually, these things have been implemented on my machine, but they are still very rudimentary, not as easy to use as DOS!
In fact, a lot of materials I found on the Internet, then read and did experiments, and finally designed by myself! Unfortunately, everything is implemented by myself, and there is no one to cooperate with me... Pain...
OK, now I'll tell you how to implement an operating system!
The first step, everyone's most confused thing might be how to implement a self-booting program?! Actually, the principle of self-booting is very simple. Write 55AA (hexadecimal) in the last 2 bytes of sector 1, track 0 of the floppy disk, and then write machine code in the preceding bytes, and then the computer will execute it! Note that when calling interrupts, don't call DOS soft interrupts, otherwise the computer will crash, because at this time we are independent of any operating system, and those interrupts we haven't filled in yet, hehe!
The second step, of course, is to design a disk file system format by yourself, so as to manage the disk! Beginners, pay attention! Folders are actually designed as pointers, because on the disk file system, folders are a dynamically changing structure, and each folder stores many pointers, pointing to the addresses of other files or folders!
Third, how to implement process calls! Actually, in real mode, it's very simple. You can get the machine code from the disk file, then load it into memory (remember the memory address at this time, including CS, IP), and then use the PUSH instruction and RET instruction, and the code will be loaded into memory. If it's not an illegal instruction, it will execute smoothly, hehe!
OK, the most important things of the operating system have been implemented, namely the file system and the process loader! Actually, these things have been implemented on my machine, but they are still very rudimentary, not as easy to use as DOS!
In fact, a lot of materials I found on the Internet, then read and did experiments, and finally designed by myself! Unfortunately, everything is implemented by myself, and there is no one to cooperate with me... Pain...
临河居士
http://www.xygod.pc5.org
http://www.xygod.pc5.org





