[hatari-devel] ENABLE_SMALL_MEM problem |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: [hatari-devel] ENABLE_SMALL_MEM problem
- From: Thomas Huth <th.huth@xxxxxxxxx>
- Date: Sat, 23 Dec 2017 09:16:08 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1514016973; bh=PA53zco3lzu21j3Kpy3yCzVbmJLLNS/QQ76coMLjwCU=; h=Date:From:To:Subject:From; b=oS2KZbBTc9iltIWciyH4g5Tga5EtP8n3Wvj4KUnrZsgD9a7+WzwWXaQvhIaaLwze+ 06qPLzKXg1Wh65bNnK7g5X+PryLNoU89gITU0j9Efn4WnPP+WVEtTcfktCDc5vb7wm PyQVDY9oPbk6BXXrHDL2GaFd7WXhjES/N75VP/We3ZkdGTV/uhxhfnNEh3v7d4Zazy YhXcZyCOEj3Te2Y4c6mELNWXeZqgLdm3BwqA5jC1Kq8ZdJ50awzEjTyHYXfk43q8mr wZ0jXHmkSzGi6LGCkk2WPz/gTw/qagvTV3gc3Au9l9OeQdZHmoeXFIt23TcZvpCUjR TzMeIKGnE7atQ==
Hi,
I recently tried to compile Hatari with ENABLE_SMALL_MEM again, but it
is currently broken: Main_Init() calls STMemory_Init() which again
calls STMemory_Reset() and that accesses IoMem[], causing a
segmentation fault. IoMem[] is not available in ENABLE_SMALL_MODE until
memory_init() has been called during TOS_LoadImage(), which happens
later in Main_Init() (when it calls Reset_Cold()).
So we either have got to change the order here a little bit, or maybe
remove the call to STMemory_Reset() from STMemory_Init() ? The latter
should likely be OK since STMemory_Reset() is called again from
Reset_ST()? Nicolas, do you have an idea what's the right fix here?
Anyway, since ENABLE_SMALL_MEM tends to bitrot every year, we should
maybe also consider to get rid of this special mode (after the next
release?). It has originally been included to be able to run Hatari on
machines that have very limited RAM or are unable to provide a BSS
array of 16 MiB due to any means (e.g. old Windows CE smartphones). I'm
not aware of any such system left nowadays, even the smallest embedded
systems have hundres of MiBs of RAM nowadays.
So we could simply rip of the related code. Another idea: Rip out the
non-SMALL_MEM code and make the SMALL_MEM code the default mode
instead, so that we always malloc the STRam instead of using a huge
16 MiB array for everything, ST RAM, ROM and IO memory. Using
malloc() sounds like a cleaner approach, and recent CPUs should really
be good enough so that you should not see a performance difference
between the two modes anymore today, I guess... Any opinions?
Thomas