Hello, Dear Community!
Today the amounts of RAM we can get for laptops/desktops are close to what servers had just a few years back.
Most of the time we barely use even 50% of the total memory available, unless gaming or dealing with virtualization/video editing/3D-modelling on a large scale.
I had an idea for computers with dual-boot (let's take for example Linux and Windows OSs) to simplify the switching between them. Having 12-16GB of RAM is too much for any of those systems most of the time.
But what if we could divide RAM between two of them simultaneously?
If may sound like a crazy idea, but aside from solving a couple of possible issues, the whole concept is extremely trivial by itself.
Imagine that you worked on linux for 4 hours, then you decided you had to use Photoshop or wanted to play with your friends on Windows (what else is there to do, right? Ü ). Instead of losing your session on linux and rebooting to get into Windows, you just put your computer into suspend, then wake it up, get a bootloader-alike prompt menu and choose Windows there (or linux, if you changed your mind).
My vision on how it can be accomplished:
In grub or any other bootloader, we tell the kernel which memory range it can occupy, instead of using the whole amount.
For example, we tell linux to occupy the last 8GB of RAM, while windows will be limited to use the first 8GB.
(Below I'm posting links to materials I found on how to do that, but now sure if that's going to be enough):
Memory starting address on linux:
Bonus from TI:
Kernel memory limit on windows:
Once we suspend our machine, we get to the first tricky part: we have to call a 'fake' bootloader upon resume, before we actually get back to the saved session in our RAM. It should be able to point at the certain address in our memory, or load a certain OS to that address range in the RAM. I actually thought that it might be possible to accomplish by calling a patched grub installation, but without rebooting/discarding the ram content. I'm sorry, I'm not that deep into boot stages and/or suspend/resume mechanics.
So if we don't have a suspended OS by the specific address in ram, that 'fake' bootloader will load the OS just as GRUB would, but without wiping the other suspended sessions from other OS's in the RAM.
This might be simpler or easier, not sure.
Sharing the RAM is not required in case with hibernation, just a lot of disk space (SWAP or big system partition on Windows).
The only thing required here is to patch the hibernation mechanics on both windows and linux to start grub after powering up the system after hibernation.
I'm actually not sure that it's not working by default right now because I don't have enough space to suspend both of my OS's to a 120GB SSD
I see the future where we switch between different Operating Systems by closing and opening lids of our laptops, future where we don't reboot as much and don't have to start our precious sessions all over and over again.
It's possible and I believe in this idea, that it will make our lives better and we never ever again will have to deal with long system boots!
Thank you for taking time to read my post, especially the last paragraph which turned out being quite obnoxious instead of motivational.
I'll be glad to hear any opinions or comments on it!