On Feb 23, 2016, at 2:33 PM, Mark Cave-Ayland wrote:
On 23/02/16 03:58, Programmingkid wrote:
On Feb 20, 2016, at 12:18 PM, Mark Cave-Ayland wrote:
I/O offsets were wrong in legacy mode and some were missing in non-legacy mode. This fixes serial port detection in NetBSD, which was ignoring it. This also partly fixes MacOS 9.2, which relies on them to initialize OpenTransport.
Based upon an original patch from Hervé Poussineau hpoussin@reactos.org.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk
openbios-devel/drivers/escc.c | 43 ++++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 13 deletions(-)
diff --git a/openbios-devel/drivers/escc.c b/openbios-devel/drivers/escc.c index 9b87083..44b73f0 100644 --- a/openbios-devel/drivers/escc.c +++ b/openbios-devel/drivers/escc.c @@ -388,7 +388,20 @@ escc_add_channel(const char *path, const char *node, phys_addr_t addr, cell props[10]; int index; int legacy;
- int reg_offsets[2][2][3] = {
{
/* ch-b */
{ 0x00, 0x10, 0x40 },
/* ch-a */
{ 0x20, 0x30, 0x50 }
},{
/* legacy ch-b */
{ 0x0, 0x2, 0x8 },
/* legacy ch-a */
{ 0x4, 0x6, 0xa }
}
- };
- switch (esnum) { case 2: index = 1; legacy = 0; break; case 3: index = 0; legacy = 0; break;
@@ -425,17 +438,21 @@ escc_add_channel(const char *path, const char *node, phys_addr_t addr, set_property(dnode, "compatible", buf, 9);
if (legacy) {
props[0] = IO_ESCC_LEGACY_OFFSET + index * 0x4;
props[1] = 0x00000001;
props[2] = IO_ESCC_LEGACY_OFFSET + index * 0x4 + 2;
props[3] = 0x00000001;
props[4] = IO_ESCC_LEGACY_OFFSET + index * 0x4 + 6;
props[5] = 0x00000001;
props[0] = IO_ESCC_LEGACY_OFFSET + reg_offsets[legacy][index][0];
props[1] = 0x1;
props[2] = IO_ESCC_LEGACY_OFFSET + reg_offsets[legacy][index][1];
props[3] = 0x1;
props[4] = IO_ESCC_LEGACY_OFFSET + reg_offsets[legacy][index][2];
} else {props[5] = 0x1; set_property(dnode, "reg", (char *)&props, 6 * sizeof(cell));
props[0] = IO_ESCC_OFFSET + index * 0x20;
props[1] = 0x00000020;
set_property(dnode, "reg", (char *)&props, 2 * sizeof(cell));
props[0] = IO_ESCC_OFFSET + reg_offsets[legacy][index][0];
props[1] = 0x1;
props[2] = IO_ESCC_OFFSET + reg_offsets[legacy][index][1];
props[3] = 0x1;
props[4] = IO_ESCC_OFFSET + reg_offsets[legacy][index][2];
props[5] = 0x1;
set_property(dnode, "reg", (char *)&props, 6 * sizeof(cell));
}
if (legacy) {
@@ -446,13 +463,13 @@ escc_add_channel(const char *path, const char *node, phys_addr_t addr, OLDWORLD(set_property(dnode, "AAPL,address", (char *)&props, 1 * sizeof(cell)));
- props[0] = 0x00000010 - index;
props[0] = 0x10 - index; OLDWORLD(set_property(dnode, "AAPL,interrupts", (char *)&props, 1 * sizeof(cell)));
props[0] = (0x24) + index;
- props[1] = 0;
- props[2] = 0;
- props[1] = 0x0;
- props[2] = 0x0; NEWWORLD(set_property(dnode, "interrupts", (char *)&props, 3 * sizeof(cell)));
-- 1.7.10.4
I had a lot of problems applying this patch. Eventually I just applied it by hand. Testing your v2 patch set with Mac OS 9.2 ends with an Illegal Instruction error for me. When I tested Mac OS 9.0, the OS just stops booting and does nothing. It doesn't crash. I just sits there doing nothing. The mouse cursor still can move. I tried this OS again and it crashed on the second time. The third time it just sat there doing nothing like the first time.
Just this one patch, or the entire patchset? Pretty much everything just works with "git am" these days?
It was with this patch only. This patch would not show up when I went to view it as raw text.
I think there are two issues here: firstly something does cause memory corruption which can cause random crashes under OS 9, and secondly the changes to the serial ports. We know that OT probe causes OS 9 to crash/hang when booting from a vanilla image, but the probe doesn't take place on pre-installed images. In these cases the hang is almost better than the crash in that at least the OS gets to the point where it can probe the serial ports, it is just that the QEMU emulation is lacking.
Agreed.
If the change in behaviour occurs when booting from a fresh ISO then I'm not too worried because everyone testing at the moment will have removed these extensions from their images. However if existing installed images start to fail then perhaps the patch needs more work.
It was fresh ISO's that I used for testing.