Some funny Manux facts
For your interest or your amusement, here are some little facts about the Manux operating system :
- The weirdest bug I encountered was about accentuated characters. The symptom was : vim failed to edit any file whose name contained an accentuated character. It took me quite a bit of time to understand that my shell of the time, sash, was delegating all the commands that contained any non-standard character to bash, who in turn refused to work because of an unimplemented syscall. Of course, with such an initial symptom, I could have searched for long!
- A deserved second place goes to the bug that led to a deterministic kernel crash whenever I would remove a certain debugging trace. Augh! And of course, whenever I put it back, there was no anomaly, and everything seemed to work just right. The final diagnosis? The function called before this one was written using inline assembly, and it contained an error in its list of clobbered registers; while the printk() happened to re-establish a normal situation.
- A bronze medail goes to the bug that prevented vim (again!) from reading regular files through symlinks. The issue seemed incomprehensible, its symptoms were completely incoherent... until I understood that there were not one but two bugs, one in userspace, the other in kernelspace, that were triggered exactly at the same time and with the exact same apparent symptom. Of course the rest wasn't coherent!
- I made plenty of errors while writing the kernel, but here is a funny one that comes to my mind. Once, while writing the kernel memory allocator, I had used the available addresses in a linear way, starting at zero. Uh-huh... Guess why the debugging then became horribly complicated? That's right, the null address had become valid, and the dereferencing of the NULL pointer stopped generating errors. The rule that the NULL pointer is invalid and undereferencable is a userspace rule, and if the kernel wants to benefit from it, it has to do the required work itself!
- I started writing Manux when I was a student, but did not finished it before graduating. I simply kept working on it, always thinking this wouldn't be long... In the end, it took me eight years. Well, I guess everyone can make mistakes!
- The oldest piece of code in Manux is the core of the kernel memory allocator, the mmh. It's actually my first homework for my second year's operating system course, only slightly adapted. Although these works are supposed to be done by two students, the strategy in my team was "we both make the homework, then compare them and give the teacher the best version", so I was able to reuse my work with no copyright issue. But I guess the teachers would be surprised to learn one of these homeworks was actually deployed in a genuine kernel.
- If you speak French, you may find some fun at the reading of the non-regression test readv_1.c. It creates a pipe, on which it emits the last message I haven't been able to translate in English. The message reads : ATTENTION : alerte ? toutes les unit?s. Des renseignements laissent penser que certains de nos ennemis, incapables de falsifier nos messages, sont parvenus par tra?trise ? saboter nos syst?mes de r?ception. Veuillez ?viter toute communication inutile, et rapporter imm?diatement toute anomalie ?ventuelle au quartier g?n?ral ou ? qui de droit (en chiffrement maximal). This wouldn't be so hard to translate, save for the fact that, as part of its task to test the readv() syscall, this test then receives it... In a, well, reordered way : Des renseignements certains, parvenus par tra?trise, laissent ? penser que toutes les unit?s de nos ennemis sont incapables de falsifier nos messages ou saboter nos syst?mes de r?ception. Veuillez rapporter imm?diatement toute alerte ?ventuelle et toute communication ? qui de droit au quartier g?n?ral. ATTENTION : anomalie en chiffrement maximal, ? ?viter (inutile).
- You want a little game? Try finding the very small ASCII-art crocodile hiding in a comment, in the kernel source code.
- The name "Manux" wasn't found by me, it was actually the nickname some of my colleagues gave me in a previous job. They thought I was particularly good as a Linux sysadmin. Well, I hadn't told them I had cloned it.
- Before this name, since I needed to put something in the uname, I had named it "Colbux", but I disliked this name and hoped somebody would later suggest a better one. In fact, I didn't had to ask.
- Amongst the unimplemented Linux syscalls, sched_yield(2) is certainly the funniest. To my knowledge, this is the only syscall whose non-implementation is actually a valid working implementation.
- The kernel is written in three languages : C, assembly, and machine code. Yes, a portion of the kernel is written directly in machine code. Seven bytes, corresponding to four instructions. I guess you won't actually need high fluency in this language to hack it.