Open Source OS source code wanted

Programming, for all ages and all languages.
Post Reply
draggy
Posts: 9
Joined: Wed Feb 23, 2005 12:00 am

Open Source OS source code wanted

Post by draggy »

hi to all mighty operating system coder and developer :D

I come before you to seek answer to my noob question.......

I know some ASM/C/C++........ But the problem is most educational open source operating system codes out there are hard to read and understand.... I was hoping that someone can point out few of these operating systems which their codes are simple and easy to understand for beginner like myself.

Thank you
:D :oops:
User avatar
Alboin
Member
Member
Posts: 1466
Joined: Thu Jan 04, 2007 3:29 pm
Location: Noricum and Pannonia

Post by Alboin »

M....I.....N....I....X.....! Oh M...I..N..I...X...! Oh where oh where did my little dog go!?

Uh...Minix was written for education purposes, and it is BSD. (Therefore, free.)

A suggestion, however, I don't think reading code will help you much in the area of learning. Try reading a book, on theory, or documentation. (The Intel manuals are a nice place to start.) If you understand your architecture, an OS is easy. It's the theory that'll bite ya. :wink:
C8H10N4O2 | #446691 | Trust the nodes.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Post by Combuster »

You can try my kernel:
http://dimensionalrift.homelinux.net/co ... a32_pc.asm
or alternatively
http://dimensionalrift.homelinux.net/co ... rces&root=

Its not really about best practices but if you prefer assembly over C it might be a nice read. There's more comments in there than what I normally do.

However as said before, its no real substitute for the osdev wiki and related reads.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
draggy
Posts: 9
Joined: Wed Feb 23, 2005 12:00 am

Post by draggy »

Thank for the reply and information......

I'm more preferred to read the codes on how they are be done...........
You can try my kernel:
http://dimensionalrift.homelinux.net/co ... a32_pc.asm
or alternatively
http://dimensionalrift.homelinux.net/co ... rces&root=

Its not really about best practices but if you prefer assembly over C it might be a nice read. There's more comments in there than what I normally do.

However as said before, its no real substitute for the osdev wiki and related reads.
I preferred C/C++ programming language


Thank
User avatar
Zacariaz
Member
Member
Posts: 1069
Joined: Tue May 22, 2007 2:36 pm
Contact:

Post by Zacariaz »

i dont think you wanna try avoiding assembly.
jnc100
Member
Member
Posts: 775
Joined: Mon Apr 09, 2007 12:10 pm
Location: London, UK
Contact:

Post by jnc100 »

Although I haven't looked at it much myself, from what I hear, as Alboin pointed out, Minix is a good bet and there is a book you can get which talks you through most of the code. In addition, there is something called Bran's development kernel, which I understand some people have followed.

Other than that, most of the contributors here have some sort of OS going, try checking out their websites. I guess some code is more documented than others. I seriously discourage you from looking at mine though (although it is C/asm) partly because it uses horrendous coding practices and partly because its in a bit of a state of flux at the moment. I do believe, however, that revision 125 gives you a screen full of a's, b's and c's, if that's your thing!

Regards,
John.
draggy
Posts: 9
Joined: Wed Feb 23, 2005 12:00 am

Post by draggy »

Zacariaz wrote:i dont think you wanna try avoiding assembly.
Then I need some serious low level assembly tutorial :D

Anyone got some serious low level assembly tutorial?

Thank
:D
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Post by AJ »

Hi,

x86 Assembly programming really isn't as difficult as it's made out to be, once you get the hang of the basic syntax - it's just a matter of getting to know the instructions you need for os dev, for loading the GDT, IDT, etc....

I would suggest that if you start with Bran's os dev tutorial, the small assembly stub that it gives you is more than enough to get started. I wouldn't suggest it, but you could just blindly copy the ASM bits from there.

If you are writing an OS, though, taking the time to learn a bit about assembly is good, as you should really know a bit about the chip you are intending to run your OS on. The intel manuals, which are free, are a good reference if you already know some ASM but don't know exactly which instructions you need when.

Also, the assembly you will need to write an OS (I assume this is what you mean by 'low level assembvly') is no different to the assembly you program apps in, other than the fact that you should not use any macros you haven't written yourself (or at least read the source of to ensure they don't use any system calls).

Cheers,
Adam
User avatar
elderK
Member
Member
Posts: 190
Joined: Mon Dec 11, 2006 10:54 am
Location: Dunedin, New Zealand
Contact:

Post by elderK »

Then I need some serious low level assembly tutorial Very Happy

Anyone got some serious low level assembly tutorial?
Yep, It's called the Intel System Developer's Manuals, particularly the x86 Architecture's Instruction set.

Failing that, The GNU Assembler (or NASM) references. NASM covers all of it's supported instructions in pretty generous detail.

The truth here is, you will not find much success in this area if you are not willing to invest serious time, either researching or tinkering (both, if you actually want to do something decent).

One of (if not THE most) important skills to learn, in general, is to be able to learn from specifications or generic references. This includes the Intel references mentioned above, as well as the various Chipset datasheets scattered around the Internet.

Look at what you want to achieve, understand what you have to learn to be able to accomplish that and realize, most importantly, that regardless of what people say, it is unlikely that you will revolutionze the entire computing world after 45 minutes of introducing yourself to Assembly.

;) Thats what dedication is for.

~Z
User avatar
JAAman
Member
Member
Posts: 879
Joined: Wed Oct 27, 2004 11:00 pm
Location: WA

Post by JAAman »

i agree -- get the intel manuals (link in my signature)

intel will send you (free of charge) hard-copies of the manuals (which i recommend -- get all 5 books)
these have a complete list of and description of each instruction (volume 2) with lots of details on the use of the instruction and side-affects of it and encoding charts and more, as well as a complete description of the internal operations of the CPU (the part which is the job of the OS to manage) in volume 3
draggy
Posts: 9
Joined: Wed Feb 23, 2005 12:00 am

Post by draggy »

:D
Speewave
Member
Member
Posts: 40
Joined: Fri Jun 22, 2007 1:11 pm
Location: The USA
Contact:

Post by Speewave »

Either FreeDOS or Minix.

if you want to go even further Get Debian Linux.

avoiding ASM can be harmfull to your project but i have seen OS's from Plain C\C++ so whatever if you know ASM on an Intel Pentium /// then your OS only can work on that. so getting the Intel Guides is good!
User avatar
os64dev
Member
Member
Posts: 553
Joined: Sat Jan 27, 2007 3:21 pm
Location: Best, Netherlands

Post by os64dev »

newos is simple enough though it contains a lot of code which makes a little harder again.
Author of COBOS
draggy
Posts: 9
Joined: Wed Feb 23, 2005 12:00 am

Post by draggy »

:D thank for all the reply
earlz
Member
Member
Posts: 1546
Joined: Thu Jul 07, 2005 11:00 pm
Contact:

Post by earlz »

I don't recommend looking at any of my OS source codes...they are really messy, and my main one, JouleOS, I wrote while learning C...I now know most every low level feature of C, but the codes is horrible! (also, I don't recommend doing that...you already have to learn a lot of things on the fly with an OS, much less a whole language!)



I am not good at reading manuals and specifications, though the Intel x86 manuals are a pretty good reference point...The floppy drive manual though, I probably never will understand...it jsut isn't specific enough for me....might work for you though..

For x86 stuff though, another good, quick, reference is http://www.ousob.com/ng/iapx86/
I have been using it for everything from OS deving, to emulator making, to more OS deving...it is just a great quick reference! but somethings it isn't specific enough on, so that is where the intel manuals come in!


(/me knows none of the above is written very well)
Post Reply