[OpenBIOS] Qemu, OpenBIOS, and HostID
Olivier Danet
odanet at caramail.com
Sat Dec 28 23:43:27 CET 2013
On 28/12/2013 22:16, Artyom Tarasenko wrote:
> Hi Oliver,
>
> On Fri, Dec 27, 2013 at 10:56 PM, Olivier Danet <odanet at caramail.com> wrote:
>> On 27/12/2013 20:42, Tarl Neustaedter wrote:
>>> On 2013-Dec-27, 14:10 , Nick Couchman wrote:
>>>> First, thanks to everyone who has worked to get OpenBIOS up to its
>>>> current functional level over the past couple of years. I'm using Solaris 9
>>>> on OpenBIOS with pretty good success these days, which is awesome.
>>>>
>>>> I do have a question about Qemu, OpenBIOS, and the Solaris hostid. It
>>>> seems that, currently, when booting Solaris with Qemu, the host ID is set to
>>>> "80000000." As far as I can tell, this isn't near correct - according to
>>>> all of the documentation I've read, the host ID should be calculated based
>>>> on the machine type, and some portion of the MAC address. This may be the
>>>> wrong forum in which to ask this, but I'm wondering if someone could shed
>>>> light on why it shows up that way, and if there's a way in OpenBIOS via the
>>>> PROM/NVRAM data to set the host ID to something a little bit closer to
>>>> normal?
>>>
>>> The HOSTID used to have embedded knowledge about the system type and other
>>> details. As of (I recall) Sun4u, the hostid is 0x8000.0000 plus a serial
>>> number. Openbios should pick a number other than "0" for the serial number
>>> :-)
>>>
>>>
>> [On 32bits SparcStations]
>> The Host ID is made of the machine type and the serial number.
>> the serial number is identical to three bytes of the Ethernet MAC address,
>> shown as decimal during boot.
>> All that stuff is written into the NVRAM
>>
>> For example, on a SparcStation 20 :
>> MAC Address = 08:00:20:74:FB:DA
>> Host ID = 7274FBDA (72 is the machine type of the SS20)
>> Serial number = #7666650 = 0x74FBDA
>>
>> (And the barcode on the NVRAM chip is also "74FBDA" )
>>
>> On a SparcStation5, the machine type is 0x80, everything else is identical.
>>
>> Maybe this small patch for QEMU could help :
>> ------------------------------------------------------------------------
>> diff --git a/include/hw/nvram/openbios_firmware_abi.h
>> b/include/hw/nvram/openbios_firmware_abi.h
>> index 5e6e5d4..492c8d5 100644
>> --- a/include/hw/nvram/openbios_firmware_abi.h
>> +++ b/include/hw/nvram/openbios_firmware_abi.h
>> @@ -62,6 +62,8 @@ Sun_init_header(struct Sun_nvram *header, const uint8_t
>> *macaddr, int machine_id
>> header->type = 1;
>> header->machine_id = machine_id & 0xff;
>> memcpy(&header->macaddr, macaddr, 6);
>> + memcpy(&header->hostid , &macaddr[3],3);
>> +
>> /* Calculate checksum */
>> tmp = 0;
>> tmpptr = (uint8_t *)header;
>> ------------------------------------------------------------------------
> Can you please submit this patch (+ SoB) to the qemu-devel mailing list?
> It's short and beautiful.
>
> Artyom
>
The "idprom" property produced by OpenBIOS is modified with this patch,
but I do not have any Solaris image.
Can you test it ?
Olivier
More information about the OpenBIOS
mailing list