Author: mcayland Date: Sat Nov 24 15:43:11 2012 New Revision: 1073 URL: http://tracker.coreboot.org/trac/openbios/changeset/1073
Log: PPC: Add keyboard device alias as a duplicate of stdin.
This is required when attempting to boot Mac OS X.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk
Modified: trunk/openbios-devel/arch/ppc/qemu/qemu.fs
Modified: trunk/openbios-devel/arch/ppc/qemu/qemu.fs ============================================================================== --- trunk/openbios-devel/arch/ppc/qemu/qemu.fs Sat Nov 24 15:43:09 2012 (r1072) +++ trunk/openbios-devel/arch/ppc/qemu/qemu.fs Sat Nov 24 15:43:11 2012 (r1073) @@ -46,6 +46,14 @@ then ;
+\ set the keyboard alias to stdin +:noname + active-package + " /aliases" find-device + input-device encode-string " keyboard" property + active-package! +; SYSTEM-initializer + \ ------------------------------------------------------------------------- \ pre-booting \ -------------------------------------------------------------------------
On 2012-Nov-24 09:43 , repository service wrote:
+\ set the keyboard alias to stdin +:noname
- active-package
- " /aliases" find-device
- input-device encode-string " keyboard" property
- active-package!
+; SYSTEM-initializer
- \ ------------------------------------------------------------------------- \ pre-booting \ -------------------------------------------------------------------------
I'm not sure that's the right answer - the input device isn't necessarily a keyboard, is it?
The way openboot creates this alias is during device creation. When a keyboard is created, FCode creates a boolean property "keyboard" in its device node. Openboot's framework, when device creation is done (I think it's in finish-device), looks for this property and creates a keyboard devalias when it exists. That might be heavier weight than needed for openbios (you don't need to support multiple keyboard drivers, like adb and usb, independently), but I'm a bit apprehensive about just assuming input-device is a keyboard.
On 24/11/12 18:37, Tarl Neustaedter wrote:
I'm not sure that's the right answer - the input device isn't necessarily a keyboard, is it?
The way openboot creates this alias is during device creation. When a keyboard is created, FCode creates a boolean property "keyboard" in its device node. Openboot's framework, when device creation is done (I think it's in finish-device), looks for this property and creates a keyboard devalias when it exists. That might be heavier weight than needed for openbios (you don't need to support multiple keyboard drivers, like adb and usb, independently), but I'm a bit apprehensive about just assuming input-device is a keyboard.
Hi Tarl,
In OpenBIOS, input-device is set during the architecture-specific initialisation code to either a keyboard/serial port depending upon the options passed into QEMU. So for example, if I launch QEMU with -nographic then the OpenBIOS will use the serial ports instead of the keyboard. Perhaps the comment above the word is slightly misleading, but the code as it stands will correctly duplicate whatever input device has been chosen from the QEMU hardware configuration. If there is another variable I should be using instead, please let me know and I'll make the relevant changes.
ATB,
Mark.
On 24/11/12 18:37, Tarl Neustaedter wrote:
I'm not sure that's the right answer - the input device isn't necessarily a keyboard, is it?
Ah hang on a second - perhaps I've misunderstood you here. Is what you're saying here is that the keyboard property can only belong to a (physical) keyboard device?
ATB,
Mark.
On 2012-Nov-24 13:50 , Mark Cave-Ayland wrote:
I'm not sure that's the right answer - the input device isn't necessarily a keyboard, is it?
Ah hang on a second - perhaps I've misunderstood you here. Is what you're saying here is that the keyboard property can only belong to a (physical) keyboard device?
Right. You don't want to create a keyboard devalias if the input-device is a serial port. It may not matter for openbios under qemu, but when you get to real hardware, there are cases where you need to distinguish between keyboards and serial ports.
On 24/11/12 19:03, Tarl Neustaedter wrote:
Right. You don't want to create a keyboard devalias if the input-device is a serial port. It may not matter for openbios under qemu, but when you get to real hardware, there are cases where you need to distinguish between keyboards and serial ports.
Hmmm. How about we do something along the lines of: scan all devices in /aliases for one with a device_type of keyboard, and assign the keyboard alias to the first one we find? The main reason for doing this is that I'd like to keep the alias assignment outside of the hardware driver code.
ATB,
Mark.
On 2012-Nov-24 14:09 , Mark Cave-Ayland wrote:
.
Hmmm. How about we do something along the lines of: scan all devices in /aliases for one with a device_type of keyboard, and assign the keyboard alias to the first one we find? The main reason for doing this is that I'd like to keep the alias assignment outside of the hardware driver code.
Why scan the device in /aliases, rather than the entire device tree? On real hardware, your keyboard may not already be represented in /aliases.
On 24/11/12 19:13, Tarl Neustaedter wrote:
Why scan the device in /aliases, rather than the entire device tree? On real hardware, your keyboard may not already be represented in /aliases.
Okay - I have a revised patch that works which I shall send through to the list for review shortly.
ATB,
Mark.