I want to learn how to build a basic OS, initially in an emulator. The long-term idea is a simple phone that can make calls. Would RISC-V and C be a reasonable place to start, and how much assembly would I need?
Where should I start if I want to build a basic OS?
Answers
RISC-V is a reasonable choice, and QEMU can emulate it on your PC. Start with C and learn enough RISC-V assembly to understand what happens before your C code can run. You may need a little assembly for early startup, depending on the boot setup you choose.
Keep the first goal tiny: get a program running in the emulator and print a message. Then work through things like handling interrupts and managing memory. A basic kernel is a learning project on its own, so leave the phone part for later.
Reply to this answer
Making calls is a separate problem from writing a kernel, and it's likely the harder one if you mean calls over a cellular network. You'll need to deal with cellular hardware and network requirements, potentially including VoLTE and certification.
If the actual goal is a usable phone rather than learning kernel development, starting with an existing phone OS or a stripped-down Android build is a much more practical route. You can explore the phone and networking side without also having to build everything underneath it.
Jexlin-4c:
And if cellular service isn't required, a simple radio project is a different kind of goal entirely. It may not need a full OS.
Reply to this answer
If the hardware side is unfamiliar, try Nand2Tetris first. It builds up from simple digital logic toward a computer and software, which gives you a useful mental model before you tackle a real processor.
For the practical OS side, look for the OSDev Wiki getting started material. A book on operating system design, such as one covering Minix, can complement tutorials by explaining more of the theory.
Reply to this answer
One thing to decide early: are you trying to learn OS development or build a device that makes calls? Both are valid, but they're very different projects.
For the device, look into embedded development and existing hardware rather than assuming you need a full OS from scratch. For the learning project, an emulated kernel is a good target, even if it never becomes a phone.
Reply to this answer
Add your answer
Answers are reviewed before publication.
h.8+notch_316:
So I don't need to learn the whole instruction set before trying to boot something?
5n+spoolgate_438:
No. Learn the instructions and startup conventions you encounter as you go, and keep an architecture reference handy.