Making a little C-L OS?

tgp1994

New Member
Messages
33
Reaction score
0
Points
0
I was just going to try an educate my self on the ways of the computer, so since I *sorta* know some programming languages, I thought it would be cool to make a very small commandline OS for VMWare.

So I understand that the lowest language you can get to is ASM. And I've read tons upon tons of guides and information about ASM, but I usually just end up getting confused. I mean, it's giving me the impression that it's straightforward, but I don't have any idea what includes I need if I were to start out with nothing, and I these memory addresses, there doesn't seem to be any book that says what each one does. (Beep, print a string, w/e.)

If someone could help a bit, that would be great.
 

xav0989

Community Public Relation
Community Support
Messages
4,467
Reaction score
95
Points
0
Well, I've tried to program in Assembler once myself, but I stopped for the exact same reason as you. However, I believe that most OSes Kernels are built in C or C++ nowadays, so you should check that out.
 

ichwar

Community Advocate
Community Support
Messages
1,454
Reaction score
7
Points
0
ASM, lol. Why not at least start out with something simpler, like C, python, or Java? It will make learning ASM a good bit easier I think.
 

ah-blabla

New Member
Messages
375
Reaction score
7
Points
0
C is probably the best language for an OS, since it is can then be translated to ASM for you. (Unix, Linux, HURD, Solaris, even Window$ I think are written in C, earlier OSs were commonly written in ASM.) The only thing is C is quite a horrible language (a.k.a. low-level), which means you have to do memory management etc (and even more so with ASM), but that is to be expected if you are writing a kernel. I would recommend writing applications first before an os so that you get to know whatever language you are using well.
 

tgp1994

New Member
Messages
33
Reaction score
0
Points
0
So you can seriously write a program up in C and any PC will run it? (Well, I'm aiming at Intel pcs.) I bet there's a little more to it, but heck, I think C would be Easier than assembly. So then if anyone has any C guides to making stand alone programs that will run at boot time, that would be awesome. Also some favorite IDEs woulsd be nice too ;)

EDIT: And I'm not planning on making the next Microsoft windows or the next Ubuntu, just a simple thing where I can type hi and it says hi back or something. (And I'm not that lonely :p)
 
Last edited:

ah-blabla

New Member
Messages
375
Reaction score
7
Points
0
So you can seriously write a program up in C and any PC will run it? (Well, I'm aiming at Intel pcs.) I bet there's a little more to it, but heck, I think C would be Easier than assembly. So then if anyone has any C guides to making stand alone programs that will run at boot time, that would be awesome. Also some favorite IDEs woulsd be nice too ;)

EDIT: And I'm not planning on making the next Microsoft windows or the next Ubuntu, just a simple thing where I can type hi and it says hi back or something. (And I'm not that lonely :p)
Maybe look at the Linux source code. At best that from the early days where there wasn't as much of it. But if I remember correctly even the Linux kernel has some ASM in it. Getting the kernel into memory and starting it is probably the hardest part, so you might want to look at how kernels actually get loaded by a bootloader. (grub?)

BTW, a degree in computer science is definetely helpful here.

Update:// This might be interesting for you:
http://www.osdever.net/bkerndev/index.php
BTW, the page there is broken, read this instead:
http://www.osdever.net/bkerndev/Docs/intro.htm
 
Last edited:

tgp1994

New Member
Messages
33
Reaction score
0
Points
0
Lol too bad I'm only in Highschool. So could this possibly be a little too much for me? I mean, ya, I've done quite a bit of VB.Net, but that looks neither as simple nor as straightforward as this stuff. I'll take a look guys, thanks.
 

ah-blabla

New Member
Messages
375
Reaction score
7
Points
0
If you've only ever used VB.net then you definitely need to practice with C before trying to write a kernel. C is quite different from VB.net, notably being a procedural language whereas VB is object orientated, so programs in general are structured quite differently. In C you also have to learn memory management, which I think VB.net does for you. Then there's pointers and other strange things in C. But for a simple kernel that says hello you probably don't need to know too much. I would just go ahead and try, and see how far you get.
 

tgp1994

New Member
Messages
33
Reaction score
0
Points
0
Umm... what the heck... my post didn't post. Well, what I tried to say was, ya, I bet C is a lot different/harder the VB.Net. Do you or anyone else happen to know of any good C IDEs that preferably come with Intellisense/A list of C commands and a built in compiler?
 

ichwar

Community Advocate
Community Support
Messages
1,454
Reaction score
7
Points
0
Umm... what the heck... my post didn't post. Well, what I tried to say was, ya, I bet C is a lot different/harder the VB.Net. Do you or anyone else happen to know of any good C IDEs that preferably come with Intellisense/A list of C commands and a built in compiler?
If you're running windows, then Microsoft's Visual studios is a good choice. Otherwise, check out netbeans, I believe that will do C also, though I'm not sure. There is also a C plugin for eclipse, I think.
 

tgp1994

New Member
Messages
33
Reaction score
0
Points
0
Ya, I have Visual Studio Pro 2008, but it only does C++, VB.Net, and C# :( Too bad it doesn't do C.
 
Top