Commit Graph

70 Commits

Author SHA1 Message Date
Marcel Moolenaar
5002a60f9b Round of cleanups and enhancements. These include (in random order):
o  Introduce private types for use in linux syscalls for two reasons:
   1. establish type independence for ease in porting and,
   2. provide a visual queue as to which syscalls have proper
      prototypes to further cleanup the i386/alpha split.
   Linuxulator types are prefixed by 'l_'. void and char have not
   been "virtualized".

o  Provide dummy functions for all syscalls and remove dummy functions
   or implementations of truely obsolete syscalls.

o  Sanitize the shm*, sem* and msg* syscalls.

o  Make a first attempt to implement the linux_sysctl syscall. At this
   time it only returns one MIB (KERN_VERSION), but most importantly,
   it tells us when we need to add additional sysctls :-)

o  Bump the kenel version up to 2.4.2 (this is not the same as the
   KERN_VERSION MIB, BTW).

o  Implement new syscalls, of which most are specific to i386. Our
   syscall table is now up to date with Linux 2.4.2. Some highlights:
   -  Implement the 32-bit uid_t and gid_t bases syscalls.
   -  Implement a couple of 64-bit file size/offset bases syscalls.

o  Fix or improve numerous syscalls and prototypes.

o  Reduce style(9) violations while I'm here. Especially indentation
   inconsistencies within the same file are addressed. Re-indenting
   did not obfuscate actual changes to the extend that it could not
   be combined.

NOTE: I spend some time testing these changes and found that if there
      were regressions, they were not caused by these changes AFAICT.
      It was observed that installing a RH 7.1 runtime environment
      did make matters worse. Hangs and/or reboots have been observed
      with and without these changes, so when it failed to make life
      better in cases it doesn't look like it made it worse.
2001-09-08 19:07:04 +00:00
Andrew Gallatin
055d495677 Fix linux_getcwd() so that if the cwd isn't cached (__getcwd() fails),
the cwd is looked up inside the kernel. The native getcwd() in libc
handles this in userland if __getcwd() fails.

Obtained from: NetBSD via OpenBSD
Tested by: Chris Casey <chriss@phys.ksu.edu>, Markus Holmberg <markush@acc.umu.se>
Reviewed by: Darrell Anderson <anderson@cs.duke.edu>
PR: kern/24315
2001-08-29 19:05:27 +00:00
Peter Wemm
481d7a5891 Zap obsolete (died with LKM) EXPORT_SYMS variable 2001-02-04 10:52:25 +00:00
Peter Wemm
e4b36f7dd8 It is unlikely that we'll be supporting old-style ZMAGIC linux a.out
binaries on anything but i386.. (ia64, sparc64, etc)  Invert the .if
so that it is inclusive of i386 platforms rather than excluding just
the alpha.
2001-01-07 03:10:15 +00:00
David E. O'Brien
c68159a6d8 Use a consistent style and one much closer to the rest of /usr/src 2001-01-06 14:00:42 +00:00
Marcel Moolenaar
b4c6727a3a Don't auto-generate the syscalls. 2000-12-03 01:30:31 +00:00
Marcel Moolenaar
fa581ad823 Fix dependency for auto-generated files. This commit is
for archiving purposes only; auto-generation is going to
be reverted.

requested by: obrien
submitted: gallatin
2000-12-02 23:47:41 +00:00
Marcel Moolenaar
2bfb7720d6 Fix breakage for parallel builds. 2000-11-05 03:10:45 +00:00
Sheldon Hearn
59807abe47 Retire linux(8). Using shell scripts to load kernel loadable modules is
out of fashion.  This particular case, unlike joy(8) and friends which
are just plain silly, did more than just load a kernel loadable module.
However, /etc/rc and the linux_base port were adjusted a while back to
cope with the absence of this script.

The only outstanding reason to hang on to it would have been for the
linux(8) manual page, which clued folks into the existence of the
Linuxulator.  A new linux(4) was introduced a while back.  It does
a much better job.

