Fix for "Cannot map RAM" on Leopard

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

User avatar
Cat_7
Expert User
Posts: 6121
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Post by Cat_7 »

Just to be sure: With the new build I installed Mac OS 904 on a new hard disk image with 1024 Mb memory. Things went fine. However, when starting from the HD (with any memory setting), this appears:

SIGSEGV
pc 0x2714c923
ea 0x5b3dc062
r0 00000000 r1 2120c9c2 r2 00000000 r3 153fbe4e
r4 ffffd5cb r5 000018fe r6 03072a07 r7 00000000
r8 45fe02fc r9 07342809 r10 2550d000 r11 00000108
r12 25390530 r13 00000000 r14 2120ca1e r15 00000001
r16 45fe02fc r17 25516ec0 r18 5b3dc062 r19 153fbd66
r20 2120ca9e r21 15313756 r22 21217400 r23 00000000
r24 153fbe52 r25 00000000 r26 00000004 r27 00006d18
r28 153b1e54 r29 25690090 r30 25760000 r31 68fff000
f0 0.00000 f1 0.00000 f2 0.00000 f3 0.00000
f4 0.00000 f5 0.00000 f6 0.00000 f7 0.00000
f8 0.00000 f9 0.00000 f10 0.00000 f11 0.00000
f12 0.00000 f13 0.00000 f14 0.00000 f15 0.00000
f16 0.00000 f17 0.00000 f18 0.00000 f19 0.00000
f20 0.00000 f21 0.00000 f22 0.00000 f23 0.00000
f24 0.00000 f25 0.00000 f26 0.00000 f27 0.00000
f28 0.00000 f29 0.00000 f30 0.00000 f31 0.00000
lr 25690090 ctr 00000000 cr 40001c08 xer 00000004
pc 25690090 fpscr 00000000

EDIT: this is with the build from the first post. I had to lower memory all the way down to 64Mb before SheepShaver would start to the desktop from the hard disk image. After that first start, I can now use any memory setting and SheepShaver will run.
Last edited by Cat_7 on Tue Jul 28, 2009 6:10 am, edited 2 times in total.
mschmitt
Tinkerer
Posts: 80
Joined: Sun Jul 05, 2009 10:33 pm

Post by mschmitt »

Ronald P. Regensburg wrote:Well, I have a folder "sheepshaver.sheepvm" but whatever I do, it remains an ordinary folder.

Also, the Info.plist file does not look any different from the one in previous builds.
My mistake. I didn't realize I had to re-run configure first.

(Myrd changed the source file Info.plist.in; configure copies it to Info.plist, make puts it in the .app.)

I rebuilt and re-uploaded it to the same file, with the same download URL.

I tried it and the bundle does work now.

(I think we need a real creator code though, other than ????. Or a bundle identifier.)
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 »

Cat_7 wrote:Just to be sure: With the new build I installed Mac OS 904 on a new hard disk image with 1024 Mb memory. Things went fine. However, when starting from the HD (with any memory setting), this appears:
After installing 9.0 on a fresh disk image with memory set to 1024MB, i have no problem starting from the newly installed system still with 1024MB of memory. This is with the 'normal' setup, not with the self-contained VM.

With a self-contained VM, however, I appear to have a problem starting up from a 7.5.3 System CD (oldworld rom and 256MB of memory). Starting with the exact same setup from a 9.0 install CD, I have no problem. And startup from the 7.5.3 CD with the same settings and same files in the 'normal' (not self-contained VM) setup there is no problem either. With the 7.5.3 CD startup begins normally, but shortly after the welcome screen appears, SheepShaver crashes. This happens consistently. In Console:

Code: Select all

