Page 1 of 2
Where To Start
Posted: Fri Apr 22, 2005 11:00 pm
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.
Re: Where To Start
Posted: Sun Apr 24, 2005 11:00 pm
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
Re: Where To Start
Posted: Sun Apr 24, 2005 11:00 pm
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?
Re: Where To Start
Posted: Tue Apr 26, 2005 11:00 pm
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.
Re: Where To Start
Posted: Tue Apr 26, 2005 11:00 pm
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
Re: Where To Start
Posted: Tue Apr 26, 2005 11:00 pm
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
Re: Where To Start
Posted: Tue Apr 26, 2005 11:00 pm
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).
Re: Where To Start
Posted: Tue Apr 26, 2005 11:00 pm
by Smith
Has anyone heard of the book "OS Development for Dummies" ??
Smith
Re: Where To Start
Posted: Wed Apr 27, 2005 11:00 pm
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).
Re: Where To Start
Posted: Wed Apr 27, 2005 11:00 pm
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
Re: Where To Start
Posted: Thu Apr 28, 2005 11:00 pm
by Smith
Which distributions come with GNOME, XFCE etc??
Or where to get them as I already have Linux.
Re: Where To Start
Posted: Mon May 02, 2005 11:00 pm
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
Re: Where To Start
Posted: Mon May 02, 2005 11:00 pm
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
Re: Where To Start
Posted: Tue May 03, 2005 11:00 pm
by ManOfSteel
Re: Where To Start
Posted: Tue May 03, 2005 11:00 pm
by Smith
Has anyone heard of the book OS Development for Dummies and the program OS Creator??