Re: [hatari-devel] defaulting to SMALL_MEM

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


Am Wed, 9 Feb 2022 20:19:42 +0100
schrieb Christian Zietz <czietz@xxxxxxx>:

> Eero Tamminen schrieb:
> 
> > For some reason, these Valgrind errors happen only with TOS4, not
> > with EmuTOS:  
> 
> Meanwhile, I have an idea what's going wrong in Hatari. I don't have
> time to fully prove my theory; but hopefully it'll help anyway.
> 
> Via NVRAM (see my post where I attached it) I configured the Falcon to
> boot in 1-bit-per-pixel (mono) mode. Switching the Videl to mono is
> tricky, as was discussed about a year ago on the EmuTOS list.
> 
> Atari TOS does so via an intermediary step, where it switches to a 4
> bpp mode. For this intermediary step the allocated amount of video
> memory is not sufficient, so the Videl reads past the end of ST RAM.
> This is apparently harmless on real hardware, but on Hatari with
> SMALL_MEM it accesses unallocated memory, potentially causing an
> access violation. (EmuTOS uses a different method.)
> 
> The easiest fix might be to allocate a bit more memory than needed for
> ST RAM.

Thanks for the explanation, that makes sense, indeed. For some weird
reasons, I was not able to reproduce the issue, though. But I now wrote
a little test program that sets the video base to the end of the RAM,
and with that program, I was finally able to get a crash, too.

I've now committed a fix, please check whether it's working for you,
too.

 Thanks,
  Thomas



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