HackZ Memories Mac OS

broken image


Keep me going
give me coffee!

Upgrade the memory of nearly any iMac, MacBook Pro, Mac Pro, or Mac mini. Save money by trading in your original memory chips for a cash rebate. The Mac OS X mmap man page says that it is possible to allocate superpages and I gather it is the same thing as Linux huge pages. I do not know OSX memory.

As I'm currently rewriting Q - [kju:] from scratch, I have to tackle a longstanding QEMU frontend problem: vga buffer of the guest os in one application - vga output window in a viewing/controlling app.
The most economic would be a buffer that could be accessed by both apps. Shared Memory.
There was once a shmem patch submitted to the QEMU dev list, but it got dropped in favor for a vnc solution. As I'm not satisfied with vnc speed, I took a stab at the shmem patch.

shmem on OS X, it's a no-go..
Shmem would be the most geleagnt way of creating shared memory. Unfortunateley, Apple has limited shmem to a lousy 4MB - for the whole system!Blade:~ mike$ cat /etc/rc | grep shmmax
sysctl -w kern.sysv.shmmax=4194304 kern.sysv.shmmin=1 kern.sysv.shmmni=32 kern.sysv.shmseg=8 kern.sysv.shmall=1024
Manipulating rc is not my thing. Setting shmem with 'sysctl -w kern.sysv.shmmax=10485760' to 10MB on the fly needs to much privileges.

Distributed Object, anybody?
I'm already using DO to communicate between the controoling ap and the QEMU instances. The problem with DO is, that all the messages are copied and sent to the corresponding object. So accessing a buffer in a distandt object with - (void *) screenBuffer; will copy and send the whole buffer, not just a memorypointer. The advantage of the DO, you could have the viewer on a different machine - (Q - [kju:] Server anybody? :)).
So I wrote a methode, that just sends updated segments of the screenBuffer.
Here is a downstripped version of the Distributed Object (DO) I used to transfer changes in the guests videoram to the viewer:

DO in data reciever process: We come to attack mac os.

Hackz Memories Mac Os Download

DO in data creator process:

Downside of the shared Object: data is copied at least 2 times: when the message is created and when the data is writen from the message to the reciveers buffer. Faster than vnc.. but data objects are sometimes not released as fast as created => incredible memory footprint.

Hackz Memories Mac Os 11

finally, mmap!
With mmap you can load a file into memory. Cube dude mac os. Phantom pillar mac os. If more than one processes mmap the same file, all processes can access the same mmap, that way we have shared memory, and a convenient way to share the adress: the file.

First we need a file the size we need shared memory..

..after we attach, from multiple processes.

Hackz memories mac os catalina

Downside? Well if more than one process make changes to the mmaped file, it's writen from time to time (normally when the last process exits) but I can live with that.
I hope to comit the rewrite of Q - [kju:] soon 🙂

Mike





broken image