Creating an Operating System from Scratch: Looking for Advice

In summary, the person was trying to create their own operating system from scratch, but had trouble with the C libraries that they were using. They stated that they would like to eventually make OSs that run specific hardware, and that they were a beginner in assembly. They also mentioned that they would need help from someone if they wanted to pursue this goal.
  • #1
STAii
333
1
Did any of you ever try to program his own operating system ?
I have been trying to do so for some weeks now, i made some little stuff (a loading message, showing a picture on screen ...), but this is far from doing a real OS !
(all was did in assembly)
Anyone here has experience in that ?
 
Computer science news on Phys.org
  • #2
I know and old member called Feztaa was creating his own unix based OS. I personally have not. Mactech?
 
  • #3
Well to start, no I haven't. I've played a bit in years gone by with assembly but mainly, well pretty much exclusively, in win32.

Just out of interests sake:

What compiler are you using?
Are you starting from absolute scratch?
Do you have a plan of what you want or what you fantasise?
What platform, cross platform?
Are you serious or is this just a laugh?

[Removed Broken Link]

This link seems to be a good 'from scratch' starting point.

[Removed Broken Link]

This one for other OSs, from scratch and linux or DOS like

http://www.osdev.org

This one also seems obvious

[Removed Broken Link]

BeOS seems to be a good model and this group is working on an open source clone. They've got some source and if you look around there's a link to NewOS which is what it this open source version is based on

Raavin :wink:
 
Last edited by a moderator:
  • #4
Well, i found some other free OSs online too.
What compiler are you using?
I am using A86, a compiler that is almost like TASM, but is kind of free (well it is not exactly free, but i assume so ).
Are you starting from absolute scratch?
Yes, i am starting from scratch, and this is getting way too hard (From the begining).
My orignal idea was to make only the basics in Assembly, and then do the real work in C, but i still didn't figure out how to make the whole thing (problems with the fact that the C libraries that i have are made for Win !)
Do you have a plan of what you want or what you fantasise?
You wouldn't believe how simply my fantasy is so far !
I only want to load a background, be able to identify a pointing utility (and the keyboard), and drawing a cursor on screen :smile:, can you think of anything simpler ?
Are you serious or is this just a laugh?
Till now it is only a kind of test, a way to gain some experience in those stuff.
But i am planning someday to make totally customized OSs, or maybe make OSs that run certain hardware (only made for my OSs), so that people will have to use my OS with that hardware (tricky, right ? :wink:)

I am really a beginner in assmebly, so i have a little question.
How can i load a file without using the interrupter 21h ?
Cause as you know INT 21h depends on DOS, therefore i cannot use it :smile:.
Thanks.
 
  • #5
Start with a text-based system... it will be much easier!

You need to write your own filesystem drivers first, before you can load any files. :wink:
 
  • #6
As I said, my assembly experience is almost exclusively win32, and mainly for cracking in my younger days, so manipulating disassembles files and editing in assembly or hex. I do feel much more comfortable with assembly than other languages, although I probably haven't taken much time with others. I see higher level languages as trying to write a story with a word processor that, instead of writing individual letters, only allows predefined sentences. Just an opinion.

I agree with the text based/command line system as a first go, but I do believe that if you are going for a GUI based goal, then starting with that and throwing a shell on top like win3/win95 or linux isn't the way I'd go. I'd be looking for graphics to be native to the system. Not sure how you accomplish this though.

As far as the windows libraries go I'm not entirely sure but one suggestion is to look at http://www.xosl.org/ which is not an OS but an open source graphical OS loader. It might give you a start at what libraries to use.

If you are serious and you want a research assistant I'd be happy to do what I can. If I can't find it on the internet, it just ain't there.

Raavin
 
  • #7
Originally posted by damgo
Start with a text-based system... it will be much easier!
Well as you have noticed, my OS does not have any functions, so ... how will this be done in a text-based way :wink: ?
Kind of a message shows, then no prompt, no nothing ? (i can show the message easily)
You need to write your own filesystem drivers first, before you can load any files. :wink:
Yeah, it seems so, but since this is far more complicated then what i was planning to do, i will drop it for the moment.
Originally posted by Raavin
I see higher level languages as trying to write a story with a word processor that, instead of writing individual letters, only allows predefined sentences
A very good analogy, i totally agree.
When you are doing assembly, you feel you are the controller of everything, while you always find limits in other language (i tried VB for a looooooong time ! Maybe C is more powerful than VB anyway).
I agree with the text based/command line system as a first go, but I do believe that if you are going for a GUI based goal, then starting with that and throwing a shell on top like win3/win95 or linux isn't the way I'd go. I'd be looking for graphics to be native to the system. Not sure how you accomplish this though.
I agree that if a big OS is being planned, you have to make a good starting (and a usefull one, and able to be re-used) first, this will be a command based OS at the begining.
I have seen some OSs that are all GUI dependent, it seems it is harder to accomplish development in those than the ones bases on command lines first.
As far as the windows libraries go I'm not entirely sure but one suggestion is to look at http://www.xosl.org/ which is not an OS but an open source graphical OS loader. It might give you a start at what libraries to use.

