Commit graph

1974 commits

Author SHA1 Message Date
Peter Wemm 434bf653d2 - bzero() after malloc() bug fix
- look up relocation symbol names in correct table bugfix.
- remove unused (initialized to 0) variable and conditional free() of it.
1998-10-15 17:16:24 +00:00
Peter Wemm bd4e381b03 - bzero() after malloc(). This is especially obvious when kern_malloc is
compiled with DIAGNOSTIC.
- Don't break from the preload module processing loop prematurely.
1998-10-15 17:12:12 +00:00
Peter Wemm ddd62546e1 Fix sysinit_add().
- Don't include multiple copies of the previous sysinit in the new one.
- Leave space for and explicitly null terminate the new list.
1998-10-15 17:09:19 +00:00
Doug Rabson 216a0f2d7f Don't frob the user stack directly, use suword instead. This fixes the
elf_freebsd_fixup() panic which many people have noticed on the alpha.
1998-10-15 09:52:19 +00:00
Doug Rabson 67fc32a9ff Use the interface name as well as the method name when creating the method
description.

Submitted by: Nick Hibma <nick.hibma@jrc.it>
1998-10-15 09:50:45 +00:00
Kenneth D. Merry a937ccdc09 Disable the 'devstat_end_transaction' busy count printf until after 3.0
release goes out the door.  We know there's a bug in the devstat
implementation in the wd driver, but bde and msmith haven't been able to
fix it yet.

So, disable the printf to avoid confusing/worrying people.

Suggested by:	msmith
1998-10-14 20:44:05 +00:00
Dmitrij Tejblum f74d75a2b6 Backed out rev. 1.164. It caused problems on SMP.
PR:		8309
1998-10-14 15:05:52 +00:00
Peter Wemm 2a26e9ea83 Align to sizeof(long) rather than sizeof(int32_t). It needs to be
long because this code is shared with the alpha.  I hope the alpha can
read 32 bit ints at 32 bit alignment (vs. 64 bit alignment).
1998-10-14 05:07:23 +00:00
Peter Wemm ca65d5c714 Load the full symbol tables if they are present. This means that ddb
and tracebacks have access to local symbols.  This is particularly
important for the Alpha.
1998-10-13 09:27:00 +00:00
David Greenman 6cde7a165f Fixed two potentially serious classes of bugs:
1) The vnode pager wasn't properly tracking the file size due to
   "size" being page rounded in some cases and not in others.
   This sometimes resulted in corrupted files. First noticed by
   Terry Lambert.
   Fixed by changing the "size" pager_alloc parameter to be a 64bit
   byte value (as opposed to a 32bit page index) and changing the
   pagers and their callers to deal with this properly.
2) Fixed a bogus type cast in round_page() and trunc_page() that
   caused some 64bit offsets and sizes to be scrambled. Removing
   the cast required adding casts at a few dozen callers.
   There may be problems with other bogus casts in close-by
   macros. A quick check seemed to indicate that those were okay,
   however.
1998-10-13 08:24:45 +00:00
Dmitrij Tejblum 9bbd8a2498 UnVMIO vnodes of block devices when they are no longer in use. (Some
things, like msdosfs, do not work (panic) on devices with VMIO enabled.
FFS enable VMIO on mounted devices, and nothing previously disabled it, so,
after you mounted FFS floppy, you could not mount msdosfs floppy anymore...)

This is mostly a quick before-release fix.

