cebix / macemu

Basilisk II and SheepShaver Macintosh emulators
1.4k stars 293 forks source link

64bit fixes from Flatpak release #232

Closed SegHaxx closed 3 years ago

SegHaxx commented 3 years ago

Basilisk II has been accepted on Flathub. These patches are now live in production. :)

These are the fixes I needed to make this possible. It comes down to:

1) 64bit portability fixes (fix #188 #55 #27) 2) Updating autotools 3) The linker scripts break spectacularly on the freedesktop platform

BII has historically had to do a lot of faffing about with the memory map to make sure things fit on 32bit platforms, and the linker scripts are part of that.

On 64bit, we have free reign over the entire 32bit address space, and then some, except for that pesky security guard at 0x0:

$ pmap -x `pidof BasiliskII`
4569:   BasiliskII
Address           Kbytes     RSS   Dirty Mode  Mapping
0000000000010000   66624    6168    6168 rw---   [ anon ]
0000000004422000     772     772     772 r----   [ anon ]
0000561ea6297000     440     440       0 r---- BasiliskII
0000561ea6305000     904     840       0 r-x-- BasiliskII
0000561ea63e7000     256     164       0 r---- BasiliskII
0000561ea6428000     152     152     152 r---- BasiliskII
0000561ea644e000     160     160     160 rw--- BasiliskII
...

You can see the Mac RAM and framebuffer allocations starting at 0x10000 and 0x4422000. Everything else is well into 64bit space. I see no reason for the linker scripts to exist on 64bit platforms.

And with the upcoming memory management fix I'm working on we shouldn't even need them on 32bit anymore. :)

asvitkine commented 3 years ago

Not sure what the expectation is for this PR, but if you'd like things upstreamed, it can't be in the form of 600 commits.

You can send more granular PRs for specific improvements.

SegHaxx commented 3 years ago

Sorry forgot this was still open and messed up the tag. I rebased my work on kanjitalk755's repo.