If you are serious and you want a research assistant I'd be happy to do what I can. If I can't find it on the internet, it just ain't there.
I will check the site now.
And thanks for your offer, i will not forget it when i get serious.
 
  • #8
C is waaaay closer to assembly than VB! If you don't include libraries, it's actually fairly straightforward to see how your C code gets translated into assembly. You can also inline assembly code into your C as needed, which is very useful for low-level stuff like OS's.

BTW, Staii, how much do you know about Linux? You might consider installing and playing with its command-line and programming stuff... it gives you a much better feel about how things work, and what the OS does, than Windows. It's also IMO a far far better environment for serious low-level programming.

Couple question?

- You are running in protected mode, right? :)

- Do you know how to get keyboard input?

- Do you know how to set up interrupt tables and handlers?


http://www.tldp.org/LDP/tlk/tlk.html has a good overview of the stuff a normal OS does.

Here are some links to classes on OS design... mostly these focus on advanced and hardware-independent stuff, but you still might find them a little useful:

http://www.cs.sfu.ca/CC/760/tiko/lecnotes/
http://www.cs.nyu.edu/courses/spring03/V22.0202-002/class-notes.html
http://www.cs.oberlin.edu/faculty/jdonalds/341/ [Broken]

Have fun... I haven't ever written an OS myself, but some of my friends did (or at least started too) and I have a basic idea of how things are setup... so I might be able to answer a few questions.

(PS - The problem with Win3/9x wasn't the command-line base, it was running on old code that didn't use modern (386+ on PCs) memory management (protected pages) and multitasking features. Even WinNT has a command-line base (you can get to it in the install), as does UNIX/Linux.)
 
Last edited by a moderator:
  • #9
I'm pretty sure that for win95 and up (98 and up at least), that the command line bits aren't actually required for the OS. I'm pretty sure you can safely delete them, command.com etc. with no ill effects. Unless of course you need to load some stuff from dos before windows loads.

You can pump out a bootable dos disk by typing sys a: in the run dialog or a dos box.

Raavin
 
  • #10
Originally posted by Greg Bernhardt
I know and old member called Feztaa was creating his own unix based OS. I personally have not. Mactech?

i remember talking to him so much.. i miss the old PF. I personally haven't either.
 
  • #11
Is anybody really interested in this topic? I played around with low-level programming for a while, and a couple friends of mine wrote their own OSs for our school's OS design class. I can drone on and hit on the basics, if ppl want to hear it...
 
  • #12
Hi,

I know nothing, I'm totally illiterate but there're good books by a good author out there that'd help you much:

All books are by Andrew S. Tannenbaum published by Prentice-Hall.

Operating Systems: Design and Implementation
Modern Operating Systems
Distributed Operating Systems (well, you need something a bit bigger than a PC/Mac/whatever)

Just finished his "Computer Networks." Great book! Great author! And you may find a free eBook version presented legally/illegaly.

If you're going the Assembly way, I think you'll also need Norton Guides with a few Assembly guide files. NG runs on MS-DOS as a TSR. It was a light in my dark hours of doing image processing with Assembly.

Writing C mixed with some extern calls to handcrafted Assembly procedures can help a lot to make your task easier and the outcome closer to optimum. There is only the burden of understanding stack structure for extern calls to pass parameters. That was what I never got to understand!
 
  • #13
damgo, I would be interested in hearing the basics.
 

1. What is the first step in creating an operating system from scratch?

The first step in creating an operating system from scratch is to determine the purpose and goals of the operating system. This will help guide the design and development process.

2. Do I need to have a strong programming background to create an operating system?

Yes, having a strong programming background is essential for creating an operating system from scratch. You will need to be proficient in a low-level programming language such as assembly or C/C++ to write the core components of the operating system.

3. What are the key components of an operating system?

The key components of an operating system include the kernel, which is responsible for managing system resources and providing a bridge between hardware and software, the file system, which manages the storage and organization of data, and the user interface, which allows users to interact with the system.

4. How long does it take to create an operating system from scratch?

The time it takes to create an operating system from scratch varies depending on the complexity and goals of the system, as well as the programmer's experience and resources. It can take anywhere from several months to several years to develop a fully functional operating system.

5. Can I use existing code or frameworks to create an operating system from scratch?

While it is possible to use existing code or frameworks as a starting point for creating an operating system, it is generally recommended to write the code from scratch. This allows for greater control and customization, and ensures that the operating system is tailored to the specific goals and needs of the developer.

Similar threads

Replies
4
Views
997
  • Computing and Technology
Replies
6
Views
1K
  • Programming and Computer Science
Replies
2
Views
1K
  • Computing and Technology
Replies
21
Views
2K
  • Computing and Technology
Replies
30
Views
12K
  • Computing and Technology
Replies
2
Views
2K
  • Classical Physics
Replies
13
Views
835
Replies
19
Views
2K
  • Computing and Technology
Replies
18
Views
1K
  • Programming and Computer Science
Replies
6
Views
1K
Back
Top