Where To Start

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Smith
Member
Member
Posts: 38
Joined: Wed Feb 02, 2005 12:00 am

Where To Start

Post by Smith »

HOW DO I START?

I'm trying to write an OS, but I can't find any sort of help in tutorials, books, anything. The thing is they all say ,
"Find someone who can teach you."
(Why do they even bother to publish the books then??)

My Questions Follow:
-what is a good developing environment? (Windows, Linux, Unix, Mac etc.)
-what software should I use?
-which language to use? (C/C++, Pascal, Fortran, Java, Perl...(easiest please!!!)
-How to write the code?

All the very beginner question.

Smith


P.S. Please do mind that I am short of time and cannot read a bible's worth of literature.
User avatar
ManOfSteel
Member
Member
Posts: 60
Joined: Tue Feb 01, 2005 12:00 am

Re: Where To Start

Post by ManOfSteel »

what is a good developing environment? (Windows, Linux, Unix, Mac etc.)
You can freely use any environment (OS if that's what you mean). MS-DOS if you want. Some OS, like most Linux and UNIX, already have some programming and OS related programs and utilities, though, and may be preferred by some people.
what software should I use
A basic ASCII text editor (notepad and edit will be fine). Some options like syntax highlighting or line counting can also be interesting.
A compiler/assembler, of course: every language has its own compiler/assembler.
An emulator is also interesting to have if you're tired of rebooting your computer just to test a few changes. Try Bochs, it's probably the best one, it's free and open source.
Some utilities are useful like the ones that write files to the disk. Rawrite is good.
Check this: http://www.osdever.net/downloads.php
which language to use? (C/C++, Pascal, Fortran, Java, Perl...(easiest please!!!)
Java, Perl or the likes will not be very useful for basic OS programming.
You may use Pascal, but most people will use C, C++ and assembler. C++ is quite difficult to begin with. You can mix C with assembler or use one of them alone (although, some parts can only be done in assembler).
How to write the code
I don't really understand your question. Are you asking about the basics of a programming language or about programming an OS?
For the former: http://www.programmershelp.co.uk/, http://www.programmersheaven.com/
For the latter: http://www.osdever.net/documents.php, http://www.osdever.net/tutorials.php, http://www.nondot.org/sabre/os/, http://www.codezen.org/viridis/whitepaper.php
Last edited by ManOfSteel on Sun Apr 24, 2005 11:00 pm, edited 1 time in total.
Smith
Member
Member
Posts: 38
Joined: Wed Feb 02, 2005 12:00 am

Re: Where To Start

Post by Smith »

Thanks ALOT!

When I said:
"How to write the code"
I ment how to program the OS.

I'm Still looking through the links.

I have also got the book:
"Operating Systems: Design and Implementation second edition" which is turning out to be a slow read.

Again Thanks,

Smith

P.S: Which parts can only be written in ASM?
Last edited by Smith on Sun Apr 24, 2005 11:00 pm, edited 1 time in total.
User avatar
ManOfSteel
Member
Member
Posts: 60
Joined: Tue Feb 01, 2005 12:00 am

Re: Where To Start

Post by ManOfSteel »

I have also got the book:
"Operating Systems: Design and Implementation second edition" which is turning out to be a slow read.
Rather good choice. Check out the source code of Minix. If you have a copy without the CD (not an original book), you still can get the source code at the writers site, AFAIK.
Which parts can only be written in ASM
I'm not really sure since I'm only using assembler, but I think it's a few pieces like the boot sector's code and possibly the interrupt routine (I think you can jump to your C routines within the ASM ones). But again, I'm not 100% sure.
Smith
Member
Member
Posts: 38
Joined: Wed Feb 02, 2005 12:00 am

Re: Where To Start

Post by Smith »

I did get the original book with the CD and have look (briefly) through the code, but the book its self doesnt explain how to write the code and the order it comes in. The only hints are in the code but that makes up 45% of the book.

I need someone to teach me.


Smith
DRF
Posts: 3
Joined: Wed Mar 23, 2005 12:00 am

Re: Where To Start

Post by DRF »

The best place to start is to learn some of the languages you need. Even if you are sticking to 'C' for as much as possible you should be able to at least read asm examples and vice versa. Preferably you should have an indepth knowledge of the compiler based language that you plan to use for the majority of your coding, and be able to understand example code that is made in asm/c.

There aren't many books specifically on OS developing (as there isn't the demand) but there are a number of useful tutorials contributed by people.
Finding someone to coach you isn't that easy as each OS tends to be different and has a large list of options you may take and different points to start at or combinations of your code and 3rd party code. First you need to decide what basic design to use for your OS then ask for help when you get stuck.

An example of issues to address earlier rather than later are:
* Purpose of the OS? (Educational or usable or security etc)
* Language you want to use to write it in? (Anything compiled eg asm/c/c++/pascal but remember all the functions that are built into header/system libarys will need to be writen from scratch for your OS)
* Mode? (real mode 16bit or protected mode 32bit, the protected mode is more popular now as it offers more security and more memory is enabled)
* Filesystem? (FAT is quite easy but there are things like ext2 etc as well or you can make your own)
* Console or graphical only? (console is easier and normally done first)
* Any support for linux/windows standards and applications? (.com/.exe support or support for linux app's if they are re-compiled as opposed to writing all your own applications)

And anything else I've forgotten to mention.

Daniel

www.osdever.net
www.osdcom.info
Smith
Member
Member
Posts: 38
Joined: Wed Feb 02, 2005 12:00 am

Re: Where To Start

Post by Smith »

I'd like an OS thats both Console and graphical (if possible (I'll add an attachment to the next post with my planning).
Smith
Member
Member
Posts: 38
Joined: Wed Feb 02, 2005 12:00 am

Re: Where To Start

Post by Smith »

Has anyone heard of the book "OS Development for Dummies" ??

Smith
User avatar
ManOfSteel
Member
Member
Posts: 60
Joined: Tue Feb 01, 2005 12:00 am

Re: Where To Start

Post by ManOfSteel »

I'd like an OS thats both Console and graphical
These will require a lot of time especially if you're going to use protected mode. Even to have the most basic text-based shell, you must have of lot of other things set first, like the PM itself and everything that is linked to it (GDT, IDT, ...), you'll have to program the PIC and at least have a few software interrupt handlers for the "character printing" and "keyboard key reading" routines you'll be using in your console.
The graphical one should come after a very long time, because you'll probably need much more programming like at least a reliable memory manager.

I suggest you first make a very basic 16-bits real mode OS so that you can get the basics of operating systems and computer hardware functionning, before jumping to the world of protected mode where you'll have a lot of reading to do. At that time, you may begin with the Intel manuals (especially the "System programming" one).
Kimm
Member
Member
Posts: 50
Joined: Wed Nov 03, 2004 12:00 am
Location: Sweden

Re: Where To Start

Post by Kimm »

-what is a good developing environment? (Windows, Linux, Unix, Mac etc.)
I would suggest Linux with XFCE or GNOME with the Anjuta IDE and gcc.
XFCE is better if your looking for a light desktop with lots of features, its basicly GNOME but lighter... supports gnome themes and programs
Smith
Member
Member
Posts: 38
Joined: Wed Feb 02, 2005 12:00 am

Re: Where To Start

Post by Smith »

Which distributions come with GNOME, XFCE etc??

Or where to get them as I already have Linux.
PetrBrok
Posts: 2
Joined: Mon May 02, 2005 11:00 pm

Re: Where To Start

Post by PetrBrok »

-what is a good developing environment? (Windows, Linux, Unix, Mac etc.)
If you intend writing a commercial operating system choose Windows
-what software should I use?
Your mean programming tools, assembler, compiler etc.
If you use Windows use Borland C, and notepad.
-which language to use? (C/C++, Pascal, Fortran, Java, Perl...(easiest please!!!)
C or if you want something to ressemble Basic, Fortran.
-How to write the code?

Write a bootsector.
Write a simple kernel and load it.
Add memory management
Add process management.
and the rest
Smith
Member
Member
Posts: 38
Joined: Wed Feb 02, 2005 12:00 am

Re: Where To Start

Post by Smith »

Where can I get examples of a good bootsector and kernel. I have already looked at the links at www.osdever.com/downloads.php
User avatar
ManOfSteel
Member
Member
Posts: 60
Joined: Tue Feb 01, 2005 12:00 am

Re: Where To Start

Post by ManOfSteel »

Maybe some free/open source OSs will help you a little.
This is a list of OSs containing some open source ones, Crasha's CS TBOS, V2OS, Menuet OS.
Last edited by ManOfSteel on Tue May 03, 2005 11:00 pm, edited 4 times in total.
Smith
Member
Member
Posts: 38
Joined: Wed Feb 02, 2005 12:00 am

Re: Where To Start

Post by Smith »

Has anyone heard of the book OS Development for Dummies and the program OS Creator??
Post Reply