Readit News logoReadit News
botirk commented on Show HN: I wrote an OS in 1000 lines of Zig   github.com/botirk38/OS-10... · Posted by u/botirk
sofia44 · 3 months ago
Very cool! Mad props friend
botirk · 2 months ago
thanks!
botirk commented on Show HN: I wrote an OS in 1000 lines of Zig   github.com/botirk38/OS-10... · Posted by u/botirk
s-lambert · 3 months ago
The project was made with an older version of Zig, which used strings as keys in zig.build.zon before but then it was changed to use enum literals in 0.14.0 IIRC.
botirk · 2 months ago
yea exactly!
botirk commented on Show HN: I wrote an OS in 1000 lines of Zig   github.com/botirk38/OS-10... · Posted by u/botirk
valleyer · 3 months ago
Bizarre that the README.md does not specify that this is for RISC-V.

I also went to look to see where "console output" was implemented, and ... it looks like it's just not? ConsoleWriter.write() calls kernel.putChar, which does not exist...

botirk · 2 months ago
were you trying to build with 0.15, it was broken till recently, I like to preface this is not a feature ready OS, its just a learning experiment!
botirk commented on Show HN: I wrote an OS in 1000 lines of Zig   github.com/botirk38/OS-10... · Posted by u/botirk
mtlynch · 3 months ago
Cool projects!

A few suggestions:

- You're committing .zig-cache to git, but that's build output, so it shouldn't be under version control. You should add it to .gitignore (you already have zig-cache without leading dot).

- Your README.md refers to a CONTRIBUTING.md that doesn't exist

- It's helpful to say exactly which Zig compiler you need. It currently says "0.10.0 or later" but 0.10.0 is almost three years old now.[0] Most 0.10.0 code does not compile in 0.15.1.

[0] https://ziglang.org/download/#release-0.10.0

botirk · 2 months ago
yes good point, README was AI generate not going to lie, missed those details its updated now to work with 0.15!
botirk commented on Show HN: I wrote an OS in 1000 lines of Zig   github.com/botirk38/OS-10... · Posted by u/botirk
ants_everywhere · 3 months ago
Sweet!

Folks interested in this may also like "Operating System in 1,000 Lines" https://operating-system-in-1000-lines.vercel.app/en/

and the implementation in C https://github.com/nuta/operating-system-in-1000-lines

botirk · 2 months ago
yes exactly, its based off that!
botirk commented on Show HN: I wrote an OS in 1000 lines of Zig   github.com/botirk38/OS-10... · Posted by u/botirk
wsve · 3 months ago
I was hoping to get some commentary about the project and what lessons you learned from it. You wrote an OS in 1000 lines of Zig, but... So what? What should I take away from this? Are you posting this to encourage people to use the OS, or learn from the project? How was Zig helpful or a hindrance for this? Why limit to 1000 lines? Why did you post this?
botirk · 2 months ago
this is not usable at all, its just to show people that OSes are not mysterious things, at a bare bones level quite simple

u/botirk

KarmaCake day69November 4, 2023View Original