EMUTos + AltRAM

General Discussion, STOS.
czietz
Posts: 586
Joined: 14 Jan 2018 13:02

Re: EMUTos + AltRAM

Post by czietz »

Adding to my previous post: One can easily verify correct Alt-RAM detection (without having an Atari TT) with Hatari:

grab0019.png
grab0020.png

And here's a photo from back when I had by TT temporarily at 512 MiB TT-RAM:

emutos_512mb.jpg

I already pointed to EmuTOS's TT-RAM detection routine in my previous post. It goes through memory in 1 MiB steps and checks two things:
1. there is no bus error,
2. some test data can be written and read back.

If I had a PiStorm, I would check why tests apparently start to fail above 64 MiB. Perhaps there is some mirroring of memory?
You do not have the required permissions to view the files attached to this post.
czietz
Posts: 586
Joined: 14 Jan 2018 13:02

Re: EMUTos + AltRAM

Post by czietz »

czietz wrote: 02 Aug 2023 17:43 If I had a PiStorm, I would check why tests apparently start to fail above 64 MiB. Perhaps there is some mirroring of memory?
To better explain what I mean: Purely as a hypothesis (I don't have a PiStorm and I wouldn't even know where to check) let's consider what might happen: EmuTOS checks for the 65th MiB of TT-RAM, which is located at 65+16 = 81 MiB. Now, the PiStorm's CPU emulator says "sorry, I can't handle that" because only 64 MiB of TT-RAM are mapped. If, however, this causes the request to be put onto the Atari's bus (which is only 24 bits), it will wrap around and look like an access to ST-RAM. Thus, the ST-RAM will "mirror" above the TT-RAM. This, obviously, causes the TT-RAM detection routine to fail to detect the correct amount.

Can you please make sure that directly above the mapped TT-RAM there is either a bus-error (preferred solution) or at least 1 MiB of memory that cannot be written to?
dad664npc
Posts: 166
Joined: 12 Sep 2022 14:32
Location: Oxfordshire

Re: EMUTos + AltRAM

Post by dad664npc »

Many thanks for the feedback. So I have a bit of work then to find out what I've buggered up :)
ATARI STfm, STe, Mega ST, TT
Amstrad CPC464, CPC6128
PiStorm dev - https://github.com/gotaproblem/pistorm-atari
Pico HDC - https://bbansolutions.co.uk
czietz
Posts: 586
Joined: 14 Jan 2018 13:02

Re: EMUTos + AltRAM

Post by czietz »

I think I might have found something. Note though that this is my first look ever into the PiStorm/PiStorm-Atari codebase, so I might be wrong.

This function appears to handle byte-sized memory reads: https://github.com/gotaproblem/pistorm- ... tor.c#L652

However, if the read request cannot be handled internally (by platform_read_check), the function passes the request onto the bus, even if the high byte (A31-A24) of the address is not zero. Imho, this function should generate a bus-error instead. Or at least return 0, like the Amiga implementation https://github.com/captain-amygdala/pis ... tor.c#L945. The same thing applies to all other read and write functions.

