Dynamic linking is supported on OSF/1, however with some warnings.
/spin/bin/loader.
You can change the loader path by setting the SPIN shell variable
LOADER_PATH.
script ~/spin/user/scripts/mount.rc)
The PC version does not support dynlinking.
Lots of system calls are missing. You won't be able to
run some applications. If you are in doubt, use the
system call tracer(syscall trace)
to find out what system calls your app is using.
You have to use FreeBSD statically linked binaries.
At UW, /spin/bin/bsd-newcc on Linux box(es) is the
cross compiler that produces FreeBSD binary. It is actually gcc, so
you have to pass
-staticoption when linking.
When installing GNU softwares, do
% setenv LDFLAGS -static
before running configure.
sphinx shell command.
Note: exec shell command does not work any more.
!>sphinx exec ~/spin/user/sphinx/progs/helloWhen running a dynamically linked binary, you first have to load NFS.
!> nanny touch Sphinx !> script ~/spin/user/script/mount.rc !> sphinx exec /usr/local/bin/wish -f your-scriptYou can also pass arguments to the child proc.
!>sphinx exec /spin/yasushi/sphinx/progs/hello hi thereIn the above example,
hi and there are passed to
the user program. In the user program, you can access them using
familiar argc, argv protocol.
Shell variables are passed to the child proc as environment variables.
The sphinx shell command supports several subcommands.
sphinx install
sphinx uninstall
sphinx ps
sphinx kill pid signo
sphinx trace
sphinx untrace
sphinx exec PATH ARGS...
sphinx texec PATH ARGS...
sphinx pexec PATH ARGS...
^C is delivered only when the process is
executing the system call. SIGIO is not supported.
I think the real reason of these problems is that the current terminal
driver interface is synchronous; i.e., it is read/write, not
put/get(like in System V stream). We have to switch to asynchronous
one soon.
/dev/kmem
sysctl(2).
It is a system call to access kernel resources in a manner similar to
SNMP. It will be relatively easy to support sysctl.
^C is typed, X should be dequeued and made runnable. The way UNIX implements this is that the signal delivery code looks into the current thread state, and if it's in interruptible wait state, the delivery code just dequeues the thread from whatever queue it is waiting on.
I found it's difficult to do this from M3 world. To make tty signal work, I added a terrible hack in tty.c. First, I added a field last_signal to struct tty. It is char. When a key that raises signal is pressed, it sets last_signal to be the signal number, and wakes up a thread. When waking up a thread for other reasons(ex, newline pressed), it sets last_signal to be -1. When thread wakes up, it checks last_signal and if it's not -1, it returns EINTR.
This is not a right solution, because last_signal is a global variable, so there is a race condition(However it would work in most cases because console access is arbitrated using some higher level protocol and there usually is only one thread waiting on struct tty). Another problem of this "solution" is that it's not generic. It works for tty, but it won't work for threads waiting on select, etc.