Very cool! I just started to dvelve into RISC-V, and the book I'm reading (not in English) offers their own emulator[1], which, at a glance, is much simpler than QEMU, and comes with a weird license[2]. I wonder if people actually used it, since it looks like an academic project. Maybe I can also follow this tutorial and test it out. [1] https://github.com/NJU-ProjectN/nemu/tree/master [2] https://github.com/NJU-Proj…
You can follow the MIT course and use QEMU if so wish.
Operating System in 1,000 Lines – Intro
31–40 of 129 posts
Re: Operating System in 1,000 Lines – Intro
#32A noble idea, but Github is literally littered with hobbyist home-grown Unix-like kernels in C. As an industry are we not supposed to be trying to move away from hoary old unsafe C? Could we not have a hobbyist educational OSes in more of the C replacements? Drew DeVault wrote Bunnix in Hare, in one month. There's the proof of concept. How about tiny toy Unix-likes in Zig, Nim, Crystal, Odin, D, Rust, Circle, Carbon,…
Why?
> https://en.wikipedia.org/wiki/TUNIS
Interesting; do you know whether the source code is available somewhere?
Re: Operating System in 1,000 Lines – Intro
#33Re: Operating System in 1,000 Lines – Intro
#34QEMU contains a built-in GDB server, you'll need a GDB client built for the target architecture (riscv in this case) and connecting to the QEMU GDB server over the network.
Re: Operating System in 1,000 Lines – Intro
#35Re: Operating System in 1,000 Lines – Intro
#36I wrote this book so you can spend a boring weekend writing an operating system from scratch. You don’t have to write it in C - you can use your favorite programming language, like Rust or Zig.
I intentionally made it not UNIX-like and kept only the essential parts. Thinking about how the OS differs from Linux or Windows can also be fun. Designing an OS is like creating your own world—you can make it however you like!
BTW, you might notice some paragraphs feel machine-translated because, to some extent, they are. If you have some time to spare, please send me a PR. The content is written in plain Markdown [1].
Hope you enjoy :)
[1] https://github.com/nuta/operating-system-in-1000-lines/tree/...
Re: Operating System in 1,000 Lines – Intro
#37A noble idea, but Github is literally littered with hobbyist home-grown Unix-like kernels in C. As an industry are we not supposed to be trying to move away from hoary old unsafe C? Could we not have a hobbyist educational OSes in more of the C replacements? Drew DeVault wrote Bunnix in Hare, in one month. There's the proof of concept. How about tiny toy Unix-likes in Zig, Nim, Crystal, Odin, D, Rust, Circle, Carbon,…
Isn't it? There is a very well-developed kernel written in ADA with SPARK and formally verified at that: https://ironclad.nongnu.org
And PASCAL-derived languages were very popular for operating systems in the 80s. To name a few: Apple's LISA OS, DEC's VAXELN, and OBERON. There were others as well that didn't quite make it, like DEC's MICA and Acorn's ARX.
Re: Operating System in 1,000 Lines – Intro
#38Very nice, I always enjoy some low-level discussion like this. I found a small typo/editing glitch on the "RISC-V 101 page" [1]: - It's a trending CPU ("Instruction Set Architecture") recent years. It should probably say "ISA" instead of "CPU", and the word "in" is missing from after the parentheses, right? Edit: Markdown, don't format the quote as code. Oops. 1: https://operating-system-in-1000-lines.vercel.app/en/0…
I was wondering that too. I'll update it with other examples (x86 and Arm).
Re: Operating System in 1,000 Lines – Intro
#39Apples to oranges, though. It was a specialized firmware system. Probably the biggest part was the IEEE-488 communications handler.
Re: Operating System in 1,000 Lines – Intro
#40Author here. I wrote this book so you can spend a boring weekend writing an operating system from scratch. You don’t have to write it in C - you can use your favorite programming language, like Rust or Zig. I intentionally made it not UNIX-like and kept only the essential parts. Thinking about how the OS differs from Linux or Windows can also be fun. Designing an OS is like creating your own world—you can make it how…