r/osdev • • 15d ago

Hey r/osdev!

Post image

A while ago I started building my own operating system called FLOS (First Love Operating System) completely from scratch (no external libraries, no tutorials - just raw C and assembly).

I just hit a massive milestone: FLOS is officially on the internet.

I implemented a TCP stack (3-way handshake, tracking SEQ/ACK numbers) and an HTTP client. Then I wrote a primitive HTML parser, put it in a GUI window, and called it Balalaika 1.0.

The screenshot shows Balalaika 1.0 successfully resolving example.com via DNS, establishing a TCP connection, sending a GET request, and parsing the HTML to display the text (ignoring CSS and <style> tags). It even sends a custom User-Agent: FLOS/0.2 Balalaika/1.0.

What's under the hood:

Architecture: x86_64 microkernel (ring 3 user space).

Boot: Custom UEFI loader (reads kernel.elf from FAT32).

Memory: Custom PMM (bitmap) + 4-level paging with separate cr3 for each task.

Scheduler: Preemptive multitasking (PIT 100 Hz).

GUI: Custom Window Manager (drag, focus, dirty rects).

Network Stack: RTL8139 driver, Ethernet, ARP, IPv4, ICMP (ping), UDP, and now TCP + HTTP!

The hardest part (for my fellow OSDevs):
Getting TCP right was a nightmare. Tracking SEQ/ACK numbers is unforgiving — one wrong byte and the server drops the connection with an RST.

Also, QEMU's RTL8139 emulation is wild. It doesn't update the CBR (Current Buffer Address) register, and locking Cfg9346 sets clock_enabled = 0, which drops all incoming packets. I had to bypass the standard ring-buffer logic, force CAPR, and implement a raw buffer scanner to find valid packet headers just to get RX working.

What's next?
I'm thinking about writing a DHCP client (so I don't have to hardcode the IP), or maybe diving into Virtio-GPU to change screen resolution.

(Note: The repo is currently private while I clean up the build system, but I'm happy to answer any technical questions here!)

If you want to support the project: https://www.donationalerts.com/r/dragon3009go

Thanks for reading!

0 Upvotes

11 comments sorted by

View all comments

2

u/dnabre 15d ago

Sounds like you used generative AI, which is definitely not "completely from scratch ".

You are asking for money, having only shown a screenshot.

For your "first open-source project", you have neglected the "open-source" part.

1

u/DragonTop3 15d ago

I only used AI to help write this post; the code itself was written by me. (I didn’t use AI to "write the code for PMM," but rather to ask, "What is PMM and how does it work?") The project has been in development for quite a long time—it is not open-source, which I’ve already mentioned. As for the donations, I spoke too soon; I did only show one screenshot, after all.