Skip to main content
gamedev.net
🔒 Locked

writing operating systems

Started by clum Aug 13, 2003 at 9:28 AM 20 replies 2.3k views
Original Post
clum
clum
Has anyone tried to write an operating system, even a very, very basic one? It seems quite complicated. When I last installed Linux, I left a little partition open just in case I want to. Look at this, there seems to be lots about the subject, especially for hobbyist programmers.
Zorx (a Puzzle Bobble clone)Discontinuity (an animation system for POV-Ray)
Jakarta
Jakarta
I once went to some page which had like 20 lines of ASM code and like 10 lines of C code for the OS. That''s not too bad. Allthough I never tried it but I trust that it works.
DukeAtreides076
DukeAtreides076
Yeah I tried that once. I managed to get a bootsector onto a floppy and boot it into real mode before i lost interest and went back to games. If youre going to do it you should get the Bochs x86 emulator so you dont have to restart your machine every time.
clum
clum
Cool. I just discovered that grub (which I use - I have Windows and Linux) comes with a sample kernel which I compiled (it took me a while how to do that in a bootable way), put on my extra partition, and added to my boot menu. It doesn''t do much, but its pretty cool. I''m trying to setup bochs but its harder than it looks (and it looks hard).
Zorx (a Puzzle Bobble clone)Discontinuity (an animation system for POV-Ray)
dede
dede
A friend once did it for a class, and it was rather, interesting.

It took him a good 6 months of work, and when he was finished, it actually work, and had a GUI(a text GUI, but a GUI nonetheless).

I told him I''d write some programs using it, but I don''t think he finished it...

~~~~~
"Video games could have prevented this tragety." - mortisthecat
Download and play Slime King I.
Foxostro
Foxostro
I tried writing an operating system a few months ago. It was fun, but I lost interest after my floppy disc drivers nuked my harddrive

Now I leave the OS writing to the competant/professionals

My Website
Ravuya
Ravuya
OS writing would interest me more if I had something other than my work machines to do it on. Maybe if I buy that old Atari 8-bit...
clum
clum
I got bochs working, finally (I have no idea why they made it so complicated).
Zorx (a Puzzle Bobble clone)Discontinuity (an animation system for POV-Ray)
BradDaBug
BradDaBug
Hey! Bochs looks pretty cool!

Anyone ever used the BSVC 68k simulator? Is there something like that for the x86?
I like the DARK layout!
RamboBones
RamboBones
I once spent months trying to get my own OS working. I could do real mode fine, but since I couldn''t use my compiled C code in that I tried to get protected mode working, that''s where I failed . I even downloaded a protected mode kernel, but yep you guessed it not even that worked . Try it if you want, but be prepared for failure.



GDSAUBY GameDev Society For UnBanning YodaTheCoda
If you want to see yoda unbanned then put this in your sig
thooot
thooot
I''m currently semi-working on an OS. So far I have a boot loader with A20 enabled, protected mode, and I can use C code. Still need to port the c standard library though (that''s a pain).
blueEbola
blueEbola
I''ve made attempts before, but the farthest I ever got was writing some simple text on screen and making the BIOS initiate an unusual beeping noise. After that I got bored and went back to games
Dreddnafious Maelstrom
Dreddnafious Maelstrom
id really like to but its such an ambitious project, i like to stick with things i can forseably finish in my lifetime.
"Let Us Now Try Liberty"-- Frederick Bastiat
Raymondo
Raymondo
quote:
Original post by blueEbola
I''ve made attempts before, but the farthest I ever got was writing some simple text on screen and making the BIOS initiate an unusual beeping noise. After that I got bored and went back to games

Same here.

Oluseyi
Oluseyi
quote:
Original post by Dreddnafious Maelstrom
id really like to but its such an ambitious project, i like to stick with things i can forseably finish in my lifetime.
The way I see it, the mistake far too many make is trying to write the OS bottom-up. I think it would be much more attainable if your OS design was sufficiently close to something that exists, and was in the public domain or covered by an Open Source/Free Software license, that you could use the existing codebase as scaffolding and replace portions when "higher" levels required more functionality than the existing portions provided. That''s how Linus wrote Linux, by the way.

I mean, how much better can you write a bootloader? Why should you write a bootloader, given the availability of OS-agnostic options like LILO and GRUB? (Especially GRUB.) Where your OS is likely to try something different is in userland - and perhaps in small ways in the kernel - so why not reuse?