This script just isn't useful any more.
2000-11-02 13:48:53 +00:00
Andrew Gallatin
f11610e091 Support for the linux ipc syscalls on the alpha, where each one has
its own syscall rather than going through a demux function like
linux_ipc() on i386
2000-11-01 23:17:31 +00:00
David E. O'Brien
73bf6c9152 Allow the building of the syscall bits at compile time. 2000-11-01 09:23:12 +00:00
David E. O'Brien
23b16c61fa Don't install manpages.
They are being moved elsewhere, and they are causing problems being here.
2000-10-08 16:56:04 +00:00
David E. O'Brien
229edd6df7 Only install secondary components if the destination directory exists.
This may be a WIP, but `make release' needs it sooner than later.
2000-10-04 07:20:24 +00:00
David E. O'Brien
3e0aa01059 Since AlphaLinux is the weirdest Linux of all, probably best to do the
logic this way.
2000-09-06 20:21:55 +00:00
David E. O'Brien
849baab858 Two sys/compat/linux sources aren't applicable on the Alpha at this time. 2000-09-06 20:21:15 +00:00
Marcel Moolenaar
0ec24f5a8a Connect the new sources in /sys/compat/linux and the new file
in /sys/i386/linux.
2000-08-22 06:02:01 +00:00
Bruce Evans
27d3393199 Use the genassym script here too. The linux and svr4 modules were broken. 2000-06-03 07:40:19 +00:00
Peter Wemm
64db83a8ab Use .include <bsd.kmod.mk> to get to ../../*/conf/kmod.mk instead of
encoding the relative path.
2000-05-27 01:14:33 +00:00
Peter Wemm
56ca39961b Pull in sys/conf/kmod.mk, rather than /usr/share/mk/bsd.kmod.mk.
This means that the kernel can be totally self contained now and is not
dependent on the last buildworld to update /usr/share/mk.  This might
also make it easier to build 5.x kernels on 4.0 boxes etc, assuming
gensetdefs and config(8) are updated.
2000-05-04 12:08:52 +00:00
Bruce Evans
27e2d53c58 Compile linux_genassym.c with ordinary ${CFLAGS}. The (small) need for
-U_KERNEL became negative when all all the genassym.c's were converted
to be cross-built.

Use "genassym ... > ${.TARGET}", not "genassym -o $@ ...", so that
genassym(1) doesn't need to support -o.

Removed duplicate -D_KERNEL from flags for compiling linux_locore.s.
2000-01-09 10:04:53 +00:00
Peter Wemm
c447342094 Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"
is an application space macro and the applications are supposed to be free
to use it as they please (but cannot).  This is consistant with the other
BSD's who made this change quite some time ago.  More commits to come.
1999-12-29 05:07:58 +00:00
Marcel Moolenaar
00d6d49adc Use genassym(1) and <sys/assym.h> to generate assembler symbols. 1999-12-23 19:59:47 +00:00
Martin Cracauer
e14140f43e Add a run of Linux ldconfig. 1999-12-13 08:38:22 +00:00
Bruce Evans
6f940b3847 Removed special rules for building and cleaning device interface files
and empty options files.  The rules are now generated automatically in
bsd.kmod.mk.  Cleaned up related things ($S and ${CLEANFILES}).
1999-11-28 18:53:47 +00:00
Marcel Moolenaar
a50db55884 Replace 'i386' with '${MACHINE_ARCH}' in preparation of the development
of a linuxulator for Alpha.
1999-11-12 20:04:59 +00:00
Marcel Moolenaar
48adcae922 Install linux.sh in /usr/sbin and not in /usr/bin.
PR: 13545
Submitted by: Jose M. Alcaide <jose@we.lc.ehu.es>
1999-09-03 07:15:38 +00:00
Marcel Moolenaar
9e8b10d186 Add MAINTAINER and remove the unused COMPAT_LINUX and VM_STACK defines. 1999-08-28 09:04:21 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Marcel Moolenaar
c6dfea0ebd Add sysctl variables for the Linuxulator. These reside under `compat.linux' as
discussed on current.

The following variables are defined (for now):

    osname (defaults to "Linux")
        Allow users to change the name of the OS as returned by uname(2),
        specially added for all those Linux Netscape users and statistics
        maniacs :-) We now have what we all wanted!

    osrelease (defaults to "2.2.5")
        Allow users to change the version of the OS as returned by uname(2).
        Since -current supports glibc2.1 now, change the default to 2.2.5
        (was 2.0.36).

    oss_version (defaults to 198144 [0x030600])
        This one will be used by the OSS_GETVERSION ioctl (PR 12917) which I
        can commit now that we have the MIB. The default version number is the
        lowest version possible with the current 'encoding'.

A note about imprisoned processes (see jail(2)):
  These variables are copy-on-write (as suggested by phk). This means that
  imprisoned processes will use the system wide value unless it is written/set
  by the process. From that moment on, a copy local to the prison will be
  used.