28-07-09 16:38:57 SheepShaver[198] Warning once: This application, or a library it uses, is using NSQuickDrawView, which has been deprecated. Apps should cease use of QuickDraw and move to Quartz. 
28-07-09 16:39:05 SheepShaver[198] *** _NSAutoreleaseNoPool(): Object 0x14ad80 of class NSCFArray autoreleased with no pool in place - just leaking
Stack: (0x96c6df0f 0x96b7a442 0x92e94f6f 0x92efa01a 0x92ef9fc4 0x92f69f2c 0x92f56248 0x92f55690 0x92f69e45 0x92fab7d5 0x780e3e82 0x780e492c 0x780dcbdb 0x780b0f25 0x780b0fe2 0x928badc7 0x928bacb0 0x7804b29b 0x780a2781 0x78069b6e 0x92948814 0x929486e7 0x78068ee4 0x928c3155 0x928c3012) 
28-07-09 16:39:05 SheepShaver[198] *** _NSAutoreleaseNoPool(): Object 0x16a510 of class NSCFString autoreleased with no pool in place - just leaking
Stack: (0x96c6df0f 0x96b7a442 0x92e8fc63 0x9549055a 0x9541f59d 0x9541f91d 0x96b827eb 0x92e8d98d 0x92efa09f 0x92ef9fc4 0x92f69f2c 0x92f56248 0x92f55690 0x92f69e45 0x92fab7d5 0x780e3e82 0x780e492c 0x780dcbdb 0x780b0f25 0x780b0fe2 0x928badc7 0x928bacb0 0x7804b29b 0x780a2781 0x78069b6e 0x92948814 0x929486e7 0x78068ee4 0x928c3155 0x928c3012) 
28-07-09 16:39:05 SheepShaver[198] *** _NSAutoreleaseNoPool(): Object 0x10e7c0 of class NSCFNumber autoreleased with no pool in place - just leaking
Stack: (0x96c6df0f 0x96b7a442 0x92e8da42 0x92efa09f 0x92ef9fc4 0x92f69f2c 0x92f56248 0x92f55690 0x92f69e45 0x92fab7d5 0x780e3e82 0x780e492c 0x780dcbdb 0x780b0f25 0x780b0fe2 0x928badc7 0x928bacb0 0x7804b29b 0x780a2781 0x78069b6e 0x92948814 0x929486e7 0x78068ee4 0x928c3155 0x928c3012) 
28-07-09 16:39:05 SheepShaver[198] *** _NSAutoreleaseNoPool(): Object 0x16ce20 of class NSCFDictionary autoreleased with no pool in place - just leaking
Stack: (0x96c6df0f 0x96b7a442 0x9550527e 0x92e8da6a 0x92efa09f 0x92ef9fc4 0x92f69f2c 0x92f56248 0x92f55690 0x92f69e45 0x92fab7d5 0x780e3e82 0x780e492c 0x780dcbdb 0x780b0f25 0x780b0fe2 0x928badc7 0x928bacb0 0x7804b29b 0x780a2781 0x78069b6e 0x92948814 0x929486e7 0x78068ee4 0x928c3155 0x928c3012) 
28-07-09 16:39:05 SheepShaver[198] *** _NSAutoreleaseNoPool(): Object 0x10d5c0 of class NSCFNumber autoreleased with no pool in place - just leaking
Stack: (0x96c6df0f 0x96b7a442 0x92e8da42 0x92efa0fc 0x92ef9fc4 0x92f69f2c 0x92f56248 0x92f55690 0x92f69e45 0x92fab7d5 0x780e3e82 0x780e492c 0x780dcbdb 0x780b0f25 0x780b0fe2 0x928badc7 0x928bacb0 0x7804b29b 0x780a2781 0x78069b6e 0x92948814 0x929486e7 0x78068ee4 0x928c3155 0x928c3012) 
28-07-09 16:39:05 SheepShaver[198] *** _NSAutoreleaseNoPool(): Object 0x1600d0 of class NSCFDictionary autoreleased with no pool in place - just leaking
Stack: (0x96c6df0f 0x96b7a442 0x9550527e 0x92e8da6a 0x92efa0fc 0x92ef9fc4 0x92f69f2c 0x92f56248 0x92f55690 0x92f69e45 0x92fab7d5 0x780e3e82 0x780e492c 0x780dcbdb 0x780b0f25 0x780b0fe2 0x928badc7 0x928bacb0 0x7804b29b 0x780a2781 0x78069b6e 0x92948814 0x929486e7 0x78068ee4 0x928c3155 0x928c3012) 
28-07-09 16:39:05 SheepShaver[198] *** _NSAutoreleaseNoPool(): Object 0x151e30 of class NSCFArray autoreleased with no pool in place - just leaking
Stack: (0x96c6df0f 0x96b7a442 0x92efa5ec 0x92efa352 0x92f69f2c 0x92f56248 0x92f55690 0x92f69e45 0x92fab7d5 0x780e3e82 0x780e492c 0x780dcbdb 0x780b0f25 0x780b0fe2 0x928badc7 0x928bacb0 0x7804b29b 0x780a2781 0x78069b6e 0x92948814 0x929486e7 0x78068ee4 0x928c3155 0x928c3012) 
28-07-09 16:39:05 SheepShaver[198] *** _NSAutoreleaseNoPool(): Object 0x151600 of class NSCFArray autoreleased with no pool in place - just leaking
Stack: (0x96c6df0f 0x96b7a442 0x92e94f6f 0x92efa46b 0x92f69f2c 0x92f56248 0x92f55690 0x92f69e45 0x92fab7d5 0x780e3e82 0x780e492c 0x780dcbdb 0x780b0f25 0x780b0fe2 0x928badc7 0x928bacb0 0x7804b29b 0x780a2781 0x78069b6e 0x92948814 0x929486e7 0x78068ee4 0x928c3155 0x928c3012) 
28-07-09 16:39:05 SheepShaver[198] *** _NSAutoreleaseNoPool(): Object 0x14d870 of class NSCFArray autoreleased with no pool in place - just leaking
Stack: (0x96c6df0f 0x96b7a442 0x954fdcb5 0x96bc110b 0x92efd1c3 0x92f562d5 0x92f55690 0x92f69e45 0x92fab7d5 0x780e3e82 0x780e492c 0x780dcbdb 0x780b0f25 0x780b0fe2 0x928badc7 0x928bacb0 0x7804b29b 0x780a2781 0x78069b6e 0x92948814 0x929486e7 0x78068ee4 0x928c3155 0x928c3012) 
28-07-09 16:39:05 SheepShaver[198] *** _NSAutoreleaseNoPool(): Object 0x156cb0 of class SDL_QuartzWindow autoreleased with no pool in place - just leaking
Stack: (0x96c6df0f 0x96b7a442 0x92fab838 0x780e3e82 0x780e492c 0x780dcbdb 0x780b0f25 0x780b0fe2 0x928badc7 0x928bacb0 0x7804b29b 0x780a2781 0x78069b6e 0x92948814 0x929486e7 0x78068ee4 0x928c3155 0x928c3012) 
28-07-09 16:39:04 [0x0-0x26026].SheepShaver[198] SIGSEGV 
28-07-09 16:39:04 [0x0-0x26026].SheepShaver[198]   pc 0x26f4e483 
28-07-09 16:39:04 [0x0-0x26026].SheepShaver[198]   ea 0x2af42000 
28-07-09 16:39:04 [0x0-0x26026].SheepShaver[198]  r0 00000000   r1 2179b16e   r2 00000000   r3 2584a340 
28-07-09 16:39:04 [0x0-0x26026].SheepShaver[198]  r4 258031a0   r5 00006706   r6 ffffd3ce   r7 00001efc 
28-07-09 16:39:04 [0x0-0x26026].SheepShaver[198]  r8 00000002   r9 15816bb0  r10 ffffffff  r11 00001f00 
28-07-09 16:39:04 [0x0-0x26026].SheepShaver[198] r12 ffff001a  r13 00020000  r14 00000020  r15 00000299 
28-07-09 16:39:04 [0x0-0x26026].SheepShaver[198] r16 15816bb0  r17 2af42000  r18 258031a0  r19 25849862 
28-07-09 16:39:04 [0x0-0x26026].SheepShaver[198] r20 00001f6c  r21 217a1190  r22 157a1000  r23 00000000 
28-07-09 16:39:04 [0x0-0x26026].SheepShaver[198] r24 25849840  r25 00000020  r26 00000000  r27 ffff9481 
28-07-09 16:39:04 [0x0-0x26026].SheepShaver[198] r28 00000000  r29 25ce2488  r30 25c60000  r31 68fff000 
28-07-09 16:39:04 [0x0-0x26026].SheepShaver[198]  f0 0.00000   f1 0.00000   f2 0.00000   f3 0.00000 
28-07-09 16:39:04 [0x0-0x26026].SheepShaver[198]  f4 0.00000   f5 0.00000   f6 0.00000   f7 0.00000 
28-07-09 16:39:04 [0x0-0x26026].SheepShaver[198]  f8 0.00000   f9 0.00000  f10 0.00000  f11 0.00000 
28-07-09 16:39:04 [0x0-0x26026].SheepShaver[198] f12 0.00000  f13 0.00000  f14 0.00000  f15 0.00000 
28-07-09 16:39:04 [0x0-0x26026].SheepShaver[198] f16 0.00000  f17 0.00000  f18 0.00000  f19 0.00000 
28-07-09 16:39:04 [0x0-0x26026].SheepShaver[198] f20 0.00000  f21 0.00000  f22 0.00000  f23 0.00000 
28-07-09 16:39:04 [0x0-0x26026].SheepShaver[198] f24 0.00000  f25 0.00000  f26 0.00000  f27 0.00000 
28-07-09 16:39:04 [0x0-0x26026].SheepShaver[198] f28 0.00000  f29 0.00000  f30 0.00000  f31 0.00000 
28-07-09 16:39:04 [0x0-0x26026].SheepShaver[198]  lr 25ce2488  ctr 00000000   cr 40101f2f  xer 00000000 
28-07-09 16:39:04 [0x0-0x26026].SheepShaver[198]  pc 25ce2488 fpscr 00000000 
28-07-09 16:39:05 [0x0-0x26026].SheepShaver[198] SheepShaver V2.3 by Christian Bauer and Mar"c" Hellwig 
28-07-09 16:39:05 [0x0-0x26026].SheepShaver[198] Using /Users/ronald/Desktop/MacOS.sheepvm as vmdir. 
28-07-09 16:39:05 [0x0-0x26026].SheepShaver[198] Reading ROM file... 
28-07-09 16:39:05 [0x0-0x26026].SheepShaver[198] Using SDL/coreaudio audio output 
28-07-09 16:39:05 [0x0-0x26026].SheepShaver[198] Detected CPU features: MMX SSE SSE2 SSE3 SSSE3 
28-07-09 16:39:05 [0x0-0x26026].SheepShaver[198] PowerPC CPU emulator by Gwenole Beauchesne 
28-07-09 16:40:49 com.apple.launchd[76] (0x10e0c0.Locum[209]) Exited: Terminated
Edit: I did so may tests that I mixed them up.
I can not startup from the 9.0 CD with the self-contained VM and an old-world rom. With a 7.5.3 CD SheepShaver crashes, with a 9.0 CD, the CD is ejected.

