October 11-12
Visit the Haiku developer and user event in Düsseldorf, Germany.
axeld's blog
Why BFS needs chkbfs
You are probably aware of the existance of chkbfs. This tool checks the file system for errors, and corrects them, if possible.
Nothing is perfect, so you might not even be asking yourself why a journaling file system comes with such a tool.
In fact, it wasn't originally included or planned in the first releases of the new BFS file system. It was added because there is a real need for this tool and you are advised to run it after having experienced some BeOS crashes.
FreeType bashing
As many of you know, we are using FreeType as our font renderer. It is already able to produce very nice font renderings, but the quality of the rendering still seem to improve with every further version.
Until today, we were using FreeType in a wrong way, though. That didn't affect the rendering quality, but let the app_server crash pretty regularly (note, it still does that, but for different reasons and even a tiny bit less often 8-)). Somehow we assumed that FreeType was safe to be used in a multi-threaded environment. It even kind of is, but not in the way we used it.
Not yet
As I advertised yesterday, I had a short look at hyper threading today. Well, that short look was actually a bit longer than what I hoped for - and it even still doesn't work.
While starting up the second logical processor is working almost fine - for some reason it needs some longer timeouts between the initialization commands - I get no interrupts anymore, when both processors are running. Have I said none? Not true, as the inter-CPU messages (which are interrupt based) are still working. But even the APIC timers don't trigger an interrupt anymore (the timer interrupt is what makes the CPU switch to another thread from time to time).
Hyper Threading?
Tomorrow, I'll have a short look at implementing Hyper Threading support - not the full monty, but it would still be nice to have it start using the two logical processors in my system; after all, I bought this system with enabling Hyper Threading in Haiku in mind.
After that excursion, I will start looking at the app_server again. I had started to refactor the code some weeks ago, but got interrupted, and didn't find the time to continue this effort. I hope to make the app_server stable in the next few weeks - it's one of the biggest show stoppers for Haiku right now: the kernel should decide when the time for a reboot has come (read KDL), not some bloody userland application :-)
Finally
I just booted into Haiku working on an SMP machine. Unfortunately, I am not really sure what change exactly triggered this - I've tried so much and all of a sudden it started to work, after I disabled setting up the APIC (the advanced programmable interrupt controller) to use ExtINT delivery mode - that shouldn't tell you anything, I know, but it's still remarkably that this code was originally disabled as well.
It took me quite a number of hours to get it working, so it's a bit frustrating not to know what was actually responsible for the hickup, but it still didn't make me that curious to start an investigation on this topic for now...
SMP update
Even though I usually don't work at the weekend, I had to, since I didn't manage to work 8 hours on friday.
Unfortunately, I still haven't got SMP to work yet. I've investigated the issue, and came to the simple conclusion that the APIC interrupts doesn't reach their goal (it just took me some time to get there, and exlude all other possible faults). I can trigger such an interrupt manually, so the second CPU is setup correctly, but its APIC doesn't seem to be. You don't understand a word of what I just said? Well, let's just say one CPU doesn't manage to talk to the other CPU (through the APIC, the "advanced programmable interrupt controller").
Signal Distractions
It took a bit longer to get the dual machine up and running again - it has two 500 MHz PIIIs and the hard drive is a bit older as well, so it took about two hours to update the source repository and get it compiled.
While waiting for the machine to complete its task, I had the time to look into some other known issues of our code, and clean the signaling code a bit. We are now able to handle signals with interrupts turned on, some minor bugs went away, and there is now support for sigsuspend() and sigpending() - nothing earth shaking, but definitely a step into the right direction.
There were some other distractions, so I played around with SMP only shortly - I am just sure now that it still doesn't work :-)





