banner



How To Create A Simple Operating System

Download Article

Download Article

This wikiHow teaches you how to plan and develop an operating system if you don't know how to code in C, or C++. Operating systems manage computer hardware and provide the resources that applications need to run. Writing an operating system from scratch requires a strong command of computer science, a programming language like C or C++, assembly, and code management practices.

  1. 1

    Take some basic Computer Science courses. Unlike developing for the web, creating an operating system requires a strong understanding of algorithms, data structures, computer hardware, and resource management.[1] People get degrees in this stuff, so don't expect to write an entire operating system after reading an online tutorial! Harvard's Intro to Computer Science course is available online through EDX at no cost.

  2. 2

  3. 3

    Learn an assembly language. Assembly languages are low-level languages designed to communicate with different processors. Since assembly is different for different processor types (e.g., x86 assembly Language for Intel, AMD, VIA, and other processors), you'll need to learn the version for the type of processor you're coding for.

    • This open-source book, if read in its entirety, can give you a solid enough understanding for building an operating system.[2]
    • The Art of Assembly Language is a highly-recommended book about assembly available both on and offline.
    • You should also do a lot of research on the type of processor(s) on which your operating system should run. The manuals for processor architecture can easily be found using a Google search ("Intel Manuals," "ARM manuals," etc.).
  4. 4

    Complete an operating system tutorial. OS tutorials will walk you through the process of creating a basic operating system. This gets you used to the process and helps you figure out if there are any pieces you're missing. Once you've completed a tutorial or two, you'll be well on your way to creating your very own operating system.

    • Bare Bones is a tutorial that helps you write your first simple 32-bit kernel. After completing the tutorial, the next step is to use Meaty Skeleton to structure your own operating system.
    • Linux from Scratch is an online book that walks you through creating your own Linux operating system.
    • Operating systems from 0 to 1 is a free book about creating various operating systems from start to finish.
  5. 5

    Figure out your operating system goals. What do you want your operating system to do? How should it look? Do you really need to write an entire operating system or are you just looking to create a certain look for your desktop? These are all things to consider before beginning to code.[3]

    • Consider developing with a team of other programmers. Having a team of developers working on the project will cut the development time significantly.
    • Add your project goals, plans, and questions to your public repository so it's easy for others to help you.
  1. 1

    Choose a development environment. This is the platform you'll be using to code your new operating system. It's a matter of personal preference, but most people either use Windows or a flavor of UNIX. If you're using Windows, it's a good idea to install a UNIX environment like Cygwin or MinGW. You'll generally want to make sure whatever environment you're using includes the following:

    • GCC (the Gnu compiler). If you're using Windows, you can install it in Cygwin or MinGW.
    • Binutils is a collection of tools used for manipulating object files. Again, if you're using Windows, you can install it in Cygwin.
    • A good text editor. Vim and emacs are commonly used in UNIX environments. Windows users can use Notepad, or check out Notepad++ for a multi-tab upgrade.
    • Perl and/or Python. One or both are recommended for string manipulation.
  2. 2

    Set up your version control system. Writing an operating system means you'll likely be creating hundreds (or thousands!) of lines of code. When you're working on revisions, this can get confusing. Some options to check out are CVS, Mercurial, and Subversion.

  3. 3

  4. 4

    Choose a kernel design. The kernel is the core of your operating system, providing an interface between the user and the computer hardware. There are monolithic kernels and micro kernels. 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.

  5. 5

    Start small. Begin with small things such as displaying text and interrupts before moving on to things such as memory management and multitasking. You can also try making a simple 16-bit Operating System, instead of taking a big leap.

    • You will not have a full system in two weeks. Start with an OS that boots, then move on to the cool stuff.
  6. 6

    Test your new operating system with 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, use a virtual machine application. VMWare is a common option that works with both Windows and Linux, and so is Bochs. Check for potential deadlocks and other bugs and repair them as needed.

  7. 7

    Release a "release candidate." You can do this by uploading your tested code to your public repository. This will allow people to test your operating system and report back on any issues they run into.

  8. 8

    Network with other operating system developers. There's an entire community of operating system developers congregating on various forums, including /r/osdev on Reddit and the Software Engineering Stack Exchange. One you've gotten a grasp on developing a basic operating system, read existing posts to see what kind of things come up during the development process.

