Commit Graph

12113 Commits

Author SHA1 Message Date
Peter Wemm de78ca7e63 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.
1998-10-09 23:55:31 +00:00
Peter Wemm adbb7dbee6 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.
1998-10-09 23:49:28 +00:00
Peter Wemm 94e9d7c12d 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).
1998-10-09 23:42:47 +00:00
Peter Wemm cfb55a60f9 MODINFO_ADDR has real addresses now, remove the manual relocation based
on cpu type.
1998-10-09 23:37:37 +00:00
Peter Wemm df9e84e0c0 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.
1998-10-09 23:36:26 +00:00
Peter Wemm c6b72a39e9 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. :-)
1998-10-09 23:34:09 +00:00
Peter Wemm 286896fe56 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.
1998-10-09 23:32:03 +00:00
Robert Nordier 91284f875f 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.)
1998-10-09 23:30:16 +00:00
Peter Wemm ea4170d0f6 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.
1998-10-09 23:29:44 +00:00
Peter Wemm 1dd643abae Remove DDB_ELF_SYMBOLS and DDB_KLD_SYMBOLS options. KLD will be the sole
interface to symbols in an elf kernel.
1998-10-09 23:26:26 +00:00
Peter Wemm 7deb2dabef 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. :-)
1998-10-09 23:24:55 +00:00
Peter Wemm 1d59e49683 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.
1998-10-09 23:22:30 +00:00
Peter Wemm f62f10b275 Remove kernelname setenv, the common code does it.
Use the metadata for symtab pointers, mainly to keep it common with
elf_freebsd.c.
1998-10-09 23:20:47 +00:00
Peter Wemm 376f525c56 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.
1998-10-09 23:18:43 +00:00
Peter Wemm 6323a7f93f 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.
1998-10-09 23:15:39 +00:00
Peter Wemm c582ad070a Use a consistant module search path (same as kernel will be).
Use new dependency mechanism.
1998-10-09 23:12:34 +00:00
Peter Wemm 12218096e1 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.
1998-10-09 23:11:05 +00:00
Peter Wemm c2ad65ca15 elf_machdep.c and rindex.c are now standard 1998-10-09 23:08:14 +00:00
Peter Wemm 814500450b 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.
1998-10-09 23:07:27 +00:00
Peter Wemm 1f68fea8bd A hook for storing the origin of a module, this is important when
it's being registered in sorted sysinit sequence and not in load order.
1998-10-09 23:05:45 +00:00
Peter Wemm 3c1cc39618 Add SI_SUB_KLD
First part of support for merging SYSINIT sets.

This, and the following KLD commits have been OK'ed by jkh and msmith
based on my assertion that it works here (barring merge errors :-).
1998-10-09 23:03:27 +00:00
Justin T. Gibbs f4d63fca8a Call dpt_intr from our timeout routine to clear any pending commands before
performing actual timeout processing.

Modify a few printf statements.

Submitted by:	Simon Shapiro <shimon@simon-shapiro.org>
1998-10-09 21:42:19 +00:00
Justin T. Gibbs f8c5944d43 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.
1998-10-09 21:40:50 +00:00
Justin T. Gibbs 9574f7968d Hook up ahapoll so that dumps, synchronize cache commands or any other
command that comes in through xpt_polled_action works correctly.
1998-10-09 21:38:36 +00:00
Mike Smith a8dad95401 Don't try to initialise the environment out of a sysinit, it's handled
in MD code instead.
1998-10-09 21:21:34 +00:00
Peter Wemm bde362f5e9 Null commit.. CVS aborted on freefall last time (reaonly file).
An elf_reloc() function for the i386.  Based on alpha/alpha/elf_machdep.c
and rtld-elf/i386/reloc.c.
1998-10-09 20:38:03 +00:00
Peter Wemm 033f58df20 An elf_reloc() function for the i386. Based on alpha/alpha/elf_machdep.c
and rtld-elf/i386/reloc.c.
1998-10-09 20:35:45 +00:00
Justin T. Gibbs e95de2a602 Pass termination information via softc flags to the core driver. The
EISA probe missed out on this change in attach->core API.
1998-10-09 17:42:28 +00:00
Justin T. Gibbs 4b3aa31c63 When 'using defaults' ensure that termination is enabled.
Removed some unused code.
1998-10-09 17:41:39 +00:00
Robert Nordier 4025ae9d2a Get this building as a.out or ELF.
With thanks to: jdp
1998-10-09 17:19:51 +00:00
KATO Takenori 60f27d13a7 Sync with sys/i386/i386/machdep.c revision 1.312. 1998-10-09 12:36:25 +00:00
Kenjiro Cho 513bc54fe0 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.
1998-10-09 11:48:22 +00:00
Jordan K. Hubbard e4f570a215 Fix damaged comment. 1998-10-09 11:03:46 +00:00
Mike Smith cab57be9ae 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.
1998-10-09 07:11:19 +00:00
Mike Smith 6ba0dd2cfc 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.
1998-10-09 07:09:22 +00:00
Mike Smith 2d7c587f15 MODINFO_NAME can't be 0, that's the end of the metadata area. 1998-10-09 07:06:43 +00:00
Jordan K. Hubbard b526345c9e Add some evil temporary phys-to-kern translation for mfs. 1998-10-09 06:21:12 +00:00
Bill Paul 62034864f7 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.

Submitted by: Jason Wright from the openbsd group
1998-10-09 03:59:24 +00:00
Mike Smith 1d13be3330 Missing defines for the kernel environment and module metadata lookup
functions
1998-10-09 01:44:09 +00:00
Jordan K. Hubbard 48c540f9a1 include proper header for Mike's new stuff. 1998-10-09 01:40:56 +00:00
Mike Smith 6ba9413b55 Kernel environment access, preloaded module lookup. 1998-10-09 00:31:29 +00:00
Mike Smith d7a5acb5ec Initialise kernel environment and module metadata pointers. 1998-10-09 00:31:06 +00:00
Mike Smith 8aeb56c2db New files for kernel environment and module metadata interfaces. 1998-10-09 00:30:50 +00:00
John Polstra 9b35a0d694 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.

Reviewed by:	dg (David Greenman)
Submitted by:	tegge (Tor Egge)
1998-10-09 00:24:49 +00:00
Jordan K. Hubbard f97ad428df 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.
1998-10-08 23:34:44 +00:00
Mike Smith 8ef367d43c 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.
1998-10-08 21:03:41 +00:00
Dag-Erling Smørgrav 83eb77e880 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)
1998-10-08 20:55:54 +00:00
KATO Takenori 0dce060dd6 Discard previous commit. 1998-10-08 17:20:58 +00:00
KATO Takenori c9b153c8af Oops, discard my previous commits becase sumitted code is for RELENG_2_2. 1998-10-08 17:16:41 +00:00
KATO Takenori caff4610b9 Add entry for EtherEZ98 and Access/PC N98C+ cards.
Reviewed by:	kato
Submitted by:	chi@bd.mbn.or.jp (Chiharu Shibata)
1998-10-08 17:07:44 +00:00