The last post about the Linuxulator where I explained the Linuxulator from an user point of view got some good amount of attention. Triggered by a recent explanation of the Linuxulator errno stuff to a fellow FreeBSD developer I decided so see if more developers are interested in some more info too…
The syscall vector
In sys/linux/linux_sysvec.c is all the basic setup to handle Linux “system stuff” in FreeBSD. The “system stuff” is about translating FreeBSD errnos to Linux errnos, about translating FreeBSD signals to Linux signales, about handling Linux traps, and about setting up the FreeBSD system vector (the kernel structure which contains all the data to identify when a Linux program is called and to be able to lookup the right kernel functions for e.g. syscalls and ioctls).
There is not only one syscall vector, there is one for a.out (struct sysentvec linux_sysvec) and one for ELF (struct sysentvec elf_linux_sysvec) binaries (at least on i386, for other architectures it may not make sense to have the a.out stuff, as they maybe never seen any a.out Linux binary).
The ELF AUX args
When an ELF image is executed, the Linuxulator adds some runtime information (like pagesize, uid, guid, …) so that the userland can query this information which is not static at build-time easily. This is handled in the elf_linux_fixup function(). If you see some error messages about missing ELF notes from e.g. glibc, this is the place to add this information to. It would not be bad from time to time to have a look what Linux is providing and missing pieces there. FreeBSD does not has an automated way of doing this, and I am not aware of someone who regularly checks this. There is a little bit more info about ELF notes available in a message to one of the FreeBSD mailing lists, it also has an example how to read out this data.
Traps
Linux and FreeBSD do not share the same point of view how a trap shall be handled (SIGBUS or SIGSEGV), the corresponding decision making is handled in translate_traps() and a translation table is available as _bsd_to_linux_trapcode.
Signals
The values for the signal names are not the same in FreeBSD and Linux. The translation tables are called linux_to_bsd_signal and bsd_to_linux_signal. The translation is a feature of the syscall vector (= automatic).
Errnos
The values for the errno names are not the same in FreeBSD and Linux. The translation table is called bsd_to_linux_errno. Returning an errno in one of the Linux syscalls will trigger an automatic translation from the FreeBSD errno value to the Linux errno value. This means that FreeBSD errnos have to be returned (e.g. FreeBSD ENOSYS=78) and the Linux program will receive the Linux value (e.g. Linux ENOSYS=38, and as the Linux kernel returns negative errnos, the linux program will get –38).
If you see somewhere an “-ESOMETHING” in the Linuxulator code, this is either a bug, or some clever/tricky/dangerous use of the sign-bit to encode some info (e.g. in the futex code there is a function which returns –ENOSYS, but the sign-bit is used as an error indicator and the calling code is responsible to translate negative errnos into positive ones).
Syscalls
The Linux syscalls are defined similar to the FreeBSD ones. There is a mapping table (sys/linux/syscalls.master) between syscall numbers and the corresponding functions. This table is used to generate code (“make sysent” in sys//linux/) which does what is necessary.
GD Star Rating
loading…
GD Star Rating
loading…
Tags: architectures,
elf image,
freebsd mailing,
freebsd system,
kernel functions,
kernel structure,
linux linux,
linux program,
missing pieces,
userland —
There are some HOWTOs out there in the net which describe some automatic network based install via PXE-booting a machine from a server which has a specific FreeBSD release in the PXE-booting area and a non-interactive config for sysinstall to install this FreeBSD version on the machine which PXE-boots this.
The setup of this is completely manual and only allows to netboot one FreeBSD version. The server-side setup for the clients is also completely manual (and only allows to install one client at a time, it seems). This is not very user-friendly, and far away from the power of Jumpstart/JET for Solaris where you create a template (maybe from another template with automatic value (IP, name, MAC) replacement) and can specify different OS releases for different clients and then just run a command to generate a good config for this.
I thought a little bit how it could be done and decided to write down all the stuff (so far 160 lines, 830 words) to not forget some details. All in all I think this could be done (at least a sensible subset) in a week or two (fulltime) if you have the hardware, motivation, and time. As always, the problems are within the details, so I may be off with my estimation a little bit (also depends upon the knowledge-level (shell, tftp, dhcpd, install–software) of the person doing this).
Unfortunately I do not know if I have the hardware at home to do something like this. I have some unused harddisks which could be used in a machine which is used temporary as a test-install-client (normally I use this machines as my Desktop… if I do not use my little Netbook instead, as I do not do much at home currently), but I’ve never checked if this machine is PXE-booting-capable (VIA KT133 chipset with a 3Com 3c905C–TX Fast Etherlink XL). I also do not have the time to do this (with the current rate of free time I would expect to need about a year), except maybe someone would call my boss and negotiate something.
I can not remember any request to have something like this on the freebsd-current, freebsd-arch or freebsd-hackers list since I read them (and that is since about at least 3.0-RELEASE). Is this because nearly nobody is interested in something like this, or are the current possibilities enough for your needs? Do you work at a place where this would be welcome (= directly used when it would be done)? If you use a simple solution to make a net-install, what is your experience with this (pros/cons)?
GD Star Rating
loading…
GD Star Rating
loading…
Tags: 3c905c tx,
3com 3c905c,
freebsd release,
freebsd version,
harddisks,
howtos,
knowledge level,
netbook,
os releases,
pxe —
I updated some workstations of the client to Solaris 10 update 9. Upon installing my xorg.conf (dual-screen setup) I had to notice that it does not work anymore. The problem is, that the NVidia driver does not contain support for the graphic card we use.
Normally this is not a big deal, this can happen… but in this case this is about SUN Ultra 20 workstations with SUN provided NVidia Quattro FX (NV37GL) cards. Ok, they are not the most recent ones, they where bought 4 – 5 years ago, but still, they just work as needed here and the current Solaris release has no out-of-the-box support for them. I would expect this to work already in a fresh install (yes, I was not able to get the nv driver to work with two screens on this graphic card, it seems the nv driver has not support for this).
Solution for me: download the old driver from NVidia and integrate it into Jumpstart (but still, some hours are lost because of first trying to get a working dual-screen setup with the nv driver before taking an old NVidia driver and using it like before in xorg.conf).
Another glitch a co-worker discovered is that StarOffice is not included anymore. That is again something which will cause some loss of time. I will have to have a look how to handle it. Probably it is best to install it on the server and mount it via NFS on the workstations. I will see soon if this is can be done (installation of OO into a specific place which can be shared) or not.
GD Star Rating
loading…
GD Star Rating
loading…
Tags: dual screen,
graphic card,
jumpstart,
nice things,
nvidia driver,
solaris 10,
specific place,
staroffice,
two screens,
xorg —
I was building BerkeleyDB (4.7, yes I know, there are more recent versions available) on a Solaris machine. First try was to unpack, cd into the directory, run configure. It failed, there is no configure script. Bah.
Second try: searching for docs… found some… in HTML (the README refers to it and tells nothing else). This is a remote machine, I do not want to use a HTML browser remotely (I may not even have one installed there…). Bah.
Ok, dist/configure exists, no special options needed for my case, it seems.
There is even a Solaris specific HTML file, but from a quick glance at it with ‘less’, it looks like a FAQ.
Usability from a command line: zero.
Possibility to compile from a GUI (unix): I doubt it.
What is wrong with plain text files? If I download the source and want to compile it (and for Solaris this is the normal way of working), why the hell do I need some GUI instead of getting a plain text file with the required description (which is not graphically enhanced in the HTML version either)? You can even generate a plain text version of the docs automatically during the src-packaging process.
Hey Oracle, there is room for improvement here!
GD Star Rating
loading…
GD Star Rating
loading…
Tags: docs,
glance,
hell,
html browser,
line zero,
oracle,
readme,
solaris machine,
unix,
usability —
After moving our secondary management site (our team is split up into 2 different locations) to a new building, we decided to clean-up some things. One of those things involves moving the LDAP to a different machine (more or less a new server for the new site, it is independent regarding LDAP/homes/… from the primary site). While I am at it, I take the opportunity to move from DSEE5 to DSEE7 (my previous post about the DSEE6 migration was at the primary site). This time I took the package distribution instead of the zip distribution (the main reason is that I can get patch-listings with an automatic tool, and the secondary management site has no disaster-recovery requirements for the applications… we just will setup a new secondary site somewhere else if necessary).
Here my experiences with the installation instructions of DSEE7.
- The install instructions refer to the web interface for the DSEE7 management, but I have not seen something which tells you first have to setup an application server (this was better in the DSEE6 instructions).
- When using the Glassfish application server which comes with Solaris 10 for the web interface, you will get an exception after deploying the dscc7.war, as it is using an outdated JVM. After some fighting and Googling, I found that I have to change the AS_JAVA value in /usr/appserver/config/asenv.conf to a more recent JVM as it is pointing to the very outdated j2se 1.4.x. I pointed it to /usr/java (which is a symlink to the most recent version installed as a package). Instead of the original exception I got another one now (after a redirection in the web-browser), something that it can not find the AntMain class (Glassfish uses ANT from /usr/sfw, this is the one which comes with Solaris 10 update 9). I tried with Java 5 instead of Java 6, but I get the same error. In the net there are some discussions about such errors (it is even a FAQ at the ANT site), but this Glassfish/DSEE7 thing is a black box for me, so what am I supposed to do here (I do not want to put the system into an unofficial state by installing my own ANT for Glassfish/DSEE7)?
It was not mentioned in the Appendix of the DSEE7 install instructions which explains how to install the .war in Glassfish that you have to change to a more recent JVM, and I still fight with the AntMain problem (hey Oracle, there is room for improvement in the product compatibility testing and documentation verification process).
I will update this posting when I make some advancements. For now I let the web interface in the bad state as it is and concentrate on finishing the LDAP move to the new system (installing an DSEE on a backup system, configuring replication, switching the clients to them). The web interface is independent enough to handle it later (hints welcome, that is the main purpose why I write this posing in the middle of the work).
GD Star Rating
loading…
GD Star Rating
loading…
Tags: appserver,
automatic tool,
directory server,
jvm,
oracle directory,
package distribution,
sfw,
solaris 10,
web interface,
zip distribution —