[OpenBIOS] [PATCH] drivers/escc.c: Add slot-names property ch-a node under escc

Programmingkid programmingkidx at gmail.com
Tue Feb 9 15:47:57 CET 2016


On Feb 9, 2016, at 3:24 AM, Alyssa Milburn wrote:

> On Mon, Feb 08, 2016 at 10:45:42PM -0500, Programmingkid wrote:
>> Mac OS X's AppleSCCSerial kernel extension requires the slot-names property in order to use any serial ports. This patch adds the property.
>> 
>> After this patch is applied, the next thing that stops Mac OS X from using the serial port is something  having to do with DMA. 
> 
> Great!
> 
> You can assign addresses for serial DMA and even OS 9 will try poking at the
> dbdma controller, so this is just a question of hooking up the qemu side. I
> can try doing this later today if it's useful..

It is definitely useful. The ability to run Mac OS 9 in QEMU depends on it.


> Which version of OS X are you using for testing this?

Mac OS 10.2.8 is running as the guest. 

> 
>> http://www.opensource.apple.com/source/AppleSCCSerial/AppleSCCSerial-126.4.0/PPCSerialPort.cpp
>> In this file the setPortName() function is what does the searching for slot-names. 
>> 
>> Index: drivers/escc.c
>> ===================================================================
>> --- drivers/escc.c	(revision 1378)
>> +++ drivers/escc.c	(working copy)
>> @@ -456,6 +456,11 @@
>>     NEWWORLD(set_property(dnode, "interrupts",
>>              (char *)&props, 3 * sizeof(cell)));
>> 
>> +    /* The four numbers in front of Modem are needed for AppleSCCSerial
>> +       kernel extension compatibility. */
>> +    char *names = "0001Modem";
> 
> Weird. Is this meant to be \x00\x00\x00\x01Modem? (I see that the OS X code
> you linked is just skipping the first four bytes. And it hardcodes the
> PowerMac1,1 case I switched to for my own testing, heh..!)

I don't know if your string would work, but you are right that the first four bytes are just skipped. So it doesn't really matter what they are. 

> 
>> +    NEWWORLD(set_property(dnode, "slot-names", names, strlen(names) + 1));
> 
> If so, I guess you have to replace the strlen with a hard-coded length.

Is there an issue with strlen()? I thought it was a good idea because it makes the code more self-documenting, meaning you understand what the last argument expects. 

> (Shouldn't the slot-name only be set to a string for one channel? Maybe it
> doesn't matter?)

I don't know. But I do know my G3 iMac's value for this property is this:

00000001
Modem

The PowerMac3,1 probably has the same value.

> - Alyssa

Thank you very much for reviewing my patch. 


More information about the OpenBIOS mailing list