Page 1 of 1

Anybody point me where to start?

Posted: Fri Jul 27, 2007 10:37 am
by eboyd
I'm a third year CS student and although I've done plenty of OOP and some assembly, I'd really like to understand how to build an OS, even a very simple one.

I have a decent grasp of the different types of kernels (monolithic, etc.) and have some interesting ideas about building one.

The problem is it's very hard to find good information or tutorials about getting started and the right tools to use.

Any input here is most welcome!

Thnx

Posted: Fri Jul 27, 2007 10:56 am
by AJ
Hi,

Have you looked at the wiki or www.osdever.net? Lots of useful information there.

Cheers,
Adam

Posted: Fri Jul 27, 2007 3:15 pm
by os64dev
The problem is it's very hard to find good information or tutorials about getting started and the right tools to use.
Clearly you didn't look because the internet is swamped with it. You sure that you googled with osdev in the query? Try again, hell there is even a WIKI on this site.

Posted: Fri Jul 27, 2007 5:55 pm
by eboyd
yea i've looked. i've even found things. a lot of which however assume one has a better understanding of it than i do. what i was hoping for, after looking through these forums a bit and seeing that people here really know what the heck they're talking about, is that their expertise and guidance might be more insightful than my previous google searches.

Posted: Fri Jul 27, 2007 7:24 pm
by frank
This is a good tutorial

http://www.osdever.net/bkerndev/index.php?the_id=90

However if you are working on a windows computer I would recommend using cygwin and setting up a cross compiler GCC Cross-Compiler.

Bochs would also be a good thing to get right first thing.

Posted: Sat Jul 28, 2007 9:58 am
by eboyd
Cool stuff so far!

Much of what I've seen talks about DJGPP, I use DevC++ for almost everything I do, can I just use the command line version of GCC that was installed with DevC++, or is DJGPP necessary for these things?

And, this might sound pretty stupid to some of you OS buffs, but do AMD and Intel use the same assembly language? I know there are different assembly languages, some that are cross-platform, but I don't know if it makes a difference when building a kernel/OS.

Posted: Sat Jul 28, 2007 10:26 am
by frank
eboyd wrote:Much of what I've seen talks about DJGPP, I use DevC++ for almost everything I do, can I just use the command line version of GCC that was installed with DevC++, or is DJGPP necessary for these things?
Well the version of GCC that comes with DevC++ is actually a port of GCC called MinGW. It is recommended that you either use DJGPP or Cygwin because MinGW has some problems that make it hard to use during OS developing.
eboyd wrote:And, this might sound pretty stupid to some of you OS buffs, but do AMD and Intel use the same assembly language? I know there are different assembly languages, some that are cross-platform, but I don't know if it makes a difference when building a kernel/OS.
Both AMD and Intel processors use the same machine code. I think that you are thinking of the two different syntaxes for assembly code that are out there, Intel and AT&T. Both syntaxes compile to the same machine code. Whether you use Intel or AT&T is largely up to personal preference and the assembler you use. FASM and NASM are two assemblers that use intel syntax and GAS uses AT&T.

Posted: Sat Jul 28, 2007 10:27 am
by jnc100
eboyd wrote:Much of what I've seen talks about DJGPP, I use DevC++ for almost everything I do, can I just use the command line version of GCC that was installed with DevC++, or is DJGPP necessary for these things?
If you're using windows, I suggest the best compiler to use would be a GCC Cross-Compiler, hosted under Cygwin.
eboyd wrote:And, this might sound pretty stupid to some of you OS buffs, but do AMD and Intel use the same assembly language? I know there are different assembly languages, some that are cross-platform, but I don't know if it makes a difference when building a kernel/OS.
Not stupid at all. They're pretty much the same, apart from some of the very latest stuff in 64-bit mode. Generally, when one company implements something new, then the other will use the same opcodes so that software doesn't have to be rewritten. Obviously there are some architectural differences with things like SSE support ant MTRRs, but then there are equally differences between different models produced by the same company.

Regards,
John

Posted: Sat Jul 28, 2007 2:38 pm
by Pyrofan1
you're also going to want a copy of the intel manuals.

Posted: Sun Jul 29, 2007 1:59 am
by neon
The tutorials at my site are a step by step series in building
a 32 bit OS in descrete detail from scratch (No Grub.)

OS Development Series

Its still in development, so please tell me if you see any errors,
or even suggestions or comments. Thanks, and I hope it helps.

Posted: Sun Jul 29, 2007 10:28 am
by KrnlHckr
frank wrote:
eboyd wrote:Much of what I've seen talks about DJGPP, I use DevC++ for almost everything I do, can I just use the command line version of GCC that was installed with DevC++, or is DJGPP necessary for these things?
Well the version of GCC that comes with DevC++ is actually a port of GCC called MinGW. It is recommended that you either use DJGPP or Cygwin because MinGW has some problems that make it hard to use during OS developing.
And you don't want to introduce any more complexity into an already complex project. Welcome to the world of kernel programming! It's a load of fun - if you are prepared to work.

EDIT: Bran's tutorial (http://www.osdever.net/bkerndev/index.php) is a very nice introduction to kernel development. It has a few rough spots in it that caused me some significant headaches, but a methodical following by you should help tremendously while you learn to crawl. When you are comfortably crawling, you can start to walk by (perhaps) re-implementing Bran's code in your own ways. (By that, of course, I mean improve upon, not just change variable names around!) :D

Posted: Sun Jul 29, 2007 10:46 am
by earlz
I'm Assuming your using XP, if you are using Vista, there will be some very weird things you have to do for thigns to work right...

Posted: Tue Jul 31, 2007 3:22 pm
by Candy
frank wrote:
eboyd wrote:Much of what I've seen talks about DJGPP, I use DevC++ for almost everything I do, can I just use the command line version of GCC that was installed with DevC++, or is DJGPP necessary for these things?
Well the version of GCC that comes with DevC++ is actually a port of GCC called MinGW. It is recommended that you either use DJGPP or Cygwin because MinGW has some problems that make it hard to use during OS developing.
That's not quite true. OS development is best done on a compiler that was compiled to make binaries for your OS, or compiled to make generic binaries. Nobody outside of OS developers and hackers need these, so there aren't any generally available. We usually make a crosscompiler for a generic target, so it doesn't try to hack Windows fixes into our OS like leading underscores and alloca calls, nor Unix-like defaults (although I can't mention any, I'm pretty sure there are). Windows-based compilers are the most common source of error in compile processes, with the main focus on DJGPP and MingW since both were hacked severely to work in the target environment "natively" and thus not in any other environment.

Posted: Tue Jul 31, 2007 8:17 pm
by AndrewAPrice
hckr83 wrote:I'm Assuming your using XP, if you are using Vista, there will be some very weird things you have to do for thigns to work right...
Vista and DJGPP don't go very well together. You have to continually click 'ignore' at these memory violation errors.