When I started writing code for the Serenum hardware back in early 2023, I only had the SOC manual but not the CPU manual. This didn’t cause much issue since the CPU is a compliant risc-v GC + 0.7V design. I have for a long time been impressed with how slow the device is. But you work with what you have, and most recently I have rewritten the compiler to use Sea of Nodes for better optimization and code generation. Once this was done I wanted to gather data from the CPU performance counters for further optimization. But the counters revealed something extremely odd. In an ideal IPC control benchmark I was only measuring 0.005 or 0.01 instructions per clock. It is supposed to be 1.0. Additionally I was reading an icache miss rate of 50 %. An absurd number.
It turns out that there are additional features implemented in this CPU’s MMU. These include extra page table bits that can tell the CPU if the physical memory should be treated as cacheable or not. Since I did not know about these bits, they were set to zero, uncachable. Executing machine code from uncachable memory is not a good idea because it causes each instruction fetch for every instruction to wait 100 cycles on main memory. It turns out that by changing a single bit in a machine configuration register I was able to disable these additional features yielding a 100x speedup of all userspace code. Great News! This has dramatically improved the usability of Serenum.
New things in this release: 1. 100x faster due to fixed icache. 2. The compiler has been rebuilt on a Sea of Nodes architecture. 3. The Static Document Viewer is deployed as the way to read the system documentation. 4. I implemented hotplug for the USB keyboard. It took me 2 hours. I should have done this earlier. 5. I patched in some lower resolution (800x600) rendering for the legacy text editor. Using it is still a primitive experience but now the switch between it and the window manager is instant. This is because the monitor does not need to perform a mode change.
THE FUTURE
Given the 100x improvements I can compromise less on the OS design and IPC interfaces. I am writing a new window manager to run at 1024x768. This will take less time than last because I am walking in familiar territory. I expect release 9 will focus mostly on revised filesystem dynamics and how they interact with the WM. For example, a GUI program must be able to open a graphical “Open File” dialogue. This has to be handled by the Window Manager. Furthermore, I am starting to miss my funky one of a kind split keyboard layout. I want to have a settings menu on the new WM where one can choose keyboard layouts among QWERTY ANSI, QWERTY ISO, DVORAK and “Sams Crazy Layout”.
The crazy part about my layout is that it is not perfect and I don’t intend to stay on it. I have used this layout for 2 years. Enough experience to design a new one from scratch again soon. That is the crazy part.
Also, I am starting a new job. This will slow but not stop Serenum development.