But I can startup fine from the 9.0 CD with a self-contained VM if it contains a newworld rom instead of an oldworld rom.
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 »

Distributing a complete virtual machine is tempting. Just to show that it is possible:

(Link removed in compliance with site policy to not link directly to rom files. RPR)

- it contains a newworld rom
- RAM is set to 256MB
- extfs is set to /Users/Shared
- although the archive is only 1.6MB, it contains a new disk image that SheepShaver will recognise as a 1GB volume and when the MacOS initializes it, the file will grow to that size.

1. Make sure a copy of the latest SheepShaver build by mschmitt is present on your MacOSX machine.

2. Unpack the downloaded zip archive.

3. Mount a 8.5, 8.6, 9.0, or 9.0.4 system CD in MacOSX.

4. Double-click MacOS.sheepvm and watch the VM startup from the CD and find the new disk image to be initialized.
Last edited by Ronald P. Regensburg on Fri Nov 20, 2009 10:27 pm, edited 1 time in total.
mschmitt
Tinkerer
Posts: 80
Joined: Sun Jul 05, 2009 10:33 pm

Post by mschmitt »

Could we try your Old World ROM / Self Contained VM test using a build from what is in CVS, without any of my changes?

I'd like to isolate it to either Myrd's sheepvm prefs code, or my code.

It don't think it is a combination -- we only stomped on each other on a single line. But it may be possible.


I might try and reproduce your test. I have a 7.something start up disc and the Old World ROM from my PowerMac 8500.


Could the problem have something to do with the NVRAM file?
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:I'd like to isolate it to either Myrd's sheepvm prefs code, or my code.
It is not related to either. It is an old problem (happens with all previous builds and not only with the new SheepVM), or a new problem on my machine.
Could the problem have something to do with the NVRAM file?
Yes.

It happens when using an (at least my) oldworld rom with no pre-existing nvram file (or ~/.sheepshaver_nvram file) or with a nvram file that is newly created.

Only my old ~/.sheepshaver_nvram file works OK, also when copied as "nvram" into a self-contained VM. Now, how did I create that "good" nvram file? Its creation date is 14-05-2009, not even long ago.
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 day that my "good" ~/.sheepshaver_nvram was created, I had problems using SheepShaver after removing the ~/.sheepshaver_nvram file.

See: http://www.emaculation.com/forum/viewto ... 9609#29609
and: http://www.emaculation.com/forum/viewto ... 9615#29615

With that in mind back to the current problem.

- SheepVM with an oldworld rom that I renamed "Mac OS ROM" and no nvram file to start with. SheepShaver crashes during startup from 7.5.3 CD
- Tried to startup from 9.0 CD. At startup the CD was ejected. Happy Mac was replaced by the blinking question mark. I pushed the CD back and SheepShaver continued startup successfully.
- And now startup from the 7.5.3 CD proceeds normally.

