I couldn't find any FAQ for this subforum (like the one on the networking subforum), so I had to ask.

-> Where should I start? Let's say I want to make a GUI OS for 32-bit x86 machines (or 64-bit ones). I want it mainly to write a network server for it (so it has to support TCP/IP). ... Well it doesn't necessarily have to be GUI even, but that would be nice :) . And let's say that I have infinite patience and infinite amount of time :mrgreen: The OS must be possibly most stable and most secure. It must support multithreading (support for Intel's HyperThreading technology would be cool), and possibly more than 1 CPU.

-> What about the drivers? How do you get/make the drivers for your own OS? Is it possible to make some other OS's drivers to work on your system? (like making your OS 'compatible' with an existing one?)

So put this simply: I'd like to know how to make a full-blown OS even if I'll never have to write one.

Sorry if these are dumb questions - I've never played with anything OS-related and I'd like to make first step ;) Windows programming is starting to be boring :P and I think that unix/linux programming wouldn't help either :)

BTW: I like the idea to write in ASM as much OS as possible, so any help there would be appreciated.
Posted on 2005-11-21 20:13:58 by ti_mo_n
I've was working on an OS Development Guide, but I have yielded work on that to my own OS Development stuff.

I think the best source for any OS information is probably all centralized at the OS Development & Design Forum @ MegaTokyo.com.
Posted on 2005-11-21 21:22:41 by SpooK
Hey ti_mo_n, your project sounds interesting. Do let me know if you need help.
Posted on 2005-11-22 01:14:18 by roticv
Thank you Spook for the link. It led me to these places:

http://www.mega-tokyo.com/osfaq2/
http://www.nondot.org/sabre/os/articles

Both of them rock. :)


Thank you roticv for your interest. I'll definitely need a hand on this project, so you're welcome with any ideas/suggestions/beer/etc. :P ;) And of course I'll need the help when it'll come to actually 'write' the OS, procedure after procedure.

First I have to learn a bit about it (I'm in the middle of the mentioned "OSFAQ" right now). Then I'll try to make a simple bootloader. I don't want to use anything widely available, because I want this project to be a valuable experience.

This OSFAQ is great. I've already risen my knowledge by 10'000 % :P

From what I've learned it seems that the OS will need the following:

-> bootloader
-> kernel
-> commandline / GUI shell

Bootloader won't be very difficult as it's only a proc which loads some stuff. Knowledge about RealMode addressing and BIOS interrupts is required (and I already have that knowledge since 'the old times' ;) ).

The kernel is going to be a tough one. I must read about Task(CPU time)/Memory allocation, some advanced concepts of protected mode, and learn those intructions and registers which you never use in win32 programming :P So I'll have to read Intel's manuals again (very thouroughly this time) and of course finish reading this OSFAQ.

From what I see, it's a project for 2-3 years of manwork. Because of that, I think that making it for 64-bit CPUs would be more clever (32-bit CPUs may get outdated until then). What do you think? And what about compatibility? Are those 64-bit CPUs downwards-compatible with 32-bit ones?

I propose to make it as Windows'ish as possible. Support for PE exes is a must. Making it able to run PE exes / DLLs will ease the programming for it (you'll be able to work on Windows OS without any special tools - just the standard ones). Ideally it will have the things like "kernel32.dll" and "user32.dll" but that's of course a long journey. I don't want it to be ideal Windows clone, because that's near to impossible to achieve. I just want to follow some standards - I believe that will ease the development process a lot.

Finally the OS will be able to run a TCP/IP server (HTTP/FTP with PHP/SQL) (it will need to support some other protocols too, like DHCP).

That's of course just a starting concept. I'm open for any suggestions/ideas/oher help :)

As for the work itself: I'm going to learn a lot through November and December (and January if needs be). The main reason is that I must finish an app. I have a deadline set on January and my publisher will get mad if I won't finish it :P Right after it's finished, I'll switch to the OS development project. Until then, I'll (only) be reading about the topic in any free time.
Posted on 2005-11-22 14:27:42 by ti_mo_n
Dark Fiber's OS FAQ is OK, but it still limits the freedom of your though, since those techniques are not the only way to do things. Just steer clear of Tim Robinson's ASM-bashing rants and you will be ok.
Posted on 2005-11-22 18:17:43 by SpooK
Yeah - I always get the basic idea first, next learn different ways, and then write something mine ;) following somebody's way of thinking is not educational, IMO ;)
Posted on 2005-11-22 19:26:24 by ti_mo_n
Try this q&a. http://roticv.rantx.com/iota/qna.txt

