[OpenBIOS] [PATCH 1/10] Dummy get-key-map in keyboard device package

Andreas Färber andreas.faerber at web.de
Wed Aug 10 21:15:29 CEST 2011


Am 10.08.2011 um 19:53 schrieb Blue Swirl:

> On Tue, Aug 9, 2011 at 9:54 PM, William Hahne <will07c5 at gmail.com>  
> wrote:
>> "get-key-map" is a Forth word that provides a map of all the keys  
>> currently
>> pressed on the keyboard. Since it is only used by BootX to  
>> determine if one
>> of the shortcuts for verbose or single user mode is pressed. It is  
>> a waste
>> of time to provide a full implementation. This just hands out a  
>> dummy key
>> map which specifies verbose mode.
>> Index: drivers/adb_kbd.c
>> ===================================================================
>> --- drivers/adb_kbd.c (revision 1041)
>> +++ drivers/adb_kbd.c (working copy)

>> @@ -566,3 +569,18 @@
>>   }
>>   PUSH(i);
>>  }
>> +
>> +static unsigned char fake_keymap[32] = {
>
> Can this be 'const'?
>
>> + 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00,
>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> + 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00
>> +};
>> +
>> +static void keyboard_get_key_map(void)
>> +{
>> + /* This is a bit of a hack since BootX requires a get-key-map word.
>> +    In the future this should be changed to give the actual current
>> keymap,
>> +    but since this only effects keyboard input in BootX it isn't a
>> priority. */
>> + PUSH( (int)fake_keymap );
>
> 'long' would not truncate on 64 bit host with 64 bit cells.

pointer2cell() or so would be even better. :)

Andreas



More information about the OpenBIOS mailing list