Best Launguage for OS development (Apart from ASM)

Page 1 of 1 [ 10 posts ] 

Madbones
Veteran
Veteran

User avatar

Joined: 7 Mar 2010
Age: 27
Gender: Male
Posts: 777
Location: In the zone

13 Apr 2011, 7:24 pm

I want to make an OS (As a project).
Yes, im a crazy idoit.
But I want to do it, I have the time, I almost have the skills (I know basic-moderate Objective C but im by no means ready, but when I have learnt OBJ C Im wondering what I should learn next).
This OS will need a GUI.
Im prepared to do over 8000 hours of code or more.
I dont care how long it takes, or how hard it is, I will enjoy doing it (Programming is my special intrest).
I was thinking of developing it in Java, but it would not be very stable is my guesses.
Allot of people have said C++, is that a good idea?
Thanks



SilverShoelaces
Snowy Owl
Snowy Owl

User avatar

Joined: 7 Nov 2010
Age: 33
Gender: Female
Posts: 156

13 Apr 2011, 7:38 pm

You're not a crazy idoit. And if you do have the skills to program your own OS, you certainly aren't an idiot, either.

The first thing I would do if I were to want to program my own OS is go to the Linux forums. I don't think the majority of people on this site are nearly knowledgeable enough about operating system programming to help you, and those who are might not see this post. Most people who use Linux are at least a little savvy with some sort of code.

I'm no programmer myself, but I do know that in my college all the OS classes are at very high levels. So you have my admiration, sir or madam. (I can't tell which you are from your post, obviously.)



iceb
Veteran
Veteran

User avatar

Joined: 26 Apr 2007
Age: 67
Gender: Female
Posts: 1,562
Location: London UK

14 Apr 2011, 1:25 am

Most if not all forms of *nix are written in C


_________________
Wisdom must be gathered, it cannot be given.


Fuzzy
Veteran
Veteran

User avatar

Joined: 30 Mar 2006
Age: 51
Gender: Male
Posts: 5,223
Location: Alberta Canada

14 Apr 2011, 9:59 am

Follow through on one of the linux from scratch how-tos. You learn lots about what you will need to create.

What I am currently doing it recreating some of the user interface stuff, such as docks, file managers and menus. Later I would like to look into modifying one of the window managers.

So really, you can approach the problem from two directions at once and take guidance from someone elses experience. This will ease your task.


_________________
davidred wrote...
I installed Ubuntu once and it completely destroyed my paying relationship with Microsoft.


Madbones
Veteran
Veteran

User avatar

Joined: 7 Mar 2010
Age: 27
Gender: Male
Posts: 777
Location: In the zone

14 Apr 2011, 12:13 pm

SilverShoelaces wrote:
You're not a crazy idoit. And if you do have the skills to program your own OS, you certainly aren't an idiot, either.

The first thing I would do if I were to want to program my own OS is go to the Linux forums. I don't think the majority of people on this site are nearly knowledgeable enough about operating system programming to help you, and those who are might not see this post. Most people who use Linux are at least a little savvy with some sort of code.

I'm no programmer myself, but I do know that in my college all the OS classes are at very high levels. So you have my admiration, sir or madam. (I can't tell which you are from your post, obviously.)

Why thank you!
And also, tanks for the reccommendations.
I asked on other comunities (not Linux ones) and they all thought I was crazy.
Now im getting somewhere!



Madbones
Veteran
Veteran

User avatar

Joined: 7 Mar 2010
Age: 27
Gender: Male
Posts: 777
Location: In the zone

14 Apr 2011, 12:14 pm

Fuzzy wrote:
Follow through on one of the linux from scratch how-tos. You learn lots about what you will need to create.

What I am currently doing it recreating some of the user interface stuff, such as docks, file managers and menus. Later I would like to look into modifying one of the window managers.

So really, you can approach the problem from two directions at once and take guidance from someone elses experience. This will ease your task.

Great thanks.
Getting even thuther.
Where can I find the tutorials that you where talking about?
Thanks so much :)



Fuzzy
Veteran
Veteran

User avatar

Joined: 30 Mar 2006
Age: 51
Gender: Male
Posts: 5,223
Location: Alberta Canada

14 Apr 2011, 1:04 pm

Madbones wrote:
Fuzzy wrote:
Follow through on one of the linux from scratch how-tos. You learn lots about what you will need to create.

What I am currently doing it recreating some of the user interface stuff, such as docks, file managers and menus. Later I would like to look into modifying one of the window managers.

So really, you can approach the problem from two directions at once and take guidance from someone elses experience. This will ease your task.

Great thanks.
Getting even thuther.
Where can I find the tutorials that you where talking about?
Thanks so much :)


I am not surprised. The other OS adherents often have a mind set that their operating systems work with some inscrutable black magic.

For linux from scratch start here: http://www.linuxfromscratch.org/ and if thats too tricky (and it should not be) then google linux from scratch tutorial. Dont forget that you can run that from a virtual machine such as virtual box.

Going from the other way, tutorials on http://www.wxwidgets.org/ using c++ or python will get you started. wxwidgets is cross platform, but gtk, qt, can all be interesting as well. Tkinter is pretty ugly though. They all have python versions as well as c/c++.

If you have linux boxen, specifically debian/ubuntu/mint you can use
apt-get source conky

to get the source for conky, for instance.

conky is a monitor that embeds in the wallpaper, and you can make it do all sorts of interesting things. Its probably a good start, and you can script it to watch your changes. Maybe later you can port it or recreate it in your operating system. Its not a large/complicated application.

Here is a screen cap to show it in action. http://cache.gawker.com/assets/images/l ... 9922_b.jpg It looks like they have three instances running there.

And lastly, ask many questions.


_________________
davidred wrote...
I installed Ubuntu once and it completely destroyed my paying relationship with Microsoft.


MDM
Snowy Owl
Snowy Owl

User avatar

Joined: 30 May 2010
Age: 30
Gender: Male
Posts: 126
Location: Montana, USA

14 Apr 2011, 2:51 pm

I'm writing an OS as well. I recommend asm and C, C++ is generally a bad choice for beginners as the runtime is more complex as well as it can be slower if you don't know what you're doing. Also, throw away any aspirations you have for having a GUI - at least for 1.0. Also, you should realize when you have a GUI, it probably won't be anything fancy, probably an extremely low resolution GUI thats a little bit laggy. Graphics code is some of the hardest code to write, and least documented code to write.

Also since you use obj-c I presume you're a mac user. As a mac user you probably have gcc-llvm or at least llvm-ld (and even if you don't, the default version of ld isn't good). Install a development tool of the latest gcc version (including gcc and binutils). Make sure to install the tools that are used are for the correct architecture that you wish to compile to.

Although lots of people use GRUB, I recommend rolling out your own bootloader/MBR. This will help you get into asm and low level programming in general.

Java is out of the question - any language with a big runtime is a definite no. If you really wanted to use Objective-C, it is a possibility, however, the runtime for objc is tough, and its a little bit slow.

If you want to get serious into making an OS, I recommend getting an EE book, a book on Unix, a book on Minix (preferably the one written by Andrew Tanebaum), a good hardware book (I think several OS devs liked The Indispensable PC Hardware Book), also a good book for getting into asm would be the Graphics Programming Black Book. You'll probably want to learn how to use NASM, as well as you will want to learn the gcc ld scripting language. Learning how to use GCC styled inline assembly is also quite important.

If you want to get serious with your OS, you also should either be POSIX compliant, or have a *nix like library so that you can port GCC and other programs to your OS.

The average 1.0 OS that I see is about 10,000 lines. While this is a small amount of code, this often times takes 1-3 years to write. It's very difficult code. When Linus created Linux, he was an above average programer, wrote an extremely simple OS with an extremely simple (and out dated *cough cough*) kernel model. Also he didn't really have to write any of the OS programs because of GNU. Even with all of that though, it took him a year of extremely hard work to write his OS. You're probably going to want to write a hybrid kernel instead of a monolithic or a pure micro though, so expect to spend even more time than him.

There are probably 15-30 modern OS tutorials, however, don't follow one of those tutorials for your final OS project. These tutorials are not made to become real OSs. They're made to teach you the basics. If you follow one of these tutorials, you are going to need to rewrite your OS at some point, or at least a large amount.

Also it should be noted that writing your OS from scratch is completely different than writing a linux variant. A large amount of people just want to write a new interface and things along that line - if you are one of these people, stick with writing a linux variant.

Good luck!



Fuzzy
Veteran
Veteran

User avatar

Joined: 30 Mar 2006
Age: 51
Gender: Male
Posts: 5,223
Location: Alberta Canada

14 Apr 2011, 8:56 pm

Great advice MDM. Great resources too.

I think you further summed up the idea that I was putting across. By looking at several different OS', you get an idea of how they work in general, and this is a good start on imagining the workings of your own. Linux from Scratch will give Madbones a list "I need something that does this, and this, and..." so your idea of writing a boot loader is great. Thats just the sort of element I meant.

On the other hand, coming from both sides lets you circle the drain so to speak. It will give Madbones and idea of what the future desktop is going to need.

Here is a list of 10 alternate operating systems that are not windows, linux or osx. One is BSD though... Some are tiny and would give a good overview of what you might like to do.

http://www.techradar.com/news/software/ ... ems-934484


_________________
davidred wrote...
I installed Ubuntu once and it completely destroyed my paying relationship with Microsoft.


MDM
Snowy Owl
Snowy Owl

User avatar

Joined: 30 May 2010
Age: 30
Gender: Male
Posts: 126
Location: Montana, USA

14 Apr 2011, 9:26 pm

I agree completely, Fuzzy.

Also, make sure to bookmark osdev.org (there is a wealth of information there that will be invaluable). A good OSdev forum is http://forum.osdev.org/ although, I recommend only reading there for quite a while - the members there are very impatient, and although intelligent and knowledgable, they don't like inquiries that they consider below them or obvious.

Also, I forgot to mention in my original post, you will want to grab a copy of Intel's manuals.