Commit Graph

12209 Commits

Author SHA1 Message Date
Robert Nordier
dfce019974 Drop .MAKEFLAGS: hack. 1998-10-12 02:05:44 +00:00
Robert Nordier
7870a52598 Do without head and tail: they're pretty unnecessary here anyway. 1998-10-12 01:44:15 +00:00
Robert Nordier
36e85d353d Use rather than for linking. This allows the new rather
than stale version of libstand.a to be found.

After this change, the new boot code is apparently building correctly
in a make world.
1998-10-12 01:03:00 +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
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
Robert Nordier
1b9112ea6b In src/Makefile.inc1:
Remove /sys/boot from legacy-build.
    Add btxld to build-tools.
In src/sys/Makefile:
    Add /sys/boot for i386 ELF.

I'm still not sure why the new boot code was being built along with the
legacy stuff, which meant a completely wrong default environment for it.

This may well still be the wrong way to go about this, but it can't work
all that much worse than it has been.
1998-10-11 18:39:38 +00:00
KATO Takenori
9aba3db9f1 Sync with sys/i386/boot/biosboot/table.c revision 1.17. 1998-10-11 15:09:36 +00:00
KATO Takenori
02ca745405 Sync with sys/i386/boot/biosboot/boot.c revision up to 1.74. 1998-10-11 15:09:14 +00:00
KATO Takenori
980418a9b0 Sync with sysi/386/boot/biosboot/boot.h revision 1.24. 1998-10-11 15:08:50 +00:00
KATO Takenori
45b48978af Sync with sys/i386/i386/machdep.c revision 1.313. 1998-10-11 15:04:38 +00:00
KATO Takenori
9e1e84578a Sync with sys/i386/conf/files.i386 revision 1.206. 1998-10-11 15:02:49 +00:00
KATO Takenori
abe3697a3a Sync with sys/i386/conf/Makefile.i386 revision 1.126. 1998-10-11 15:01:40 +00:00
KATO Takenori
049f9fd334 Sync with sys/i386/conf/GENERIC revision 1.124. 1998-10-11 15:00:24 +00:00
Robert Nordier
1339399694 Override for ELF. 1998-10-11 12:59:40 +00:00
Robert Nordier
10806461a7 Override for ELF. Override .s.o suffix rule. 1998-10-11 11:27:48 +00:00
Peter Wemm
7532a55a62 Fix a warning that's been bugging me for ages. 1998-10-11 10:29:49 +00:00
Peter Wemm
68e3a08de1 Fix a warning 1998-10-11 10:28:51 +00:00
Peter Wemm
6e9108b6ac 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.
1998-10-11 10:19:11 +00:00
Peter Wemm
450caa170f Cosmetic: After the autoboot timeout, print a \n. 1998-10-11 10:10:41 +00:00
Peter Wemm
7d9cbdec8f 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).
1998-10-11 10:07:52 +00:00
Peter Wemm
a1c1935fa8 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.
1998-10-11 10:05:13 +00:00
Peter Wemm
1206a4f594 Warn that one of the DEBUG statements has a v86 recursion bug. 1998-10-11 10:01:55 +00:00
Peter Wemm
00fe329527 Fix comment to match code 1998-10-11 09:53:30 +00:00
David Greenman
91aa9f9055 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.
1998-10-11 06:28:54 +00:00
John Polstra
2116e6ab2f 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.
1998-10-11 04:54:16 +00:00
Dima Ruban
18d099b0c4 add <sys/linker.h> 1998-10-11 03:53:35 +00:00
Justin T. Gibbs
2863f7b147 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.
1998-10-10 21:10:36 +00:00
David Greenman
da91462d5e Fixed mbuf leak in fxp_stop(). 1998-10-10 19:26:40 +00:00
Gary Palmer
1383f617d2 Make kernel build on alpha again. New kld stuff needs rindex. 1998-10-10 18:32:18 +00:00
Bruce Evans
7934b2cd38 Don't pretend to support ix86's with 16-bit ints by using longs just
to ensure 32-bit variables.  Doing so broke i386's with 64-bit longs.

This also fixes printf format errors.
1998-10-10 14:30:05 +00:00
Robert Nordier
0def18d819 Fix a typo.
Output another newline before invoking bootstrap.
1998-10-10 14:03:03 +00:00
Bruce Evans
8a8a7f91ae 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.
1998-10-10 14:02:07 +00:00
Bruce Evans
9c9755b4f8 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).
1998-10-10 13:51:24 +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
160ba1c5c8 PC-98 doesn't have CMOS ram. 1998-10-10 10:36:12 +00:00
KATO Takenori
ed68ba2cd0 PC-98 doesn't have CMOS ram. 1998-10-10 09:38:02 +00:00
David E. O'Brien
32a023dc3f Add GENERIC rev 1.124 changes 1998-10-10 09:25:12 +00:00
Jordan K. Hubbard
cbe7e08892 Add entries for MFS which are consistent with the others, now that
Peter has made this more selectable.
1998-10-10 08:13:58 +00:00
Jordan K. Hubbard
a33b93ff31 Allow more flexible use of MFS root.
Submitted by:	peter
1998-10-10 08:12:24 +00:00
Peter Wemm
c9a5e21100 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.
1998-10-10 02:44:53 +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
b24d73e14b rm *.so and *.ko in clean as well. 1998-10-10 01:00:56 +00:00
Warner Losh
19bed41a5d 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.

Requested by: bde, gibbs
Approved by: jkh
1998-10-10 00:44:12 +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
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
KATO Takenori
7143cdbb01 Add ungermann-Bass Access/PC N98C+ support to fe driver (PC-98).
Reviewed by:	kato
Submitted by:	chi@bd.mbn.or.jp (Chiharu Shibata)
1998-10-08 17:06:32 +00:00
KATO Takenori
bb168650e8 Add SMC EtherEZ98 support to ed driver (PC-98).
Reviewed by:	kato
Submitted by:	chi@bd.mbn.or.jp (Chiharu Shibata)
1998-10-08 17:04:59 +00:00
KATO Takenori
5baef6cd27 BIOS ROM base address is 0xe8000 on PC-98. 1998-10-08 16:15:22 +00:00
Bill Paul
3aff6980c6 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.
1998-10-08 15:45:36 +00:00