China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-01 21:55
中国DOS联盟论坛 » DOS开发编程 & 发展交流 (开发室) » [Original] Implementation of Operating Systems View 2,950 Replies 16
Original Poster Posted 2003-10-08 00:00 ·  中国 河北 石家庄 电信
中级用户
★★
疯狂的流浪者
Credits 276
Posts 56
Joined 2003-09-25 00:00
22-year member
UID 10329
Gender Male
Status Offline
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...
临河居士
http://www.xygod.pc5.org
Floor 2 Posted 2003-10-08 00:00 ·  中国 河北 石家庄 电信
中级用户
★★
疯狂的流浪者
Credits 276
Posts 56
Joined 2003-09-25 00:00
22-year member
UID 10329
Gender Male
Status Offline
To obtain machine code, I'm using ULTRA EDIT! Actually, as long as you understand the MZ file format, it's okay! You can also use DEBUG, if you don't mind the trouble!
临河居士
http://www.xygod.pc5.org
Floor 3 Posted 2003-10-09 00:00 ·  中国 湖北 武汉 联通
高级用户
★★
Credits 677
Posts 194
Joined 2003-09-13 00:00
22-year member
UID 9778
Gender Male
Status Offline
If that's the case, xy_god, it's a very simple thing for you to write a master boot record virus! In fact, some software such as "Return Genius" and multi-system booting and so on have rewritten the master boot record. First, move the content of the master boot record to another place, (or use a jump instruction to execute and then come back), execute your own code and then execute the code of the master boot record!
Floor 4 Posted 2003-10-10 00:00 ·  中国 河北 石家庄 桥西区 联通
中级用户
★★
疯狂的流浪者
Credits 276
Posts 56
Joined 2003-09-25 00:00
22-year member
UID 10329
Gender Male
Status Offline
Actually, one of the motivations for me to learn these things back then was to make something like a virus or something!
临河居士
http://www.xygod.pc5.org
Floor 5 Posted 2003-10-10 00:00 ·  中国 湖北 武汉 联通
银牌会员
★★★
Credits 1,681
Posts 512
Joined 2003-08-02 00:00
23-year member
UID 7953
Gender Male
Status Offline
If you make an operating system compatible with DOS, then you don't have to worry about "no one cooperating with me"...

Or it will be as difficult as the beginning of Unix.
Somehow somewhere I've got to choose.
No matter if it is win or lose.
Floor 6 Posted 2003-10-10 00:00 ·  中国 湖北 武汉 联通
高级用户
★★
Credits 677
Posts 194
Joined 2003-09-13 00:00
22-year member
UID 9778
Gender Male
Status Offline
Actually, it's almost impossible for one person to write an operating system!
I think xy_god is still at the stage of making houses to 30% in "Empire: Rise of Rome"!
Floor 7 Posted 2003-10-11 00:00 ·  中国 福建 福州 电信
元老会员
★★★
农民
Credits 2,903
Posts 991
Joined 2003-07-23 00:00
23-year member
UID 7391
Gender Male
From 福建省
Status Offline
Hehe, everyone should be interested in operating systems, and we can discuss together.
Also, the person above seems to like playing Empire, I wonder if they will play Conqueror.
艰难奋长戟,万古用一夫

中国DOS联盟 http://www.cn-dos.net 欢迎大家来共同学习
我的MSN&E-Mail cn_archer@hotmail.com QQ 56049418
Floor 8 Posted 2003-10-13 00:00 ·  中国 湖北 武汉 联通
高级用户
★★
Credits 677
Posts 194
Joined 2003-09-13 00:00
22-year member
UID 9778
Gender Male
Status Offline
有空到浩方对战平台,打一场阿!
http://www.cga.com.cn
我的名字是IkillGame
有空到浩方对战平台, have a match at HF Arena!
http://www.cga.com.cn
My name is IkillGame
Floor 9 Posted 2003-10-25 00:00 ·  中国 湖南 长沙 电信
初级用户
★★
Credits 255
Posts 54
Joined 2003-10-24 00:00
22-year member
UID 11864
Gender Male
Status Offline
Go ahead, go ahead. In this world, nothing is impossible (don't mind the person above ^_^). If there's anything you need help with, just let us know, everyone will definitely stand up for you!
Floor 10 Posted 2003-10-26 00:00 ·  中国 河北 石家庄 电信
中级用户
★★
疯狂的流浪者
Credits 276
Posts 56
Joined 2003-09-25 00:00
22-year member
UID 10329
Gender Male
Status Offline
Well, I'm currently writing a mouse driver. It's hard to find the writing materials and they're all in English, so I have to translate them myself!
临河居士
http://www.xygod.pc5.org
Floor 11 Posted 2003-10-27 00:00 ·  中国 湖南 长沙 电信
初级用户
★★
Credits 255
Posts 54
Joined 2003-10-24 00:00
22-year member
UID 11864
Gender Male
Status Offline
Keep it up ^_^
Floor 12 Posted 2003-10-27 00:00 ·  中国 北京 科技网
银牌会员
★★★
颓废青年
Credits 2,265
Posts 721
Joined 2003-05-12 00:00
23-year member
UID 2032
Gender Male
Status Offline
Expert!
Floor 13 Posted 2006-03-12 22:27 ·  中国 河南 新乡 电信
新手上路
Credits 18
Posts 5
Joined 2006-03-12 21:05
20-year member
UID 51892
Status Offline
I admire you and respect you
Floor 14 Posted 2006-03-14 07:32 ·  中国 上海 东方有线
中级用户
★★
Credits 255
Posts 57
Joined 2003-06-26 00:00
23-year member
UID 5927
Gender Male
Status Offline
There is a book called "Write Your Own Operating System". I bought it. It's okay. I just don't have time to read it. I suggest everyone also go to the bookstore and flip through it.
Floor 15 Posted 2006-03-17 13:18 ·  中国 江苏 苏州 姑苏区 电信
初级用户
Credits 46
Posts 21
Joined 2006-03-08 22:23
20-year member
UID 51619
Gender Male
From 中华人民共和国
Status Offline
The boot program is the easiest to handle, even I can do it!
The boot program of my computer was made by myself. There are installed on the computer:
MS-DOS 6.22
Windows 98
Windows XP
Fedora Core 2
Forum Jump: