Switching from webdev to backend will be quite frustrating.
First, choose a board/hardware/architecture - maybe even go with an OS simulator which you can run on your machine. Learn C and some assembly (intel, MIPS, ARM, coldfire/motorolla 68k) depending on which CPU architecture you are building your OS for.
I've have seen C++ packages which will allow you to make an OS in C++, then convert it automatically for you to assembly, but it is such a headache to get them to convert properly. I would not recommend them.
Before you start writing code, you should design your OS. Maybe even put your design decisions in a 50 page paper with some diagrams as well.
Some things to think about:
- memory map (where exactly in memory do you load parts of your OS; where will it reside)
- how your scheduler would work (process and/or thread aware, priorities). Perhaps a diagram with queues for different priorities; also a diagram for process states in different queues (Ready, blocked, waiting for msg, running, executing, interrupted, etc)
- how to do interprocess communication (mailboxes, mutexes, atomicity, synchronous vs asynchronous communication, format of
message envelopes {sender process id, receiver process id, message type, message}
)
- how to handle kernel vs user modes
- memory allocation algorithms - you will write your own malloc/free operator (how do you keep track when user allocates memory dynamically? will you use a buddy tree algo? linked list? stack? etc)
- how to handle interrupts (also context switch goes in here - how will you save all registers and restore them: you have one stack you need to keep track of where you are on it)
- standard processes: keyboard process, monitor output, timing,
- how to add timing services
- how to load user processes and run them
- to add preemption or not
- add hotkeys (useful to debug your OS esp. in case it freezes, you can add hot keys to inspect memory)
- testing your OS
EDIT - URL update
Developing Your Own 32-Bit Operating System is out of print but is available online:
http://www.ipdatacorp.com/mmurtl/mmurtlv1.pdf