3 ms·
> One project I have had on the list for many years is to build Linux on BSD. Could it be done? Has it been tried? How do you mean? Compiling the Linux kernel
by yjftsjthsd-h 9y ago
> One project I have had on the list for many years is to build Linux on BSD. Could it be done? Has it been tried?
How do you mean? Compiling the Linux kernel on a BSD machine? Using GNU on BSD (if so, the answer is yes; see Debian GNU/kFreeBSD)? Linux kernel with BSD userland?
- feelin_googley 9y agoCompiling Linux on computer running BSD. User has no computer running Linux, but she has computer running BSD. She builds needed toolchain, downloads and compiles Linux kernel. Its relatively easy to build BSD while running Linux. But vice versa?
- yjftsjthsd-h 9y agoOkay, so I tried it, and I'm going to say, "not easily". Started from base FreeBSD install, installed gcc and gmake, pulled down a tarball from kernel.org. Did a `gmake x86_64_defconfig` to get started. First problem: FreeBSD calls it "amd64", Linux calls it "ia86". Exported ARCH=ia86 and retried. It gets further now but appears to blow break trying to build some .S files (FreeBSD uses as from GNU binutils, but it's like a decade old). I couldn't figure out how to fix, so gave up:) I suspect it would work in a Linux jail, though, since that's a GNU userland with a Linux ABI from the kernel. Didn't try, though. I also won't speak to whether it would work on netbsd/openbsd/etc.
- feelin_googley 9y agochroot into /emul/linux directory/jail with GNU/Linux libraries, headers and GCC toolchain as Linux binaries, not BSD ones, then build. There are probably obvious reasons this wont work but without trying I do not know what they are.