Opened 19 months ago

Last modified 5 months ago

#13725 assigned enhancement

Implement trojan-horse host take-over

Reported by: miqlas Owned by: mmu_man
Priority: low Milestone: Unscheduled
Component: System/Kernel Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All


One was able to install BeOS R5 in Windows, and then it was able start with double click. We should have something like that because R5 compatibility :)

Haiku should be installable in Windows and Linux. The user will get an icon on the Desktop where one can start Haiku with double click. The host kernel will be killed graceully and Haiku kernel will be started.

I assume, we can use systemd to accomplish that on Linux.

Change History (10)

comment:1 Changed 19 months ago by diver

Milestone: R1/beta1Unscheduled
Owner: changed from nobody to mmu_man
Status: newassigned

I once tried to look into using but didn't do much. Looking at the wiki the project was discontinued in 2012. The page also mention BeOS btw.

mmu_man started FAT driver in 2008 but it seems to be unfinished. Since current versions of Windows don't use FAT as boot volume NTFS driver needs to be implemented.

Taking into account current amount of devs this is clearly out of scope of beta1.

comment:2 Changed 19 months ago by pulkomandy


We do have perfectly (or almost) working FAT and NTFS drivers already.

However, the main problem there is "taking over" the OS. I'm pretty sure they won't let us do that. We could go quite far (reformatting the disk, setting up a bootloader, etc) but probably not to the point of killing the running OS and bootstraping ourselves. What was possible in Windows 9x may not be in more modern systems.

comment:3 Changed 19 months ago by diver

I was talking about bootloader FAT driver which is different from normal FAT.

comment:4 Changed 19 months ago by pulkomandy

Ah, I see that. This should not be needed unless we want to run from a file instead of a partition like BeOS PE did. I think I would handle things a bit differently if doing this in the modern world. Probably writing an Haiku image to an USB stick and then rebooting the machine to it, then possibly performing next steps of the install from there.

Or if we really wanted to run the installer from Windows, have it create a partition and setup the UEFI bootloader to allow booting from it. But I think it makes more sense to do this after booting from USB (and it is unlikely that we can take over the running OS without a reboot anyway).

So, do we end up with just a tool to easily write a disk image to USB, or do we need to go further?

comment:5 Changed 19 months ago by emmamai

Loading straight into Haiku can be done from Linux, look into kexec. It's enabled by default on a lot of distro kernels iirc, and in addition to loading Linux kernels, also supports any ELF binary or multiboot-compatible kernel.

The filesystem thing would still need to be sorted out, though. It *would* be cool if the run-from-a-file thing could be done, but that'd take some developer time that might be better focused elsewhere...

comment:6 Changed 19 months ago by pulkomandy

Well, it would be "just" another partitionning system, with some tricks to mount it properly at boot. Or it could be just a loop mount, that should work as long as we can read the host filesystem (wether it's ok to write to the file without telling the host FS is another interesting question).

As for kexec, that could work, but our kernel needs some arguments passed to it. So probably we would kexec the stage2 bootloader instead, and then load the kernel from there?

comment:7 Changed 19 months ago by diver

There's also WinKexec :)

Last edited 19 months ago by diver (previous) (diff)

comment:8 Changed 18 months ago by diver

Turns out there is an active fork of wubi that works with EFI

comment:9 Changed 14 months ago by kallisti5

Priority: blockerlow

comment:10 Changed 5 months ago by luroh

Type: bugenhancement
Note: See TracTickets for help on using tickets.