GoofyOS

GoofyOS

36 devlogs
89h 4m
•  Ship certified
Created by Nico

Goofy OS is a lightweight, feature-rich operating system built from scratch in Rust. It aims to provide a modern computing experience while showcasing advanced OS concepts and design principles.

We feature:
- Memory management
- Interrupt handling
- I/O Handling
- Userspace and ELF loading
- A fully working desktop env

(This might seem very unclear, please check the repo for more details here: https://github.com/RetrogradeDev/goofy-os)

Timeline

Ship 1

1 payout of shell 2033.0 shells

Nico

5 months ago

Nico Covers 36 devlogs and 87h 56m
Earned sticker
Nico
Nico
1h 10m 5 months ago

More time spent on docs, polishing the UI a bit, media, ...
I think I'm ready to ship but I'm sort of scared, it feels like I'm gambling with almost 90h...

So I finished the docs and they are up and running: https://retrogradedev.github.io/goofy-os/
I hate Jekyll and this theme I picked, but I don't really have time to make something else

Update attachment

As you might have seen, I attached the wrong image in the previous commit. I indeed created some docs using Claude, and now spent some time correcting and editing them, although they covered most of our codebase

Update attachment
Earned sticker
Nico
Nico
2h 19m 5 months ago

I added a TicTacToe game and refactored our window management. I think we're almost ready to ship?

Update attachment
Nico Nico 5 months ago

Wrong attachment :) As you might see, I’m gonna document everything (the AI docs were trash)

Earned sticker
Nico
Nico
11h 7m 5 months ago

I tried adding a userland again! I used eduOS as a reference. Things started well, but once we tried actually executing the code in user mode, we got stuck again. I really don't know what to do. I disabled processes again, but I can't keep avoiding it...

Update attachment

Big FS update! We update the lastaccessdate field on file read, but more importantly, we support copying, moving and renaming files! Most of the time spent on this was making the moving/renaming more efficient (instead of copying+deleting the file, we just change the metadata)

Update attachment

I added some FS info the the Sysinfo app. It's not very useful, but who cares :)

Update attachment

So I made the backbuffer optional and measured the timing difference, and damn it's fast. I can't upload more than one screenshot, but it's also much more stable. This screenshot is a comparison of the original fb (top) and new backbuffer (bottom), based on 2 new screen recordings, taken at exact the same moment. The framebuffer is 10-40x times faster (depends on how many pixels have changed).

Update attachment
Nico
Nico
5h 49m 5 months ago

I finally implemented a basic backbuffer for the VGA framebuffer. The VGA buffer is quite slow, so we write to this second (faster) buffer and copy all the dirty regions when needed. It's still a bit slow so I have to find our whether this is the user->bb or bb->fb part, but I'll start with making this configurable, so I can test the performance impact.

Update attachment
Nico
Nico
3h 17m 5 months ago

IT'S WORKING! Finally, after all this time, context switching is WORKING with CPU register saving/restoring. The only weird thing: it doesn't work when I turn my battery saver on (I have no idea why lol).
I'm gonna try to merge my old branch where I develop process support with my main branch, maybe slower interrupts fix it?

Update attachment
Nico
Nico
1h 53m 5 months ago

I tried working on my userand again, but this context switching errors every single time. I'm thinking about rewriting this entire task sheduler (again)

Update attachment
Nico
Nico
1h 11m 5 months ago

I rewrote our entire config handling so everything (including Uefi/Bios) is handled from a single config file. I also changed the README a bit

Update attachment
Nico
Nico
3h 41m 5 months ago

We now support both UEFI and the Legacy BIOS! It was quite difficult to get the APIC to work, but now we have 200% faster boot times, a slightly faster and slightly larger framebuffer, but more importantly: support for more hardware!

Update attachment

LFN (Long file name) support! You can now create files and folders in other formats and longer than the 8.3 format.

Update attachment
Nico
Nico
1h 11m 5 months ago

You can now create and save files directly in the notepad app! (aka Save As)

Update attachment

We can edit and save files with the notepad!

Update attachment
Nico
Nico
1h 18m 5 months ago

We can now create, delete and navigate through folders!

