tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

amd64 kernel, i386 userland



Hi

In order to have more RAM without reinstalling everything, using
an amd64 kernel on to of a i386 userland seems appealing. netbsd32
emulation works fine, and the machine boots to multiuser without 
a hassle.

But there are minor problems, with binaries that use ioctl to talk
with a kernel subsystem: I spoted ipf and raidctl.

A quick and dirty way to work the problem around is to use the amd64 
binaries for ipf and raidctl. But that cannot work with the rest of
the system not yet migrated to amd64: amd64 binaries will get the i386
dyanmic loader /lib/ld.elf_so and they will not run.

Things would be much easier if the kernel searched /emul/netbsd64 
before / for native binaries. Of course such a behavior cannot be made 
default because of the performance penalty. But a compile time option
would be nice without causing any performance harm to people that do
not want it.

I propose the patch below. It could be improved even further by having
a sysctl for that, but just a build option would be useful without
being too intrusive. Opinions?

--- sys/kern/kern_exec.c.orig   2014-01-21 16:55:00.000000000 +0100
+++ sys/kern/kern_exec.c        2014-01-21 16:55:13.000000000 +0100
@@ -184,9 +184,13 @@
 
 /* NetBSD emul struct */
 struct emul emul_netbsd = {
        .e_name =               "netbsd",
+#ifdef COMPAT_NATIVE
+       .e_path =               COMPAT_NATIVE,
+#else
        .e_path =               NULL,
+#endif
 #ifndef __HAVE_MINIMAL_EMUL
        .e_flags =              EMUL_HAS_SYS___syscall,
        .e_errno =              NULL,
        .e_nosys =              SYS_syscall,


-- 
Emmanuel Dreyfus
manu%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index