How To Build Your Own OS
" Some Tips, Strategies & Things Required To Build Your Own Operating System "
Ever since I dreamt of creating and having my own OS (The Sami OS), I've been Google searching day-n-night to find the best ways to create my own OS no matter how much it costs, but each Website had different and very Complex methods and some were too easy and obvious methods; so I thought of sharing some of these on my Website...
Steps on creating your own OS from scratch: (source: WikiHow) (Difficulty: Hard):
- Decide what media you want to load your OS on. It can be a floppy disk, CD drive, DVD drive,flash drive, a hard disk, or another PC.
- Decide what you want your OS to do. Whether it is a fully capable OS with a GUI or something a bit more minimalistic, you'll need to know what direction you are taking it before beginning.
- Target what processor platform your operating system will support. If you are not sure, your best bet is to target the X86 (32 bit) processor platform as most computers use X86 platform processors.
- Decide if you would rather do it all yourself from the ground up, or if there is an existing kernel you would like to build on top of. Linux from Scratch is a project for those that would like to build their own Linux distro.
- Decide if you're going to create your own bootloader or a pre-created one such as GRUB. While coding your own bootloader will give a lot of knowledge of the hardware and the BIOS, it may set you back on the programming of the actual kernel.
- While it is possible to create an operating system in a language such as Pascal or BASIC you will be better off using C or Assembly. Assembly is absolutely necessary as some vital parts of an operating system require it. C++ contains keywords that needs another fully built OS to run. Don't use it.
- Start small. Begin with small things such as displaying text and interrupts before moving on to things such as memory management and multitasking.
- Decide on your API. While this is a long way off it is a good idea to plan ahead. A good API to choose is POSIX, which is well documented. All Unix systems have at least partial support for POSIX, so it would be trivial to port Unix programs to your OS.
- Decide on your design. There are monolithic kernels and microkernels. Monolithic kernels implement all the services in the kernel, while microkernels have a small kernel combined with user daemons implementing services. In general, monolithic kernels are faster, but microkernels have better fault isolation and reliability.
- After all development is done, decide if you want to release the code as open source, or proprietary.
If you want an easy way. Consider Linux distros like Fedora Revisor, Custom Nimble X, Puppy Remaster, PCLinuxOS, mklivecd, or SUSE Studio and SuSE KIWI. However, the operating system you created will belong to the company who started the service first. Although you have rights to distribute it freely, change it and run it however you like (but under the GPL).
Alternative Method: Use Suse Studio (Difficulty- Medium)
SUSE Studio is an online Linux image creation tool by Novell. Users can develop their own Linux OS, software appliance or virtual appliance, mainly choosing which applications and packages they want on their "custom" Linux and how it looks. In addition, they can choose between openSUSE, SUSE Linux Enterprise Server and SUSE Linux Enterprise Desktop bases, GNOME and KDE desktops, and an abundance of other features.
To find out how to use Suse Studio, please Click Here and/or watch This Video tutorial.
Another Alternative Method: Use Instructables' Method On Building Your Own OS (Difficulty- Medium)
Instructables recommends using Microsoft Visual C++ 2008 (which requires the learning and proper usage of the C++ Programming language) and another program named Cosmos User Kit. Its a bit easier than WikiHow's way of building an OS but both are overall hard and time consuming but you are free to give them both a try provided you have plenty of free time.
To checkout Instructables' way of building your own OS, Click Here.
Another Alternative Method: Use Tinkernut's Method On Building Your Own OS (Difficulty- Hard)
In 2010, Tinkernut made a Video Tutorial on "How To Make An Operating System", where he briefly showed how to build your own OS using Assembly language. It sounds easy but it really isn't. Infact, if you mess up the Codes then you will end up having tonnes of Bugs and errors. So you really need to have basic knowledge of some (atleast one) Programming language(s).
To checkout Tinkernut's way of building your own OS, Click Here (Its a YouTube Video).
Things to consider before creating your own OS (source: WikiHow):
- Do not wipe your hard drive completely. Remember, wiping your drive will clear out ALL your data and its irreversible! Use GRUB or another boot manager to dual boot your system with another OS until yours is fully functional.
- An alternative method of testing your new operating system is to use a virtual machine. Rather than rebooting your computer each time you make changes, or having to transfer the files from your development computer to your test machine, you use a virtual machine application to run your OS while your current OS is still running. Three such VM applications are VMWare, Bochs (an open source alternative) and Microsoft Virtual PC.
- Use websites such as http://osdev.org and http://osdever.net to help you develop your own operating system. Please note that you are required to thoroughly know C or C++ and x86 Assembly language. You must also understand general and complex programming concepts such as Linked Lists, Queues, etc.
- You are also required to have read the processor manuals for the processor architecture you have chosen; whether x86 (Intel), ARM, MIPS, PPC, etc. The manuals for a processor architecture may be easily found using a Google search ("Intel Manuals", "ARM manuals" etc).
- Do not start an operating system project in order to begin learning programming. If you don't already know C, C++, Pascal, or some other suitable language inside out, including pointer manipulation, low-level bit manipulation, bit shifting, inline assembly language, etc, you are not fit for operating system development.
- It is an excellent idea to keep a backup of the last working source, in case something goes terribly wrong with the current version or your development PC crashes and is unable to boot.
- Consider developing it in a team; that way, less time is required and more problems can be solved and generally the OS may be better.
- It may be a good choice to make a completely new partition for developing the OS.
- You will not have a full system in two weeks. Start with an OS that boots, then move on to the cool stuff.
- Check for potential deadlocks and other bugs.
Here are some OS development resources: (source: Stackflow)
- Writing Your Own Operating System
- Linux From Scratch
- SharpOS (C# Operating System)
- Minix3 and Minix2
- OS Dev Wiki and Forums
- BonaFide
- Bran
- Roll your own toy UNIX-clone OS (the link is down)
- Broken Thorn OS Development Series
- MikeOS
- Freebyte's Guide to Free and non-free Operating Systems
- Pintos Project
- (continued) More at Stackflow :)
Please refer the Instructions, Tips, Strategies & Warnings on WikiHow. It'll really be helpful for you and if you follow them correctly, you may not end up messing up your existing computer and your OS.
Remember, having your operating system carelessly written to the hard drive can corrupt it completely or even fry it (in theory).
Wishing you all the best with your OS!
Download This Page As PDF (So that you can refer later on)
Did you know that you can make dollars by locking selected areas of your blog / site?
ReplyDeleteAll you need to do is to open an account on AdscendMedia and add their Content Locking tool.