Add New Question

  • Question

    Can I do this if I have no programming experience?

    Community Answer

    Only if you're willing to learn a lot. You will require a full understanding of at least assembly code, and the motivation to learn more. Building your own OS is not a small task.

  • Question

    What should be my first step?

    Community Answer

    Learn programming languages and concepts, and practice to become a very strong programmer.

  • Question

    Which applications can I use to program my operating system?

    Community Answer

    That depends on the programming language you are using. It is recommended, however, to use an IDE, or Integrated Development Environment, to program your operating system, as IDEs have built-in tools and features to help make development easier. Not all IDEs support every language however, so you will want to specifically search for IDEs that support the language (or languages) you're using.

  • Question

    Is coding my own kernel better than using an existing kernel?

    Community Answer

    Getting an open source kernel is better than coding one if you are in uni or something because you're not having to start from scratch or pay for it since it is open source. However, coding one proves a higher knowledge in programming, which you might prefer.

  • Question

    Can I merge the Windows and Android operating systems?

    Community Answer

    You can, but they're both two different operating systems and it would require a great deal of programming experience and work. Thus, unless you're able to do the programming, don't try it.

  • Question

    How can I merge Windows and Android operating systems?

    Community Answer

    Windows is an unstructured OS, not to mention it's not open source, adding functionality to Windows is a pretty tough task. While Android can be said to be a variant of Linux, a structured and open-source OS, adding functionality layers is easy, but too many layers result in bad user experience. Back to the question, It would certainly require you have extensive knowledge of Android (you can try cooking an Android rom) and insider-knowledge of how some core components of Windows work, so what do you get after merging these two OS, will it be structured or unstructured, to begin with? There's too much ambiguity!

  • Question

    How much time would it take to build a new operating system?

    Community Answer

    It'd take months if not years to make an OS that works properly with plenty of functionality. There's no possible way you can cook up an operating system in a few weeks or days.

  • Question

    Can I make an operating system using java only?

    Community Answer

    Yes, Someone has done that before. However, If you want people to actually use your OS don't use java. It not only will take much, much longer but it will also not be as good as an OS made from another coding language. So, you can, yes, but should you? Probably not.

  • Question

    What are some essential skills for developing an OS?

    Community Answer

    You need a LOT of knowledge regarding assembly and a low-level language, such as C. You'll also need extensive knowledge on memory handling, and will need to be able to handle connections with devices and peripherals.

  • Question

    Can you give me more information about graphics and where to start?

    Community Answer

    You can make the graphics yourself, and you can start anytime and in any place you want. All you need is some programming knowledge and some software to program it with. If you're not sure what to do, doing an online tutorial with such places as Code Academy or Khan Academy might help.

Show more answers

Ask a Question

200 characters left

Include your email address to get a message when this question is answered.

Submit


Video

  • Be sure to implement security features as your top priority if you ever want your system to be viable.

  • After all development is done, decide if you want to release the code as open source, or proprietary.

  • 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; as a programmer, you are expected to be skilled enough to figure out his own way of dealing with it.

  • An operating system can be user friendly, too. Make sure to add user friendly features, making these an integral part of your design.

  • Do not join the OSDev.org forums and start asking obvious questions. It will simply result in "Read the Manual" answers. You should try reading Wikipedia, and the manuals for the various tools you wish to use.

  • Do not start an operating system project 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 ready for operating-system development.

  • If you do something ill-advised, like write random bytes to random I/O ports, you will crash your OS, and can (in theory) fry your hardware.

About This Article

Article SummaryX

1. Take some computer science courses.
2. Learn a high-level programming language at an advanced level.
3. Learn a low-level assembly language.
4. Complete an operating system tutorial.
5. Plan your operating system.
6. Create your programming environment.
7. Build and test.
8. Release a release candidate.

Did this summary help you?

Thanks to all authors for creating a page that has been read 1,469,486 times.

Is this article up to date?

How To Create A Simple Operating System

Source: https://www.wikihow.com/Make-a-Computer-Operating-System

Posted by: sainanderser.blogspot.com

0 Response to "How To Create A Simple Operating System"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel