Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document kernel settings to run SheepShaver in Linux somewhere obvious #135

Open
rakslice opened this issue Oct 15, 2020 · 15 comments · May be fixed by #142
Open

Document kernel settings to run SheepShaver in Linux somewhere obvious #135

rakslice opened this issue Oct 15, 2020 · 15 comments · May be fixed by #142
Labels
docs Anything documentation-related SheepShaver affects SheepShaver executable

Comments

@rakslice
Copy link
Contributor

rakslice commented Oct 15, 2020

To run SheepShaver in Linux, one that was made with the default configure addressing setting, requires changing the kernel setting vm.mmap_min_addr to 0.

Otherwise you get an error like:
$ SheepShaver
Cannot map Low Memory Globals: Operation not permitted.

It would be nice if this was documented somewhere obvious like the readme.

You can set the setting by echoing 0 to /proc/sys/vm/mmap_min_addr as root, or doing

sudo sysctl -w vm.mmap_min_addr=0

and you can make it happen automatically at startup by putting

vm.mmap_min_addr = 0

into /etc/sysctl.d/whatever.conf

Edit:
The kernel null deref protection afforded by mmap minimum address enforcement has defense in depth value. If we can make some working build other than a real addressing build be the default configure option, great.

This issue is just a practical matter: while real addressing is still the default configure option, without instructions, users encounter the error message and show up in the issue tracker for support.

@ianfixes
Copy link
Member

Thanks for contributing this. Is this something that works in CI but fails locally? To say it another way, does the CI config need to be updated in some way to expose this issue?

@rakslice
Copy link
Contributor Author

rakslice commented Oct 15, 2020

This is a setting that has to be set on the local machine where the the software is used, it has nothing to do with building.

@rakslice rakslice changed the title Document kernel settings to run in Linux somewhere obvious Document kernel settings to run SheepShaver in Linux somewhere obvious Oct 15, 2020
@rakslice
Copy link
Contributor Author

I've edited the issue a bit to try to clarify that.

@ianfixes
Copy link
Member

If I'm understanding this correctly, you're talking about the proper way to run SheepShaver after it is already built

@ianfixes ianfixes added docs Anything documentation-related SheepShaver affects SheepShaver executable labels Oct 16, 2020
@rakslice
Copy link
Contributor Author

Yes, that's correct.

@SegHaxx
Copy link

SegHaxx commented Dec 1, 2020

I highly recommend not messing with vm.mmap_min_addr or encouraging others to do so. It is the way it is for good reason. Compile with --enable-addressing=direct instead.

Linux, FreeBSD and probably every other unix OS are moving towards making real addressing impossible going forwards, as it is a security risk.

We should really change the default SheepShaver build to use direct addressing.

@SegHaxx SegHaxx linked a pull request Dec 1, 2020 that will close this issue
@rakslice
Copy link
Contributor Author

rakslice commented Dec 1, 2020

Note that if you change the default addressing mode, for arches and compiler versions where the default is to build the JIT using pregenerated stuff, you'll want to reroll the pregenerated stuff to match the new addressing mode (which to some degree is an archaeology project for the taking AFAICT - see cebix/macemu#222) or at least make JIT not the default in the meantime.

@SegHaxx
Copy link

SegHaxx commented Dec 1, 2020

It'd be better to comment on my PR if you want me to change it. :)

@rakslice
Copy link
Contributor Author

rakslice commented Dec 1, 2020

Oh, there was no PR on the issue when I opened the page. :D I'm surprised you got that far without running into a problem?

@SegHaxx
Copy link

SegHaxx commented Dec 1, 2020

I'm able to boot my System 7.6.1 CD in SheepShaver and get the "Welcome to Mac OS" screen, but then it segfaults. I haven't used SheepShaver in ages so I don't know if this ever worked though. I'm going to go find a Mac OS 8.6 CD and see if that works.

@rakslice
Copy link
Contributor Author

rakslice commented Dec 1, 2020

idk what kind of shape this fork is in, but SheepShaver has historically worked with 7.6.1.

@SegHaxx
Copy link

SegHaxx commented Dec 1, 2020

That's the question then. Has SheepShaver ever worked for anyone in this branch? :)

@rakslice
Copy link
Contributor Author

rakslice commented Dec 1, 2020

Testing real addressing JIT builds of 28f61bf on Linux VMs I have handy with Mac OS 7.6.1 installs:
i686 jit true -> boots to desktop ok
i686 jit false -> boots to desktop ok
x86_64 jit true -> boots to desktop ok
x86_64 jit false -> segfault on the boot screen before the first extension icon appears, no PPC stack trace

Did you maybe land on the non-working combination by sheer chance?

@rakslice
Copy link
Contributor Author

rakslice commented Dec 1, 2020

For more background, that's with the 7200/7500/8500/9500 v1 ROM, the one with Apple checksum 96CD923D

@rakslice
Copy link
Contributor Author

rakslice commented Dec 1, 2020

Moving the discussion to the PR since I see you also commented there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Anything documentation-related SheepShaver affects SheepShaver executable
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants