3 ms·
How did you do that?
by M95D 3y ago
How did you do that?
- actionfromafar 3y agoI don't remember, specifically I don't remember if I had to compile a tiny device driver to expose a chunk of RAM as a block device. In that case, it might have been something like this sample: https://www.opensourceforu.com/2012/02/device-drivers-disk-on-ram-block-drivers/ https://www.opensourceforu.com/2012/02/device-drivers-disk-o... There might also have been some way to convince the kernel a piece of RAM was a block device. The "ramdisk.c" driver in Linux was simpler before. After that, it was a matter of creating an init script which formatted the block device as a swap device, then running swapon.