The successful startup with the oldworld rom from the 9.0 CD created a correct nvram file that enabled startup from 7.5.3.

Weird. Still, this is not good. A nvram file or ~/.sheepshaver_nvram file is usually created the first time you startup from a MacOS system. That first time a correct file should be created when a compatible system and rom file are used.
mschmitt
Tinkerer
Posts: 80
Joined: Sun Jul 05, 2009 10:33 pm

Post by mschmitt »

I duplicated your crash with my 7.5.3 CD and Mac 8500 ROM.

When the nvram file doesn't exist, SheepShaver creates one and initializes it with certain values.

I'm guessing that what it initializes it with isn't valid for older ROM and older system file.

(There must be some big difference starting with System 7.6, because I see a lot of resource patching code that it is isn't applied for System 7.5.)

If you manage to get far enough, the NVRAM will get written with valid values for this ROM + OS, so then it works from then on.

If we understood what all is in the NVRAM, we could inspect a working copy and figure out what is different from the initialized version. But we don't know what is in there. The code is very cryptic.
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 viewed both the "good" ~/.sheepshaver_nvram file that was created last May 14th and the "good" nvram file that was created yesterday in the sheepvm bundle in a Hex editor. They appear to be identical. And apparently they stay identical, regardless the rom file or MacOS version used.
(They may change with changing some of the settings in MacOS. On actual hardware Macs, a few settings were saved in pram/nvram.)

(Haven't viewed a "bad" nvram file yet.)


Edit: Correction: There are subtle differences between the "good" files as well as between the "good" files and the "bad" files. However, so far, "bad' nvram files that were created under the exact same conditions appear to be identical.
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 »

Once a nvram file is "good", it will stay good and can be used with different rom files and MacOS systems. At first glance, the good files seem identical, but small changes are made when changing to a different rom file or different MacOS system.
mschmitt
Tinkerer
Posts: 80
Joined: Sun Jul 05, 2009 10:33 pm

Post by mschmitt »

Ronald P. Regensburg wrote:Once a nvram file is "good", it will stay good and can be used with different rom files and MacOS systems. At first glance, the good files seem identical, but small changes are made when changing to a different rom file or different MacOS system.
FWIW, I found the documentation for the NVRAM layout.

One thing to know is there are major changes between how the NVRAM is used in Old World and New World ROMs.

The PRAM is documented in Inside Macintosh: Operating System Utilities Chapter 7 - Parameter RAM Utilities.

And I found a site that documents some of what is in the Extended PRAM.

The 8K NVRAM layout is documented in the manual for PCI developers.
mschmitt
Tinkerer
Posts: 80
Joined: Sun Jul 05, 2009 10:33 pm

Are we ready?

Post by mschmitt »

Do you think the memory allocation changes are stable enough to commit to CVS?

If so, what is the procedure for doing so?
Myrd
Granny Smith
Posts: 107
Joined: Mon Dec 25, 2006 4:09 am

Post by Myrd »

Someone with commit access, such as myself, would have to do it.

Please generate diff files and send them to the basilisk-dev mailing list on sourceforge, where I can review them.
mschmitt
Tinkerer
Posts: 80
Joined: Sun Jul 05, 2009 10:33 pm

Post by mschmitt »

The RAM-anywhere changes described in this thread are now committed to CVS.
User avatar
ClockWise
Site Admin
Posts: 4397
Joined: Mon May 20, 2002 4:37 am
Location: Uiwang

Post by ClockWise »

I think this would be a great time to prepare a new download and a new sticky for everyone here.
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 »

ClockWise wrote:I think this would be a great time to prepare a new download and a new sticky for everyone here.
Too busy right now, but next week I can again provide a new UB build, bundled with files like a ReadMe, a webloc file pointing to the manual, keycodes file, and maybe a script to install a pre-configured prefs file. Then the other sticky topics can be removed (un-sticked).
mschmitt
Tinkerer
Posts: 80
Joined: Sun Jul 05, 2009 10:33 pm

Post by mschmitt »

The timer fix that Charles S. (*) put in has caused a build problem in CVS. I think I figured out what is wrong, but it will take a few days to get that straightened out.

I'm working on two small fixes:
  1. Fix NVRAM initialization so can create OS 7 machines.
  2. Fix so SheepShaver can still find the ROM after first boot if user uses the built-in pref editor but doesn't set the ROM path.
This will take a week or so.


* Charles S. is famous! We have a Mac celebrity contributing code.
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:
  1. Fix NVRAM initialization so can create OS 7 machines.
  2. Fix so SheepShaver can still find the ROM after first boot if user uses the built-in pref editor but doesn't set the ROM path.
Those would be important improvements for setting up SheepShaver for the first time.

Another problem that first time users encounter is the fact that when SheepShaver cannot startup (when it finds no rom file or when it finds no startup volume), the application must be quit with control-ESC, which is unusual for Mac users. It would be nice if the application could be quit with command-Q or from the corresponding item in the application menu. I do not know if that can be changed easily.
gsammons
Space Cadet
Posts: 4
Joined: Wed Feb 06, 2008 2:04 am

Cannot map ram in Sheepshaver

Post by gsammons »

Thanks so much for your fix on Sheepshaver....I have been struggling for months with Sheepshaver not working on my MacPro after a ram upgrade and an addition of an additional graphics card.

It finally works after a long time of tinkering with it. It had worked perfectly before a ram upgrade and an addition of a second graphics card.

Version 2.3 (090707) (2.3 (090707))

Thanks again.

8O
kby
Student Driver
Posts: 11
Joined: Mon Feb 23, 2009 11:39 pm

You go away for a few months and the world changes...

Post by kby »

Wow, many thanks (in advance as I haven't tried it yet) to mschmitt. I think allocating RAM dynamically is a perfectly legit solution (in general—not sure I can vouch for the specific case.

I can't remember for sure, but I think I tried compiling in direct mode but gave up; looked like too much work for me at the time. I managed to get an X version to work most of the time in as I think mentioned earlier, at least it works most of the time (often either hangs or aborts after booting leaving stranded shared memory, but after deleting the shared memory and exiting from X, it's usually OK to retry (if it's really stuck the formerly started process
is hung still and has to be killed before the shared mem is released; normally done when X exits).

I also moved around RAMbase; that was how I got it to work at all even under X, IIRC, for my G5. But, yes, that only works as long as things don't move around again too much; I could never figure out a single optimal value I could guarantee would work in even "most" cases.

I'll have to read through this, now, get the right source, and try and SDL version again. The disadvantage with the X version is primarily (for me) that I could never figure out a correct keycode map that allowed "command" to map through (as opposed to "meta" or interpreted by X11 itself). There's probably a way to do it, but I gave up after a few attempts and just lived with it.-kby
mschmitt
Tinkerer
Posts: 80
Joined: Sun Jul 05, 2009 10:33 pm

Re: You go away for a few months and the world changes...

Post by mschmitt »

kby wrote:I can't remember for sure, but I think I tried compiling in direct mode but gave up; looked like too much work for me at the time. I managed to get an X version to work most of the time in as I think
Direct mode as used by SheepShaver is fundamentally flawed.

In Basilisk II, when Direct mode is used, it finds where it can fit the RAM & ROM (allocated contiguously), then it calculates an offset to that address such that the VM machine thinks the RAM and ROM are located at the correct addresses.

But when Direct mode is used in SheepShaver, the offset is calculated and compiled into the program at build time. So, it can't be used to create a portable program.

One possibility is to change SheepShaver so Direct mode works the same as in Basilisk II.

Right now I'm trying to get it to do the memory allocation before it initializes the Cocoa environment. I'm struggling with Objective C to C++ calls.
kby
Student Driver
Posts: 11
Joined: Mon Feb 23, 2009 11:39 pm

Re: You go away for a few months and the world changes...

Post by kby »

mschmitt wrote:
Direct mode as used by SheepShaver is fundamentally flawed.

Right now I'm trying to get it to do the memory allocation before it initializes the Cocoa environment. I'm struggling with Objective C to C++ calls.
I probably just tried to compile with that option and found it would require extensive changes that I didn't have the background to deal with. I have done a fair amount of c, but no "real" c++, and haven't tinkered with the Mac enough to help you with Obj C or C++.

I figured out most of what I did with gdb and vmmap, I think. I'm glad it was helpful at the beginning. I think once I got a version to work at all, I left it for more committed and experienced souls such as yourself; thanks again for taking up the torch.

Now, if only MacsBug could work inside...then I might be able to get 9.2.2 to work (having been involved in getting 9.2.2 to run on old world machines; http://www.os9forever.com for details)...-kby
kby
Student Driver
Posts: 11
Joined: Mon Feb 23, 2009 11:39 pm

Tnx again to mschmitt

Post by kby »

Built it from cvs; works fine. I even used shared SDL libs...-kby
jules
Space Cadet
Posts: 1
Joined: Mon Sep 28, 2009 4:06 pm

Post by jules »

thanks ever so much people.

Your update saved/modification my life.

No more ram problem.

In: 10.5.8 on intel.
Post Reply