(I can't explain, though, why this works for up to 32 MiB TT-RAM.)
dad664npc
Posts: 166
Joined: 12 Sep 2022 14:32
Location: Oxfordshire

Re: EMUTos + AltRAM

Post by dad664npc »

Thanks for looking. Now resolved, not sure why this is needed - but hey-ho

if ( ( address & 0xFF000000 ) == 0xFF000000 )
address &= 0x00FFFFFF;

if (address & 0xFF000000)
return 0;

IMG_0111.jpg
You do not have the required permissions to view the files attached to this post.
ATARI STfm, STe, Mega ST, TT
Amstrad CPC464, CPC6128
PiStorm dev - https://github.com/gotaproblem/pistorm-atari
Pico HDC - https://bbansolutions.co.uk
User avatar
Cyprian
Posts: 542
Joined: 22 Dec 2017 09:16
Location: Warszawa, Poland

Re: EMUTos + AltRAM

Post by Cyprian »

dad664npc wrote: 04 Aug 2023 05:08 Thanks for looking. Now resolved, not sure why this is needed - but hey-ho

if ( ( address & 0xFF000000 ) == 0xFF000000 )
address &= 0x00FFFFFF;

if (address & 0xFF000000)
return 0;


IMG_0111.jpg
CPU type isn't "68000"
Is it ok in your PiStorm case?
ATW800/2 / V4sa / Lynx I / Mega ST 1 / 7800 / Portfolio / Lynx II / Jaguar / TT030 / Mega STe / 800 XL / 1040 STe / Falcon030 / 65 XE / 520 STm / SM124 / SC1435
DDD HDD / AT Speed C16 / TF536 / SDrive / PAK68/3 / Lynx Multi Card / LDW Super 2000 / XCA12 / SkunkBoard / CosmosEx / SatanDisk / UltraSatan / USB Floppy Drive Emulator / Eiffel / SIO2PC / Crazy Dots / PAM Net
http://260ste.atari.org
dad664npc
Posts: 166
Joined: 12 Sep 2022 14:32
Location: Oxfordshire

Re: EMUTos + AltRAM

Post by dad664npc »

CPU type can be 68000 to 68040 on the PiStorm.
Are you asking if the PiStorm fits in an Atari ST or STe? That'll be a big fat NO :) But stormy has installed in an H5
ATARI STfm, STe, Mega ST, TT
Amstrad CPC464, CPC6128
PiStorm dev - https://github.com/gotaproblem/pistorm-atari
Pico HDC - https://bbansolutions.co.uk
User avatar
Cyprian
Posts: 542
Joined: 22 Dec 2017 09:16
Location: Warszawa, Poland

Re: EMUTos + AltRAM

Post by Cyprian »

dad664npc wrote: 04 Aug 2023 10:22 CPU type can be 68000 to 68040 on the PiStorm.
ok
dad664npc wrote: 04 Aug 2023 10:22 Are you asking if the PiStorm fits in an Atari ST or STe? That'll be a big fat NO :) But stormy has installed in an H5
no, just CPU type in PiSTorm
ATW800/2 / V4sa / Lynx I / Mega ST 1 / 7800 / Portfolio / Lynx II / Jaguar / TT030 / Mega STe / 800 XL / 1040 STe / Falcon030 / 65 XE / 520 STm / SM124 / SC1435
DDD HDD / AT Speed C16 / TF536 / SDrive / PAK68/3 / Lynx Multi Card / LDW Super 2000 / XCA12 / SkunkBoard / CosmosEx / SatanDisk / UltraSatan / USB Floppy Drive Emulator / Eiffel / SIO2PC / Crazy Dots / PAM Net
http://260ste.atari.org
User avatar
thorsten.otto
Posts: 148
Joined: 04 Nov 2019 02:20

Re: EMUTos + AltRAM

Post by thorsten.otto »

alexh wrote: 02 Aug 2023 13:51 That was a physical hardware limitation of the 68000 chip. I don't think emulated 68000 need to have that limitation.
There are cases where that emulation is needed (Hatari for example has an option for it). For example, in TOS 1.04, the vector number is placed in the upper 8 bits for exceptions. And IIRC, early version of Tempus (a blazingly fast text editor) used those bits to store the length of text lines.
User avatar
Badwolf
Site sponsor
Site sponsor
Posts: 3043
Joined: 19 Nov 2019 12:09

Re: EMUTos + AltRAM

Post by Badwolf »

thorsten.otto wrote: 05 Sep 2023 08:58 There are cases where that emulation is needed (Hatari for example has an option for it). For example, in TOS 1.04, the vector number is placed in the upper 8 bits for exceptions.
Wow. That's good to know. Thanks.

As an aside, ISTR early MacOS used the top 8 bits for something too.

BW
DFB1 Open source 50MHz 030 and TT-RAM accelerator for the Falcon
Smalliermouse ST-optimised USB mouse adapter based on SmallyMouse2
FrontBench The Frontier: Elite 2 intro as a benchmark

Return to “SOFTWARE”

Who is online

Users browsing this forum: ClaudeBot and 6 guests