954,498 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

designing an operating system

I'm not sure if this is the right spot to put this. I was wondering how would you create and operating system like linux or windows or novell. What programs would you use. I've always wondered how it was done. I would love to learn to create my own.

viperman224
Junior Poster
183 posts since Dec 2003
Reputation Points: 29
Solved Threads: 1
 
I'm not sure if this is the right spot to put this. I was wondering how would you create and operating system like linux or windows or novell. What programs would you use. I've always wondered how it was done. I would love to learn to create my own.

To achieve this you would need to program in a low-level language such as ASM (usually), but hey this is a C++ forum so I'll explain how to do it in C++.

It is essential to understand the heart of the OS, which is called the kernal, is the MOST important part of an OS. Fancy graphics and SVGA coding can all come after you have developed a solid hardcore kernal. Now as for what programs you would use, believe it or not you can use any standard command line compiler or IDE (such as Borland or MSVC++). The most important thing about using an OS is how its loaded. All hardrives and bootable media have something called boot sectors (typcal near front cylinders of the media) that allow "execution" of your OS. As long as you comply with specific system standards and handle all your RAM right then your OS should be properly loaded. Making an OS is a in-depth subject, when I first took a shot at it the below tutorials really helped me out. Check it out.

Tutorial on making a C/C++ OS:

Part 1: http://www.1cplusplusstreet.com/vb/scripts/ShowCode.asp?txtCodeId=6718&lngWId=3

Part 2:
http://www.1cplusplusstreet.com/vb/scripts/ShowCode.asp?txtCodeId=6743&lngWId=3

BountyX
Posting Whiz in Training
230 posts since Mar 2004
Reputation Points: 28
Solved Threads: 9
 

This was originally posted in the tutorials section of the site. It got moved to C++. I think Computer Science is more appropriate for it so it's being moved once again ;)

cscgal
The Queen of DaniWeb
Administrator
19,422 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 230
 

Sorry if I'm being in any way rude by this, but do you understand the undertaking you would have to go through in creating an OS? Bill Gates has a little empire for a reason. The OS would have to be adaptable to modern security risks and have the ability to adapt to software designers specifications.

I admire your desire to build one, but understand it is quite the task.

ajax-the-techie
Light Poster
41 posts since Mar 2004
Reputation Points: 10
Solved Threads: 1
 

he can try to build a kernal, thats what counts, and proven by linux a kernal can be a one man job, who knows maybe he will make an awsome kernal and distribute the source and in 4 years it will be graphical...

but in the rare occerence of the stated situation above, the most important thing is by trying to develop an OS he will understand the guts of how an OS works. Good Luck, despite an OS being a huge task and a duanting procedure, you can still keep it small and practial, creating nessisary OS's to repair computer complications would be a good application.

EDIT: remember an OS is just a system level environment, hello world can be an OS if developed and installed correctly.

BountyX
Posting Whiz in Training
230 posts since Mar 2004
Reputation Points: 28
Solved Threads: 9
 
infamous
Junior Poster in Training
77 posts since Mar 2004
Reputation Points: 47
Solved Threads: 2
 

the linux kernel was a one man job 13 years ago... with all due respect to Torvalds (and the man deserves a lot of it), I doubt he would be able to write the gargantuan beast we have now, all on his own

well, he probably could, but it would be more complicated now by orders of magnitude than what it was before...

but yes, you're of course right. viperman224 can write a basic dos. its quite an undertaking though...

I would recommend doing a LFS install first, so that you see how an OS these days fits together (as good as an article could be, nothing beats experience). better to see what end result you want than to start writing c without a clear image of what you want as a goal

or maybe a LFS of an older kernel would be better...they would be simpler without all the extra security and networking routines. you can always learn about those later...the important bit is to understand how dos works :)

but yeah. an interest in doing something is the first step towards much fun (and long nights...and an annoyed girlfriend...)

Olio
Newbie Poster
18 posts since Mar 2004
Reputation Points: 11
Solved Threads: 0
 

The most obvious implementation is to write a cooperative multitasking system whereby when one application has finished doing stuff with the CPU, it calls some kind of yield function, or calls a wait for message function.

In the implementation of that you then have to switch to another task if necessary - possibly by calling setjmp() and longjmp() to save the stack and the cpu context (Assuming this is in C)

Otherwise you'll have to switch stack and save the CPU context manually, which will be CPU specific and may involve assembly language.

Once you've figured out which process needs to run you can then call longjmp() back to the context of that process, and continue it from where it left off. ect.....


