<font face="arial, sans-serif">Hello,</font>
<div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">I would like to apologize for not splitting up my last post. I am a Google Summer of Code student working on getting Mac OS X to work in Qemu. </font></div>


<div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">Currently the cpu device in OpenBIOS has incorrect timebase-frequency and clock-frequency properties. The Mac OS X scheduler relies on these values to calculate the length of a timeslice. Both values are taken from fw_cfg by OpenBIOS. </font>The problem with timebase-frequency is that the value is far too high. Mac OS X depends on this value being sufficiently smaller than clock-frequency. The value for clock-frequency no longer even exists in fw_cfg and is therefore reported as 0. Mac OS X needs some value here even if it doesn't indicate an actual cpu frequency. The patch below for OpenBIOS provides some fake values that work, but since the values are hard-coded into OpenBIOS, it isn't a very nice solution. </div>


<div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">The best solutions I can think of are to either compute clock-frequency in OpenBIOS or have Qemu provide a value even if its purpose is only to appease Mac OS X or any other OS that depends on the value. If the timebase frequency is correct than it can be lowered otherwise it can be corrected. I am posting this RFC to get thoughts more on what to do with clock-frequency. For reference the timebase frequency is from the fw_cfg value FW_CFG_PPC_TBFREQ and clock frequency is from FW_CFG_PPC_CPUFREQ.</font></div>


<div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">Thanks,</font></div><div><font face="arial, sans-serif">William Hahne</font></div><div><font face="arial, sans-serif"><br>
</font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif"><div>Index: arch/ppc/qemu/init.c</div><div>===================================================================</div>
<div>--- arch/ppc/qemu/init.c<span style="white-space:pre-wrap">  </span>(revision 1041)</div><div>+++ arch/ppc/qemu/init.c<span style="white-space:pre-wrap">  </span>(working copy)</div>
<div>@@ -250,12 +250,14 @@</div><div>     push_str("icache-block-size");</div><div>     fword("property");</div><div> </div><div>-    PUSH(fw_cfg_read_i32(FW_CFG_PPC_TBFREQ));</div><div>+    /* XXX - Mac OS X needs valid values for timebase-frequency and clock-frequency</div>


<div>+       for scheduling to work. These are just temporary values and shouldn't be hardcoded here. */</div><div>+    PUSH(16600000);</div><div>     fword("encode-int");</div><div>     push_str("timebase-frequency");</div>


<div>     fword("property");</div><div> </div><div>-    PUSH(fw_cfg_read_i32(FW_CFG_PPC_CPUFREQ));</div><div>+    PUSH(266000000);</div><div>     fword("encode-int");</div><div>     push_str("clock-frequency");</div>


<div>     fword("property");</div></font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif"><br>
</font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif"><br>
</font></div>