Re: [hatari-devel] hatari tt scc emulation

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Eero Tamminen schrieb:

> On 07/17/2017 09:43 AM, Christian Zietz wrote:
>> I'm quite confident that -- if required -- I could provide a test case
>> that does not need MiNT and that will crash at the same instruction
>> inside TOS 3.06.
> 
> That would be useful!

Please find attached the test case, in source form as well as compiled
with Pure C. This little programs tests that Bconmap and the TT SCC are
available, then it reads the current baud rate and sets it again -- all
using XBIOS functions, not direct HW access. Under Hatari with TOS 3.06
and TT emulation, this crashes in TOS code while accessing the SCC
Channel B control register at $FFFF8C85:

Bus error exception at 0xe0312a!
$00e0312a : 14bc 000c                          move.b    #$c,(a2)

.... where A2 is $FFFF8C85.

I don't think the application (be it MiNT or be it my testcase) can be
faulted for using XBIOS functions to access a serial port that TOS
claims is available.

> Michael, attached is (untested) patch to disable SCC write bus errors.

I'm afraid there's something wrong with it. TOS 3.06 crashes during
startup. It seems like access to the SCC DMA control ($FFFF8C14) also
needs to be intercepted. When I add...

{ 0xff8c14, SIZE_WORD, IoMem_VoidRead, IoMem_WriteWithoutInterception },
        /* SCC DMA */

.... to ioMemTabTT.c, the sample FreeMiNT installation provided to me by
Michael boots without crashing.

Regards
Christian
-- 
Christian Zietz  -  CHZ-Soft  -  czietz@xxxxxxx
WWW: http://www.chzsoft.de/
PGP/GnuPG-Key-ID: 0x52CB97F66DA025CA / 0x6DA025CA

Attachment: bconmap.zip
Description: Zip compressed data

#include <tos.h>
#include <stdio.h>

int main(void) {

	BCONMAP *map;
	long baudrate;

	if (Bconmap(0) != 0L) {
		printf("Bconmap not available!\r\n");
		return 1;
	}
	
	map = (BCONMAP*)Bconmap(-2);
	printf("Bconmap reports %d devices\r\n", map->maptabsize);
	
	Bconmap(6);
	baudrate = Rsconf(-2,-1,-1,-1,-1,-1);
	Rsconf((int)baudrate,-1,-1,-1,-1,-1);
	printf("ST serial port baud rate setting: %ld\r\n", baudrate);

	if (map->maptabsize >= 2) {
		Bconmap(7);
		baudrate = Rsconf(-2,-1,-1,-1,-1,-1);
		Rsconf((int)baudrate,-1,-1,-1,-1,-1);
		printf("SCC port B baud rate setting: %ld\r\n", baudrate);
	}	
	
	return 0;
}


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/