Improving the Linux compatibility layer in the FreeBSD kernel

The goal is to update to 2.6.16 compatible Linux syscalls. Without this compatibility, we are not able to update to a more recent linux_base port.

Test equipment

LTP

Very easy to set up: install linux_dist-gentoo-stage3, download the tarball into a directory below /usr/local/gentoo-stage3/, mkdir dev and sys in the gentoo-stage3 directory, mount devfs, linprocfs and linsysfs and then do a "chroot /usr/local/gentoo-stage3 bash". To prepare the LTP extract the tarball, cd into the directory, type "make autotools && ./configure && make all install" and then you can run the first tests with "./runltp -v -p -l mylogfilename 2>&1 | tee verboselog.txt".

If you don't have at least revision 1.187 of /sys/compat/linux/linux/misc.c you need to comment out "reboot02" in runtest/syscalls or your system will reboot. "send01" (and some test immediatly after that test) will cause a kernel panic if you don't have at least revision 1.282 of uipc_socket.c (mutex so_snd held when returning to userland).

There are some tests which hang around and do not finish if you use a -current prior to ~20061222, you need to kill those tests there.

Keep an eye on /usr/local/gentoo-stage3/tmp between tests and clean it up. You should also run "ipcs" and remove some leftover (compare before and after each run).

A little funny note: we are even more compatible than a real linux distribution (don't take this literally). LTP 20061222 does not even compile on Ubuntu 6.10. The error message is ../../generate.sh: 60: arith: syntax error: "cnt--" and the line in question is while [ $((cnt--)) -gt 0 ] ; do. If you do a loop unrolling by hand it fails later when you try to run the LTP tests even before it tries the first test. We did not try to proceed further, we want to fix problems on FreeBSD, not on Linux.

Missing stuff

Syscalls

syscall

status

add_key

not started

adjtimex

not started

capget

not started

create_module

will not be implemented

epoll_XXX

implemented in p4; -current missing only epoll_create

fadvise64

not started

fstatfs64

not started

futex

in current, problems when swapping out/mmaping etc.

inotify_XXX

userspace implementation available, expected to be ported to kernel soon; -current missing only inotify_init

io_XXX

in P4, needs testing; implemented in -current

keyctl

not started

lookup_cookie

implemented in -current

mbind

not started

mincore

not started

ppoll

not started

prctl

partially implemented

pselect6

not started

ptrace

implemented in -current

quotactl

not started

readahead

implemented in -current

remap_file_pages

not started

rt_sigqueueinfo

not started

sendfile

not started

sendfile64

implemented in -current

setfsgid

not started

setfsuid

not started

set_mempolicy

not started

stime

not started

swapoff

implemented in -current

sysctl

will probably not be implemented

sysfs

not started

syslog

not started

unshare

not started

vhangup

not started

waitid

not started

List of all system calls in linux-2.6.16 branch (i386)
List of all system calls in linux-2.6.16 branch (amd64)

This is a list of syscalls used in the linux-2.6 mainline branch. If all the above syscalls have been implemented to ensure 100% compatibility with the linux-2.6.16 branch the next step is to catch up with the linux-2.6 mainline branch syscall wise.

List of all system calls in linux-2.6 mailine branch

Would be nice if somebody could write a script of some sort to make a nice syscall-table out of these src files.

IPC

type

status

11

not implemented

12

not implemented

13

implemented in current as of 20070114

17

implemented in current as of 20070114

-257

not started, probably a "has to fail" regression test sentinel

ioctl

type

status

used by

0x6d02 ('m',2)

not implemented

dd

0x541c ('T',28)

not implemented

consoletype

0x8905 ('M',5)

not implemented

ltp-20090930 (sockioctl01)

0x8914 ('M',20)

not implemented

ltp-20090930 (sockioctl01)

PRs

TODO

in -current

MFC

The following needs to be MFCed (incomplete list):

The following will not be MFCed (maybe incomplete list):

Bugs

A note to users: Feel free to read the following list of things to fix, but do not make conclusions out of it. The linux compatibility environment runs just fine. There are some broken edge cases which don't affect the daily use. The following list is only meaningful for developers. Just because something is marked as a bug, it doesn't mean it doesn't work. It may be the case that some obscure error condition does not return the expected error value, or that a seldomly used feature is not implemented.

Misc

Automated test results

linux-kernel (last edited 2009-11-06 08:11:51 by AlexanderLeidinger)