Update attachment
Nico
Nico
5h 34m 6 months ago

Ladies and gentlemen we have a…. FILESYSTEM (and a extremely basic file explorer)
We have a basic FAT32 implementation and an ATA disk driver, so we can read, write and update files like a real OS! We can forward a FAT32 formatted .img file to QEMU which our ATA driver can read. The FAT32 parser will parse and process all data or send data back to the ATA driver, which will write it to the disk, so we can reboot and still access our files!

The next bunch of updates will include:
- update to the file explorer GUI to support folders
- parse and write long names (currently we only support the 8.3 format)
- parse metadata time and dates
- parse hidden and read only flags
- make our notepad able to write to the FS
- and FS data to the sysinfo app

Update attachment
Nico
Nico
1h 16m 6 months ago

Sysinfo app! This was actually quite hard to make, because I had to find a way to get info about our CPU, memory, stack, heap, ... The rust raw_cpuid handles all the hard work related to our CPU. Stack tracking is quite simple: at the entry point save our stack pointer. When we want to get the ucrrent usage, simply fetch the pointer again and calculate the difference.
For the heap: we just change a var each time we do alloc/dealloc

Update attachment
Nico
Nico
2h 29m 6 months ago

Added a notepad app and polished the taskbar UI. This took longer that I excepted :(

Update attachment

Spent some time polishing our UI. The biggest improvement is probably our way cleaner way of rendering text (you probably won't see this on the screenshot unless you zoom it, but it's WAY smoother). This was actually quite a simple fix: instead of doing color = text_color * pixel_opacity, we do color = text_color * pixel_opacity + bg_color * (1 - pixel_opacity)

Update attachment

Drag apps around!

Update attachment

I implemented dirty rectangle tracking so we only redraw parts of the screen that actually changed (which is way, WAY faster, for some reason the VGA framebuffer is slower than my grandma)

Update attachment
Nico
Nico
2h 37m 6 months ago

I'm here to present: the CALCULATOR!!! I implemented a window manager that keeps track of all apps open and forwards events to them, and this is a example app made with it!
Next up: maybe add a notepad/sysinfo app, improve our Surface* api to rerender only changed parts and polish colors.

Surface API = the piece of code that makes us able to render shapes without rendering them pixel per pixel to the framebuffer

Nico
Nico
1h 42m 6 months ago

Improve performance, added support for mouse buttons and add a small start menu example

A new, very cool mouse cursor! We also calculate the amount of storage needed for the mouse bg at compile time now

Update attachment

Spend a lot of time refactoring our framebuffer to be able to render text when not in console mode, so we now render the time and date in our taskbar

Update attachment

We can now read time from the hardware's Real-Time Clock (RTC).

Update attachment
Nico
Nico
7h 26m 6 months ago

After spending a lot of time on trying to save CPU registers (which didn't work), I decided to try to make a GUI. Of course I'm still working on userland, but a GUI is something nice to have (the red will be the taskbar)

Update attachment

We got mouse input working! I also found out x86_64 has a faster syscall instruction so I will need to adapt my code to that.

We finally have user processes! This took me so long. The final fix was running kernel code using JUMP instead of just calling the entry point. I'm so happy lol, this feature took me 15h (!).
I also installed Zed editor, it's blazing fast but for some reason didn't it log all my time...

Update attachment
Nico
Nico
7h 25m 7 months ago

I got the ELF loading to work, but when the program sends the exit syscall, we can't return to kernel mode for some reason. I spent for 3h debugging it, without a result. I even asked Claude (my original plan was no AI 🥺), but that made it worse, so I think I'll just revert all commits...

Update attachment
Nico
Nico
2h 57m 7 months ago

I tried implementing user processes, but our syscalls always end up with a page fault. I have no idea what I'm doing wrong...

Update attachment

Upgraded the bootloader. This was the most terrible problem in the world, I hate the GDT, but at least we have better graphics now...

Nico
Nico
1h 58m 7 months ago

Render more shapes than just text!

Nico
Nico
3h 46m 7 months ago

Completed 11/12 chapters of the blog

Update attachment
Laky2k8 Laky2k8 7 months ago

This looks really cool already, congrats :D

Are you following some tutorial?