Writing a new OS will
not be a trivial undertaking.
The best resource online for OS development would be:
https://wiki.osdev.org/Main_Page
That site contains a lot of information for would-be OS developers.
I don't know how much programming experience you have, but if you are thinking of creating your own OS, you'll need to be an expert coder already!
In order to write an operating system, you will need to at least have a good general knowledge of computer science and operating systems design. You'll need to be an expert programmer with at
least one low-level programming language (like C, or C++). You will also need expert debugging skills. Experience with assembly would also help.
You'd also need to know a lot about:
- The entire toolchain you will be using in order to develop your OS. From compilers/interpreters/debuggers to emulators/virtualisation software that you could use to test your OS in a virtualised environment.
- UNIX systems and the POSIX standard.
- The hardware/platforms you will be targeting. And I mean right down to the manual for the CPU and its instruction set. (e.g. you can download manuals for intel chipsets directly from Intel)
- Executable formats
In order for your OS to be able load and run binary, executable files, you'd need to know about the various binary/executable formats and how they work - So for example, if you were creating something that was compatible with Unix/Linux - you might want to look at how the ELF executable format works.
I could go on and on. My point is: you need to know a LOT!
The few websites and forums out there that are dedicated to OS development (like osdev.net)
WILL NOT hold your hand through the process of learning - the onus will be entirely on you to learn what you need to know. The OS development communities can be quite hostile to new developers too. So be careful not to ask stupid questions, or ask for information that you could get from a manual - they are often quick to dismiss questions like that with the reply "RTFM".
Even osdev.net say that building an OS is not a good way for novice developers to learn how to code.
If you're up to doing all of that reading and research and doing it all yourself - then more power to you.
Stans suggestion of Linux From Scratch might be a good starting point. That would allow you to build your own Linux based operating system from scratch.
And that would give you the option of either:
1. Using pre-existing software components
2. Writing your own components
3. mixing and matching pre-existing software with some of your own custom software.
Alternatively - you could perhaps start out by joining an existing OS project - Like one of the many Linux distributions, or one of the alternative, independent OSes listed on osdev.net (if any of them are still alive):
https://wiki.osdev.org/Projects
Either way, by joining an existing project - you can get a feel for the way things work, learn from the other members of that projects community and build your understanding of things from there.
Then once you are more experienced and confident - then you can think about starting your own OS.
Personally, if it was me - I'd probably take the Linux from scratch approach first. LFS will help you to understand how a Linux distribution is put together.
Alongside that, you might also want to take a look at the
source code and the
documentation for the Linux Kernel, and see how it works too.
After all - If you are going to write your own operating system, you will need a kernel to deal with all resource management and interactions between hardware and software. Even if you decide NOT to use Linux - understanding the design and implementation Linux kernel would help you to be able to create your own kernel.
There is also GNU Hurd - which is GNU's microkernel, which has been in development since a few years before Linux was first released by Linus Torvalds. I don't know what state that project is in, but the last I heard - they were still having some problems with it. But it might be worth having a search for some information about Hurd and how it is designed/implemented.
Sorry for the wall of text. Hopefully some of it will be useful!