Page 1 of 1
Open Source OS source code wanted
Posted: Wed Jun 13, 2007 10:01 am
by draggy
hi to all mighty operating system coder and developer
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
Posted: Wed Jun 13, 2007 10:15 am
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.
Posted: Wed Jun 13, 2007 3:59 pm
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.
Posted: Thu Jun 14, 2007 1:06 pm
by draggy
Thank for the reply and information......
I'm more preferred to read the codes on how they are be done...........
I preferred C/C++ programming language
Thank
Posted: Thu Jun 14, 2007 1:20 pm
by Zacariaz
i dont think you wanna try avoiding assembly.
Posted: Thu Jun 14, 2007 1:27 pm
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.
Posted: Fri Jun 15, 2007 10:56 am
by draggy
Zacariaz wrote:i dont think you wanna try avoiding assembly.
Then I need some serious low level assembly tutorial
Anyone got some serious low level assembly tutorial?
Thank
Posted: Mon Jun 18, 2007 1:26 am
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
Posted: Mon Jun 18, 2007 8:47 am
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
Posted: Mon Jun 18, 2007 9:41 am
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
Posted: Fri Jun 22, 2007 1:05 pm
by draggy
Posted: Sun Jun 24, 2007 7:05 pm
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!
Posted: Mon Jun 25, 2007 1:21 am
by os64dev
newos is simple enough though it contains a lot of code which makes a little harder again.
Posted: Thu Jul 12, 2007 10:47 am
by draggy
thank for all the reply
Posted: Thu Jul 12, 2007 3:11 pm
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)