That''ll be 2¢...
superpig
superpig
quote:
Original post by dede
a text GUI


Uhm, contradiction in terms much? I think you maybe mean a ''shell...''

I''d be quite interested, at some point, in building an OS using something stable like Linux as the kernel (cos that way I benefit from the work of people much smarter than me, and of course much more hardware support).

So, my own filesystem, shell, eventually a GUI, and so on. Could be fun working on the ''applications'' section of the operating system.

Superpig
- saving pigs from untimely fates, and when he''s not doing that, runs The Binary Refinery.
Enginuity1 | Enginuity2 | Enginuity3 | Enginuity4
Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse
Jamie7
Jamie7
quote:
Original post by Ravuya
Maybe if I buy that old Atari 8-bit...


LOLLS!!@@!

well I made JamieOS once.. kicked ass


later

Crispy
Crispy
We should make a collective effort to top MS with a new open source freeware OS: GDinux
"Literally, it means that Bob is everything you can think of, but not dead; i.e., Bob is a purple-spotted, yellow-striped bumblebee/dragon/pterodactyl hybrid with a voracious addiction to Twix candy bars, but not dead."- kSquared
bpj1138
bpj1138
If anyone''s interested, here''s my "flat mode" bootsector + C program compiled with NASM and GCC.

http://www.geocities.com/bpj1138/hello32.html

I used this as a starting point to write a Java VM as the "kernel" of the OS. It used green threads so the entire system was running off the C code of the VM. I got a text console and keyboard drivers working, both written in Java, believe it or not. I also got most of the Java base classes done. The problems were that it was pretty damn slow, plus my garbage collector was flawed or rather was a conceptual error on my part (reference couting gc)...

One day, I''ll probably go back to it, do a rewrite.
--bart
Dreddnafious Maelstrom
Dreddnafious Maelstrom
quote:
Original post by Oluseyi
quote:
Original post by Dreddnafious Maelstrom
id really like to but its such an ambitious project, i like to stick with things i can forseably finish in my lifetime.
The way I see it, the mistake far too many make is trying to write the OS bottom-up. I think it would be much more attainable if your OS design was sufficiently close to something that exists, and was in the public domain or covered by an Open Source/Free Software license, that you could use the existing codebase as scaffolding and replace portions when "higher" levels required more functionality than the existing portions provided. That''s how Linus wrote Linux, by the way.

I mean, how much better can you write a bootloader? Why should you write a bootloader, given the availability of OS-agnostic options like LILO and GRUB? (Especially GRUB.) Where your OS is likely to try something different is in userland - and perhaps in small ways in the kernel - so why not reuse?

That''ll be 2¢...



hehe, thanks for the input, IIRC you were talking about writing an OS some time ago and i believe your plan was to use the existing Linux kernel and write your own file system. Since i read this post ive been googling a bunch of sites about OS construction and i want to toss some noob systems programmer questions at you, feel free to answer or ignore.

I may reveal a lack of knowledge about what goes on under the hood of a typical OS, because im not a computer scientist, i am(was) a business major. I went to B&N today trying to find a book on the subject but no luck. If you have knowledge of a good book i could educate myself with then please speak up.


* anyone can tackle these but if you''re just taking a stab at it please qualify your answer.

1) Assuming i use a prewritten bootloader would it still be possible to have the project be proprietary?

2) Can i use Cpp for development or would i need to use straight C to achieve a workable speed?

3) Can i use Visual Cpp or would i need a different compiler?

4) I have no experience with WINE but from what i understand it will run Windows programs without any hitches, if this is correct does it suffer a big performance hit? I''m also assuming that it achieves its emulation thru COM technology, is that assumption on target?

5) What is the signifigance of the file system? Ive found plenty of documentary on several file systems.(EXT/[23], Reiser, Joliet, FAT32, HPFS) but nothing on NTFS. I understand empirically what a file system does but i have no grasp of its signifigance with compatability.

6) Im assuming when writing an OS from the ground up you would have to provide your own HAL, are most devices still based on DOS so that a single driver might serve a large range of similar devices or are most drivers manufacturer specific?

7) How much knowledge of x86 compatible assembly would be required to get the job done?

Anyway, thanks for entertaining some noob questions, from what i understand this is the toughest task available to a coder and quite possibly beyond my skill level, but its certainly an interesting task.
"Let Us Now Try Liberty"-- Frederick Bastiat

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.