Peter Wemm [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 Wemm [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 Wemm [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 Wemm [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 Wemm [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 Wemm [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 Wemm [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.
Robert Nordier [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 Wemm [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 Wemm [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 Wemm [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 Wemm [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 Wemm [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 Wemm [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.
Peter Wemm [Fri, 9 Oct 1998 23:07:27 +0000 (23:07 +0000)]
Debug typo fixes.
Change symbol_values return type to int, on the chance that we've
been given the wrong symbol table. Symbols have a string index that
must be relative to the correct string table.
Add prototypes for better kld support for ddb.
Justin T. Gibbs [Fri, 9 Oct 1998 21:40:50 +0000 (21:40 +0000)]
Only pull 16 bits of residual information from completing queues. This
is a work-around from an LRAM access bug on the 940UA. In a future
microcode revision, the high 16bits of residual information will be moved
to a safe location and we'll return to 32bit residuals. Since we only
allow 64KB I/O, 16bits is enough.
Kenjiro Cho [Fri, 9 Oct 1998 11:48:22 +0000 (11:48 +0000)]
fix a bug which could lock up a transmitter.
don't use the entire buffer space. if WRTX becomes equal
to RDTX, the transmitter stops assuming the buffer is empty.
Mike Smith [Fri, 9 Oct 1998 07:11:19 +0000 (07:11 +0000)]
Remove some debugging code.
Do a much better job of DWIM with partial device specifications.
Fix the module metadata build process, which was completely broken.
Use a larger read buffer when copying large objects in; this
improves performance marginally and will avoid flushning any small caches
we might choose to implement.
Mike Smith [Fri, 9 Oct 1998 07:09:22 +0000 (07:09 +0000)]
Sync the MODINFO constants with <sys/linker.h>
Remove debugging in command_read().
Correctly strip leading controls on script commands.
Make 'ls' more DWIM in regard to pathnames. We can still do better.
Bill Paul [Fri, 9 Oct 1998 03:59:24 +0000 (03:59 +0000)]
Add support for yet another "cyclone" board, with PCI device id 0x905A.
This is a 100BaseFX board with SC fiber media connectors. I don't actually
have one of these but I've been told it works with the xl driver.
John Polstra [Fri, 9 Oct 1998 01:43:08 +0000 (01:43 +0000)]
Don't try to print out the signal number that caused core to be
dumped. It is not in a fixed location in the file, so at best,
garbage comes out. I don't think this code was ever valid.
Satoshi Asami [Fri, 9 Oct 1998 01:27:21 +0000 (01:27 +0000)]
Add new variable NO_FILTER_SHLIBS -- it will disable ELF <-> a.out shlib
name conversion. Use it for binary ports that come with its own private
shlib dirs, ports that install linux compatibility libraries (thus following
their naming conventions and not ours), etc.
Reviewed by: Martin Cracauer <cracauer@FreeBSD.ORG>
John Polstra [Fri, 9 Oct 1998 00:24:49 +0000 (00:24 +0000)]
Fix a panic on SMP systems, caused by sleeping while holding a
simple-lock.
The reviewer raises the following caveat: "I believe these changes
open a non-critical race condition when adding memory to the pool
for the zone. I think what will happen is that you could have two
threads that are simultaneously adding additional memory when the
pool runs out. This appears to not be a problem, however, since
the re-aquisition of the lock will protect the list pointers."
The submitter agrees that the race is non-critical, and points out
that it already existed for the non-SMP case. He suggests that
perhaps a sleep lock (using the lock manager) should be used to
close that race. This might be worth revisiting after 3.0 is
released.
Use lstat() rather than stat in determining whether a file exists,
otherwise we'll miss the "symlink exists but points nowhere" case.
Submitted by: asami and/or possibly <ru@ucb.crimea.ua>
Allow the module area to be used in order to find the MFS image
(in addition to allowing it to be compiled in) and stop overloading
the MFS_ROOT variable to store size information.
remove stdio.h include; I forgot Bruce's cardinal rule that header files
shouldn't include other ones (which, unfortunately, is also a hellish
rule since he broke interfaces like sysctl this way by requiring undocumented
header files to be included just in order to be able to use them now - SIGH!).
Mike Smith [Thu, 8 Oct 1998 21:03:41 +0000 (21:03 +0000)]
Fix up the kernel environment and module data pointers in the bootinfo if
they are present.
If we are told where the end of the loaded kernel image is, believe it.
Make that annoying "device busy" message dependent on DEBUG (using the
DEB macro). There are probably quite a few other messages that warrant
a similar treatment, and many more that should be converted to plain
log messages (e.g. "WARNING: wrintr but write DMA inactive!"). Now
that I think of it, same goes for the CAM code (e.g. the famed "tagged
openings" message)
While I'm at it, remove the tickadj manpage from src/share/man0/man8,
though I'm afraid there's a lot more that needs fixing in this file,
judging by 'find /usr/src -name "*.8" -print'.
Remove all references to tickadj(8) from rc, rc.conf and rc.conf.5.
Disable building tickadj(8) by removing util from SUBDIR in the xntpd
Makefile. Note that the sources are still there and tickadj can still
be built and installed by doing:
# cd /usr/src/usr.sbin/xntpd/util
# make all install
There are enough references to tickadj in e.g. the xntpd documentation
(not to mention the sysctl variables it uses etc.) that I don't feel
up to implementing the final solution right now.
Bill Paul [Thu, 8 Oct 1998 15:45:36 +0000 (15:45 +0000)]
Correctly update the tail pointer of the transmit queue in tl_start()
(one-liner). I have yet to actually encounter any problems due to this
bug, but why take chances.
Add the quirk entry framework to handle disabling the synchronize cache
command on drives that don't like it. Right now, there's just a bogus
quirk entry in the table that doesn't do anything, but that should be
changed once we get actual inquiry data for drives that don't like the
synchronize cache command.
Also, add a shutdown hook that runs through all direct access peripherals
and runs a synchronize cache on them if they're still open, and if
synchronize cache isn't disabled via a quirk entry.
Add a synchronize cache call at the end of dadump() (again, conditionalized
on the quirk entry), so we can insure that the disk cache contents get
flushed to physical media after a dump.
Check the new quirk entry in daclose() to decide whether or not to
synchronize the cache for a disk at final close.