[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Using Linux emulation in FreeBSD to run a Debian Linux userland



Dear Petr,

I forgot to mention that I am not on the list, so please CC replies to
me. I noticed Petr Salinger's reply because I was looking through the
mailing list archives.

> Please could, you give us some examples of what does not work
correctly using FreeBSD ABI and works using Linuxator ABI ?

Your wiki suggested that things weren't working as well as they do on
Debian Linux, so I was under the impression that they would work better
if the abstractions were moved to the Linuxulator. Perhaps I had the
wrong impression.

> What kind of userland ? Do you have working X-server, attached
> printers, cameras, ...

I have not tried the X server. I do know that FreeBSD users have used
Linux emulation to make Humble Bundle games work, so I assume that X
will work, but I do not know the specifics.

As for printers and cameras, I don't know. I am running Gentoo Linux in
a jail running in a VM. It permits me to try a Gentoo Linux development
environment with OS-level virtualization, but but I have not tried using
it for anything else.

Yours truly,
Richard Yao


On 07/13/2012 09:44 AM, Richard Yao wrote:
> Dear Everyone,
> 
> I understand that Debian GNU/kFreeBSD currently builds software using
> the FreeBSD ABI. It might be easier to make some changes to FreeBSD's
> linux emulation and Debian Linux's packages so that the FreeBSD kernel
> could boot a Linux userland using the same binaries used in Debian
> Linux. This would make many things start working and reduce the things
> that you need to maintain dramatically.
> 
> There is not much interest in this in either Gentoo or FreeBSD, but I
> thought it might be worthwhile to share the idea with you.  Right now, I
> have Gentoo Linux's userland running in a FreeBSD jail nearly perfectly,
> so it is definitely possible.
> 
> The only issues that I have encountered running Gentoo Linux in a jail
> are as follows:
> 
> 1. FreeBSD's Linuxulator does not support amd64
> 2. ptrace does not appear to work on the amd64 FreeBSD kernel (breaking
> gdb, strace and glibc compilation).
> 3. A few binaries do system calls that didn't exist in Linux 2.6.16
> (breaking build systems)
> 
> I assume that #2 would not be a problem if my host system was i386
> instead of amd64. I worked around #3 by making rm, tar and touch
> symlinks to busybox. With that said, this should be much easier to
> maintain than what Debian GNU/kFreeBSD is now. I also understand that
> one of the FreeBSD developers has Debian Linux running in a jail, so
> this is definitely possible.
> 
> Some improvements will need to be made to the Linuxulator so that the
> userland will be able to manage the kernel. In particular, it would need
> hooks to enable the following commands to work:
> 
> sysctl
> lsmod
> insmod
> modprobe
> rmmod
> reboot
> shutdown
> zfs
> zpool
> 
> In addition, the FreeBSD kernel should have a kernel setting added to
> enable these hooks so that the changes could be merged into FreeBSD. It
> would be set in the bootloader's equivalent of /etc/loader.conf.
> 
> Beyond that, there would also need to be an abstraction made in Debian's
> package manager so that packages for out-of-tree modules will be
> replaced with ones that work with the FreeBSD kernel. This might also
> require changes to the Linuxulator to accommodate that.
> 
> Once that is implemented, Debian GNU/kFreeBSD will be able to improve by
> implementing currently unimplemented syscalls in the Linuxulator and by
> extending the Linuxulator to support more architectures.
> 
> Yours truly,
> Richard Yao
> 


Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: