Layers and processes in Chikuma
· workbench
Chikuma works pretty well now, and with a good amount of unit testing behind it, the natural next step is to refactor. I move it from a monolithic firmware to something modular, Unix-shaped, the road Apple took with the later iPods and the iPhone, when everything at Apple started to run on XNU.
Before, everybody imported everybody, the drivers called the UI and the kernel went fishing in the drivers. Now the build counts the imports between layers, a ratchet that fails as soon as there is one more. It started at 1075, I'm at 359, and the functional part stays the same.
Then each service started at boot became a process, with its heap, its ports and its file descriptors, and all of it is given back when it stops. The message ports open like files, /port/<name>, and you read and write them like a socket. It runs on my iPod, the remote presses the Mac sends it reach the UI that way.
For the moment, the processes own their resources but isolate nothing, the MMU is on with one flat table and everything runs in supervisor mode. NetBSD did run on a toaster with an ARM9 of the same kind, so next is MMU domains and user mode.