Booting OS 7.5 with no initial NVRAM

About SheepShaver, a PPC Mac emulator for Windows, MacOS X, and Linux that can run System 7.5.3 to MacOS 9.0.4.

Moderators: Cat_7, Ronald P. Regensburg, ClockWise

Post Reply
mschmitt
Tinkerer
Posts: 80
Joined: Sun Jul 05, 2009 10:33 pm

Booting OS 7.5 with no initial NVRAM

Post by mschmitt »

Regarding the problem of SheepShaver crashing when you attempt to boot OS 7.5 with no initial NVRAM...

I've found the magic byte. All you need is 0x25 at NVRAM offset 0x138a.

SheepShaver does not initialize this value.

If you boot with an Old World ROM, it reads this value and if it is 0x00, it changes it to 0x05.

If you boot with OS 8 it must be getting set to 0x25. (I haven't run that trace to confirm.)

I don't know what 0x25 means. The "5" means that 32-bit addressing is on. If the high nybble was 8 then it would mean that the 68040 cache was on. But a "2" isn't documented.

So it is likely it has something to do with memory or cache.

A simple fix would be to have SheepShaver init this NVRAM byte to 0x25.

But what we don't know is if there would be consequences. I'm wondering about impact on Mac OS prior to 7.5.5.

Note: OS 7.5.5 was the last to support non-32 bit clean Macs, including all with less than a 68030 CPU.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Booting OS 7.5 with no initial NVRAM

Post by Ronald P. Regensburg »

mschmitt wrote:I'm wondering about impact on Mac OS prior to 7.5.5.
Which system versions are you referring to? SheepShaver does not run anything earlier than 7.5.3, or does it?
mschmitt
Tinkerer
Posts: 80
Joined: Sun Jul 05, 2009 10:33 pm

Re: Booting OS 7.5 with no initial NVRAM

Post by mschmitt »

Ronald P. Regensburg wrote:Which system versions are you referring to? SheepShaver does not run anything earlier than 7.5.3, or does it?
Oops, you're right.


Meanwhile, I now know what this XPRAM setting is for: 25 means the Modern Memory Manager is turned on, which should be the default for System 7 on PowerPC machines. 05 means the Modern Memory Manager is turned off.

What is the Modern Memory Manager? The previous memory manager was written in 680x0 assembly-language. When Apple did the transition to PowerPC processors, they rewrote the memory manager in C and compiled it into native PowerPC code.

The API to the both versions of the memory manager was the same.

In System 7.5.x users can choose to run with the old memory manager if they want.

It would appear that something in SheepShaver doesn't like running with the 680x0 version of the memory manager.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Booting OS 7.5 with no initial NVRAM

Post by Ronald P. Regensburg »

mschmitt wrote:It would appear that something in SheepShaver doesn't like running with the 680x0 version of the memory manager.
I tried switching between modern memory management on and off in 7.5.5. System 7.5.5 runs fine in SheepShaver with modern memory manager either on or off. However, switching between the two memory management versions (in both directions) appears to be problematic. I have no time today to investigate further. Possibly there is a timing problem writing to and reading from the nvram file.
mschmitt
Tinkerer
Posts: 80
Joined: Sun Jul 05, 2009 10:33 pm

Re: Booting OS 7.5 with no initial NVRAM

Post by mschmitt »

Ronald P. Regensburg wrote:I tried switching between modern memory management on and off in 7.5.5. System 7.5.5 runs fine in SheepShaver with modern memory manager either on or off. However, switching between the two memory management versions (in both directions) appears to be problematic. I have no time today to investigate further. Possibly there is a timing problem writing to and reading from the nvram file.
I was testing with System 7.5.3 Revision 2. I upgraded to System 7.5.5, but I get the same results:
  • If the Modern Memory Manager is On, it boots fine.
  • If the MMM is off, then it gets a SIGSEGV when it boots.
  • If I start without an NVRAM, on boot it sets the MMM off. And then dies with the SIGSEGV.
  • But if I change SheepShaver so it initializes new nvram files with the MMM set to be on, then it works.
  • Result is the same regardless of whether I boot from a physical CD, an image of the CD, or a hard drive file.
I'm testing with the host as OS X Intel.

Note: The Modern Memory Manager setting is read when it starts up, so if you change it in the control panel, the change won't take effect until you restart.

Also, SheepShaver only saves the nvram once per minute. I haven't figured out yet whether it will always save it when you shut down or restart.

I have some more testing to do.
mschmitt
Tinkerer
Posts: 80
Joined: Sun Jul 05, 2009 10:33 pm

Post by mschmitt »

Status report:

I tested my NVRAM initialization fix using System 7.5, OS 8, OS 8.5 and OS 9, on a PowerMac 8500 ROM (Old World, TNT), Mac OS ROM 1.2.1 and Mac OS ROM 1.6.

The good news is it has two beneficial effects:
  1. It fixes booting System 7.5 without an NVRAM file
  2. For some reason, it helps with the problem of OS 8 & OS 8.5 ejecting the CD
Further good news is I can find no harmful effects.

The bad news is I get a SIGSEGV booting OS 8 on the Old World ROM, both with and without my fix. So I'll have to do some more investigating; perhaps there is another NVRAM setting at work.
mschmitt
Tinkerer
Posts: 80
Joined: Sun Jul 05, 2009 10:33 pm

Post by mschmitt »

I've uploaded a new SheepShaver Universal Binary, built from the most recent CVS.

It contains:
  • The RAM-anywhere changes.
  • The logic for handling sheepvm bundles.
  • The recently committed changes for precise timing under OS X.

    Note: The build issue is now fixed in CVS.

    (I wonder if the precise timer has any effect on some of the outstanding SheepShaver bugs, such as QuickTime support? Or the freeze that happens when you run the Mac OS network setup wizard?)
  • The fix discussed in this thread to initialize the NVRAM to use the PPC memory manager, intended to fix issues with creating new OS 7.5 machines.
  • A new fix: If the ROM file is being found because it has the magic name "ROM" or "Mac OS ROM", then it will continue to be found even after the Preferences editor is used.

    This is intended to fix the issue where a user creates a new machine, with the ROM file in the SheepShaver application folder, then uses the Preferences editor to create the hard disk, but does not change the ROM path.
Try it out. If it works, I'll submit the patches for the last two items.

Here's the download link:

http://bit.ly/SheepShaver_UB_2009-08-23
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Post by Ronald P. Regensburg »

Finding a "Mac OS ROM" or "ROM" file without a rom defined in the prefs file works.

The nvram fix seems to work for when no initial nvram file is present, but a couple of times I got a SIGSEGV while booting with a pre-existing nvram file (or ~/.sheepshaver_nvram file) that was created with a different setup (different MacOS version, different rom, earlier SheepShaver build). So far, I have not been able to reproduce this reliably.

(I am getting a little confused about what is and what is not (yet) committed to CVS and I do not know how your work and Myrd's work relate. The better default settings for a new VM are not available when the SheepShaver executable from this latest build is used in the SheepShaverLauncher.)
mschmitt
Tinkerer
Posts: 80
Joined: Sun Jul 05, 2009 10:33 pm

Post by mschmitt »

Ronald P. Regensburg wrote:The nvram fix seems to work for when no initial nvram file is present, but a couple of times I got a SIGSEGV while booting with a pre-existing nvram file (or ~/.sheepshaver_nvram file) that was created with a different setup (different MacOS version, different rom, earlier SheepShaver build). So far, I have not been able to reproduce this reliably.
My fix only affects when SheepShaver initializes a new NVRAM file (or after the NVRAM/PRAM/XPRAM has been zapped). It has no effect on any processing that takes place with an existing NVRAM.

Note: I'm still having trouble booting OS 8 on an Old World ROM, with and without my change. I suspect another NVRAM issue but I'm not sure yet.
(I am getting a little confused about what is and what is not (yet) committed to CVS and I do not know how your work and Myrd's work relate. The better default settings for a new VM are not available when the SheepShaver executable from this latest build is used in the SheepShaverLauncher.)
When you build SheepShaver now, it picks up a different version of the built-in preferences editor. The Launcher is a separate Xcode project, which has to be built separately, in Xcode. It is not built by the "make" build system.

Maybe the code for the better default settings is not in CVS yet.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Post by Ronald P. Regensburg »

mschmitt wrote:Note: I'm still having trouble booting OS 8 on an Old World ROM, with and without my change. I suspect another NVRAM issue but I'm not sure yet.
There may be a problem with the "The RAM-anywhere changes" in combination with certain MacOS installations, rather than a problem with the fix for no initial nvram. I have here a 7.5.5 installation that will consistently give me a SIGSEGV (late in the startup process) with both your 090726 build and your 090823 build, whether or not there is a initial nvram file, but that will boot and run fine with my 090319 build if a proper nvram file is present.

I have another 7.5.5 installation and also a 8.1 installation that do not have a problem with the newer builds. Both 7.5.5 installations are set to use Modern Memory Management.
mschmitt
Tinkerer
Posts: 80
Joined: Sun Jul 05, 2009 10:33 pm

Post by mschmitt »

Ronald P. Regensburg wrote:There may be a problem with the "The RAM-anywhere changes" in combination with certain MacOS installations, rather than a problem with the fix for no initial nvram. I have here a 7.5.5 installation that will consistently give me a SIGSEGV (late in the startup process) with both your 090726 build and your 090823 build, whether or not there is a initial nvram file, but that will boot and run fine with my 090319 build if a proper nvram file is present.

I have another 7.5.5 installation and also a 8.1 installation that do not have a problem with the newer builds. Both 7.5.5 installations are set to use Modern Memory Management.
Exactly what ROM are you using? Are you testing on PPC or Intel?

Your test results don't match mine. One thing I tried was booting 7.5.3 with the "pinned" SheepShaver version, and it created the same Modern Memory Manager related SIGSEGV.

So I'm thinking it might be the ROM version.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Post by Ronald P. Regensburg »

I am testing in 10.5.8 on Intel and I use the same old world rom for all 7.5.3 through 8.1 installations. (What do you mean with "pinned" version?)

The 7.5.5 installation that gives a SIGSEGV* with your latest builds, both with or without a pre-existing nvram present, appears to boot normally with those builds with extensions off.

But it does boot normally with extensions enabled with the 090319 build (of course, as I wrote above, with a initial nvram file already present).

The extensions set in this 7.5.5 installation is different from the extensions set in the other 7.5.5 installation that does not have the problem with your builds. I will try to find which extension(s) is/are involved.

* This SIGSEGV seems different from the Modern Memory Related one and occurs later in the startup process.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Post by Ronald P. Regensburg »

The extension in 7.5.5 that makes the latest builds crash with a SIGSEGV is "Video Digitizer Update".

I found four descriptions of the Video Digitizer Update extension:

- Part of the Apple MPEG Media System. Provides the software interface between the built-in video and the hardware MPEG card.
- Part of Apple MPEG Media System Software, this is the low level software interface to the video hardware for support of the Apple MPEG Media System card.
- Video Digitizer Component which supports the YUV protocol on older Macs with the built-in AV board.
- Installed by the Apple Video System for support of CU-SeeMe when using the Apple Video Card. Supposedly, all of the Apple Video Player options work perfectly without this file, but CU-SeeMe will not show your own picture in the "Self" window, nor will it provide options for sending video.

Obviously, this extension should not be used in SheepShaver because the hardware (the Apple MPEG card) is not available. Still, it is strange that the problem does not occur with the older build (without the "RAM-anywhere" changes) and only with the newer builds.

In this case the extension came with the original software bundle from a restore CD for a PPC Performa 5300 with System 7.5.1, first updated to 7.5.3 and next updated to 7.5.5.
PeterHolbrook
Apple Corer
Posts: 273
Joined: Fri Oct 26, 2007 7:56 am

Post by PeterHolbrook »

mschmitt wrote:(I wonder if the precise timer has any effect on some of the outstanding SheepShaver bugs, such as QuickTime support?
I'm afraid QuickTime support is just as buggy as it has always been. Last night I installed QuickTime 6.0.3, but it isn't any better than it used to be. So I went back to version 5.0.2, which, for me, is reasonably stable (except for MIDI play).
mschmitt
Tinkerer
Posts: 80
Joined: Sun Jul 05, 2009 10:33 pm

OS 7.5.5 SIGSEGV with ram-anywhere code

Post by mschmitt »

Ronald P. Regensburg wrote:What do you mean with "pinned" version?
I mean the 090319 version.

I have recreated the SIGSEGV with Ronald's extension.
mschmitt
Tinkerer
Posts: 80
Joined: Sun Jul 05, 2009 10:33 pm

Post by mschmitt »

The two fixes (NVRAM init for PPC memory manager, finding ROM in default location) are committed to CVS.

As for Roland's problem with the video extension: it appears that this extension was coded to expect the ROM to be loaded at a particular address, so it doesn't work when you relocate the ROM.

The SIGSEGV dump has an execution address of 0x48000012; the ROM used to be loaded at 0x4800000.

So when the ROM is loaded contiguous with the RAM, and the RAM is a small amount, then that address is unallocated.

This is disturbing -- where there is one program with such a dependency, there may be others.


I'm experimenting with Plan B: keeping the ROM at a fixed address, but trying to do the memory allocations before SDL inits the Cocoa application. This way the RAM should get a chance to load while the address space is still clean.
ZOleg
Inquisitive Elf
Posts: 37
Joined: Tue May 25, 2004 9:11 am
Location: Russia

Post by ZOleg »

Where is download new build for Win32?
prowler
Tinkerer
Posts: 49
Joined: Thu May 14, 2009 10:53 pm
Location: Sidcup, England

Post by prowler »

ZOleg wrote:Where is download new build for Win32?
http://www.emaculation.com/forum/viewto ... 25&start=0
or, more specifically,
http://www.open.ou.nl/hsp/downloads/She ... 3_2009.zip
mschmitt
Tinkerer
Posts: 80
Joined: Sun Jul 05, 2009 10:33 pm

Download Statistics

Post by mschmitt »

The "SheepShaver UB 2009-08-23" version I posted has a download link via bit.ly. This provides download statistics.

As of today, it has been download 197 times:

96 United States
19 Japan
13 Other
13 France
10 Germany
9 United Kingdom
7 Canada
7 Australia
3 Sweden
3 Netherlands
3 Italy
3 Switzerland
2 New Zealand
2 Mexico
2 Spain
5 Other Countries
User avatar
ClockWise
Site Admin
Posts: 4397
Joined: Mon May 20, 2002 4:37 am
Location: Uiwang

Post by ClockWise »

I'm in love with statistics!

We get a lot of Japanese visitors to the site. But as far as I can tell, none of them post to the forum. :(

For the whole site, the visitors for the month so far come from these countries:

USA: 34%
Japan: 7%
Germany: 5%
UK: 5%
Canada: 5%
France: 5%
Australia: 4%
Netherlands: 4% (hey guys!)
Italy: 3%
Spain: 2%
Post Reply