Very cool! Would suggest https://oshub.org/explore if youre interested in hobby operating systems.
HN user
joexbayer
A related article discussing Gustedt’s first defer implementation, which also looks at the generated assembly:
https://oshub.org/projects/retros-32/posts/defer-resource-cl...
Up to TCP most protocols are very straight forward, atleast getting them to work semi reliable. But then TCP explodes in complexity with all the state management and possible paths a connection can take.
HTTP is mostly annoying because of all the text parsing :D
Wow! Looks great! Id suggest checking out https://oshub.org/ it has a lot of hobby operating systems similar to this one.
Small blog post exploring a defer implementation using GCC’s cleanup + nested functions, looking at the generated assembly and potential use cases.
I’ve had a bunch of images of my OS lying around from over the years. Luckily, I started taking them early, all the way back to the textmode days. I thought I’d put together a small post series to look back on the different stages and how it’s evolved.
Any feedback is welcome! Hope you enjoy.
Been working on this site for a while after working on my own hobby OS for a few years. Idea is to have a central place to share and gather hobby operating systems.
Its possible to login with github and import projects from gitlab, codeberg and github. You can also import your projects without a user (although you wont be able to manage the project then).
Also allows posting "posts" on your project (devlogs, blogs, discussions, releases). Its all still in beta and got some future ideas that would be cool to implement. Would love any ideas or feedback.
Been posting changelogs at: https://oshub.org/changelogs
Oh, didn’t notice that lmao!
I’m overwhelmed with the effort you put into making my OS run! I really appreciate it! Will take some time to through it all in detail. But a lot of the partitions and filesystem parts of the OS was simply to be able to mount the image in Linux and copy over files. Initially my OS and bootloader didn’t need partitions. As you noticed currently the kernel is not part of the filesystem, but is prepended. The entire partition / boot system is very shaky, so a lot more work will have to go into making it stable. Thanks again for all your comments and efforts. Will try to implement and research as much as possible of the parts you touched on! Thanks!
Thanks! I’d encourage you to continue! Took alot of breaks myself, but chipping away at it is really rewarding.
Ahh embarrassed I did not pick up on that.
Thanks!
Yeah, love that machine! Thanks!
I think the two best places to learn about it is the osdev forum and osdev wiki. There are so many useful resources to get you started there.
There are some tutorials out there too, but a lot of them have bugs and you basically recreate their OS.
Regarding studying opcodes, I never went that deep, closest I got was looking them up for my C compiler, so I know the most common basic ones.
https://forum.osdev.org/ https://wiki.osdev.org/Expanded_Main_Page
Thanks! Yes, knowing that you’ve written everything from high up in userspace down to the drivers is a great feeling! But also a debugging hell…
The C compiler is built for the OS, and works inside it. The project became just so big that I wanted to take it out of the OS repo. Especially because it works on Linux too.
Oh, I really like UNIXes abstractions and use alot of them in my OS. What I meant was, because I use GCC for compiling, ld for linking, ar for archives etc, I noticed that I got really bound to the C way of UNIX. Or maybe POXIS would be more appropriate. It did “force” me into some design decisions which I did not like. Or even just the way I wrote C is so UNIX / Linux like. Wish I tried to branch out more, especially considering how different Windows C is.
I guess yeah, a full plan would perhaps make it like work. I guess I meant more like an idea of what the goal is. So I could better plan the features.
Oh I doubt that, probably will never be even close. But, it was never the goal to create a “real” product. Just a hobby project for myself to tinker with.
Had a rule for myself that I wanted to write everything myself, and it had always been a “goal” of mine to build one. So it just kinda fit together
There is no magic interaction between the compiler and OS. It simples compiles to the same machine code (i386) and uses interrupts for system calls. Structs are handled as a memory region with a size based on its members, and the member access is simply an offset into that region.
Current it has lots of limitations such as only int and char, no switch statements etc. The biggest change from default C, is allowing functions in structs and implicit passing a struct to a function if it’s a struct function. You can read more here:
Oh I’d love to, but good UI is apparently my biggest weakness. I’ve rewritten it so many times. And I’m probably gonna rewrite it soon again.
I’d love to hear about you project! Seeing what other people make is a big inspiration. I have not tried Zig, for the kernel I don’t think anything will beat C for me personally. But for userspace applications I’d love to try it!
Thanks for the feedback! I think the biggest thing I’d do different is to have a plan. I just started out with the goal of doing the basic hello world OS, and that’s it. But then I kept adding new things, adding more and more working on multiple things at the same time. Which has lead to some technical debt I’m still trying to fix. I’d also try to be less UNIX dependent.
Regarding language, I love C for its basic syntax and “straight to the point” style. Maybe I’d consider some other languages for userspace applications.
A goal for me from the start was always that I wanted to write everything myself, no porting of any software, and for me that’s the entire point of the project. I mostly adhered to the rule of copy ideas not code.
WiFi is definitely on my todo list! Already have written some C WiFi code, just need to find time to writer the driver.
Hehe, yeah was a Turbo was a big inspiration for the textmode editor.
Thanks! The feedback has been amazing. Motivates me to do more!
Thanks! Most of the window / graphics system is handled in the kernel, here are the two “services” which do a lot of the heavy lifting:
https://github.com/joexbayer/RetrOS-32/blob/development/grap...
https://github.com/joexbayer/RetrOS-32/blob/development/grap...
Yes! Love seeing other OS projects on here, always inspiring!
Appreciate your response! Will have a look at 16by16 fonts.
Thanks! It’s really liberating not having to worry about selling, marketing etc. Only reinvent the wheel till new ideas come. :D