Page 2 of 2

Re: Where To Start

Posted: Tue May 03, 2005 11:00 pm
by Kimm
If you intend writing a commercial operating system choose Windows
what??! Windows has none of the basic tools for OS or software developement, sure, it has Notepad, but lets face it, notepad does not have automatic intenting nor synthax highlighting. Linux is more stable while it provides you with a great c compiler (gcc) and, if needed, there are GNU compilers for almost any language that are usualy installed from the systems package lists. Theres like a thousand different IDE's that work perfectly for all kinds of developement, I for one have not seen one editor that does not have synthax highlighting.

The more stable part also, ofcourse, makes it more suitable for emulating other OS's witch would be good,

Then, also, almost all software is free, in almost all ways possible. I can see no reason to why you should use Windoze for OS developement!!

Re: Where To Start

Posted: Tue May 03, 2005 11:00 pm
by frizzz
Smith wrote:Where can I get examples of a good bootsector and kernel.
Look at my homepage "www.rcfriz.de" !
I published there an assembler OS, written in NASM-dialect.
This is my first attempt to an OS, which is better extentable with drivers and programs.
But if You want to know about that things, which need to be done, before You can start any program, You will find an example in my "FDOS1". I tried to make it at simple as can be and added a lot of comments for beginners.
You will find the bootsector, switching to protected mode, switching A20-line, handling of GDT an IDT, memory-magament, simple file-systems, FD- and HD-driver...

Re: Where To Start

Posted: Wed May 04, 2005 11:00 pm
by PetrBrok
Smith you can find examples of bootsectors searching in Google.
As for simple kernels, you basically write a printf, statup code in asm,
and a lame main who calls printf.There aren't good examples on net.
If you use fortran is easyer.Write a a routine called f.asm who provides
S_STOP and the rest for fortran.
For assembly I recomend you TASM.
You should of course provide a simple GDT to test your printf.
Kimm: (or who is your name).Myself I use Linux, but... for non GPL -ed OS
Windows is a must.As for tools TASM, and Borland C(++) are all you need.And if you use console mode, the syntax highlighting is not needed.

Re: Where To Start

Posted: Wed May 04, 2005 11:00 pm
by DennisCGc
PetrBrok wrote: Kimm: (or who is your name).Myself I use Linux, but... for non GPL -ed OS
Windows is a must.As for tools TASM, and Borland C(++) are all you need.
Could you please explain WHY Windows is a must if you're writing a non-GPL'ed OS ?
And if you use console mode, the syntax highlighting is not needed
Nothing is needed, it's only 100x handier when it's available (especially for C,C++, etc.)

Re: Where To Start

Posted: Thu May 05, 2005 11:00 pm
by Kimm
I dont think you understand the meaning of the GPL

GPL means that you release the application in source form and perhaps also as binary, and its free for everyone to download and edit any way they want BUT, if they edit the source code of it and redistribute it, they have to give out the source and make it freely available to everyone and give the original aouthor credit for the code he/she wrote.

it does not mean that when you use a GPL'ed piece of software for for example building an OS you have to make that os GPL, thats just silly. Using GPL'ed software works under the same basic rules as using any other software, whatever you make with it: is yours to do anything you want to do with it!!

Re: Where To Start

Posted: Thu May 05, 2005 11:00 pm
by Smith
I need examples of how to actually write the code where can I find books to explain that.

Re: Where To Start

Posted: Thu May 05, 2005 11:00 pm
by jensif
that makes two of us

Re: Where To Start

Posted: Fri May 06, 2005 11:00 pm
by frizzz
Whatever You want to do... the first piece of code needs to be written in assembler, because you can't boot or switch to protected mode (... the "arch dependand" things) with a program written in a "higher" language.
Look at the linux-sources to find examples...

Some people want to do the rest of the OS using assembler ( I belong to them). Other people want to use C/C++ and start already written open source pograms. The latter have to take care of some preconditions set by C-conventions (standard-library, function calls...). If you want to program using an other "higher" language ( pascal, fortran...), you will find other preconditions - and very few open source programs.

Besides the decision about the programming language, you need to decide, what You want to do with Your own OS ( or if You could join a project of others...).
I think You should write Your own OS only then, when You have special desires using the hardware of the AT-PC. I.e. drive Your own electronic devices via parallel-port or program pics, EPROMs...
The second reason for an own OS could be special software, which should run as fast as can be ( movie tricks, audio-source...)
or should make use of the hardware (ports, disks, memory..) in a not already available manner.
Else go by linux and write Your own C-programs...

If You want to be really free and if You won't read docs, hints and books for some month (or years) and if You won't have to learn at least half a dozen programming languages ( C, C++, bash-scripts, make-scripts, preprocessor, inline assembler...), You should program the whole OS in assembler. In this case You will find a well tested and commented first step on my homepage. The next step to a mature kernel will be done in this summer...

Re: Where To Start

Posted: Fri May 06, 2005 11:00 pm
by Legend
I agree with that there is not really a point in doing a unix/posix kernel anymore .. in any case, you could try to improve the linux/hurd/whatever kernel. If you want to do anything different, then the whole range of options is open to you - let it be assembler, c, c++, java, c# or whatever.

Re: Where To Start

Posted: Wed May 18, 2005 11:00 pm
by Smith
I still need pointers and how to start writing code...

Re: Where To Start

Posted: Sun May 29, 2005 11:00 pm
by frizzz
You can write Your "sourcecode" using nearly every editor, because normally the same ASCII-code is used for the letters.
But then You need a special program to translate the source to the binary opcodes, which are the mothertongue of the CPU. This sort of program is called "assembler" (if You write assembler..) or "compiler".
My feeling says: Your are an absolute beginner...
Thus I advice You to start with assembler to get the right ideas, why an operating system is needed and how the CPU and some important devices (Interrupt-controller, timer, keyboard-, FD- and HD-controllers...) work. If You know, what to do in assembler, it will be easier to understand, how to do it in a "higher level" language.
Those languages are composed of a lot of expressions, which are meant to reduce Your efforts while You are writing code. But You need to learn some more expressions for things, which are done in assembler mostly using "mov", "jmp","call" and conditional jumping. And my experiance is, that you need much more time to think than to write. Thus it doesn't matter, when you have to write "retf" in assembler instead of a "}" in C/C++
If You would like to start with assembler, You could find a little OS on my homepage, which is meant as tool for testing code and machines. It is very well commented to help beginners. I provided a link to NASM there too. This assembler-dialect is well known and You can translate Your sourcecode in Windows or linux. NASM comes with a very well done documentation of assembler-mnemonics and adressing modes.
www.rcfriz.de

Re: Where To Start

Posted: Mon May 30, 2005 11:00 pm
by dembol
If You would like to start with assembler, You could find a little OS on my homepage,
But if you would like to write your OS in C, you can find sourcecode of my kernel at my homepage: http://agnix.sourceforge.net. All device drivers and kernel subsystems are written in C.

I don't advice to write all the code in assembler, because it's very time-consuming. Only the first piece of code needs to be written in assembler, all the rest should be written in some highlevel language like C, this is my opinion. If you would like some examples how to write kernel code, look at the Linux kernel - it's the best book :)

Re: Where To Start

Posted: Mon May 30, 2005 11:00 pm
by Legend
mov, cmp, jne (or similiars), add are more abstract then a for loop that adds values up - C is more visual at what should happen - and saves you from doing stack operations yourself (but learn what a stack is ...).

And be warned that with C you can construct things that aren't immediately visual either, but that should happen later then with assembly (important when you get back to your code later, less when you write it).