Can all registered uses please login, even just for a few minutes..
It helps build a picture where our "good traffic" is coming from..
Thanks :)

EMUTos + AltRAM

General Discussion, STOS.
czietz
Posts: 587
Joined: Sun Jan 14, 2018 1:02 pm

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
grab0019.png (18.66 KiB) Viewed 2182 times
grab0020.png
grab0020.png (18.59 KiB) Viewed 2182 times

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

emutos_512mb.jpg
emutos_512mb.jpg (143.28 KiB) Viewed 2182 times

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?
czietz
Posts: 587
Joined: Sun Jan 14, 2018 1:02 pm

Re: EMUTos + AltRAM

Post by czietz »

czietz wrote: Wed Aug 02, 2023 5:43 pm 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: 178
Joined: Mon Sep 12, 2022 2:32 pm
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
PiStorm JIT dev - https://github.com/gotaproblem/pistorm-atari-jit
Pico HDC - https://bbansolutions.co.uk
czietz
Posts: 587
Joined: Sun Jan 14, 2018 1:02 pm

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: 178
Joined: Mon Sep 12, 2022 2:32 pm
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
IMG_0111.jpg (96.9 KiB) Viewed 2093 times
ATARI STfm, STe, Mega ST, TT
Amstrad CPC464, CPC6128
PiStorm dev - https://github.com/gotaproblem/pistorm-atari
PiStorm JIT dev - https://github.com/gotaproblem/pistorm-atari-jit
Pico HDC - https://bbansolutions.co.uk
User avatar
Cyprian
Posts: 547
Joined: Fri Dec 22, 2017 9:16 am
Location: Warszawa, Poland
Contact:

Re: EMUTos + AltRAM

Post by Cyprian »

dad664npc wrote: Fri Aug 04, 2023 5:08 am 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: 178
Joined: Mon Sep 12, 2022 2:32 pm
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
PiStorm JIT dev - https://github.com/gotaproblem/pistorm-atari-jit
Pico HDC - https://bbansolutions.co.uk
User avatar
Cyprian
Posts: 547
Joined: Fri Dec 22, 2017 9:16 am
Location: Warszawa, Poland
Contact:

Re: EMUTos + AltRAM

Post by Cyprian »

dad664npc wrote: Fri Aug 04, 2023 10:22 am CPU type can be 68000 to 68040 on the PiStorm.
ok
dad664npc wrote: Fri Aug 04, 2023 10:22 am 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: Mon Nov 04, 2019 2:20 am

Re: EMUTos + AltRAM

Post by thorsten.otto »

alexh wrote: Wed Aug 02, 2023 1:51 pm 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: 3065
Joined: Tue Nov 19, 2019 12:09 pm

Re: EMUTos + AltRAM

Post by Badwolf »

thorsten.otto wrote: Tue Sep 05, 2023 8:58 am 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
Post Reply

Return to “SOFTWARE”