How to Make a Computer Operating System
originated by:Cerdg, Travis Derouin, SubOne, Anonymous (see all)
An Operating System (OS) is how you tell your computer what to do. Whether the ones you have found don't measure up, or if you are a hobbyist wanting to have a creation to call your own, it can be a daunting task and it may take years to get your own operating system to be of any use. Remastering an existing Linux distro can also be straightforward and easy.
editSteps
- 1Decide 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.
- 2Decide 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.
- 3Decide 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.
- 4While it is possible to create an operating system in a language such as Pascal or BASIC you will be better off using C or C++ and Assembly. Assembly is absolutely necessary as some vital parts of an operating system require it.
- 5Start small. Begin with small things such as displaying text and interrupts before moving on to things such as memory management and multitasking.
- 6Decide 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 Unices have at least partial support for POSIX, so it would be trivial to port Unix programs to your OS.
- 7Decide 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.
- 8If you want an easy way, consider Ubuntu remastersys, Fedora Revisor, Custom NimbleX, Puppy Remaster, PCLinuxOS mklivecd, SuSE Studio[1] and SuSE KIWI.
LogMeIn Free Trial
Comprehensive Remote Management Solution. Try LogMeIn Central now!www.LogMeIn.com
Migrate to Windows 7
Improve productivity,increased Security With Windows7. Migrate Nowwww.Dell.com/Windows7
editTips
- Do not wipe your hard drive completely. 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 (http://www.vmware.com), the open source alternative bochs (http://bochs.sourceforge.net), and Microsoft Virtual PC (www.microsoft.com ; Microsoft Virtual PC may not be compatible with your distro of linux, but it is the most trustable). VMware also has a freely available server product which should suit nicely.(http://www.vmware.com/products/server/) An easy one is sun's xVM VirtualBox. (http://www.virtualbox.org)
- Getting a copy of the Intel developer manuals fromhttp://developer.intel.com/products/processor/manuals/index.htm is vital
- Use websites such as http://osdev.org and http://osdever.net to help you develop your own operating system. Please note well that for most purposes, the OSDev.org community would prefer that you stick to using their wiki, and do not join the forum. If you do decide to join the forum, there are prerequisites: 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.
- In order to compile an operating system from C or C++ code, you will of course be using one compiler or another. The OSDev community, in its rules, explicitly states that the community is not around to babysit new programmers. If you are trying to develop an operating system, it goes without saying that you are expected to be a programming "God."
- You should therefore read the user guide/manuals/documentation for your chosen C/C++ compiler, whether it comes packaged with the software or is available on the distributor's website. You will need to know many intricate things about your compiler and, for C++ development, you should know about the compiler's mangling scheme and its ABI. You are expected to understand the various executable formats (ELF, PE, COFF, plain binary, etc.), and understand that the Windows proprietary format, PE (.exe) has been copyrighted and that, if you choose to use it, you are wasting your time and if you ask questions on the forum about the use of PE in a kernel you are also wasting everyone else's time.
- 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. No. Uh-uh. Do not. 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. Please, if such is the case, do not join the OSDev.org forums and start asking obvious questions. It will simply result in RTFM answers. You should try reading Wikipedia, and the manuals for the various tools you wish to use.
- Do not expect that a proper operating system will be easy to build. There are, lots of times, intricate interdependencies. For example, in order to make an operating system able to handle multiple processors, your Memory Manager must have "locking" mechanisms in place to prevent multiple processors from accessing the same resource at the same time. The "locks" used for this will require the presence of a scheduler to make sure that only one processor accesses a critical resource at any given time and all the others are made to wait. Yet the scheduler depends on the presence of a Memory Manager. This is a case of a deadlocked dependency. There is no standard way to solve problems like this; each operating system programmer is expected to be skilled enough to figure out his own way of dealing with it. Do not ask stupid questions about implementation details.
- Last but not least it must be emphasized that if while reading this part of the article you find that you're shrinking away, then you should either: (1) Man up and go do the right thing, which is to read fully, and not skim, the manuals for your processor architecture and (2) read the manuals for your development toolchain (compiler, linker, bootloader, etc).
- Your second option is to quit, since it means that you are not a super-1337 programmer and are going to be wasting both your, and everyone else's, time asking stupid questions and getting the same answer: RTFM. You are expected to be up to par as a seasoned sage of a programmer.
- This may seem harsh but, as time passes, more and more 13-year-old big dreamers with no programming experience keep spamming forums and IRC channels and irritating everyone with stupid questions. Everyone wants to make the next Windows. The online OSDev community has been going strong for at least 11 years; have you seen anyone come up and beat Windows over the past 11 years? Do you think you're so great that you can beat the hundreds of programming gods who've worked at the same goal? The answer is no.
- It is an excellent idea to keep a backup of the last working source, in case something goes terribly wrong with the current version.
- 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.
Microsoft® System Center
Get Microsoft® System Center For Your Enterprise. Try it Free Today.Microsoft.com/SystemCenter
Migrate to Windows 7
Improve productivity,increased Security With Windows7. Migrate Nowwww.Dell.com/Windows7
Virtual Dedicated Servers
Fully Managed @Rs.12000 pm. Guaranteed uptime. 24x7 Support!Tatacommunications.com

No comments:
Post a Comment