Begininng an OS?

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.
Post Reply
User avatar
kr33
Posts: 2
Joined: Tue Jan 30, 2007 7:55 am

Begininng an OS?

Post 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
A man's dream's are an index to his greatness!
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Post by Solar »

Nothing easier than that: Check the sticky thread "Book Recommendations" in this forum and the link "Wiki" at the top...
Every good solution is obvious once you've found it.
User avatar
JAAman
Member
Member
Posts: 879
Joined: Wed Oct 27, 2004 11:00 pm
Location: WA

Post 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
User avatar
kr33
Posts: 2
Joined: Tue Jan 30, 2007 7:55 am

Post 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 :)
A man's dream's are an index to his greatness!
Crazed123
Member
Member
Posts: 248
Joined: Thu Oct 21, 2004 11:00 pm

Post by Crazed123 »

Make everything ready for multithreading, or be ready to put a single giant lock on your kernel.
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Post 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
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Post 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)
Every good solution is obvious once you've found it.
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Post 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!
ThatGuy
Posts: 9
Joined: Fri Jan 19, 2007 7:28 pm
Location: On, Canada

Post 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.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Post 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. :?
Every good solution is obvious once you've found it.
User avatar
AhlyM
Posts: 1
Joined: Fri Feb 09, 2007 7:32 am
Location: Egypt
Contact:

Post 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
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Post 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
Crazed123
Member
Member
Posts: 248
Joined: Thu Oct 21, 2004 11:00 pm

Post 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.
M-Saunders
Member
Member
Posts: 155
Joined: Fri Oct 27, 2006 5:11 am
Location: Oberbayern
Contact:

Post 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
Post Reply