des [Sun, 11 Oct 1998 22:44:32 +0000 (22:44 +0000)]
Add comments about Luigi's audio drivers. Luigi said he had a better
patch he'd commit if he could find it, but he hasn't done so so I'll
assume he didn't find it :)
alex [Sun, 11 Oct 1998 21:08:02 +0000 (21:08 +0000)]
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().
jdp [Sun, 11 Oct 1998 19:40:38 +0000 (19:40 +0000)]
Fix the MS-CHAP support. The code was passing a bit count to
MD4Update(), but our version in libmd expects a byte count.
This code is not currently compiled or linked into pppd, so I'm
reasonably sure I didn't break anything. :-) I added the necessary
statements to the Makefile, but left them commented out because we
are in feature freeze. When the code is enabled, we must be careful
to build it only if the DES library is available.
jdp [Sun, 11 Oct 1998 19:22:07 +0000 (19:22 +0000)]
If an ELF executable has a recognized brand, then believe it.
Formerly, the heuristic involving the interpreter path took
precedence.
Also, print a better error message if the brand is missing or not
recognized. If there is no brand at all, give the user a hint that
"brandelf" needs to be run.
markm [Sun, 11 Oct 1998 18:13:42 +0000 (18:13 +0000)]
Very substantial debug/improvement of the FreeBSD/Perl5 build.
o make install ; make install now works
o make all ; make all is quiet the second time
o Dependancies are properliy debugged; this means that make -jN has a
far hihjer likelyhood of working.
o a proper 'link farm' has been constructed for the build. This
dramatically simplifies the dependancy tangle.
o for perldoc's use, all the .pod files are installed.
o the man3 docs are properly compressed.
o the man pages and libary code are installed by the makefiles, not
by a perl script.
o at the end, h2ph is run.
bde [Sun, 11 Oct 1998 16:33:02 +0000 (16:33 +0000)]
Fixed removing of obsolete shared libraries:
- the directory was wrong if ${SHLIBDIR} != ${LIBDIR}. It's still wrong
if the installation of the obsolete library was done before /aout was
appended to LIBDIR.
- the version would have become wrong when the default in ../Makefile.inc
is changed from 2.0.
- the comment mostly described moving of libraries to /usr/lib/compat, but
we don't do that.
peter [Sun, 11 Oct 1998 10:19:11 +0000 (10:19 +0000)]
Probe all consoles, not just the first. It doesn't make a lot of
difference, but might later on when we implement some sort of multi-head
console mode. Select a console after probing them all.
Don't strdup a potentially NULL return from getenv().
If we don't select an active console, choose the first regardless.
Call the console init function, at startup time and on a manual change.
The env_setenv() function needs EV_VOLATILE because it's pointing to
data that isn't malloc'ed and will cause a fault if it's freed later.
peter [Sun, 11 Oct 1998 10:07:52 +0000 (10:07 +0000)]
Only call vidc_init() once (unless forced).
Cosmetic change to the init-time character eater (like, make it increment
the index counter - if there's a problem, it would sit there in an infinite
loop instead of only running 10 times).
peter [Sun, 11 Oct 1998 10:05:13 +0000 (10:05 +0000)]
Fix comconsole mode. The int 0x14 read and status commands were reversed.
Also, make sure we set %dx each time around otherwise the commands
suddenly start trying to work on things like com92 instead of com1.
Make sure comc_init() is only run once.
Cosmetic change to init-time character eater.
peter [Sun, 11 Oct 1998 07:41:31 +0000 (07:41 +0000)]
Comment about libm and libmd being needed for some libraries.
Prompted by: bde
Also. Don't build & install legacy lkm's when NOLKM has been set.
Otherwise it gets built in the src tree rather than obj, because the
previous 'make obj' at the start of legacy-build does respect NOLKM.
dg [Sun, 11 Oct 1998 06:28:54 +0000 (06:28 +0000)]
Clear out transmit descriptor memory in fxp_attach when it's malloced.
fxp_stop is called as the first thing in fxp_init, and if the tx desc
list has junk in it, the system may panic. This bug showed up as a side
effect of the changes in rev 1.56, but has been in the code since the
beginning.
peter [Sun, 11 Oct 1998 04:56:03 +0000 (04:56 +0000)]
libg++ and libstdc++ also have internal calls to libm. Programs using the
shared versions should not need to add -lm unless the program uses libm
itself. Strictly speaking, libg++ depends on libstdc++, but libstdc++
has dynamic dependencies on some exception tables and binutils doesn't
seem to like it when a secondary library has undefined references. It
doesn't seem to care when -lstdc++ is added on the command line to ld
though. Anyway, the c++ driver adds -lstdc++ explicitly, so that should
be OK. c++ also adds -lm explicitly too, even though it wouldn't need
to now. [except for statically linked binaries as .a files don't have an
equivalent of automatic internal shared object dependencies.]
jdp [Sun, 11 Oct 1998 04:54:16 +0000 (04:54 +0000)]
Fix a couple of out-of-bounds array references in mapping between
Linux and FreeBSD signal numbers. Also, check signal numbers passed
in from application programs for validity. Without these checks,
it is trivial to panic the system from a Linux program.
peter [Sun, 11 Oct 1998 04:39:56 +0000 (04:39 +0000)]
Deal with /usr/lib/compat/aout, and that we've been installing things
in the wrong places for a while.
Also, the the libtermlib.so -> libtermcap.so manually for elf, otherwise
the hard link follows the symlink and the result looks rather wierd. The
*.a files are still hard linked under elf as before.
peter [Sun, 11 Oct 1998 04:21:56 +0000 (04:21 +0000)]
Don't build elf libresolv.so*, no elf freebsd binaries have used it ever.
Also, the a.out compat version is supposed to go into /usr/lib/compat/aout.
Try and clean up the mess left behind in /usr/lib/compat.
peter [Sun, 11 Oct 1998 04:18:30 +0000 (04:18 +0000)]
Don't install an elf libgnumalloc.so* in /usr/lib/compat.. No elf binaries
have been linked against it. Try and clean up the leftovers. Also, put
the a.out libs in /usr/lib/compat/aout since that's where the default
a.out ldconfig compat path points to.
gibbs [Sat, 10 Oct 1998 21:10:36 +0000 (21:10 +0000)]
If the bus delay is >= 2 seconds, notify the user that we are waiting
for devices to settle. This will hopefully allay any 'first installation'
fears that the machine has hung.
bde [Sat, 10 Oct 1998 19:30:45 +0000 (19:30 +0000)]
vfork -> fork. The child calls execl() which calls malloc(), so
vfork() can't be used. We could use alloca() in execl() so that
it can be called between vfork() and execve(), but a "portable"
popen() shouldn't depend on this. Calling execle() instead of
execl() should be fairly safe, since execle() is supposed to be
callable from signal handlers and signal handlers can't call
malloc(). However, execle() is broken.
bde [Sat, 10 Oct 1998 19:18:30 +0000 (19:18 +0000)]
vfork -> fork. This home made popen() had the same bug as the library
popen(), but worse. The child calls execvp(), which calls malloc()
a bit more than execl(), and it calls non-library functions that call
malloc() and who-knows-what else (stdio is called in at least some
error cases).
bde [Sat, 10 Oct 1998 14:02:07 +0000 (14:02 +0000)]
Fixed warnings for pointer versus int type mismatches. Addresses must
be converted to fixed-sized integers when they are passed across the
binary interface to the kernel.
bde [Sat, 10 Oct 1998 13:51:24 +0000 (13:51 +0000)]
Fixed warnings for pointer versus int type mismatches. Addresses must
be converted to fixed-sized integers when they are passed across the
binary interface to the kernel.
Didn't fix rotted bits (including not passing dosdev to the kernel and
serious out of dateness when initially committed).
eivind [Sat, 10 Oct 1998 13:31:32 +0000 (13:31 +0000)]
Remove the description of EBADF (that's an implementation detail if I
ever saw one), and move the description of NULL behaviour out to a
'NOTES' section, with an extra note that programs should not rely up
on it.
Kinda-approve-by: bde (by not replying to the mail with the diff)
bde [Sat, 10 Oct 1998 12:48:48 +0000 (12:48 +0000)]
Don't build or install ${MAN1}. It's just a copy of ${MAN1aout} and
installing it clobbers the elf ${MAN1}. The MAN1 -> MAN1aout changes
actually work now.
peter [Sat, 10 Oct 1998 02:44:53 +0000 (02:44 +0000)]
Attempt to work around the page fault in tulip_txput(). I've been running
this myself for ages, but wasn't able to get any feedback from the people
that I sent it to for testing.
Guy Helmer <ghelmer@scl.ameslab.gov> has given it a shot (before getting on
a plane, thanks!) and it appears to stop his reproducable page fault panic
in the testing he was able to do.
imp [Sat, 10 Oct 1998 00:44:12 +0000 (00:44 +0000)]
Fix conficts in probe:
o For bt and aha only probe the one I/O range if a specific I/O is specified
in the config file.
o Don't even try to probe I/O ranges that have been seen already.
o If we conflict with an IRQ or DRQ, then fail the probe.
peter [Sat, 10 Oct 1998 00:07:53 +0000 (00:07 +0000)]
Use Mike Smith's linker module search path code.
Implement preloading in a fairly MI way, assuming the information is
prepared.
DDB interface helpers.. Provide some support for db_kld.c so that we
don't have to export too much detail.
Debugging and cosmetic nits left in from development..
The other half of the containing file hack so modules can associate
themselves with their "file".
peter [Sat, 10 Oct 1998 00:03:07 +0000 (00:03 +0000)]
Keep track of the containing file for modules. This is a bit of a hack,
but I can't think of another (relatively) easy way of getting the info
since the boot-time initialization is not done immediately after "loading".
XXX module_register() gained an extra arg. This might break the alpha
compile, if so, just add a zero to get the old behavior.
peter [Fri, 9 Oct 1998 23:59:01 +0000 (23:59 +0000)]
Updates for alignment rounding. XXX this is highly machine dependent and
should probably be moved to i386/i386/link_machdep.c (and the same for the
alpha).
Implement "deleting" a preloaded module by destroying it's tags. This is a
hack. We cannot reuse the data, it's been destroyed by relocation,
statically initialized variables have been modified, etc. Note that to
reclaim the load space is going to be more machine-dependent work.
Implement a relocate hook for machdep.c to call so that the physical
addresses get converted to the equivalent KVM addresses.
peter [Fri, 9 Oct 1998 23:55:31 +0000 (23:55 +0000)]
Fully implement KLD and preloading.
- seperate unload for preloaded linker objects.
- Don't build a kernel object if running as an a.out kernel.
- extract the real kernel name rather than hardwiring "kernel" for kldstat.
(sysctl kern.bootfile getst the full name via bootinfo)
- use real addresses on the kernel "module" rather than fictitious ones.
- preloaded module support
- search module path for file modules.
- symbols are checked to see if they are in the right containing file
before using their indexes into string tables. This is to help ddb
since it only supplies a pointer to an opaque symbol and there is no
telling which file/object/module/whatever it came from.
peter [Fri, 9 Oct 1998 23:49:28 +0000 (23:49 +0000)]
Updates for KLD backends.
- symbol_values checks that the symbol is indeed belonging to the
correct symbol and string table pairs before looking up. (since there
could be many pairs, and KLD/DDB need to find out).
- different ops for files versus preload modules - the unload mechanism
is different. (a preloaded module has to be deleted on unload since
the in-core image is tainted by relocation and variables used)
- Do not build an a.out kernel module if we're running on an elf
kernel. :-) Note that it should theoretically be possible to
mix a.out and elf KLD modules providing -mno-underscores was used
to compile it, or some other symbol conversion takes place.
- Support preload modules (even though /boot/loader doesn't yet)
- Search the module path when loading files.
peter [Fri, 9 Oct 1998 23:42:47 +0000 (23:42 +0000)]
Implement merging SYSINIT's from preloaded KLD modules. This means we
check off SYSINIT entries as they are run, and when more arrive, we re-sort
and restart (skipping the already-run entries).
This can *only* be done after KMEM (and malloc) is up and running - this is
fine because KLD is the only consumer of this and it's done after that.
The nice thing about this is that the SYSINIT's within preloaded KLD modules
are executed in their natural order. It should be possible to register
devices for the probes which follow, etc. (soon.. several key things
prevent this, such as use of linker sets for things like pci devices).
peter [Fri, 9 Oct 1998 23:36:26 +0000 (23:36 +0000)]
Relocate the preload module info from machdep specifically rather than
trying to do it in locore. We also walk through the module table
and relocate any MODINFO_ADDR pointers so that they become KVM relative
rather than physical addresses. This means that hacks for adding
0xf0000000 in places like MFS go away.
peter [Fri, 9 Oct 1998 23:34:09 +0000 (23:34 +0000)]
Call some helper routines to be supplied by kern_linker.c in order to
get to all the symbol tables for all modules, not just the core kernel
symbol table. Yes, DDB can see KLD module symbols with this, both by
lookup and in tracebacks. No more references to _end from tracebacks
within an LKM. :-)
peter [Fri, 9 Oct 1998 23:32:03 +0000 (23:32 +0000)]
At the moment, the alpha tentatively uses the ddb elf code rather than KLD,
because the alpha boot loader hasn't been converted yet, and because
it needs the full symbol tables with local symbols in order to make sense
of stack tracebacks. KLD will implement this (using full sybmol table
rather than the globals only) shortly.
rnordier [Fri, 9 Oct 1998 23:30:16 +0000 (23:30 +0000)]
Turn off the new /sys/boot stuff (except boot0) unless OBJFORMAT
is elf. (The BTX client must be ELF, though it is packaged as a.out
for compatibility.)
peter [Fri, 9 Oct 1998 23:29:44 +0000 (23:29 +0000)]
We don't compile this on an elf kernel (and explicitly not on alpha in
case it's possible to compile in something like ECOFF)
The three db_xxx.c symbol interfaces are "standard" because config isn't
flexible enough without forcing the user to know about it.
peter [Fri, 9 Oct 1998 23:24:55 +0000 (23:24 +0000)]
Attempt to at least align MODINFO_* blocks. IMHO, decoding this stuff
should be MD code since one day we'll have to recover pages from deleted
preload data. MI code can't be expected to know how to deal with pmap
internals, assuming it gets done via pmap that is. :-)
peter [Fri, 9 Oct 1998 23:22:30 +0000 (23:22 +0000)]
Turn symbol table info passing back on, although it's probably not
particularly useful in this form. KLD can deal with it much better.
setenv kernelname moved earlier.
peter [Fri, 9 Oct 1998 23:18:43 +0000 (23:18 +0000)]
Implement preloading for elf modules
- get dependency info from PT_DYNAMIC's DT_NEEDED tags.
- store MODINFOMD_DYNAMIC for the kernel's later use
setenv kernelname when we have it
Fix firstaddr/lastaddr calculation (duh! :-)
Explicitly skip string table with section names in it.
peter [Fri, 9 Oct 1998 23:15:39 +0000 (23:15 +0000)]
Preload support for a.out KLD not implemented yet. (almost)
KLD modules are *not* PIC. (Shared libs are pic to avoid relocations
causing copy-on-write, that's irrelevant here).
setenv kernelname when we load it.
Use MODINFO_SSYM/ESYM for each symbol section when (if) there are
more than one being loaded.
peter [Fri, 9 Oct 1998 23:11:05 +0000 (23:11 +0000)]
loader <-> kernel preload module interface constants moved to common file.
Remove Mike's explicit data structures for dependency info. This is
done via DT_NEEDED etc in the dynamic section for now. This may need
to be revisited later on.