Page 1 of 1

Begininng an OS?

Posted: Tue Jan 30, 2007 8:02 am
by kr33
Hi All,

I know this may seem extremely dumb, but here goes...

I have NO experience with OS Development,but with other kinds of programming, yes, i.e. ASP .NET 2.0 with C#, PHP, C++, Java etc.

But I have never tried the write my own OS, so, I's love to learn, keeping in mind, that I unfortunately don't have a clue on where to begin.

Would anyone be kind enough to give me a helping hand in starting my OS Development interests off?

Much thanks

Kr33

Posted: Tue Jan 30, 2007 8:43 am
by Solar
Nothing easier than that: Check the sticky thread "Book Recommendations" in this forum and the link "Wiki" at the top...

Posted: Tue Jan 30, 2007 12:00 pm
by JAAman
a couple links to help you (these are of course in addition to what solar said):

make sure you get the ## ---- ----- ------ Intel Manuals

these (esp volume 3a) contain important information about the workings of the x86 family of CPUs, i certainly recommend getting hard-copies of all 5 books (even though volume 3a, and 2a&b are the most useful)

the OSRC gives lots of documents about standard components

Bochs is an emulator which is very helpful -- esp in the early part

MS and VMWare also make products in the same catagory -- but unfortunately my links are out-of-date

BonaFide OS Dev hosts a lot of tutorials, can be very helpful

and of course this site: where you can ask any questions, and we will try to help you if we can

Posted: Wed Jan 31, 2007 12:08 am
by kr33
Thanks guys,

Much appreciated....If there are also any tips and tricks to OS Development other than, keeping code clean and modularized(in my opinion) and obviously with a goal in mind.

Much appreciated for the help

Kr33 :)

Posted: Wed Feb 07, 2007 4:13 pm
by Crazed123
Make everything ready for multithreading, or be ready to put a single giant lock on your kernel.

Posted: Thu Feb 08, 2007 3:15 am
by AJ
[obvious tip]Plan Ahead[/obvious tip]

If you just start writing code, as I did, think of your first attempt as a Toy OS - just for fun.

In the early stages, I would read up on a new aspect of OS dev that I hadn't considered and found that a re-write was on the cards for proper implementation. This was mainly because of the scattered-ness of my code!

Good luck,
Adam

Posted: Thu Feb 08, 2007 3:29 am
by Solar
AJ wrote:If you just start writing code, as I did, think of your first attempt as a Toy OS - just for fun.
I would go a step further: Anything, anything where you "just start writing code" should never be considered a "project". Never make a package of it. Never let it leave your local hard drive. It's a scratchbook doodle, a "proof of concept" at the best of times.

Let it escape into the wild, and it will keep coming back to haunt you. 8)

Posted: Thu Feb 08, 2007 5:35 am
by AJ
Solar wrote:Let it escape into the wild, and it will keep coming back to haunt you. 8)
Sounds like that was said with feeling :) you obviously have a past experience in mind!

Posted: Thu Feb 08, 2007 8:03 pm
by ThatGuy
AJ wrote:If you just start writing code, as I did, think of your first attempt as a Toy OS - just for fun.
This is good advice. I say start playing around to get used to coding without any support structures. As your playing start thinking of your main goal for your OS ie. Network support?(DNS, DHCP, Other), General Use?, Real Time Applications? After this is established, then decide what your kernel will look like ie. Monolithic, Micro, Other? At this point you should have a pretty good idea of what your API should look like so you can start implementing your managers with all of this in mind. So your API should be easy to pull together.

For the record I have only played around with freestanding code and have never worked on an OS project. Well, up until two months ago, I'm starting to plan one out now.

Posted: Fri Feb 09, 2007 6:44 am
by Solar
AJ wrote:...you obviously have a past experience in mind!
I spend all of my working hours a-patching and a-fixing code written by self-acclaimed "professionals" for which "escaped" is a compliment. And I have spend quite some of my spare time hours doing the same for other people's code, too. I don't want to picture what a mess it makes when you transpose that to the tripple-fault paradise that is kernel space. :?

Posted: Fri Feb 09, 2007 7:48 am
by AhlyM
Hello
I am writing my OS in pascal
for better don't write your own bootloader but use grub
also use a toolkit as a beginning in your OS ,i my self use libosdk.
Thanks

Posted: Fri Feb 09, 2007 11:11 am
by AJ
Oh - just thought of something:

When I first wrote my OS, I wrote a few non-standard support functions to aid development. When the time came to develop a libc, I realised that using standard function names for functions with non-standard behaviour was not a good idea! :roll:

If your major OS and application development are going to be in C (or C++), I have now found it is useful to link kernel and libc development fairly closely. All you need are a few careful #defines for functions which will need to be slightly different for user and kernel mode.

Cheers,
Adam

Posted: Wed Feb 14, 2007 10:25 pm
by Crazed123
AhlyM wrote:Hello
I am writing my OS in pascal
for better don't write your own bootloader but use grub
also use a toolkit as a beginning in your OS ,i my self use libosdk.
Thanks
If the OSKit contains components that suit the kernel you want, go ahead and use it. Implement only custom features. Once you have a complete kernel, you can go back over and slowly replace the OSKit code with your own.

On the other hand, using COM to keep a kernel together doesn't sound like a great idea.

Posted: Thu Feb 15, 2007 4:21 pm
by M-Saunders
As AJ says, think of your first efforts as a toy -- just some experimentation. Writing an OS is incredibly complicated, albeit hugely rewarding. Look at some of the projects developed by regulars here (eg DexOS) and see what it takes to get that far. My own OS is pretty simple by comparison but it has still required a lot of graft.

Start with the basics -- write a bootloader to get the feel of assembly and controlling a PC directly, without languages or compilers. Write simple stuff to draw graphics to the screen and print text. Knock together a floppy drive loader (easier than working with hard drives).

If you get that far and are still loving OS hacking, congratulations: you're off to a great start. Think of it as the world's biggest Lego set. Sure, it takes ages to create a Boeing 747 from Lego bits, but as you build up the cockpit, landing gear, passenger seats etc., you get a great feeling of accomplishment.

M

--
http://mikeos.sourceforge.net