|
From: Daniel R. <cos...@gm...> - 2006-04-23 19:39:22
|
> Using the INIT-STARTUP-STARTUP sequence finally works and boots up AMD > SimNow! The AP is booted up and interrupts are enabled. If I press some > keys, the scancodes are displayed. That's some excellent news, although I still don't quite understand were the problem really was. Bochs, aswell as my HT machine, start booting right after the first SIPI was sent, so that the second one is probably only meant to ensure that the BSP really waits until the AP has received the message. That's just a wild guess though, the Apic documentation just doesn't explain at all what the sequence really does. > I discovered that there is still a slight problem on uniprocessor bochs. > The current IRQ code relies on the presence of an I/O APIC - which does > in > general not exist on a UP system. The code tries to read one of the > registers, which is not mapped into virtual memory, causing a page fault. Hmm, that shouldn't be too hard to fix. During the weekend I played around with hyperthreading a bit and managed to start my second logical processor with merely some 10 lines of code - actually I did expect it to be way less trivial. Before the new feature can be added to the kernel, I'll however have to write some cpuid & msr instruction wrappers fist. As I'll be quite busy during the next few days (school starts again - yuck), I however don't expect to be able to write the code before the thursday. Apart from that I also collected some more information about local Apics on uniprocessors systems. It seems as if virtually all processors from the p54c (1994) onwards actually have a local Apic, that is however very often disabled by the BIOS. Luckily the Linux kernel includes a small hack that tries to activate the Apic by simply re-setting the very flag the BIOS cleared to disable it. According to the Intel Manuals this hack is actually not guaranteed to work, but I guess that there can't be that many problem with it, if it's in the official Linux source.. I've already tried to implement it for our kernel, but it doesn't yet work. After executing the hack the cpuid instruction does report a local Apic, but I can't access its registers. Most probably I'll just have to install a MTRR to mark the region as strong uncachable to make it work. regards, cosmo86 |