I found it while I had time to try to code an OS some years back. I gave up on the experimental OS after a while. Of course I wouldn't mind helping you with some coding, if I can squeeze out some time.

I think the important is that you manage to get what you want on a piece of paper so that you have a clear direction on how you want. hehe make sure you know intel manual 3 by heart.

Support php and sql sounds like a long long long long way to go.  ;) But I think once you get a C compiler and maybe an assembler (I would propose fasm since it would not be too difficult to port it over) to work on your OS, things would be much easier.your OS to be like. Once you are done with that you can start building your os from scratch.

Here's some questions from me:
Do you intend to code it for 64bit or 32bit?
Are you supporting TSS?
Are you gonna use segmentation?
Are you going to use paging?
Posted on 2005-11-22 20:40:42 by roticv
-> I'm thinking about 32-bit as for now, but considering the fact that OS development is a 3+ years project, I'm slowly turning my head towards 64 bit
-> TSS? You mean hardware context switching? First I have to know about the performance of both the software and hardware context switching methods.
-> I see paging as a special case of segmentation after what I've read (or am I wrong?). Yes, I want to use the paging.

edit:

IA64 seems like a hell :| I doubt writing an OS for it. I'll stick with IA32 then, or maybe AMD's x64, but definitely not IA64. (I'll leave IA64 programming for .NET :P)
Posted on 2005-11-25 22:08:25 by ti_mo_n
Don't worry there's still AMD64  ;)
Posted on 2005-11-25 22:14:35 by roticv

-> I'm thinking about 32-bit as for now, but considering the fact that OS development is a 3+ years project, I'm slowly turning my head towards 64 bit
-> TSS? You mean hardware context switching? First I have to know about the performance of both the software and hardware context switching methods.
-> I see paging as a special case of segmentation after what I've read (or am I wrong?). Yes, I want to use the paging.

edit:

IA64 seems like a hell :| I doubt writing an OS for it. I'll stick with IA32 then, or maybe AMD's x64, but definitely not IA64. (I'll leave IA64 programming for .NET :P)


Intel EMT64 is suppose to be the equivalent of AMD's x64. IA-64 was merely an attempt at combining the functions of a server with that of a space heater.
Posted on 2005-11-26 20:16:02 by SpooK
Wow thanx! I didn't know about it. I thought the only Intel's 64-bit response to AMD was the IA64. Now I can start "turning my head" a little bit faster :P
Posted on 2005-11-26 21:06:15 by ti_mo_n

Wow thanx! I didn't know about it. I thought the only Intel's 64-bit response to AMD was the IA64. Now I can start "turning my head" a little bit faster :P


IA64 (Itanium/Itanium2) was out way before AMD64 became mainstream, it was targeted mainly for servers. I used to be an "Intel" only, but after how I saw how poorly the new Pentium IV's were being designed, I decided to try out AMD64. No regrets, especially running Windows XP x64 :)
Posted on 2005-11-27 13:36:56 by SpooK
Thank you for the explaination. So EM64T is like another "operating mode" on IA32 architecture, which can be 'enabled' using a flag or something? Is it compatible with AMD's x86-64 (I hope it is :mrgreen: ) ?

OK, I've found the following:

Q9: Is it possible to write software that will run on Intel's processors with Intel® EM64T, and AMD's 64-bit capable processors?
A9: Yes, in most cases. Even though the hardware microarchitecture for each company's processor is different, the operating system and software ported to one processor will likely run on the other processor due to the close similarity of the instruction set architectures. However, Intel processors support additional features, like the SSE3 instructions and Hyper-Threading Technology, which are not supported on non-Intel platforms. As such, we believe developers will achieve maximum performance and stability by designing specifically for Intel architectures and by taking advantage of Intel's breadth of software tools and enabling services.
Posted on 2005-11-29 23:22:48 by ti_mo_n