Project info
Diary Linuxolator-status
Status of the patch: linuxolator-patch-status
Synopsis
Update the FreeBSD linux emulation layer to the current Linux kernel as of 2.6.16
Details
Currently FreeBSD linuxolator implements kernel 2.4.2 api (with some syscalls missing) but linux world has moved forward and current linux kernel has many more syscalls. FreeBSD lacks this so it's unable to run some modern linux compiled programs which use those syscalls or doesn't run optimally.
Deliverables
- updated linuxolator with new syscalls implemented
- review of the linuxolator code
- documentation of the code, comments in the code and man page update/extension
- set of regression tests
Plan
Missing syscalls
- readahead
- sendfile64
- futex
- sched_[sg]etaffinity
- get_thread_area
- io_*
- lookup_cookie
- epoll_*
- remap_file_pages
- set_tid_address
- timer_*
- clock_*
The last syscall implemented by linuxolator in FreeBSD is 267, linux kernel 2.6.16 lists syscall 310 as the last syscall. This gives us 69 unimplemented syscalls.
Beware of different semantics between linux and FreeBSD for the same syscall (sendfile?).
The Linux clone() syscall is different between linux versions.
Some syscalls cannot be implemented (or implemented properly) due to divergence between the kernels (get_mempolicy etc.).
Prioritized TODO (by AlexanderLeidinger)
- add all syscalls as "unimplemented" ! milestone point, commit to CVS by mentor of the changes above
- ask on emulation@ for programs which try to use unimplemented sycalls
- bump version (via "sysctl compat.linux.osrelease" until everything is
- implemented)
- linux_base-fc3 or fc4 (depending on availability) up and running,
- probably ony the linux clone() call has to be changed to the new semantic, but perhaps some other pitfalls are there
- have a look at the PR's below to know if there's a patch for
- something, but don't work on the PR's until it's a problem of this milestone
- repeat until it works:
- start the linux sh and try to run a program in the linux-sh
- watch out for "syscall unimplemented" messages in the console
- if there's no message, use ktrace
- fix the problem
- try to use some programs (acroread, skype, realplayer, ...) and
- fix problems as above
- have a look at PR 39201, 29698, 21463, 77710, 55835, 72920, 73777 (warning,
- mentor wants coordiantion for last listed PR) and fix the easy ones, the hard ones should be put back on the TODO list except there's a reason to give priority to them
- add in the normal device driver entries into the device_handler stuff
- that are common to all Linux machines
- implement missing syscalls as reported on emulation@ ! milestone point, commit to CVS by mentor of the changes above
- add in /dev/passX and if possible /dev/sdX support into the device_handler
- stuff (message "color scanner software for FreeBSD" on emulation@) if not already done
- milestone point, commit to CVS by mentor of the changes above
- epoll_* if not already done
- implement remaining syscalls ! milestone point, commit to CVS by mentor of the changes above
- have a look at the linux dev_t issue (HEADSUP message from phk to arch@
- in March of last year)
TODO without priority
- cleanup/review of existing code
- KASSERT the return value of copyin()
- there are places where a function A calls function B, then calls copyin()
- on the result of function B, and then checks the return value of function
B for errors -> BOOM on error when calling copyin()
- on the result of function B, and then checks the return value of function
- safety-net like in rt_sigpending (but no "new" return values, KASSERT if
- possible, rt_sigpending needs to be reviewed regarding this)
- CLK_TCK still valid? / XXX (both in linux_misc.c)
- add doxygen comments to the code
- write man pages as necessary
- ...
- bump the linux kernel version in the code
<some other ideas the student comes up with>