When you have too much memory for SheepShaver
oldvcr.blogspot.com
oldvcr.blogspot.com
Again, I never looked at how Power works in that regard, so I might have entirely misunderstood.
But a great and fun read nonetheless! (I believe this is evidenced by me thinking about it in such detail :) )
The other mapping is an identity mapping (PA==EA), as evidenced when the attempt to map EA 0 using that VSID found a PTE that mapped it to PA 0. This screams kernel-internal mapping. Lots of OSes map all RAM 1:1 to some extent.
The correct fix here is obviously to read the segment register instead of trying to do all this linear search heuristic. However, if that is not trivial for some reason, then the next best solution would be to assume that the only other possible mapping for the pages is indeed a 1:1 identity map (they should really investigate where this comes from), and filter out any PTEs found during the search that map 1:1, since no legitimate userspace process should have these freshly allocated pages mapped down there anyway. Of course, this then fails if SheepShaver ends up with EA==PA on the malloc out of sheer luck :-)
Why did this work with less RAM? Well, PPC uses hashed page tables, so they do not contain a full view of all MMU mappings. Instead, the mappings thrash on collisions. My guess is that boxes with lower RAM have enough page table churn that those fixed mappings often go away. Either that or the fixed mapping doesn't cover all RAM, and for whatever reason never collides with the allocated pages on lower-RAM systems.
When he launched SheepShaver after playing Doom for a while, either the game had caused enough page table churn to evict those identity mappings, or the allocation ended up somewhere else where it didn't collide with any identity mappings that had ever existed, and thus SheepShaver worked.
Here's the thing though: without knowing how the rest of the OS handles the HPT, this entire approach is unlikely to be stable. The author says "we will take over that memory mapping for the life of the process", but unless something guarantees those PTEs will never be evicted by the OS, it is well within its right to do that. Then when SheepShaver next tries to use those addresses, they will fault, the OS will know there is no real legitimate mapping for them, and things explode.
At least if my memory serves me right; last time I had to deal with hashed page tables was with PS3 Linux (and that was 64-bit PPC), and I've only ever used BAT mode on 32-bit (Wii) so I'm a bit rusty on this stuff :-)
It's fun what can be inferred from just a few paragraphs in a blog, I hope I didn't fail to take super important details of the architecture into account. :)
And good point with the eviction by the OS, I had somehow assumed that the driver was invoking steps to lock those PTEs down, but that may not actually be the case...
My first proper PC was a 80286 ("Opus" in Hants, UK) I think it costed about £1200. 1MB RAM, 20MB HD. 1989ish.
I went on to study Civil Engineering at Plymouth Poly (Devon). Now I run an IT firm with a slack handful of employees.
My C64 now has a USB interface.
My uncle used to do programing with punched cards. Us old gits have a habit of hanging around and making the place look untidy. Soz.
The controller for which is probably faster and has more memory than the C64 itself :) So maybe it's more like your USB controller now has a C64? :)
That aside, have you seen what Jeff Minter and co could do with a C64? You have around 40Kb RAM to play with. You've got the SID for sound and sprites are a thing. Thank the good $DEITY that your storage isn't as noisy as a Spectrum and you have a decent amount of memory to work with. Now make a game to run on this thing!
I can see a Quickshot II across the dining room (WFH.) Hmmmm, when lunch time turns up I think some Mutant Camels will need a good kicking.
Also some of the optimisations (The Hobbit on the BBC micro actually using screen memory to load the game) and "friendly rivalry" between developers and copiers (I remember trying to Hack Frak! on the BBC micro and it detecting this and playing the Jolly Roger).
I did see the harddrive Linux thing yes, I think it was shown at SHA2017 too.
And I was just joking about the controller having a C64 indeed :) Of course functionally the C64 is more versatile despite having less resources.
Back in 1998 when Unreal came out, I had a friend at high school who had a PII 450 with 128MB and a Voodoo 2. So jealous! Simpler times.
I had that Voodoo 2 card as well, it was the bees knees.
I always though it was funny that the original Apple LaserWriters had more RAM and a faster processor than the computers they were attached to: https://en.wikipedia.org/wiki/LaserWriter
So did the Commodore 64. The https://en.wikipedia.org/wiki/Commodore_1571 had a 2MHz 6502, the Commodore 64 a 1MHz 6510. It was sometimes used to speed up programs (https://retrocomputing.stackexchange.com/questions/4692/obsc...)
I never managed to use more than half of it, as in those days it was still crazy much. The CPU was 120 MHz :)
I installed it on a hand-me-down emachines, aside from figuring out some voodoo magic to get my 33K modem to work; it was a good OS. I do miss technology in the 90s.
Would you rather have a NeXTCube instead of your Mac, or rather a BeBox? Run some networking servers on your Solaris machine and do visual rendering on your SGI? Ah, it was fun times.