OS Plans.. Suggestions are welcome
Posted: Mon Nov 26, 2007 6:54 am
Hello all. Well, here is my first post to OSDev..
I have a lot of experience with assembly language and not much with C, so I plan to stick with assembly and not bug around with figuring out how to get assembly and C to work together.
From past experience, I know that I need to plan out such a big project before coding anything. I post my plans here - hopefully you will comment on the plans, perhaps point me in a good direction.
Firstly, I plan to write this OS to run on x86. Mainly because that is the most popular architecture around, because it is the only architecture I have direct access to, and because I know extensive information on the x86 architecture.
I previously read documentations on various hardware communication, particularly inferencing the video memory, the keyboard, the serial port, the serial mouse, the PS/2 mouse, directly inferencing the floppy drive chip, the PIC, and protected mode. I can basically inference all of these devices (except for parts of the video) without using BIOS. I have been able to parse out and understand the parts of the FAT on a floppy disk, and the MBR of a hard drive. I know common things like how to get the computer to restart or how to read the time from BIOS and from CMOS. I believe I read enough and know enough to start planning and writing up an OS. If not, please tell me what beginner information I lack.
The OS will be built to be used by:
Me, and other people who are good at programming. The user should be in complete control of the OS. The assumption is that the user is the programmer of everything in the OS.
Here are the main goals of the OS:
1. Get internet to work. It's tough to do so, but it's my primary goal for the OS. I never successful at connecting to the internet before, and I believe that it is the main goal I lack. This means connecting to the ISP in any way, and successfully sending and receiving a full TCP/UDP/ICMP packet.
2. Build a simple text browser, and a simple chat program. Once sending TCP packets becomes possible, building these programs should be simple.
That is all. I believe that these main goals are enough, as I do not have experience with manually connecting Internet at all. I have sent raw packets in Windows, but that is a bit different..
Here are the main rules of the OS:
1. Run as fast and as efficiently possible. I really hate it when Windows suddenly freezes for some unknown reason. It does a lot of stuff in the background that I don't know about, but I believe that a lot of that running time could be stripped away.
2. Multitasking. Multiple programs could run at the same time. This way you could be on two websites and chatting with someone at the same time.
3. Run in 32-bit protected mode. There are a few reasons for this:
a. I have looked over getting into protected mode and tried it before. Make one mistake and the whole thing triple faults. I know that my lack of experience in protected mode makes me say this, and I know that protected mode will make me have long amounts of very confusing code. However I need the extra protection, extra memory, and ability to quickly handle 32-bit data.
b. I cannot use BIOS functions. Reading from the floppy/hard disk will be horrible. For everything else, I pretty much know how to program devices without BIOS. In any case, BIOS is usually slow and limiting. I should be fine if I mainly stick to trying to connect to the Internet.
c. Seriously, I don't think I will need more than about 120 KB for my os. I am writing the thing up in assembly, and I try to optimize every single little thing. Even so, I want to be able to have many programs on at the same time. Also, there is much room for growth for the os.
d. With all the additional checks, code executes slower in protected mode. But I need the protection between programs. These additional checks are much faster than manually checking if the programs do something illegal.
e. I am very used to programming in 16-bits. I know all the commands in assembly that an 8086 computer can handle. 32-bit programming is something new to me. It is of course cool to program in 32-bits, as you can move more data faster at a time, but I don't feel very comfortable when programming in it. That is why I will first write my driver for the internet to work in real mode. Once it works, I will transfer it to 32-bits.
As you see, it was difficult for me to choose protected mode instead of real mode. I used to write in real mode all the time, arguing that it would work on an 8086, however usually people with Internet access have at least a 386... and that is all I need now.
The main problem with starting this project is figuring out how to connect to the Internet. The only Internet connection I currently have is through a linksys wireless-g usb adapter... Yes, it is quite unfortunate.. I have no experience with connecting to usb devices at all. A wireless usb device seems out of the picture.. even Linux usually doesn't run it without the original driver. I do not think I will be able to emulate the driver.
Then there is ethernet. Out of all ethernet cards, I found the DP8390 NIC documented the best. I never had any experience programming the DP8390 NIC, so I don't know if I could get it to work. I would have to buy this card and somehow connect my test computer to the router. My 486 test computer only has ISA ports. Does anybody where to buy a good ISA ethernet card that has this DP8390 NIC chip?
I of course have no experience programming this thing.. I don't know if I will get it to work. My main documentation comes from http://www.osdever.net/downloads/docs/W ... DP8390.zip If I get the card, I will have to figure out how to extend the ethernet from my router to my computer... However there is a third option:
Dial-up. Horribly slow.. need to pay for the extra phone line and Internet service, and need to buy a modem. However, if it is an external serial modem, I will probably be able to program it. Plus, I have an unused telephone line right next to the computer.
So, either find a cheap card with the DP8390 NIC chip that connects to ISA, or get dial-up. Any suggestions? I wish this were a simpler process.. Perhaps you know a better solution?
Thank you for reading through. I hope that you can provide some type of hint or suggestion for either my plans, or my problem with the Internet.
I have a lot of experience with assembly language and not much with C, so I plan to stick with assembly and not bug around with figuring out how to get assembly and C to work together.
From past experience, I know that I need to plan out such a big project before coding anything. I post my plans here - hopefully you will comment on the plans, perhaps point me in a good direction.
Firstly, I plan to write this OS to run on x86. Mainly because that is the most popular architecture around, because it is the only architecture I have direct access to, and because I know extensive information on the x86 architecture.
I previously read documentations on various hardware communication, particularly inferencing the video memory, the keyboard, the serial port, the serial mouse, the PS/2 mouse, directly inferencing the floppy drive chip, the PIC, and protected mode. I can basically inference all of these devices (except for parts of the video) without using BIOS. I have been able to parse out and understand the parts of the FAT on a floppy disk, and the MBR of a hard drive. I know common things like how to get the computer to restart or how to read the time from BIOS and from CMOS. I believe I read enough and know enough to start planning and writing up an OS. If not, please tell me what beginner information I lack.
The OS will be built to be used by:
Me, and other people who are good at programming. The user should be in complete control of the OS. The assumption is that the user is the programmer of everything in the OS.
Here are the main goals of the OS:
1. Get internet to work. It's tough to do so, but it's my primary goal for the OS. I never successful at connecting to the internet before, and I believe that it is the main goal I lack. This means connecting to the ISP in any way, and successfully sending and receiving a full TCP/UDP/ICMP packet.
2. Build a simple text browser, and a simple chat program. Once sending TCP packets becomes possible, building these programs should be simple.
That is all. I believe that these main goals are enough, as I do not have experience with manually connecting Internet at all. I have sent raw packets in Windows, but that is a bit different..
Here are the main rules of the OS:
1. Run as fast and as efficiently possible. I really hate it when Windows suddenly freezes for some unknown reason. It does a lot of stuff in the background that I don't know about, but I believe that a lot of that running time could be stripped away.
2. Multitasking. Multiple programs could run at the same time. This way you could be on two websites and chatting with someone at the same time.
3. Run in 32-bit protected mode. There are a few reasons for this:
a. I have looked over getting into protected mode and tried it before. Make one mistake and the whole thing triple faults. I know that my lack of experience in protected mode makes me say this, and I know that protected mode will make me have long amounts of very confusing code. However I need the extra protection, extra memory, and ability to quickly handle 32-bit data.
b. I cannot use BIOS functions. Reading from the floppy/hard disk will be horrible. For everything else, I pretty much know how to program devices without BIOS. In any case, BIOS is usually slow and limiting. I should be fine if I mainly stick to trying to connect to the Internet.
c. Seriously, I don't think I will need more than about 120 KB for my os. I am writing the thing up in assembly, and I try to optimize every single little thing. Even so, I want to be able to have many programs on at the same time. Also, there is much room for growth for the os.
d. With all the additional checks, code executes slower in protected mode. But I need the protection between programs. These additional checks are much faster than manually checking if the programs do something illegal.
e. I am very used to programming in 16-bits. I know all the commands in assembly that an 8086 computer can handle. 32-bit programming is something new to me. It is of course cool to program in 32-bits, as you can move more data faster at a time, but I don't feel very comfortable when programming in it. That is why I will first write my driver for the internet to work in real mode. Once it works, I will transfer it to 32-bits.
As you see, it was difficult for me to choose protected mode instead of real mode. I used to write in real mode all the time, arguing that it would work on an 8086, however usually people with Internet access have at least a 386... and that is all I need now.
The main problem with starting this project is figuring out how to connect to the Internet. The only Internet connection I currently have is through a linksys wireless-g usb adapter... Yes, it is quite unfortunate.. I have no experience with connecting to usb devices at all. A wireless usb device seems out of the picture.. even Linux usually doesn't run it without the original driver. I do not think I will be able to emulate the driver.
Then there is ethernet. Out of all ethernet cards, I found the DP8390 NIC documented the best. I never had any experience programming the DP8390 NIC, so I don't know if I could get it to work. I would have to buy this card and somehow connect my test computer to the router. My 486 test computer only has ISA ports. Does anybody where to buy a good ISA ethernet card that has this DP8390 NIC chip?
I of course have no experience programming this thing.. I don't know if I will get it to work. My main documentation comes from http://www.osdever.net/downloads/docs/W ... DP8390.zip If I get the card, I will have to figure out how to extend the ethernet from my router to my computer... However there is a third option:
Dial-up. Horribly slow.. need to pay for the extra phone line and Internet service, and need to buy a modem. However, if it is an external serial modem, I will probably be able to program it. Plus, I have an unused telephone line right next to the computer.
So, either find a cheap card with the DP8390 NIC chip that connects to ISA, or get dial-up. Any suggestions? I wish this were a simpler process.. Perhaps you know a better solution?
Thank you for reading through. I hope that you can provide some type of hint or suggestion for either my plans, or my problem with the Internet.