[OpenBIOS] [PATCH] Adds get-key-map to keyboard node

Mark Cave-Ayland mark.cave-ayland at ilande.co.uk
Mon Dec 3 22:06:01 CET 2012


On 03/12/12 20:51, Programmingkid wrote:

>> Are you sure about this? I'd be surprised if there wasn't already some
>> kind of workaround in place. As mentioned before, OpenBIOS is designed
>> to be able to run on real hardware with minimal modifications and so
>> I'm not greatly keen to do this.
>
> On real hardware? I'm not too sure about that. This page seems to
> disagree as well:
> http://www.openfirmware.info/OpenBIOS
>
> "Do not try to put OpenBIOS in a real boot ROM, it will not work and may
> damage your hardware!"

You missed the part about minimal modifications; the hardware 
initialisation routines need to be changed (to probe directly rather 
than taking information supplied via the QEMU API) but we know from 
recent emails on the list that some people are actually using OpenBIOS 
in this way.

>> Have you asked the developers on the qemu/qemu-ppc mailing lists how
>> to emulate the command key on a non-Mac?
>
> No I haven't. All the PowerPC developers are busy making some target
> called P series. I really doubt they have the time or interest in
> emulating the command key.

Sure they are now, but I'm reasonably confident that at least a couple 
of them have worked on the Mac emulation in the past. Even if they don't 
know the answer, they will be able to point you directly to the part of 
the code you need to modify, and if a patch is required, exactly what 
you would need to do in order for it to be accepted. But without asking, 
we don't even know anything yet.

> I have looked at the code QEMU uses to handle key strokes and see no
> code that sends the command key to the emulated environment. The file
> itself is called cocoa.m.
>
> Here is the code from cocoa.m that handles the keyboard:
>
> case NSKeyDown:
>
> // forward command Key Combos
> if ([event modifierFlags] & NSCommandKeyMask) {
> [NSApp sendEvent:event];
> return;
> }
>
> // default
> keycode = cocoa_keycode_to_qemu([event keyCode]);
>
> // handle control + alt Key Combos (ctrl+alt is reserved for QEMU)
> if (([event modifierFlags] & NSControlKeyMask) && ([event modifierFlags]
> & NSAlternateKeyMask)) {
> switch (keycode) {
>
> // enable graphic console
> case 0x02 ... 0x0a: // '1' to '9' keys
> console_select(keycode - 0x02);
> break;
> }
>
> The line below "// forward command key combos" is what filters out the
> command key. I see no code to emulate the command key.

I'm afraid I've never programmed a Mac, and so cannot really offer any 
advice here.


ATB,

Mark.



More information about the OpenBIOS mailing list