Reviewed by:	bde
1998-10-12 20:14:09 +00:00
Peter Wemm 2d636ab077 Only print kernel entry point during load.
Drastically quieten down the verbose load progress messages.  They were
more useful for debugging than anything, but are beyond a joke when loading
a few dozen modules.
Simplify the ELF extended symbol table load format.  Just take the main
symbol table and the string table that corresponds.  This is what we will
be getting local symbols from.  (needed for the alpha stack tracebacks).
Use the (optional) full symbol tables in lookups.  This means we have to
furhter distinguish between symbols that can come from the dynamic linking
table and the complete table.
The alpha boot code now needs to be adapted as ddb/db_elf.c cannot use
the simpler format.
I have not implemented loading the extended symbol tables from the syscall
interface yet, just for preloaded modules.
I am not sure about the symbol resolution.  I *think* it's possible that
a local symbol can be found in preference to a global, depending on the
search sequence and dependency tree.
1998-10-12 09:13:50 +00:00
Peter Wemm 2da2eeacee Relocate a few extra addresses that are stored as physical addresses via
the boot loader.
1998-10-12 09:03:48 +00:00
John Polstra d1dbc69449 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.
1998-10-11 19:22:07 +00:00
KATO Takenori 7344a7bb2e mp_machdep.c: Set a vector to boot code (PC-98).
locore.s: Tell the bios to warmboot next time (PC-98).
1998-10-10 13:37:16 +00:00
KATO Takenori ed68ba2cd0 PC-98 doesn't have CMOS ram. 1998-10-10 09:38:02 +00:00
Peter Wemm 26deceba9c Display module type as well as module name when we find one preloaded. 1998-10-10 02:29:07 +00:00
Peter Wemm 51f3fe7ab2 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".
1998-10-10 00:07:53 +00:00
Peter Wemm f3b0d44290 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.
1998-10-10 00:03:07 +00:00
Peter Wemm e4f1a52f7a 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.
1998-10-09 23:59:01 +00:00
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
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
Jordan K. Hubbard e4f570a215 Fix damaged comment. 1998-10-09 11:03:46 +00:00
Mike Smith 6ba9413b55 Kernel environment access, preloaded module lookup. 1998-10-09 00:31:29 +00:00
KATO Takenori 5baef6cd27 BIOS ROM base address is 0xe8000 on PC-98. 1998-10-08 16:15:22 +00:00
Alexander Langer d611666328 Cast the return value of tvtohz() from a long to an int to satisfy the
compiler that we know what we're doing (the value returned has already
been restricted to int ranges).

Reviewed by:	bde
1998-10-06 23:17:44 +00:00
Doug Rabson a20d77550a Make sure that the argv pointers for init are aligned to the correct
boundary on the alpha.
1998-10-06 11:55:40 +00:00
Kenneth D. Merry a795f8bbaa Make the printf when busy_time < 0 a little more descriptive. This may
help track down bugs in the devstat implementation in various drivers.
(i.e., any situation where the driver does not call the devstat routines
once and only once for each transaction initiation and completion)

Prompted by:	msmith
1998-10-06 04:16:07 +00:00
David E. O'Brien efcddb8e39 Taking the GENERIC kernel and commenting out MSDOSFS, CD9660{,_ROOT}, PROCFS,
NFS_ROOT will produce kernel that cannot mount a UFS /.

Vfs type numbers must be distinct from VFS_GENERIC (and VFS_VFSCONF, but
that has the same value and should go away).

The problem happens because NFS is the first vfs (in sys/conf order) so it
gets type number 0 and conflicts harmfully with VFS_GENERIC which is also 0.
The conflict is apparently harmless in the usual case when another vfs
gets type number 0, because nfs is the only vfs that has sysctls.

Inital fix by:	Dima <dima@tejblum.dnttm.rssi.ru>
Reason why it worked by:	bde
1998-10-05 11:10:55 +00:00
Doug Rabson 780330ee00 Send a MOD_UNLOAD event before deleting the module. if the MOD_LOAD event
failed.
1998-10-03 11:05:45 +00:00
Doug Rabson 84bc104b8e Don't call DEVICE_DETACH directly, always go through the device_detach()
wrapper which checks to make sure the device isn't currently open.
1998-10-03 08:55:29 +00:00
John Polstra 7b4c881cef Fix a bug which caused the dynamic linker pathname in the PT_INTERP
program header entry to be ignored if a recognized brand was found.
1998-10-03 04:12:09 +00:00
Doug Rabson da653c6148 Start using the new SWI registration system instead of hardwiring everything. 1998-09-26 14:25:32 +00:00
Matthew Dillon ff8fae607b PR: kern/7418
Reviewed by:	Luoqi Chen <luoqi@watermarkgroup.com>

    Fixed problem where write()s can get lost due to buffers flagged B_DELWRI
    being improperly released in brelse().
