Hi guys,<br><br>I posted a new 440BX RAM init code a few days ago that was segfaulting romcc, and I didn't get any response.<br><br>In the meantime I have narrowed the cause to this code fragment, with enough wrapper added so it can be fed to romcc on its own:<br>
<br>void romcc_fail(void) {<br>int dimm03 = 0;<br>int dimm47 = 0;<br>char mbsc[5];<br>char mbfs[3];<br>/* begin actual fragment */<br>        if (dimm03 > 2) {<br>                mbsc[4] |= 0x80;<br>                mbsc[1] |= 0x28;<br>
                mbfs[2] |= 0x40;<br>                mbfs[0] |= 0x60;<br>        } else {<br>                mbsc[4] |= 0xc0;<br>                mbsc[1] |= 0x3c;<br>        }<br>        if ((dimm03 + dimm47) > 4) {<br>                mbsc[4]  = 0xba;<br>
                mbsc[0]  = 0x30;<br>                mbfs[0] |= 0x02;<br>        } else {<br>                mbsc[0]  = 0x2c;<br>        }<br>        if (dimm47 > 2) {<br>                mbsc[4] |= 0x20;<br>                mbsc[1] |= 0x02;<br>
                mbsc[0] |= 0x80;<br>                mbfs[2] |= 0x20;<br>                mbfs[0] |= 0x18;<br>        } else {<br>                mbsc[4] |= 0x30;<br>                mbsc[1] |= 0x03;<br>                mbsc[0] |= 0xc0;<br>
        }<br>/* end actual fragment */<br>}<br><br>There are three similar constructs, any one of them is enough to cause a segfault.<br><br>mbfs and mbsc are meant to be an array of bytes that make up the MBFS and MBSC registers in the 440BX, to be written out to it once they're all set.<br>
<br>Thanks for all help<br>Keith<br><br>