On the other hand I would not suggest a DOS ......It sounds like a fun project, but it seems to me that people doing these kinds of projects are building desktop environments/GUI's not an operating systems. With that said, if I may make a suggestion, try using a MACH base rather than a DOS base. Remember the whole system is limited by the functionality of the kernel, plus MACH will just make a lot of things much easier on account of it's messaging system being, well actually existing. ;) This will enable you to not only easily develop software for it, but also to easily extend its functionality.
Make any sense?

WEATHER CHANNEL
Junior Poster
Banned
150 posts since Jan 2004
Reputation Points: 46
Solved Threads: 1
 

It may be too much for 1 person...count me in on it

Snyper
Newbie Poster
2 posts since May 2004
Reputation Points: 11
Solved Threads: 0
 

can you create an os by using visual basic 6...? its all i've got....

jchaike
Newbie Poster
9 posts since May 2004
Reputation Points: 10
Solved Threads: 0
 
can you create an os by using visual basic 6...? its all i've got....

I don't think you could do it with VB 6.

I don't think it has the neccesary access to the low-level functions that are required to build an operating system. If it had those, you'd need to compile the code to make it work.

From what I've seen, it's best to do the kernel and base progs in C and ASM, and then to do the base GUI stuff in C++. From there, use whatever else you want to do the rest.

alc6379
Cookie... That's it
Team Colleague
2,820 posts since Dec 2003
Reputation Points: 186
Solved Threads: 147
 

Hi,

No, cannot use VB, as it is an interpreted language, meaning it needs libraries (Microsoft ones) to link into the program to complete the coding.

You could, using VB6, write a small virtual environment that might have some process control and that sort of thing. Ugly.

Best bet is C or C++. But then, you need to design a file system in order to get that kernel working. It is an undertaking!

Enjoy.

Christian

kc0arf
Posting Virtuoso
Team Colleague
1,937 posts since Mar 2004
Reputation Points: 121
Solved Threads: 57
 
Hi, No, cannot use VB, as it is an interpreted language, meaning it needs libraries (Microsoft ones) to link into the program to complete the coding. You could, using VB6, write a small virtual environment that might have some process control and that sort of thing. Ugly.

Which, I'd imagine, you'd have to write in C or asm.

I dunno... that's kind of interesting, if you think about it-- an interpreted OS! Imagine, a system whose entire userland was comprised of interpreted scripts-- say, Python, for instance. The kernel could be a modified interpreter, which provided all of the I/O functions and process control, in addition to interpreting all of the scripts.

...I dunno... Think that'd be as slow as a dog, though?

alc6379
Cookie... That's it
Team Colleague
2,820 posts since Dec 2003
Reputation Points: 186
Solved Threads: 147
 

Try 'EasyOS' to get started.. it comes with all you need.
However remember that you should try making your own version of DOS before you even think of trying to remake Windows...

Natso
Junior Poster in Training
51 posts since May 2004
Reputation Points: 10
Solved Threads: 1
 

can you give me a web link to "recreate ms dos"?

jchaike
Newbie Poster
9 posts since May 2004
Reputation Points: 10
Solved Threads: 0
 

and also maybe a link to get EasyOS
-JCHAIKE

jchaike
Newbie Poster
9 posts since May 2004
Reputation Points: 10
Solved Threads: 0
 

http://www.free2code.net/tutorials/other/20/os1.php?page=1&print=1

/\
||
An EasyOS tutorial... it has a link to the download of EasyOS as well.

Natso
Junior Poster in Training
51 posts since May 2004
Reputation Points: 10
Solved Threads: 1
 

Try WWW.OSDEV.ORG . That place is awesome!

As for VB or any interpreted language forget about it!
You'll find my discussions on it at OSDEV.

crazygray
Newbie Poster
3 posts since Jan 2008
Reputation Points: 10
Solved Threads: 0
 

Which, I'd imagine, you'd have to write in C or asm.

I dunno... that's kind of interesting, if you think about it-- an interpreted OS! Imagine, a system whose entire userland was comprised of interpreted scripts-- say, Python, for instance. The kernel could be a modified interpreter, which provided all of the I/O functions and process control, in addition to interpreting all of the scripts.

...I dunno... Think that'd be as slow as a dog, though?

i read in a MSDN blog about a C#.NET based system.

jbennet
Moderator
Moderator
18,523 posts since Apr 2005
Reputation Points: 1,826
Solved Threads: 601
 
i read in a MSDN blog about a C#.NET based system.


Probably similar to Sun's approach wherein they had a small bootloader (written in C, IIRC) which would load the JRE and then treat the JRE as the OS

Infarction
Posting Virtuoso
1,580 posts since May 2006
Reputation Points: 683
Solved Threads: 53
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You