this evening I spent a bit of time doing , trying to hook up the IRQ system to the UART driver in userspace, so it can read the data received when it arrives. it's nice to do some low-level work after a couple of months of high-level programming!

Well, there goes my attempt at a simple userspace IRQ handling system. Turns out the IRQ fires again if you return to userspace without clearing the cause of the IRQ...

Here's an example of entering a symbol in the S-expression editor, sped up a bit because apparently my computer doesn't like screen recording and compiling and running a virtual machine at the same time, for some reason...

(The suggestions are bad because I only added the 20 most recently defined symbols to the tree, in order to speed it up a little.)

Show thread

update: still working on the new calling convention where stack frames are just garbage collected objects. things are starting to come together: there are type errors everywhere, but at least they are arriving at the debugger process!

Implemented a debugger process: whenever a process encounters an unhandled condition, it asks the debugger what to do. In this case, the debugger says "pop up a window describing the issue, then stop running."

Fixed some more issues with pattern-matching and a couple miscalculations in the window manager. Now you can open a window in code, and move it around using keyboard shortcuts!

Show thread

A rudimentary window manager is starting to take shape! Still a couple of bugs in the "generic window" code, which seem to be related to the receive-message-and-pattern-match implementation.

Improvements, fixes and new features in: the editor, spans, compositor, pattern-matching, lists, dynamic variables, starting processes, the usb driver and memory allocation.

Went through and applied the new calling convention to the part of the interpreter that does function calls. Seems the stack overflow issue is finally gone! (Although full tail call optimization is not done yet: the way I pass dynamic variables requires a single value on the stack per open scope.)

Show thread

Applying the new calling convention in the Lisp interpreter seems to work modestly well: after fixing a couple of bugs (forgetting to save some registers, accidentally not executing some code, `cmp reg, imm' being assembled to `cmp reg, 0x0'), everything that worked before still works!

Still having similar issues when I actually try typing things in the editor though...

bah, getting stack overflows in code that is just doing recursion.

time to build a good calling convention?

The garbage collector is now able to recycle freed pages! Still a couple of bugs to iron out, since I'm getting "bogus IRQ" kernel panics.

update: movement commands in the editor are starting to work, but my "write the simplest possible implementation, then come back to optimize it" approach is starting to cause out of memory within one (1) minute

so: time to (re)activate the garbage collector

so: time to actually debug the garbage collector now that garbage is being produced

so: time to crash, a lot

getting crashes when I press a lot of keys. processes with weird stacks too (e.g. a userspace process with sp set to an empty kernel stack), so I suspect either stack overflows or bad returns from kernel mode

blargh, something between the "draw string onto a canvas" and "put the canvas on the framebuffer" is going wrong and i can't draw the things to the framebuffer because that is exactly the thing that doesnt work :/

time for scrolling through hexdumps i guess :/

I built a new scheduler for XukutOS! Now processes can sleep for a specified time, allowing other processes to run in the meantime. This should make it possible to create a USB keyboard/mouse driver that doesn't consume your whole CPU time as it polls for updates.

After many weeks of work and breaking my head trying to understand the USB specification, I managed to make a list of the devices that are attached 🎉

untested programming idea 

Obvious follow-up questions:
Has someone come up with this idea before?
Does it actually work?

Show thread

Announcement: my project has a name, and a place on the internet!

Visit XukutOS on Gemini: gemini://vierkantor.com/xukut/

Show older
Vachtnoes

Mastodon is a server for a federated social network: everyone can run a server if they want to, including me. So this is a Mastodon server for me (Vierkantor) and my friends.