RAM Disks under OSX?

gabe

Registered
Ok, so we were able to make RAM disks in OS 9, we are able to make RAM disks in UNIX systems, but can we make RAM disks in MacOS X?

Does anyone know how?
 
According to all the BSD sites I was able to scour it looks like MacOS X isn't configured to support a RAM disk. The general instructions for creating a RAM disk under most BSD systems consists of

add 'option MFS' to your kernel configuration
use for example: mount_mfs -s 4096 swap /mnt
or add an /etc/fstab entry like this: swap /var/log mfs rw 1 0


The trouble is that MacOS X doesn't seem to have a configured swap partition, nor does it appear to have been compiled with the MFS option enabled, and alas there is no /etc/fstab either. (We do have /etc/fstab.hd, .rd, and .sd however) If you try to use /dev/mem as the mount source you'll find that mount_mfs won't accept it.

Unless I'm mistaken - and it wouldn't bother me if I was! - we may have to wait for MacOS X 10.1 or beyond before we get RAM disk support.... unless you feel like recompiling your kernel.

(I might just be mistaken after all. Check out this thread and this page)
 
Well, you can recompile your kernal if u want..... Just download the Darwin source from apple (they still have it up there, dont they?). All the bare system stuff is in there.
 
What you've both said about recompiling the kernel makes me wonder:

Does Darwin support RAM disks itself?

I can't exactly recompile my OSX kernel, now can I?

heh.
 
If you follow the links from my last post you'll find some information that strongly backs the idea that Darwin has built-in RAM disk support. You'll also learn that the RAM Disk as it exists in many BSD variants is highly inefficient in terms of memory usage but plenty fast.

You definitely can recompile the Darwin kernel. Apple has a Darwin FAQ worth reading and you can get the latest Darwin sources from this page. (The kernel itself is named 'xnu' and it's near the bottom of the page.)
 
Back
Top