I am trying to use a same image of raspbian with two kernels and switching theme with a script
The kernel loads itself into memory first on booting, then other code loads into what is called "user space" memory afterwards. Drivers and applications can be unloaded after booting, but not the kernel.
You can however create a single file system, mount it and symlink link to it. That way you could have one copy of your directory tree available to 2 different kernels. But you'd still have reboot to change kernels. I would consider this method time consuming and error prone when compared to have 2 full images on the sd card.
Retired IT professional, C programmer and "beardie weirdie".
RPi interests: Developing an Infinite Improbability Drive
“Thinking outside of the box allows you to get rewards outside of your reach.” Matshona Dhliwayo