Re: [hatari-devel] defaulting to SMALL_MEM |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [hatari-devel] defaulting to SMALL_MEM
- From: Thomas Huth <th.huth@xxxxxxxxx>
- Date: Sat, 12 Feb 2022 09:22:15 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1644657737; bh=a+gm7QLGPu931PjKUuDt7jPe32Txa1KT1dVHBl6iNeg=; h=Date:From:To:Subject:From; b=r2AHsQZj4/Pfdwn8Na8yGqf8AUGAl5aa95+eX4bbK4kIZfnLiWBVPF/edXZMA5nhd sH8ATkh62bC5NcCYoTH9LYhJRg/0Jv6Zp3ZcPjqXehaOnhRFbi3SaJAccCIS/xf83G v/tHTCdz/IIT3Z+dkTh3ggEfrHylKOoCWC+fG1/ASqDCevxwE0iMgWHKebCEn1XdZm i1LNSAdBS4wAbRhMNSnAJ4UZirzeop0PiCVB9KNse3+gVGN/xyeyMr84ich9NOpgCI AZSOHVrJvuHa3E+UXkTpd+FLECUKzXNHUOmdkmqN9ETTTEVsmZkSsJO+nYcHn+Njcs Je2ebWQoLu4vA==
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