Developing an operating system for the x86 architecture

Jeff picture Jeff · Sep 24, 2008 · Viewed 8.7k times · Source

I am planning to develop an operating system for the x86 architecture.

  • What options of programming languages do I have?
  • What types of compilers are there available, preferably on a Windows environment?
  • Are there any good sources that will help me learn more about operating system development?
  • Is it better to test my operating system on a Virtual Machine or on physical hardware?

Any suggestions?

Answer

QAZ picture QAZ · Sep 24, 2008

For my final year project in collage I developed a small x86 OS with a virtual memory manager, a virtual file system and fully preemptive multitasking. I made it open source and the code is heavily commented, check out its source forge page at:

https://github.com/stephenfewer/NoNameOS

From my experience I can recommend the following:

You will need x86 assembly language for various parts, this in unavoidable, but can be kept to a minimum. Fairly quickly you will get running C code, which is a proven choice for OS development. Once you have some sort of memory manager available you can go into C++ if you like (you need some kind of memory manager for things like new and delete).

No matter what language you choose you will still need assembly & C to bring a system from boot where the BIOS leaves you into any useable form.

Ultimately, the primary language you choose will depend on the type of OS you want to develop.

My development environment was the Windows port of the GNU development tools DJGPP along with the NASM assembler. For my IDE I used IBM's Eclipse with the CDT plugin which provides a C/C++ development environment within Eclipse.

For testing I recommend BOCHS, an open source x86 PC emulator. It lets you boot up your OS quickly which is great for testing and can be integrated into eclipse so you can build and run your OS at the push of a button. I would also recommend using both VMWare and a physical PC occasionally as you can pick up on some subtle bugs that way.

P.S. OS development is really fun but is very intensive, mine took the best part of 12 months. My advice is to plan well and your design is key! enjoy :)