[Toybox] BSD support

Rob Landley rob at landley.net
Mon Jan 20 20:41:19 PST 2014


On 01/20/14 18:55, Joe Nosay wrote:
> The biggest problems are:
> 1. Making the code compatible to use with LLVM and CLang which means
> rewriting and not patching.

I want to get it to build with llvm on Linux.

I've been following http://ellcc.org/blog/?page_id=295 but unfortunately 
the developer checked in all the extracted source packages into a giant 
svn archive instead of keeping the tarballs and patches separate, which 
makes playing with it hugely inconvenient...

> 2. That Linux compatibility is not necessary. Once "1" is done, then all
> that's required is to  "remap" whichever libraries to their proper
> places in FreeBSD.

Things that pay attention to /proc and /sys would need those at runtime.

> 3. That the BSD type operating systems are not Linux, andthat they are
> not setup the same way.
> 4. Finally, if any of you actually believe that all systems can work all
> things the same way, you're going to be in a world of shit because it
> means you have stopped being able to learn something new.
>
> I'm working on this- along with a few other Linux based programs - but;
> you are welcome to start your own porting effort. FreeBSD runs on
> multiple architectures with the Linux compatibility layer only working
> on i386 and AMD64. NetBSD has Linux compatibility for more
> architectures. You need to learn about proper branding of elf
> executables along with porting the necessary libraries if you want it to
> work through the Linux compat layer.

Let's start by working out the subset of comands that don't need a 
compatability layer. (The sort command, for example, is a fairly 
elaborate one that should not care. Same for sha1sum, bzcat... they're 
basically doing math.)

> OpenBSD does not have any Linux compat nor will it ever.

I'm happy ignoring Theo.

> As far as QEmu, Virtual Box, or any of the others are concerned: it is
> much better and more practical to run a system on bare metal.

Many moons ago somebody ported busybox to newlib+libgloss running on 
bare metal. It didn't go upstream and has probably bit-rotted by now, 
but it was a concern for a while. I also note that u-boot uses busybox 
hush as its command shell.

Somebody on the #toybox IRC on freenode is working on a bsd-licensed 
bootloader (https://github.com/gdboot/gandr/blob/master/LICENSE) and 
making toysh run on there (and then making toysh not suck) sounds like 
fun to me. :)

> These are my opinions but I did some work with porting VirtualBox and
> Ardour3 to FreeBSD, so I know what I am talking about.
>
> Try starting with the Debian-KFreeBSD community first and work from there.

Sounds like fun. I need to get an llvm build environment set up. I've 
got a musl one, but it's still gcc...

Rob



More information about the Toybox mailing list