rumpkernel / rumpctrl Goto Github PK
View Code? Open in Web Editor NEWControl and diagnostic applications for rump kernels
License: Other
Control and diagnostic applications for rump kernels
License: Other
We want to be able to call host syscalls directly, not via rumpuser_* always.
Easiest to do by linking a bit later on in the sequence, after renaming I think.
Due to gcc bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66345
I committed a workaround to NetBSD sources and will be pulling it up here soon.
reported initially by @Incognito
It is really convenient if the commands run with the host environment, but not sure that the current way of mapping all env calls to emul_ calls which uses host is the right way.
Want to init with a copy of/pointer to the host env instead.
Once portability is resolved, an in tree netbsd build would be nice, so we can use rumprun for tests. Looking through the tests that use rump (around 90), most of them could be simply replaced by shell scripts that use rumprun, which would also test the userspace tools as well as the syscalls which are currently tested.
In the short term, adding significantly to the rumprun tests and then running rumprun on netbsd head on an increasing range of architectures would be a good start - it is pretty quick writing tests for rumprun.
Running buildnb.sh fails when it reaches the stage where binaries are supposed to be built:
# compile cat/cat.o
/home/pooka/tmp/rumprun-posix/rumptools/bin/x86_64--netbsd-clang -O2 -g -fPIC -std=gnu99 -D__NetBSD__ -std=gnu99 -Werror -I/home/pooka/tmp/rumprun-posix/rumptools/compat/include -D__NetBSD__ -Ulinux -U__linux -U__linux__ -U__gnu_linux__ --sysroot=/home/pooka/tmp/rumprun-posix/rumptools/dest -c /home/pooka/tmp/rumprun-posix/rumpsrc/bin/cat/cat.c
: ctfconvert -g -L VERSION cat.o
# link cat/cat.ro
/home/pooka/tmp/rumprun-posix/rumptools/bin/x86_64--netbsd-clang -nostdlib -r -Wl,-dc -o cat.ro cat.o
clang: warning: argument unused during compilation: '-r'
/usr/bin/ld: warning: cannot find entry symbol _start; defaulting to 00000000004001c0
cat.o: In function `main':
/home/pooka/tmp/rumprun-posix/rumpsrc/bin/cat/cat.c:80: undefined reference to `setprogname'
/home/pooka/tmp/rumprun-posix/rumpsrc/bin/cat/cat.c:81: undefined reference to `__setlocale50'
/home/pooka/tmp/rumprun-posix/rumpsrc/bin/cat/cat.c:110: undefined reference to `__sF'
...
I just learned about the rump kernels and wanted to experiment a bit. I am using FreeBSD 10.2 and the build process fails while compiling fsck_ext2fs:
$ ./builnb.sh
... snip ...
( cd src-netbsd/sbin/fsck_ext2fs && /home/viktor/src/rumpctrl/rumptools/rumpmake obj && /home/viktor/src/rumpctrl/rumptools/rumpmake LDFLAGS=-Wl,-r LIBCRT0= BUILDRUMP_CFLAGS="-fPIC -std=gnu99 -D__NetBSD__ " fsck_ext2fs.ro )
# objdir /usr/home/viktor/src/rumpctrl/rumpobj/sbin/fsck_ext2fs
# compile fsck_ext2fs/dir.o
/usr/home/viktor/src/rumpctrl/rumptools/bin/x86_64--netbsd-clang -O2 -g -fPIC -std=gnu99 -D__NetBSD__ -std=gnu99 -Werror -Wno-error=tautological-pointer-compare -D__NetBSD__ -U__FreeBSD__ --sysroot=/usr/home/viktor/src/rumpctrl/rumptools/dest -I/usr/home/viktor/src/rumpctrl/src-netbsd/sbin/fsck -c /usr/home/viktor/src/rumpctrl/src-netbsd/sbin/fsck_ext2fs/dir.c
error: unknown warning option '-Werror=tautological-pointer-compare'; did you
mean '-Werror=tautological-compare'? [-Werror,-Wunknown-warning-option]
*** Failed target: dir.o
*** Failed command: /usr/home/viktor/src/rumpctrl/rumptools/bin/x86_64--netbsd-clang -O2 -g -fPIC -std=gnu99 -D__NetBSD__ -std=gnu99 -Werror -Wno-error=tautological-pointer-compare -D__NetBSD__ -U__FreeBSD__ --sysroot=/usr/home/viktor/src/rumpctrl/rumptools/dest -I/usr/home/viktor/src/rumpctrl/src-netbsd/sbin/fsck -c /usr/home/viktor/src/rumpctrl/src-netbsd/sbin/fsck_ext2fs/dir.c
*** Error code 1
Stop.
nbmake[1]: stopped in /usr/home/viktor/src/rumpctrl/src-netbsd/sbin/fsck_ext2fs
Makefile:133: recipe for target 'rumpobj/sbin/fsck_ext2fs/fsck_ext2fs.ro' failed
gmake: *** [rumpobj/sbin/fsck_ext2fs/fsck_ext2fs.ro] Error 1
Following the compiler's advice and changing the tautological-pointer-compare
option to tautological-compare
in the src-netbsd/sbin/fsck_ext2fs/Makefile
line:
CWARNFLAGS.clang+= -Wno-error=tautological-pointer-compare
fixes the issue and the build completes successfully.
./buildnb.sh
[...]
# install /home/yarwelp/rumpctrl/rumptools/dest/usr/lib/pkgconfig/libssl.pc
/home/yarwelp/rumpctrl/rumptools/bin/x86_64--netbsd-install -U -c -p -r -o root -g wheel -m 444 libssl.pc /home/yarwelp/rumpctrl/rumptools/dest/usr/lib/pkgconfig/libssl.pc
make: "/home/yarwelp/rumpctrl/Makefile" line 67: Missing dependency operator
make: "/home/yarwelp/rumpctrl/Makefile" line 71: Need an operator
make: "/home/yarwelp/rumpctrl/Makefile" line 118: Need an operator
make: "/home/yarwelp/rumpctrl/Makefile" line 132: Need an operator
make: "/home/yarwelp/rumpctrl/Makefile" line 133: Need an operator
make: Fatal errors encountered -- cannot continue
make: stopped in /home/yarwelp/rumpctrl
Some issues resolved in recent days, some more problems still.
./buildnb.sh
[...]
# install /usr/home/yarwelp/rc/rumptools/dest/usr/lib/pkgconfig/libssl.pc
/usr/home/yarwelp/rc/rumptools/bin/x86_64--netbsd-install -U -c -p -r -o root -g wheel -m 444 libssl.pc /usr/home/yarwelp/rc/rumptools/dest/usr/lib/pkgconfig/libssl.pc
make: "/usr/home/yarwelp/rc/Makefile" line 67: Missing dependency operator
make: "/usr/home/yarwelp/rc/Makefile" line 71: Need an operator
make: "/usr/home/yarwelp/rc/Makefile" line 118: Need an operator
make: "/usr/home/yarwelp/rc/Makefile" line 132: Need an operator
make: "/usr/home/yarwelp/rc/Makefile" line 133: Need an operator
make: Fatal errors encountered -- cannot continue
make: stopped in /usr/home/yarwelp/rc
Tried to compile ifconfig as a better test but there are some missing symbols - we are only linking libc.
needs -lutil -lprop
To fix this I think we ned to rename all symbols in the NetBSD libs, using objcopy to prefix them (except the ones we externally link).
If we did this we could in theory make dynamic netbsd libc etc and link these to application as there would be no namespace conflicts.
We are using the same errno for host and netbsd, which means that it seems to get cleared rather more often than is helpful. We should probably create a new errno for the netbsd stack instead of sharing it.
Hey,
I tried to increase the number of available File Descriptors in Rumprun with sysctl without
success. It seems that I have to use ulimit
for increasing them. Is this tool useable in Rumprun / can be pulled from the NetBSD source?
The libc patches only fix some issues on x86 architecture, and trivially need fixing for other architectures. However there are other issues.
Ideally want to get the size of the patches smaller. There should not really be any patches out side libc (some removed), and the libc ones need to be turned into a form that can be upstreamed.
Hi,
Rumpctl fails to build on Debian Stretch:
rumpctrl$ ./buildnb.sh
[CUT]
./rump/bin/rump-cc -O2 -g -Wall -o bin/cat rumpobj/bin/cat/cat.ro
/usr/bin/ld: -r and -pie may not be used together
collect2: error: ld returned 1 exit status
Makefile:133: recipe for target 'bin/cat' failed
gcc version 6.2.1 20161124 (Debian 6.2.1-5)
GNU ld (GNU Binutils for Debian) 2.27.51.20161201
We could do with a libpthread so you can run threaded programs.
@anttikantee said "I think you need a wrapper for pthread_create(), something like getpid + newlwp and something on the exit side too."
If we renamed public symbols in the netbsd libs eg to __rumprun__name then we could load (host) shared libraries of NetBSD symbols, which we could construct from (pic) .a files.
We would have to rename all U symbols in the user code that are not rump syscalls or emul calls to this prefix.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.