1998-09-26 00:12:35 +00:00
Peter Wemm 10baba4b95 Goodbye BOUNCE_BUFFERS, for a hack it has served us well.
The last consumer of this code (the old SCSI system) has left us and
the CAM code does it's own bouncing.  The isa dma system has been
doing it's own bouncing for a while too.

Reviewed by:	core
1998-09-25 17:34:49 +00:00
Luoqi Chen e266594c25 Eliminate a race in VOP_FSYNC() when softupdates is enabled.
Submitted by:	Kirk McKusick	<mckusick@McKusick.COM>
Two minor changes are also included,
1. Remove gratuitious checks for error return from vn_lock with LK_RETRY set,
   vn_lock should always succeed in these cases.
2. Back out change rev. 1.36->1.37, which unnecessarily makes async mount
   a little more unstable. It also keeps us in sync with other BSDs.
Suggested by:	Bruce Evans	<bde@zeta.org.au>
1998-09-24 15:02:46 +00:00
Dmitrij Tejblum a511bf18fe Fix precedence bug, so that kernel dump works. 1998-09-20 16:50:31 +00:00
Kenneth D. Merry bcc6a3da92 Change the devstat generation number from an int to a long. The int-sized
generation was causing unaligned access faults on the Alpha.

I have incremented the devstat version number, since this is an interface
change.  You'll need to recompile libdevstat, systat, iostat, vmstat and
rpc.rstatd along with your kernel.

Partially Submitted by:	Andrew Gallatin <gallatin@cs.duke.edu>
1998-09-20 00:11:23 +00:00
Doug Rabson 6e4fb91578 Document BUS_CREATE_INTR and BUS_CONNECT_INTR. 1998-09-16 08:25:56 +00:00
John Polstra 0ff27d31ea Restore the core-dumping of all writable segments for ELF executables,
minus the NULL pointer dereference in rev. 1.33.  Also simplify
things somewhat by eliminating one traversal of the VM map entries.
Finally, eliminate calls to vm_map_{un,}lock_read() which aren't
needed here.  I originally took them from procfs_map.c, but here
we know we are dealing only with the map of the current process.
1998-09-16 02:04:05 +00:00
John Polstra dada02781d Erk. Revert back to 1.31, dumping only data and stack to the core
file, until I can solve a panic that has just cropped up.
1998-09-15 22:23:12 +00:00
John Polstra 6bb20c5063 When choosing segments to write to the core file, don't assume that
writable implies readable.
1998-09-15 22:07:20 +00:00
John Polstra 8162da636b Instead of just the data and stack segments, include all writable
segments (except memory-mapped devices) in the ELF core file.  This
is really nice.  You get access to the data areas of all shared
libraries, and even to files that are mapped read-write.

In the future, it might be good to add a new resource limit in the
spirit of RLIMIT_CORE.  It would specify the maximum sized writable
segment to include in core dumps.  Segments larger than that would
be omitted.  This would be useful for programs that map very large
files read/write but that still would like to get usable core dumps.
1998-09-15 21:46:34 +00:00
Justin T. Gibbs 7ea97031d1 kern_clock.c:
Remove old disk statistics variables.

vfs_bio.c:
	Enable bowrite now that B_ORDERED works for all buffer devices.
1998-09-15 10:05:18 +00:00
Justin T. Gibbs eda00cb5d2 When a buffer is removed from a buffer queue, remember it's block number
and use it as "the currently active" buffer in doing disk sort calculations.
1998-09-15 08:55:03 +00:00
Justin T. Gibbs 2cfa0a0381 Add a new at_shutdown queue, SHUTDOWN_FINAL. This queue is run at
splhigh() after any system dumps have completed.  SHUTDOWN_POST_SYNC
isn't quite late enough for disk controllers.

Converted at_shutdown queues to use the queue(3) macros.
1998-09-15 08:49:52 +00:00
Justin T. Gibbs 7a59208d92 New Kernel device statistics code.
Submitted by:	"Kenneth D. Merry" <ken@plutotech.com>
1998-09-15 08:16:17 +00:00
John Polstra c284427561 Remove includes that are no longer needed, now that the core dumping
code has been moved into the respective imgact_xxx.c sources.
1998-09-14 23:25:18 +00:00