Opened 3 years ago

Last modified 21 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:
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 by diver, 3 years ago

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 by pulkomandy, 3 years ago


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 by diver, 3 years ago

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

comment:4 by pulkomandy, 3 years ago

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 by emmamai, 3 years ago

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 by pulkomandy, 3 years ago

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 by diver, 3 years ago

There's also WinKexec :)

Last edited 3 years ago by diver (previous) (diff)

comment:8 by diver, 3 years ago

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

comment:9 by kallisti5, 2 years ago

Priority: blockerlow

comment:10 by luroh, 21 months ago

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