I had an idea for an operating system that is portable across CPU
architectures.

You would have a set of bootloaders for each architecture (let's say,
x86 and PowerPC). The x86 bootloader would be stored in the EFI
partition, and the PowerPC bootloader would be stored in the
OpenFirmware partition. (These could all be GRUB2, or whatever). The
bootloader would be configured to load the appropriate kernel.

You would have a set of Linux kernels stored in /boot, one compiled
for each architecture. Let's say the x86 bootloader loads the x86
kernel. Then the x86 kernel loads the appropriate x86-compiled init.
(This could be done by setting the init= kernel option, for example).

The init system loads the guix daemon, which is used from then on to
load the correct programs for the running system.

One copy of each application would be installed in /gnu/store for each
architecture keyworded (to use Gentoo termiology) by the package
manager. The appropriate application for the current CPU would be
linked to the typical location on the filesystem hierarchy (/bin/cp,
/bin/cat, etc.) by the guix daemon.

This would for example allow you to install GuixSD for x86, then, by
setting an option in your package manager, install a set of PowerPC
packages in parallel, and then put your drive in a PowerPC machine and
it would boot.

Is this theoretically possible to implement?

Reply via email to