A note about the implementation:
  I choose to add a single pointer to struct prison, because I didn't like the
  idea of changing struct prison every time I come up with a new variable. As
  a side effect, the extra storage is only needed when a variable is set from
  within the prison. This also minimizes kernel bloat when the Linuxulator is
  not used; both compiled in or as a module.

Reviewed by: bde (first version only) and phk
1999-08-27 19:47:41 +00:00
Mike Pritchard
3eaf789e97 Sort xrefs.
Submitted by:	Alexey Zelkin <phantom@cris.net>
1999-08-19 00:10:37 +00:00
Nik Clayton
bf9c09f910 "Linux emulator" -> "Linux image activator"
PR:             docs/12882
Submitted by:   des
1999-08-04 18:58:37 +00:00
Guy Helmer
200c501e03 Reference kld(4).
Submitted by:	Nathan Ahlstrom <nrahlstr@winternet.com>
1999-04-23 16:12:44 +00:00
Nick Hibma
6eb1682c86 Update for the man page. 4.0 is using KLD's not LKM's. 1999-02-22 13:08:38 +00:00
Julian Elischer
b5def701c7 Compile the linux module with the same flags as the kernel.
(oops).

Submitted by:	"Richard Seaman, Jr." <dick@tar.com>
1999-01-26 21:29:01 +00:00
Jordan K. Hubbard
531842e143 Install scripts without .sh suffix. 1998-11-12 00:37:39 +00:00
Peter Wemm
0ddd3cf262 Rename joy,ibcs2,linux to joy.sh,ibcs2.sh,linux.sh (via repo copy). 1998-11-11 07:04:10 +00:00
Jordan K. Hubbard
aab22db753 We need to install the linux shell script or the lkm version will
still be in place.
1998-11-10 19:39:58 +00:00
Peter Wemm
ce6bd34722 Build linux_genassym static, this should help aout-to-elf builds 1998-11-05 04:39:26 +00:00
Peter Wemm
6a1a9040f4 Do not overwrite the lkm versions of the install scripts for now. linux
works but ibcs2 has a load failure and joy doesn't look like it'll work.
1998-11-05 04:22:52 +00:00
Peter Wemm
38266231ef Update to use kldload, no temporary files! 1998-11-05 04:19:26 +00:00
Peter Wemm
a654d07295 Sample initial set of kld-ified modules. Not all have been completely
converted yet.  These are more of a starting point.  This is NOT connected
to the parent Makefile.

OK'ed by jkh (who is ever so patiently waiting)
1998-10-16 04:30:52 +00:00
Alexander Langer
514058dc0d Unregister the glibc2 brand at module unload time.
Change the ELF registration/unregistration scheme to be less error prone.
Adding a new brand requires a single addition to linux_brandlist instead of
modifying linux_load(), linux_unload(), and linux_elf_init().

Approved by:	jkh
Reviewed by:	msmith
1998-10-11 21:08:02 +00:00
Mike Smith
4e138a28a0 Add support for glibc consumers using the new ld-linux.so.2 linker.
I can't say this was the most inspired fix, but it matches the design OK.
1998-09-17 22:08:34 +00:00
Martin Cracauer
62e334347c Load linux emulator lkm only when not already loaded. This avoids
leftover files in /tmp. Script slightly modified from PR version
to use fewer processes.
PR:		i386/7725
Submitted by:	Stefan Eggers seggers@semyam.dinoco.de
1998-09-07 16:15:59 +00:00
Bruce Evans
8c1a5985d2 Added a `build-tools' target for internal tools. (linux_genassym may
not actually work for cross compiling, but that is another problem.)

Honor LDFLAGS for building internal tools.  (Tools should normally
be built static to avoid problems with picking up target shared
libraries.  bsd.kmod doesn't set -static yet, and has some problems
with `LDFLAGS=-static ...' in the environment.)
1998-07-07 02:04:20 +00:00
Bruce Evans
7f591b7e4b Fixed missing options headers. Options that affect LKMs shouldn't
exist.
1998-07-01 17:10:00 +00:00
Bruce Evans
77d71f644a Fixed a race to build the @' and machine' symlinks early enough
for `make -jN'.
1998-03-19 12:35:55 +00:00
Eivind Eklund
ccf5ba7483 Back out opt_diagnostic.h changes. 1998-02-06 23:54:27 +00:00
Eivind Eklund
8e734a64e3 Make the LKMs handle DIAGNOSTIC as a new-style option. 1998-02-04 21:56:39 +00:00
Bruce Evans
77783a2701 Don't handle the `machine' symlink or related include paths here.
bsd.kmod.mk now handles it more generally.
1998-02-01 17:53:56 +00:00