Commit Graph

747 Commits

Author SHA1 Message Date
Stefan Eßer
2e80ea0536 Make CONF1_ENABLE_MSK1 even less restriktive: Ignore slot ID ... 1995-10-17 23:30:11 +00:00
Stefan Eßer
0e2f699b9e At least the ASUS Triton motherboards don't disable the PCI bus configuration
accesses after the BIOS bus scan. The previous revision made the assumption,
that every PCI motherboard did ...

Change the test on the initial value of the CONF1_ADDR_PORT register in a way
that makes the probe succeed on triton based motherboards, without breaking
the EISA motherboard that has some non-PCI register at the same address.
1995-10-17 15:23:14 +00:00
Stefan Eßer
287911bd50 Go back to separate tests for configuration mechanism 1 and mechanism 2.
Require the state of the configuration enable bits to be OFF assuming
that the BIOS left them that way, as it should anyway to avoid bad things
to happen.

The tests themselves are copied from the previous release, with the
exception of CONF1_ENABLE_MSK1 having the LSB set. This bit should be
read back as '0', since only DWORD addresses are legal.
1995-10-15 23:43:08 +00:00
Poul-Henning Kamp
fa356aa0c0 Pull all of libkern.a in (though not mcount) so the LKM's don't come
out shorthanded.  Makes the idea of libkern pretty void now...
1995-10-15 18:03:42 +00:00
Garrett Wollman
e2d4b1f051 Reduce jitter of Pentium microtime() implementation by letting the counter
free-run and doing a subtract in microtime() rather than resetting the
counter to zero at every clock tick.  In combination with the changes to
kern_clock.c, this should eliminate all the immediately obvious sources
of systematic jitter in timekeeping on Pentium machines.
1995-10-12 20:39:49 +00:00
Bruce Evans
668bfdc286 Include <sys/sysproto.h> so that machdep.c compiles cleanly again
(the prototype for sync() moved).

KNFize and otherwise clean up printing of BIOS geometries.

Add prototypes.

Continue cleaning up new init stuff.
1995-10-10 05:05:28 +00:00
Stefan Eßer
c7483249e7 Fix bad typo: CONF1_ENABLE_RES1 was written CONF1_ENABLE_CHK1 ... 1995-10-09 21:56:24 +00:00
Bruce Evans
029b0fc88f Fix tracing of syscalls. The previous fix required the undocumented
option DDB_NO_LCALLS to stop ddb getting control and broke all ddb
tracing.  Now there is no option and no way for ddb to trace at
address _Xsyscall or to _Xsyscall, but tracing everywhere else
works.  The previous fix did unnecessary things for Linux syscalls.

Don't bother checking that syscall frames are for user mode.

Make debugger traps inside the kernel (except at addresses _Xsyscall
and _Xsyscall+1) fatal if ddb is not configured.  They "can't happen".

Add prototypes.

Remove stupid comments, e.g., /*ARGSUSED*/ for args that are used.
1995-10-09 04:36:01 +00:00
Poul-Henning Kamp
92a69bc337 remove GCC divsi3 routines which are never used. 1995-10-05 10:32:47 +00:00
Julian Elischer
00c6cadad3 Submitted by: Juergen Lock <nox@jelal.hb.north.de>
Obtained from: other people on the net ?

1. stepping over syscalls (gdb ni) sends you to DDB, and returned
to the wrong address afterwards, with or without DDB.  patch in
i386/i386/trap.c below.

2. the linux emulator (modload'ed) still causes panics with DIAGNOSTIC,
re-applied a patch posted to one of the lists...
1995-10-04 07:08:04 +00:00
David Greenman
23e56ee8d7 Insert zeroed pages at the head of the zero queue rather than at the tail.
A measurable performance improvement results from the potential for the
page to be partially cached when it is eventually used.
1995-10-01 20:10:20 +00:00
Stefan Eßer
77b573149a New approach to the PCI bus configuration mechanism probe problem:
- try to make sure there is any kind of PCI device
- if there is anything at port 0x0cf8, then check for mech. 1 or 2
1995-09-22 19:10:54 +00:00
David Greenman
0704324a55 Fix rounding bug in last commit that would have caused the problem to not
be completely fixed.
1995-09-20 13:01:17 +00:00
Bruce Evans
2e69f359d1 Fix benign type mismatches in isa interrupt handlers. Many returned int
instead of void.
1995-09-19 18:55:37 +00:00
Stefan Eßer
a3adc4f8c5 Revert most changes of previous commit.
Changes relative to 1.12:
- Put extra instruction between outl()/inl() sequence to prevent the
  old value being read back because of the bus capacitance.
- Additional check for existence of register at CONF2_ENABLE_PORT.
1995-09-18 21:48:39 +00:00
Paul Traina
0b4a1769be Our existing Cyrix cache-disable code was short-cutting the steps for
setting the control register.  Make the read and write operations two
completely separate steps.

While we're at it, pull in the whole set of Cyrix cache control options
from NetBSD-current,  since a few motherboards do the right thing with
the Cyrix chip.

There is no option to disable the internal cache completely (yet).

Reviewed by:	pst
Obtained from:	NetBSD
1995-09-16 21:31:55 +00:00
David Greenman
97e112628f Check for page being resident when doing I/O with /dev/kmem and return
EFAULT if it is not resident. This prevents the system from manufacturing
a zero-fill page for unused but allocated areas of the kernel's VM. This
should fix the "CMAP busy" panic that some people saw during system
startup.
1995-09-15 23:49:23 +00:00
Stefan Eßer
2d14418625 Another try to determine the PCI bus configuration mode (and whether
there is a PCI bus at all) ...

- Do not expect the chip sets to follow even very clearly expressed
  requirements of the PCI 2.0 spec.
- Do not read back the value just written to an I/O port without making
  sure that some other data have crossed the bus in between ...
1995-09-15 21:43:45 +00:00
David Greenman
0937c08c4e 1) Killed 'BSDVM_COMPAT'.
2) Killed i386pagesperpage as it is not used by anything.
3) Fixed benign miscalculations in pmap_bootstrap().
4) Moved allocation of ISA DMA memory to machdep.c.
5) Removed bogus vm_map_find()'s in pmap_init() - the entire range was
   already allocated kmem_init().
6) Added some comments.

virual_avail is still miscalculated NKPT*NBPG too large, but in order to
fix this properly requires moving the variable initialization into locore.s.
Some other day.
1995-09-15 08:31:19 +00:00
David Greenman
d69caef5ed Killed isa_allocphysmem() and isa_freephysmem(). They are completely used
functions. This file is disgusting; the isa DMA stuff is especially bad and
should be rewritten.
1995-09-15 03:10:06 +00:00
David Greenman
6ce5b54918 1) Don't double map the kernel page tables. The double mapping was never
used and went a long way toward confusing the code.
2) Fix proc0's initial stack to not be 48 bytes smaller than it needs to
   be.
3) Correct comment about 'first' arg to init386().
1995-09-15 02:13:18 +00:00
Stefan Eßer
d7ea35fc88 Improved verification of configuration space accesses working:
Scan for devices instead of assuming that device 0 is present on bus 0
of every PCI motherboard.
1995-09-14 20:27:31 +00:00
Stefan Eßer
cda6791190 Make the PCI host bridge probe code more robust when dealing with chip sets
that use configuration mode 1, but still violate the PCI 2.0 specs ...
(Required for the Compaq Proliant, for example.)
1995-09-13 17:03:47 +00:00
Bruce Evans
e7451974bb Make pcvt and syscons live in the same kernel. If both are enabled, then
the first one in the config has priority.  They can be switched using
userconfig().

i386/i386/conf.c:
Initialize the shared syscons/pcvt cdevsw entry to `nx'.

Add cdevsw registration functions.

Use devsw functions of the correct type if they exist.

i386/i386/cons.c:
Add renamed syscons entry points to constab.

i386/i386/cons.h:
Declare the renamed syscons entry points.

i386/i386/machdep.c:
Repeat console initialization after userconfig() in case the current
console has become wrong.  This depends on cn functions not wiring down
anything important.

sys/conf.h:
Declare new functions.

i386/isa/isa.[ch]:
Add a function to decide which display driver has priority.  Should be
done better.

i386/isa/syscons.c:
Rename pccn* -> sccn*.

Initialize CRTC start address in case the previous driver has moved it.

i386/isa/syscons.c, i386/isa/pcvt/*
Initialize the bogusly shared variable Crtat dynamically in case the
stored value was changed by the previous driver.

Initialize cdevsw table from a template.

Don't grab the console if another display driver has priority.

i386/isa/syscons.h, i386/isa/pcvt/pcvt_hdr.h:
Don't externally declare now-static cdevsw functions.

i386/isa/pcvt/pcvt_hdr.h:
Set the sensitive hardware flag so that pcvt doesn't always have lower
priority than syscons.  This also fixes the "stupid" detection of the
display after filling the display with text.

i386/isa/pcvt/pcvt_out.c:
Don't be confused the off-screen cursor offset 0xffff set by syscons.

kern/subr_xxx.c:
Add enough nxio/nodev/null devsw functions of the correct type for syscons
and pcvt.
1995-09-10 21:36:12 +00:00
Bruce Evans
f2cb5630d0 cons.c:
Split off cdevsw initialization in cninit() into a new function
cninit_finish() that isn't called until all hardware device drivers
have been attached.  The bdevsw entry of the driver for the physical
console needs to be hooked after the physical driver has been
attached in case the attachment modified the entry.

Rearrange cninit() to avoid changing cn_tab until the driver for the
physical console has been initialized, so that the previous driver
(if any) can be used for debugging.

Start removing half-baked lint support.  bdevsw functions usually have
unused args but /*ARGSUSED*/ was used for only about 5% of them.

cons.h:
Declare cn_init_finish().

autoconf.c:
Call cn_init_finish().

Start adding prototypes.  Functions with bogus linkage (extern where
static is probably should be static) are explicitly declared as extern
so that the can be found easily (extern in a non-header is usually
wrong).

All:
Continue cleaning up init stuff: init functions shall be static;
INITs should be at the start of files...
1995-09-10 18:57:26 +00:00
David Greenman
4590fd3a2a Fixed init functions argument type - caddr_t -> void *. Fixed a couple of
compiler warnings.
1995-09-09 18:10:37 +00:00
Bruce Evans
6003967057 Fix benign type mismatches in devsw functions. 82 out of 299 devsw
functions were wrong.
1995-09-08 11:09:15 +00:00
David Greenman
f6eca02d7a 1) Really print 'real' memory - use Maxmem, not physmem.
2) Output K bytes instead of pages as this means something to more people.
3) Moved printf of avail memory to after vm_bounce_init() call so that
   bounce buffers are included in the figure.
4) Killed initcpu(); it's an unused vestige from the VAX.
1995-09-08 03:19:47 +00:00
Julian Elischer
819fb11f5e Submitted by: Luigi Rizzo (luigi@iet.unipi.it)
Obtained from: Luigi Rizzo and Gunther Schadow
Kernel support for the asc scanner driver
1995-09-08 03:14:00 +00:00
David Greenman
0e1815bb54 Minor cleanup and (very) small micro optimization to Xsyscall (and the
linux one)..
1995-09-07 21:36:17 +00:00
Bill Paul
ee1d861fbe Put back the "real memory =" printf() that vanished when the code to
handle holes in memory was added.
1995-09-06 16:13:31 +00:00
John Dyson
a29b63cb73 Machine dependent routines to support pre-zeroed free pages. This
significantly improves demand zero performance.
1995-09-03 20:39:22 +00:00
Julian Elischer
8af5d536ff devfs changes..
changes to allow devices that don't probe (e.g. /dev/mem)
to create devfs entries
this required giving 'configure' its own SYSINIT entry
so we could duck in just before it with a DEVFS init
and some device inits..
my devfs now looks like:
./misc
./misc/speaker
./misc/mem
./misc/kmem
./misc/null
./misc/zero
./misc/io
./misc/console
./misc/pcaudio
./misc/pcaudioctl
./disks
./disks/rfloppy
./disks/rfloppy/fd0.1440
./disks/rfloppy/fd1.1200
./disks/floppy
./disks/floppy/fd0.1440
./disks/floppy/fd1.1200
also some sligt cleanups.. DEVFS needs a lot of work
but I'm getting back to it..
1995-09-03 05:43:50 +00:00
Bruce Evans
8d7459c596 Declare vfs_mountroot() in the right place. 1995-08-30 01:34:28 +00:00
Bruce Evans
154042d309 Remove relocation of Crtat. Drivers already relocate it (somewhat
bogusly).  We used to undo the driver relocation here before doing
a somewhat less bogus relocation.  The result was a null relocation
here.
1995-08-29 23:45:20 +00:00
Julian Elischer
2b14f991e6 Reviewed by: julian with quick glances by bruce and others
Submitted by:	terry (terry lambert)
This is  a composite of 3 patch sets submitted by terry.
they are:
New low-level init code that supports loadbal modules better
some cleanups in the namei code to help terry in 16-bit character support
some changes to the mount-root code to make it a little more
modular..

NOTE: mounting root off cdrom or NFS MIGHT be broken as I haven't been able
to test those cases..

certainly mounting root of disk still works just fine..
mfs should work but is untested. (tomorrows task)

The low level init stuff includes a total rewrite of init_main.c
to make it possible for new modules to have an init phase by simply
adding an entry to a TEXT_SET (or is it DATA_SET) list. thus a new module can
be added to the kernel without editing any other files other than the
'files' file.
1995-08-28 09:19:25 +00:00
Bruce Evans
fadc51bdc6 Remove "memory" clobber statement from enable_intr(). Enabling interrupts
doesn't invalidate loaded variables.

Fix formatting of recent changes.
1995-08-26 20:45:59 +00:00
Bruce Evans
b2c4393679 Remove extra args from the calls to getit(). The bug was benign with the
default function call convention.
1995-08-25 19:24:56 +00:00
David Greenman
4219d2b2ac A couple of micro optimizations to improve NULL syscall performance by
about 2%.
1995-08-21 18:06:48 +00:00
David Greenman
b131795bda Fixed a few bugs and annoyances with boot():
1) deal with cold flag better
2) check for key input more often
3) get rid of unused variables
4) minor formatting improvements
1995-08-20 04:41:02 +00:00
Jordan K. Hubbard
6788ce49a0 Bring in Serge Vakulenko's IDE CDROM (ATAPI) driver. A number of
people have now indicated to me that it's working more than well
enough to bring into -current.
Submitted by:	Serge Vakulenko <vak@cronyx.ru>
1995-08-18 11:26:35 +00:00
David Greenman
d0d1c65888 Killed some unused stuff inherited from Bill Jolitz. Note that since
this changes the size of the pcb struct, gdb will need to be rebuilt
or debugging won't work correctly.

Reviewed by:	Bruce Evans
1995-08-17 11:30:03 +00:00
Bruce Evans
a722b904d7 Fake a call frame for traps so that `gdb -k' can report where fatal
traps occurred.  This also helps ddb backtrace through trap frames.
Backtracing through syscall and interrupt frames still doesn't work
but it is relatively unimportant and more expensive to fix.
1995-08-15 19:23:33 +00:00
John Dyson
8966b85c8f Make the spl oriented inline functions less likely to allow
potentially volatile memory to be kept in registers during
the "call" (inline expansion.)  Do the same for pmap_update.
1995-08-08 04:50:52 +00:00
David Greenman
a705fd3e48 Fix a bug in my disabled version of trap_pfault()...curpcb may be NULL even
when curproc isn't. This condition occurs at system startup and perhaps
at other times.
1995-07-30 17:49:24 +00:00
Bruce Evans
28f8db1403 Eliminate sloppy common-style declarations. There should be none left for
the LINT configuation.
1995-07-29 11:44:31 +00:00
David Greenman
6b837e5dda Fixed bug I introduced with the memory-size code rewrite that broke
floppy DMA buffers...use avail_start not "first". Removed duplicate
(and wrong) declaration of phys_avail[].

Submitted by:	Bruce Evans, but fixed differently by me.
1995-07-28 11:21:06 +00:00
Bruce Evans
8089a0432e Fix bogus constraint "i" that only worked with -O. The cases where it
didn't work are somewhat bogusly optimized away before the constraint
is checked.  We still expect constants passed to inline functions to
remain constant, but if the compiler ever decides that they aren't
constant then it will just generate slightly slower code instead of
an error.
1995-07-25 21:28:47 +00:00
David Greenman
e9857eee2b Rewrote memory sizing code to generally deal with holes in extended memory.
This code change should allow certain Compaq machines with a 128K hole
at 16MB to work.
1995-07-19 06:37:12 +00:00
Peter Wemm
1174c7d121 This fixes a compiler warning, and a cosmetic problem with the linux
emul code when compiling with "options KTRACE".
ktrsyscall() was expecting an array of integers, this was passing the
address of a structure containing an array of integers..
The cosmetic problem was that it was calling the "enter syscall"
trace hook twice - this looks like a cut/paste error/typo.
1995-07-16 14:10:55 +00:00
Poul-Henning Kamp
8a7580c3fe Reviewed by: phk
Submitted by:	Andrew McRae <andrew@mega.com.au>

Some initial commits from the pcmcia stuff, to make life easier for the
testers.

We will use the name "pccard" since that is really the buzzword at present.
1995-07-16 10:45:06 +00:00
Poul-Henning Kamp
7a2dada545 Make the bootinfo structure visible from sysctl.
This can be used in libdisk to guess a better bios-geometry.
1995-07-16 10:33:38 +00:00
Joerg Wunsch
446cee6e6d Include ``options POWERFAIL_NMI'' for owners of older (non-apm)
notebooks where a powerfail condition (external power drop; battery
state low) is signalled by an NMI.  Makes it beep instead of panicing.

Reviewed by:	davidg
1995-07-16 10:31:26 +00:00
David Greenman
9e951f36f1 Truncate the fault address to a page boundry when calling vm_fault(). The
last change to fix the fault-twice bug with page tables wasn't quite
complete.
1995-07-16 05:39:22 +00:00
David Greenman
4a67eb7121 Fixed bug that caused page tables to be faulted twice instead of once.
Submitted by:	John Dyson
1995-07-14 09:25:51 +00:00
David Greenman
24a1cce34f NOTE: libkvm, w, ps, 'top', and any other utility which depends on struct
proc or any VM system structure will have to be rebuilt!!!

Much needed overhaul of the VM system. Included in this first round of
changes:

1) Improved pager interfaces: init, alloc, dealloc, getpages, putpages,
   haspage, and sync operations are supported. The haspage interface now
   provides information about clusterability. All pager routines now take
   struct vm_object's instead of "pagers".

2) Improved data structures. In the previous paradigm, there is constant
   confusion caused by pagers being both a data structure ("allocate a
   pager") and a collection of routines. The idea of a pager structure has
   escentially been eliminated. Objects now have types, and this type is
   used to index the appropriate pager. In most cases, items in the pager
   structure were duplicated in the object data structure and thus were
   unnecessary. In the few cases that remained, a un_pager structure union
   was created in the object to contain these items.

3) Because of the cleanup of #1 & #2, a lot of unnecessary layering can now
   be removed. For instance, vm_object_enter(), vm_object_lookup(),
   vm_object_remove(), and the associated object hash list were some of the
   things that were removed.

4) simple_lock's removed. Discussion with several people reveals that the
   SMP locking primitives used in the VM system aren't likely the mechanism
   that we'll be adopting. Even if it were, the locking that was in the code
   was very inadequate and would have to be mostly re-done anyway. The
   locking in a uni-processor kernel was a no-op but went a long way toward
   making the code difficult to read and debug.

5) Places that attempted to kludge-up the fact that we don't have kernel
   thread support have been fixed to reflect the reality that we are really
   dealing with processes, not threads. The VM system didn't have complete
   thread support, so the comments and mis-named routines were just wrong.
   We now use tsleep and wakeup directly in the lock routines, for instance.

6) Where appropriate, the pagers have been improved, especially in the
   pager_alloc routines. Most of the pager_allocs have been rewritten and
   are now faster and easier to maintain.

7) The pagedaemon pageout clustering algorithm has been rewritten and
   now tries harder to output an even number of pages before and after
   the requested page. This is sort of the reverse of the ideal pagein
   algorithm and should provide better overall performance.

8) Unnecessary (incorrect) casts to caddr_t in calls to tsleep & wakeup
   have been removed. Some other unnecessary casts have also been removed.

9) Some almost useless debugging code removed.

10) Terminology of shadow objects vs. backing objects straightened out.
    The fact that the vm_object data structure escentially had this
    backwards really confused things. The use of "shadow" and "backing
    object" throughout the code is now internally consistent and correct
    in the Mach terminology.

11) Several minor bug fixes, including one in the vm daemon that caused
    0 RSS objects to not get purged as intended.

12) A "default pager" has now been created which cleans up the transition
    of objects to the "swap" type. The previous checks throughout the code
    for swp->pg_data != NULL were really ugly. This change also provides
    the rudiments for future backing of "anonymous" memory by something
    other than the swap pager (via the vnode pager, for example), and it
    allows the decision about which of these pagers to use to be made
    dynamically (although will need some additional decision code to do
    this, of course).

13) (dyson) MAP_COPY has been deprecated and the corresponding "copy
    object" code has been removed. MAP_COPY was undocumented and non-
    standard. It was furthermore broken in several ways which caused its
    behavior to degrade to MAP_PRIVATE. Binaries that use MAP_COPY will
    continue to work correctly, but via the slightly different semantics
    of MAP_PRIVATE.

14) (dyson) Sharing maps have been removed. It's marginal usefulness in a
    threads design can be worked around in other ways. Both #12 and #13
    were done to simplify the code and improve readability and maintain-
    ability. (As were most all of these changes)

TODO:

1) Rewrite most of the vnode pager to use VOP_GETPAGES/PUTPAGES. Doing
   this will reduce the vnode pager to a mere fraction of its current size.

2) Rewrite vm_fault and the swap/vnode pagers to use the clustering
   information provided by the new haspage pager interface. This will
   substantially reduce the overhead by eliminating a large number of
   VOP_BMAP() calls. The VOP_BMAP() filesystem interface should be
   improved to provide both a "behind" and "ahead" indication of
   contiguousness.

3) Implement the extended features of pager_haspage in swap_pager_haspage().
   It currently just says 0 pages ahead/behind.

4) Re-implement the swap device (swstrategy) in a more elegant way, perhaps
   via a much more general mechanism that could also be used for disk
   striping of regular filesystems.

5) Do something to improve the architecture of vm_object_collapse(). The
   fact that it makes calls into the swap pager and knows too much about
   how the swap pager operates really bothers me. It also doesn't allow
   for collapsing of non-swap pager objects ("unnamed" objects backed by
   other pagers).
1995-07-13 08:48:48 +00:00
Stefan Eßer
d2a2d5ec41 The PCI config mechanism 1 test failed for the Intel Aries.
Make it less strict ...

Submitted by:	NIIMI Satoshi <sa2c@and.or.jp>
1995-06-30 16:11:42 +00:00
Stefan Eßer
0847c06d2e PCI configuration mechanism now determined by a method, that doesn't
fail on new hardware (Compaq Prolinea and Compaq Prosignea), and that
doesn't erroneously identify old mech. 2 chip sets as using mech. 1.
(See section 3.6.4.1.1 of the PCI bus specs rev. 2.0)
1995-06-28 15:54:57 +00:00
David Greenman
338cd8f6be Killed redundant vnode_pager_umount() call. This is already done at
FS unmount time.
1995-06-28 04:46:11 +00:00
David Greenman
53b5ed936e Make path to kernel absolute if it is passed in relative. This fixes
a related bug in some of the new 'foo'boot bootstrap code that has been
added over the past months. This change makes it no longer necessary
for the bootstrap to fix up the path (i.e. it can be removed).
1995-06-28 04:42:25 +00:00
Bruce Evans
943c18018b Fix standards conformance bugs in <signal.h>:
include/signal.h:
There was massive namespace pollution from including <sys/types.h>.
POSIX functions were declared even when _ANSI_SOURCE is defined.

sys.sys/signal.h:
NSIG was declared even if _ANSI_SOURCE or _POSIX_SOURCE is defined.
sig_atomic_t wasn't declared if _POSIX_SOURCE is defined.
Declare a typedef for signal handling functions and use it to
unobfuscate declarations and to avoid half-baked function types
that cause unwanted compiler warnings at certain warning levels.
Fix confusing comment about SA_RESTART.

sys/i386/include/signal.h:
This has to be included to get the declaration of sig_atomic_t even
when _ANSI_SOURCE is defined, so be more careful about polluting
the ANSI namespace.

Uniformize idempotency ifdefs.
1995-06-28 02:14:13 +00:00
Bruce Evans
4ebf8117df Partially fix `sysctl machdep.console_device'. The fix will be complete
when syscons stops mapping the console to minor MAXCONS.  There is
usually no corresponding device in /dev, and the correct device has
minor 0.

cons.c:
Initialize cn_tty properly, so that CPU_CONSDEV can work.
Comment about too many variants of the console tty pointer.

machdep.c:
Return device NODEV and not error EFAULT when there is no console device.
1995-06-26 07:39:52 +00:00
Bruce Evans
6f5014b462 Convert to ANSI C: change #endif THING to #endif /* THING */.
Fix one such THING in code to match comment.
Sort IO_GSC* into numeric order and update comments about the gaps.
Sort common SCSI addresses into alphabetical order.
Remove bogus comments about com ports having i/o size 4.
Uniformize whitespace.
Uniformize case in hex digits.

This file is very incomplete.  In particular, it doesn't mention any
network cards.  This doesn't matter much for the base addresses, but
it means that the comments about which addresses are free are mostly
bogus.  The i/o sizes are unreliable because of split address ranges
for many devices (VGA, wd).  The i/o sizes are incomplete.  In
particular, there are no sizes for SCSI controllers.  The bt driver
still returns a truth value instead of a size.
1995-06-14 07:38:31 +00:00
Rodney W. Grimes
d3628763db Merge RELENG_2_0_5 into HEAD 1995-06-11 19:33:05 +00:00
Rodney W. Grimes
9b2e535452 Remove trailing whitespace. 1995-05-30 08:16:23 +00:00
David Greenman
ac8d676972 Fix setdumpdev():
- the major number wasn't checked, so accesses beyond the end of bdevsw[]
  were possible.  Bogus major numbers are easy to get because `sysctl -w'
  doesn't handle dev_t's reasonably - it doesn't convert names to dev_t's
  and it converts the number 1025 to the dev_t 0x35323031.
- Driver d_psize() functions return -1 to indicate error ENXIO or ENODEV
  (the interface is too braindamaged to say which).  -1 was interpreted
  as a size and resulted in the bogus error ENOSPC.
- it was possible to set the dumpdev for devices without a d_psize()
  function.  This is equivalent to setting the dumpdev to NODEV except
  it confuses sysctl.
- change a 512 to DEV_BSIZE.  There is an official macro dtoc() for
  converting "pages" to disk blocks but it is never used in /usr/src/sys.
  There is much confusion between PAGE_SIZE sized pages and NBPG sized
  pages.  Maxmem consists of both.

Not fixed:
- there is nothing to invalidate the dumpdev if the media goes away.
  This reduces the benefits of the early calculation of dumplo.  Bounds
  checking in the dump routines is relied on to reduce the risk of
  damage and little would be lost by relying on the dump routines to
  calculate dumplo.
- no attempt is made to stay away from the start of the device to
  avoid clobbering labels.

Fix wrong && anachronistic comment about the type of bootdev.

Reviewed by:	davidg
Submitted by:	Bruce Evans
1995-05-29 04:08:13 +00:00
David Greenman
b64b660cd3 Made "NMBCLUSTERS" calculation dynamic and fixed bogus use of "NMBCLUSTERS"
in machdep.c (it should use the global nmbclusters). Moved the calculation
of nmbclusters into conf/param.c (same place where nmbclusters has always
been assigned), and made the calculation include an extra amount based
on "maxusers". NMBCLUSTERS can still be overrided in the kernel config
file as always, but this change will make that generally unnecessary. This
fixes the "bug" reports from people who have misconfigured kernels seeing
the network hang when the mbuf cluster pool runs out.

Reviewed by:	John Dyson
1995-05-25 07:41:28 +00:00
David Greenman
5eb46edfb0 Added "BROKEN_KEYBOARD_RESET" option to disable using the keyboard reset
in cpu_reset(). Some MBs don't deal with this properly.

Submitted by:	Rod Grimes
1995-05-18 09:17:07 +00:00
David Greenman
30fd0561cd Added apersand constraint to make sure that the source and destination
registers aren't combined.

Reviewed by:	Bruce Evans and David Greenman
Submitted by:	John Dyson
1995-05-14 22:25:11 +00:00
David Greenman
a401ebbe32 Changed swap partition handling/allocation so that it doesn't
require specific partitions be mentioned in the kernel config
file ("swap on foo" is now obsolete).

From Poul-Henning:

The visible effect is this:

As default, unless
        options "NSWAPDEV=23"
is in your config, you will have four swap-devices.
You can swapon(2) any block device you feel like, it doesn't have
to be in the kernel config.

There is a performance/resource win available by getting the NSWAPDEV right
(but only if you have just one swap-device ??), but using that as default
would be too restrictive.

The invisible effect is that:

Swap-handling disappears from the $arch part of the kernel.
It gets a lot simpler (-145 lines) and cleaner.

Reviewed by:	John Dyson, David Greenman
Submitted by:	Poul-Henning Kamp, with minor changes by me.
1995-05-14 03:00:10 +00:00
Jordan K. Hubbard
c25cfd0b0d "1 easy fix in 10 excrutiating steps"
A phone call from Manfred quickly pointed up the fact that I got the conflict
check backwards.  NOW we implement the conflict checking correctly!  Wheesh!
1995-05-13 00:09:38 +00:00
Garrett Wollman
5bb4f73817 The death of `options NODUMP'. Now the dump area can be dynamically
configured (and unconfigured) on the fly.  A sysctl(3) MIB variable is
provided to inspect and modify the dump device setting.
1995-05-12 19:17:31 +00:00
Rodney W. Grimes
b2b795f07c Fix -Wformat warnings from LINT kernel. 1995-05-11 19:26:53 +00:00
Bruce Evans
d81fba0cda Add variable `idelayed' and macros setdelayed() and schedsofttty()
to access it.  setdelayed() actually ORs the bits in `idelayed' into
`ipending' and clears `idelayed'.

Call setdelayed() every (normal) clock tick to convert delayed
interrupts into pending ones.

Drivers can set bits in `idelayed' at any time to schedule an interrupt
at the next clock tick.  This is more efficient than calling timeout().
Currently only software interrupts can be scheduled.
1995-05-11 07:44:40 +00:00
Bruce Evans
0ee893eb32 Add loadandclear(). It atomically loads a value from memory, clears the
value in memory and returns the original value.
1995-05-11 07:24:35 +00:00
Jordan K. Hubbard
da8d0268df Pass me the pointed chapeau - this typo somehow got through my testing. 1995-05-11 05:20:43 +00:00
Bill Paul
2c739e6439 If you config a kernel with 'config kernel swap generic' and try to
boot diskless with it, you get a panic because setconf() is only
called for mountroot == ffs_mountroot. It really needs to be called
no matter what manner of rootfs we have. I can't really say if
swapgeneric will work with a CD-ROM though. (I get the feeling I'm
the only one who uses swapgeneric these days anyway.)
1995-05-11 02:50:11 +00:00
Jordan K. Hubbard
9cc347481f Remove all vestiges of the ALLOW_CONFLICT_FOO evil and replace it with
something slightly less evil - a per device conflict flag.
1995-05-11 02:15:55 +00:00
Garrett Wollman
c9cd353a18 Delete two debugging printfs that mistakenly crept in. 1995-05-11 00:16:44 +00:00
Garrett Wollman
748e0b0acc Make networking domains drop-ins, through the magic of GNU ld. (Some day,
there may even be LKMs.)  Also, change the internal name of `unixdomain'
to `localdomain' since AF_LOCAL is now the preferred name of this family.
Declare netisr correctly and in the right place.
1995-05-11 00:13:26 +00:00
David Greenman
85eaa94715 Correct the definition for the (unused) cpu_setstack(). 1995-05-04 07:50:06 +00:00
David Greenman
6486b7f194 Added a memcpy() routine. 1995-05-02 05:20:26 +00:00
Poul-Henning Kamp
807afe4fa5 A missing 'and', probably my fault.
Submitted by:	Ed Hudson <elh@p5.spnet.com>
1995-05-02 04:40:06 +00:00
John Dyson
641a27e68b Fixed a problem that can cause left-over pv_entries and as
as side-effect, removed some legacy code that was necessary
when we called vm_fault inside of vm_fault_quick instead of using
the kernel/user space byte move routines.
1995-05-01 23:32:30 +00:00
Rodney W. Grimes
2320728f46 Add outb to keyboard controller to do a cpu_reset, this fixes 2 known
cases of motherboards that failed to reboot.
1995-04-26 07:38:35 +00:00
Poul-Henning Kamp
58e81aafbb Add support for MFS root filesystem. 1995-04-25 03:41:12 +00:00
Poul-Henning Kamp
d3f4d460f8 Added "bio" to matcd. 1995-04-24 05:33:59 +00:00
Julian Elischer
6944abf1d7 hmm spotted a difference resulting from a merge I didn't examine close enough 1995-04-23 09:17:24 +00:00
Julian Elischer
73bac981dd include hooks for EISA configuration (possibly wrong :) 1995-04-23 09:13:08 +00:00
Poul-Henning Kamp
94624c5572 Forgot this commit the other day. The receiving end of the "boot -C" option. 1995-04-23 04:14:41 +00:00
Bill Paul
31e0d8b925 Tiny printf formatting change: if we have no cpu_vendor or cpu_id info,
don't generate a newline. (Yeah, I'm picking nits, but that empty line
I get on my 386 just looks dumb, okay? :)
1995-04-22 03:58:46 +00:00
Poul-Henning Kamp
804e33a872 Add wd2 and wd3 as swap-devices too. 1995-04-20 06:05:17 +00:00
Rodney W. Grimes
781434c1fc Reapply my fix for this:
Output the CPU features line during the probe on a seperate line, for
folks with lots of features the output use to wrap and look ugle.
1995-04-18 23:55:26 +00:00
Poul-Henning Kamp
8425684b90 Print the BIOS geometries in a human-readable format. 1995-04-17 16:49:50 +00:00
David Greenman
857f4d44be Remove gratuitous waste of 2K of memory for BIOS variables. We never load
the kernel at 0-640k; we haven't had the ability to do that since before
2.0R. Furthermore, I fail to see how putting an instruction at 0 and then
doing a .org 0x500 is going to prevent the stuff from getting clobbered
in the first place; a.out is just too stupid to know about sparse address
spaces.
1995-04-16 10:12:16 +00:00
Bruce Evans
7897b3ce69 Don't waste time sending an EOI to ICU1 if option AUTO_EOI_1 is defined.
Previously, this worked right if both AUTO_EOI_1 and AUTO_EOI_2 are
defined, but not if AUTO_EOI_1 is defined and AUTO_EOI_2 is not defined.
The latter case should be the default.  DUMMY_NOPS should be the default
too.  Currently there are only two NOPs slowing down rtcin() (although
there are no delays in writertc()) and several FASTER_NOPs slowing down
interrupt handling in vector.s.

Fix stack offsets for the (previously) unused untested
FAST_INTR_HANDLER_USES_ES case.
1995-04-15 21:32:18 +00:00
Peter Dufault
8db34c841e Add scsi target. Add "after config" call to autoconf so that scsi
targets will be configured after all scsi busses have been configured.
1995-04-14 15:13:26 +00:00
Bill Paul
09a901eb60 Hopefully I won't get flamed for this: insert a few more #if defined(I486_CPU)
and #if defined (I586_CPU) thingies into identifycpu() so that we only
compile in what's actually needed for a given CPU. So far as I can tell,
none of my 386 machines generate a cpu_vendor code, so I made the extra vendor
and feature line conditional on I486_CPU and I586_CPU. (Otherwise we
print out a blank line which looks silly.)
1995-04-14 02:06:00 +00:00
Bill Paul
695e4afe85 This a subtle reminder to people that not everybody compiles their
kernels with 'options I586_CPU.'

The declaration for pentium_mhz is hidden inside an #ifdef I586_CPU,
but machdep.c refers to it whether I586_CPU is defined or not. This
temporary hack puts the offending code inside an #ifdef I586_CPU as
well so that a kernel without it will successfully compile.

I must emphasize the word 'temporary:' somebody needs to seriously
beat on the identifycpu() function with an #ifdef stick so that
I386_CPU, I486_CPU and I586_CPU will do the right things.
1995-04-13 04:55:35 +00:00
Garrett Wollman
6c0081e92b Add a class field to devconf and mst drivers.
For those where it was easy, drivers were also fixed to call
dev_attach() during probe rather than attach (in keeping with the
new design articulated in a mail message five months ago).  For
a few that were really easy, correct state tracking was added as well.
The `fd' driver was fixed to correctly fill in the description.
The CPU identify code was fixed to attach a `cpu' device.  The code
was also massively reordered to fill in cpu_model with somethingremotely
resembling what identifycpu() prints out.  A few bytes saved by using
%b to format the features list rather than lots of ifs.
1995-04-12 20:48:13 +00:00
Poul-Henning Kamp
8d89e37c73 I got that wrong,
lnc0	@ 0x280
	lnc1	@ 0x300

moved le0 into sorted sequence.
1995-04-10 19:13:51 +00:00
Poul-Henning Kamp
1f9e6f1901 lnc0 is @ 0x300
lnc1 is @ 0x280
1995-04-10 19:12:29 +00:00
Poul-Henning Kamp
17755ac806 Changes to make FreeBSD use a CDROM as rootdev, for installation purposes.
If "BOOTCDROM" is defined, you get this pretty special case stuff.
1995-04-10 07:44:31 +00:00
David Greenman
fcb5be87ad Cosmetic changes. 1995-04-09 05:40:38 +00:00
Poul-Henning Kamp
63373752ea Move default address of lnc0 to 0x300. Luigi Rizzo said that his card
cannot even go below 0x300...
1995-04-08 21:41:52 +00:00
Joerg Wunsch
4fb0b0de3e Implement a simple hook (or hack?) to allow graphics device console
drivers to protect DDB from being invoked while the console is in
process-controlled (i.e., graphics) mode.

Implement the logic to use this hook from within pcvt.  (I'm sure
Søren will do the syscons part RSN).

I've still got one occasion where the system stalled, but my attempts
to trigger the situation artificially resulted int the expected
behaviour.  It's hard to track bugs without the console and DDB
available. :-/
1995-04-08 21:32:11 +00:00
Poul-Henning Kamp
12cfa43650 Added the "eg0" interface driver for the 3Com "3c505" or "etherlink/+"
card.  This is the braindamaged card with the 80186 CPU on it.  It is
slow, probably not very good after all, but hey, if you have one lying
around doing nothing anyway...

Added the "zp0" driver to GENERIC.
1995-04-08 09:36:04 +00:00
Andrey A. Chernov
a30090c5f7 Print "on isa" for devices with port==0 per Bruce suggestion 1995-04-06 13:55:56 +00:00
Rodney W. Grimes
5f34517b1c Output the CPU features line during the probe on a seperate line, for
folks with lots of features the output use to wrap and look ugle.

Reviewed by:	phk
1995-04-06 07:55:42 +00:00
Andrey A. Chernov
29ecb6a386 Print "on motherboard" for isa? devices with id_iobase == 0 1995-04-04 22:48:40 +00:00
David Greenman
7b0047e213 Made pmap_testbit a static function. 1995-03-30 08:55:39 +00:00
Rodney W. Grimes
ad0c439a34 Submitted by: Mahesh Neelakanta <mahesh@gcomm.com>
Change I/O address of Intel EtherExpress driver (ix0) from 0x280 to
0x300.
1995-03-30 00:20:08 +00:00
Bruce Evans
3aa12267a5 Add and move declarations to fix all of the warnings from `gcc -Wimplicit'
(except in netccitt, netiso and netns) that I didn't notice when I fixed
"all" such warnings before.
1995-03-28 07:58:53 +00:00
David Greenman
1ae89ac36a Removed declaration of pmap_changebit()...it is no longer exported.
Submitted by:	John Dyson
1995-03-26 23:42:55 +00:00
David Greenman
880d1d842e Changed pmap_changebit() into a static function as it always should
have been.

Submitted by:	John Dyson
1995-03-26 23:42:07 +00:00
Steven Wallace
c27bd0ad13 Do a printf("\n") after all conditional printfs have been done so that
a newline is always done.  Remove \n's from last conditonal printfs.
1995-03-25 05:54:33 +00:00
Stefan Eßer
0f29bf015c Correct pcibus_setup() to return as soon as one test succeeds. 1995-03-22 21:35:39 +00:00
Stefan Eßer
9c6f3c132b Delete PCI PCI bridge simulator code ...
Submitted by:	Wolfgang Stanglmeier <wolf@kintaro.cologne.de>
1995-03-22 19:51:59 +00:00
Stefan Eßer
33865a313c Remove spurious declaration of printf().
Submitted by:	Michael Reifenberger <root@rz-wb.fh-sw.de>
1995-03-22 10:52:05 +00:00
Stefan Eßer
5b3f532eb1 New ISA specific PCI code.
Supports shared PCI interrupts.

Submitted by:	Wolfgang Stanglmeier <wolf@kintaro.cologne.de>
1995-03-21 23:06:07 +00:00
David Greenman
f550a707bd Added a new version of trap_pfault() that disallows kernel page faults
to the user address space unless pcb_onfault is set. The code is currently
commented out because iBCS2 and process debugging parts of the kernel
need to be changed/fixed first.
1995-03-21 07:16:12 +00:00
David Greenman
c6d5f3ac3e Changed some #ifdef DIAGNOSTIC code that I added to be #ifdef DEBUG. 1995-03-21 07:02:51 +00:00
David Greenman
edf8a81561 Removed redundant newlines that were in some panic strings. 1995-03-19 14:29:26 +00:00
Rodney W. Grimes
f8e028be26 Add Intel EtherExpress16 (ix0) driver.
Reviewed by:
Submitted by:
Obtained from:
1995-03-18 08:12:48 +00:00
David Greenman
3e3eb41588 Call dev_shutdownall() just after unmounting filesystems. 1995-03-17 04:19:19 +00:00
Bruce Evans
b5e8ce9f12 Add and move declarations to fix all of the warnings from `gcc -Wimplicit'
(except in netccitt, netiso and netns) and most of the warnings from
`gcc -Wnested-externs'.  Fix all the bugs found.  There were no serious
ones.
1995-03-16 18:17:34 +00:00
Stefan Eßer
9b2fa02dd9 Prepare for shared interrupts (required by the new PCI code that adds
support for PCI PCI bridges, e.g. found on 4ch. Ethernet cards).

Submitted by:	Wolfgang Stanglmeier <wolf@kintaro.cologne.de>
1995-03-16 17:31:19 +00:00
Atsushi Murai
9cfb8f7ee9 Adding tunnel pseudo-device for Network Installation with User process PPP.
Reviewed by:	amruai@spec.co.jp
1995-03-12 12:10:35 +00:00
Poul-Henning Kamp
fc20488fba Moved bb stuff to support.s per Bruces suggestion. 1995-03-11 03:49:50 +00:00
Poul-Henning Kamp
9eefa8bfc4 Add a dummy ___bb_init_func for BB profiling of the kernel.
To use this: recompile src/gnu/usr.bin/cc, compile your kernel.  The
files you want to profile should be compiled with '-a -g'.  "strip -x"
the kernel and run.  You don't need to profile all files in the kernel.
My next commit is the program to extract the data from the running kernel.
1995-03-10 08:41:26 +00:00
David Greenman
b4abbbcad3 kmem_alloc() returns zero-filled memory; it isn't necessary to bzero()
it.
1995-03-10 08:13:07 +00:00
David Greenman
90c47808bb Removed unnecessary routines vm_get_pmap() and vm_put_pmap().
kmem_alloc() returns zero filled memory, so no need to explicitly
bzero() it.
1995-03-10 08:05:00 +00:00
David Greenman
d8cb3fb153 Increased number of buffers to 1/12 of (page_count - 1024). This makes the
cache minimum closer to 10% in the usual case.
1995-03-07 19:58:02 +00:00
Joerg Wunsch
68cfe626f7 pcvt is still using the XSERVER option; document this. 1995-03-05 22:23:35 +00:00
Bill Paul
bf3e3428b6 Changed the printf()s in npxattach a bit so you don't end up with
messages like this:

wdc0 at 0x1f0-0x1f7 irq 14 on isa
wdc0: unit 0 (wd0): <ST506>
wd0: size unknown, using BIOS values: 615 cyl, 4 head, 17 sec, bytes/sec 512
npx0 at 0xf0-0xff irq 13 on motherboard
npx0: changing root device to wd0a
^^^^^^

The spurious 'npx0: ' pops up if you have a 386 with a 387 FPU.
1995-03-05 04:06:44 +00:00
David Greenman
812a11a2ec Removed obsolete vtrace() and reorganized a little. 1995-03-04 02:25:36 +00:00
David Greenman
3b7517f887 Preserve reverse link integraty while doing the queue insertion. 1995-03-03 22:14:42 +00:00
David Greenman
9ad19d92e1 Use copyout to install the sigframe rather than directly writing to the
user's stack.
1995-03-03 00:43:08 +00:00
Jordan K. Hubbard
05e1d9d455 Changes to incorporate the Matsushita CDROM driver (otherwise known as
the "Sound blaster CDROM").
Submitted by:	Frank Durda IV <bsdmail@nemesis.lonestar.org>
1995-03-02 04:07:03 +00:00
David Greenman
1d1b971bec Use su/fubyte instead of directly touching the user's address space. 1995-03-01 23:59:21 +00:00
David Greenman
fde2cdc48a Various changes from John and myself that do the following:
New functions create - vm_object_pip_wakeup and pagedaemon_wakeup that
are used to reduce the actual number of wakeups.
New function vm_page_protect which is used in conjuction with some new
page flags to reduce the number of calls to pmap_page_protect.
Minor changes to reduce unnecessary spl nesting.
Rewrote vm_page_alloc() to improve readability.
Various other mostly cosmetic changes.
1995-03-01 22:08:55 +00:00
David Greenman
54ab07303b Slight change to include file order to accommodate upcoming changes. 1995-03-01 21:37:44 +00:00
Bruce Evans
550f8550ec Replace all remaining instances of i386/include' by machine' and fix
nearby #include inconsistencies.
1995-02-26 05:14:53 +00:00
Poul-Henning Kamp
ca063ee672 Change EISA size to 256 instead of 4096.
Neither are correct, but 256 does least damage.
1995-02-25 20:26:14 +00:00
Poul-Henning Kamp
6e65a78aee Read K&R and get the { } right :-) 1995-02-25 18:55:53 +00:00
Poul-Henning Kamp
d8ee5072e3 I belive I finally got the "on eisa" right.
| if (!(isdp->id_iobase & 0xf300)) {
| 	printf(" on motherboard\n");
| } else if (isdp->id_iobase >= 0x1000 &&
| 	!(isdp->id_opbase & 0x300)) {
| 		printf (" on eisa slot %d\n",
| 			isdp->id_iobase >> 12);
| 	} else {
| 		printf (" on isa\n");
| 	}
| }

Based on info in "The undocumented PC" p.165
1995-02-25 18:29:10 +00:00
Stefan Eßer
781d9d4623 Keep PCI_CONF_MODE in a safe place for later reference, if #defined.
Reviewed by:	se
Submitted by:	seb@erix.ericsson.se (Sebastian Strollo)
1995-02-25 17:51:18 +00:00
Bruce Evans
7f3ae831f7 Submitted by: seb@erix.ericsson.se (Sebastian Strollo)
Remove over-cautious early fnop() synchronization.  It caused the probe to
hang on systems without an FPU.
1995-02-23 17:32:38 +00:00
David Greenman
68940ac1a0 Use of vm_allocate() and vm_deallocate() has been deprecated. 1995-02-20 22:23:31 +00:00
Bill Paul
188291d20f Do away with 'options SWAP_GENERIC' once and for all: I get ill
just thinking about it.

Two changes need to be made to allow 'config kernel swap generic' to
work properly without requiring any compile-time flags:

/usr/src/usr.sbin/config/mkswapconf.c: we need to define a dummy stub
for the setconf() function to replace the one in swapgeneric.c that
isn't available in non-generic configurations.

/usr/src/sys/i386/i386/autoconf.c: the -a boot flag causes setroot()
to be skipped and lets setconf() prompt the user for a root device.
If you skip setroot() in a non-generic kernel, you could get severely
hosed. To avoid this, we silently ignore the -a flag if rootdev != NODEV.
(rootdev is always initialized to NODEV in swapgeneric.c, so if
we find that rootdev is something other than NODEV, we know we're
not using a generic configuration.)
1995-02-18 18:05:35 +00:00
Bruce Evans
390784fbeb Undo the busy latch changes made in the previous revision. They broke
some 386/387 systems.

Don't print the IRQ number twice in the boot diagnostics.
1995-02-17 19:38:13 +00:00
Poul-Henning Kamp
648c711bb4 This is the latest version of the APM stuff from HOSOKAWA, I have looked
briefly over it, and see some serious architectural issues in this stuff.

On the other hand, I doubt that we will have any solution to these issues
before 2.1, so we might as well leave this in.

Most of the stuff is bracketed by #ifdef's so it shouldn't matter too much
in the normal case.

Reviewed by:	phk
Submitted by:	HOSOKAWA, Tatsumi <hosokawa@mt.cs.keio.ac.jp>
1995-02-17 02:22:57 +00:00
Bruce Evans
ceb91b3e4a Fix syntax errors in #ifdefed out code. 1995-02-16 13:21:47 +00:00
Joerg Wunsch
c851c2f0ea Include three lines about the pcvt console driver, so we don't ever need
a different config file for it.
1995-02-15 20:38:36 +00:00
David Greenman
919364ea6a Use proc0's proc struct rather than curproc's when calling sync. 1995-02-15 12:27:01 +00:00
David Greenman
7389231d06 Killed the pmap_use_pt and pmap_unuse_pt prototypes as they are now in
machine/pmap.h.
1995-02-15 04:36:31 +00:00
Søren Schmidt
1e1e0b4463 First attempt to run linux binaries. This is only the changes needed to
the generic kernel. The actual emulator is a separate LKM. (not finished
yet, sorry).
Submitted by:	sos@freebsd.org & sef@kithrup.com
1995-02-14 19:23:22 +00:00
Poul-Henning Kamp
ae4c9a0208 Removed a YF comment. 1995-02-14 18:01:24 +00:00
Poul-Henning Kamp
86ca01bcee Whoops! back out last commit partly. 1995-02-14 06:57:45 +00:00
Poul-Henning Kamp
b53d84607c YFfix. 1995-02-14 06:55:42 +00:00
Poul-Henning Kamp
f026fea644 susword -> systm.h 1995-02-14 06:51:31 +00:00
Poul-Henning Kamp
a3dbba7a60 Yves has sent us a ~600 Kb patch, which shuts up gcc entirely for the
entire kernel.
Unfortunately we didn't send him a copy of the style guide before he did it.
I'm trying to find all the benign and downright sound bits and will commit
them without any other explanation than "YF fix" if they are merely cosmetic.

Reviewed by:	phk
Submitted by:	yves@dutncp8.tn.tudelft.nl (Yves Fonk)
1995-02-14 06:00:17 +00:00
David Greenman
17703e4e91 Carefully choose the low limit for number of buffers to acheive the best
performance on small memory machines.
1995-02-12 09:21:04 +00:00
David Greenman
06031f1f3f Fixed a bogus comment and made a stylistic change (testl instead of orl
to test for zero).
1995-02-12 09:13:27 +00:00
Poul-Henning Kamp
499454c6e9 Intels App Note AP-485 applied.
We will now tell a good deal more about the CPU if Intel made it.

What is a i486DX2 Write-Back Enhanced CPU ?
1995-02-11 04:21:24 +00:00
David Greenman
459a929e36 Changed extended memory test so that it's non-destructive and not a
complete test (it never was "complete", which is why it was bogus). Now
only a single longword is checked in each page.
1995-02-10 07:44:03 +00:00
David Greenman
3c632e1f0c Removed obsolete and unused vmtime() function. 1995-02-10 07:17:46 +00:00
David Greenman
b1e4a738e0 Removed unnecessary check for pr_scale in the AST/OWEUPC case. 1995-02-10 06:43:47 +00:00
David Greenman
5a32829d98 Check P_PROFIL flag for profiling rather than pr_scale as it makes more
sense.
1995-02-10 06:25:14 +00:00
Stefan Eßer
6f22585dd4 Initialisation of interrupt masks changed.
Reviewed by:	se
Submitted by:	wolf (Wolfgang Stanglmeier)
1995-02-09 20:16:19 +00:00
Jordan K. Hubbard
11af896263 Add PPP to the generic kernel. Now that Poul has made us all this space,
maybe I can get us back into the slip/ppp game without having to tell users
to reconfigure their kernels all the time! :)
1995-02-09 11:21:07 +00:00
David Greenman
87bc4e696d Mostly cosmetic changes. Use KERNBASE instead of UPT_MAX_ADDRESS in
some comparisons as it is more correct (we want the kernel page tables
included).
Reorganized some of the expressions for efficiency.
Fixed the new pmap_prefault() routine - it would sometimes pick up the
wrong page if the page in the shadow was present but the page in object
was paged out. The routine remains unused and commented out, however.
Explicitly free zero reference count page tables (rather than waiting
for the pagedaemon to do it).

Submitted by:	John Dyson
1995-02-02 08:45:14 +00:00
Stefan Eßer
fe90a500af Reviewed by: se
Submitted by:	wolf (Wolfgang Stanglmeier)
PCI specific code moved to /sys/pci.
1995-02-01 23:11:38 +00:00
Stefan Eßer
ac19f91802 Reviewed by: se
Submitted by:	wolf (Wolfgang Stanglmeier)
New ISA dependend file for PCI bus support.
Replaces sys/i386/pci/pcibios.c.
1995-02-01 23:06:58 +00:00
Bruce Evans
15e633f0d9 Fix disassembly of `bt[crs] $Ib,E'. 1995-01-29 02:38:15 +00:00
Andreas Schulz
aa98692ffb Correct a name of one structure member in the sigaltstack structure.
Now it matches the man page and also the only other commercial implementation
i have found so far ( Solaris 2.x).
Changed the name from ss_base to ss_sp.
1995-01-29 01:19:25 +00:00
Jordan K. Hubbard
f1780a6c25 Add soundblaster CD to generic kernel. Hope this doesn't run us out
of space!
1995-01-28 05:01:43 +00:00
Poul-Henning Kamp
e05407d84b New and far better NCR5380/NCR53400 scsi-driver.
Handles at least Trantor T130 and ProAudioSpectrum adapters.
The pas driver has consequently been removed.
This driver can be configured without without interrupts.

Manpage to follow when PAS16 has been edited in.

Reviewed by:	phk
Submitted by:	Serge Vakulenko, <vak@cronyx.ru>
1995-01-27 07:49:19 +00:00
David Greenman
7a642ab589 Fix from Doug Rabson for a panic related to not initializing the kernel's
PTD.

Submitted by:	 John Dyson
1995-01-26 21:06:40 +00:00
Andrey A. Chernov
87fcda4634 Remove FAT_CURSOR, it is already non-existent during several
last syscons versions
1995-01-26 05:04:37 +00:00
David Greenman
d3a10e2cad Comment out pmap_prefault for the time being (perhaps until after 2.1).
The object_init_pt routine is still enabled and used, however, and this
is where most of the 'pre-faulting' performance improvement comes from.
1995-01-26 01:45:02 +00:00
David Greenman
3edf89fe83 Make sure that the pages being 'pre-faulted' are currently on a queue. 1995-01-26 00:55:03 +00:00
David Greenman
6100ed1d12 Be a bit less fast and loose about setting non-cacheablity of pages. 1995-01-25 22:06:23 +00:00
Bruce Evans
b5d89ca8ad Load the kernel symbol table in the boot loader and not at compile time.
(Boot with the -D flag if you want symbols.)

Make it easier to extend `struct bootinfo' without losing either forwards
or backwards compatibility.

ddb_aout.c:
Get the symbol table from wherever the loader put it.
Nuke db_symtab[SYMTAB_SPACE].

boot.c:
Enable loading of symbols.  Align them on a page boundary.  Add printfs
about the symbol table sizes.
Pass the memory sizes to the kernel.
Fix initialization of `unit' (it got moved out of the loop).
Fix adding the bss size (it got moved inside an ifdef).
Initialize serial port when RB_SERIAL is toggled on.
Fix comments.
Clean up formatting of recently added code.

io.c:
Clean up formatting of recently added code.

netboot/main.c, machdep.c, wd.c:
Change names of bootinfo fields.

LINT:
Nuke SYMTAB_SPACE.
Fix comment about DODUMP.

Makefile.i386:
Nuke use of dbsym.
Exclude gcc symbols from kernel unless compiling with -g.
Remove unused macro.
Fix comments and formatting.

genassym.c:
Generate defines for some new bootinfo fields.  Change names of old ones.

locore.s:
Copy only the valid part of the `struct bootinfo' passed by the loader.
Reserve space for symbol table, if any.

machdep.c:
Check the memory sizes passed by the loader, if any.  Don't use them yet.

bootinfo.h:
Add a size field so that we can resolve some mismatches between the loader
bootinfo and the kernel boot info.  The version number is not so good for
this because of historical botches and because it's harder to maintain.
Add memory size and symbol table fields.  Change the names of everything.

Hacks to save a few bytes:

asm.S, boot.c, boot2.S:
Replace `ouraddr' by `(BOOTSEG << 4)'.

boot.c:
Don't statically initialize `loadflags' to 0.  Disable the "REDUNDANT"
code that skips the BIOS variables.  Eliminate `total'.  Combine some
more printfs.

boot.h, disk.c, io.c, table.c:
Move all statically initialzed data to table.c.

io.c:
Don't put the A20 gate bits in a variable.
1995-01-25 21:40:47 +00:00
Jean-Marc Zucconi
3bc6bf1734 Changed address of the game controller to 0x201 (was 0x200)
joy.c: joystick driver
1995-01-25 20:11:51 +00:00
Paul Richards
94187a78bf is to lnc changes 1995-01-24 20:38:39 +00:00
David Greenman
fff3cea1a9 Moved various pmap 'bit' test/set functions back into real functions; gcc
generates better code at the expense of more of it.

Submitted by:	John Dyson
1995-01-24 09:57:39 +00:00
David Greenman
fbdfe8ac22 Changed buffer allocation policy (machdep.c)
Moved various pmap 'bit' test/set functions back into real functions; gcc
generates better code at the expense of more of it. (pmap.c)
Fixed a deadlock problem with pv entry allocations (pmap.c)
Added a new, optional function 'pmap_prefault' that does clustered page
table preloading (pmap.c)
Changed the way that page tables are held onto (trap.c).

Submitted by:	John Dyson
1995-01-24 09:56:33 +00:00
Bruce Evans
1a0518966d Don't use mi_switch() to terminate cpu_exit(). Calling it just happened to
work (mi_switch() counted the last timeslice again but this didn't affect
the exiting process' rusage because the rusage has already been finalized).

Remove stale comment.
1995-01-21 15:34:03 +00:00
Bruce Evans
cee6d3700d Remove unused definitions of vm statistics counters. Most of the
counting is now done in C.  There are still about 100 unused
definitions for other things.
1995-01-21 15:22:28 +00:00
Bruce Evans
e6891db8c5 Don't count context switches here, they are already counted in mi_switch(). 1995-01-21 15:20:23 +00:00
Andreas Schulz
c82762a9c3 Submitted by: Bruce Evans
Put in the much shorter and cleaner version for the calibrate_cycle_counter
for the Pentium that Bruce suggested. Tested here on my Pentium  and
it works okay.
1995-01-19 22:05:27 +00:00
Bruce Evans
2d2fb1bf6b The %eflags checking introduced in the previous commit was too zealous.
sigreturn() sometimes failed for ordinary returns from signal handlers.
Failures of ordinary returns "can't happen" and are badly handled.
"Temporary" fix: allow users to corrupt PSL_RF.  This is fairly
harmless.  A correct fix would involve saving the old %eflags (and
perhaps the old segment registers) where the user can't get at them.
1995-01-17 01:15:12 +00:00
David Greenman
7082ec8aa5 Fixed some page table reference count problems; these changes may not be
complete, but should be closer to correct than before.
1995-01-15 09:06:23 +00:00
Bruce Evans
20415301cd Fix security holes in sigreturn(), ptrace() and procfs. sigreturn()
attempted to check for insecure and fatal eflags and segment
selectors, but missed many cases and got the IOPL check back to
front.  The other syscalls didn't check at all.

sys_process.c, machdep.c:
Only allow PT_WRITE_U to write to the registers (ordinary and FP).

psl.h, locore.s, machdep.c:
Eliminate PSL_MBZ, PSL_MBO and PSL_USERCLR.  We are not supposed
to assume anything about the reserved bits.  Use PSL_USERCHANGE
and PSL_KERNEL instead.  Rename PSL_USERSET to PSL_USER.

exception.s:
Define a private label for use by doreti when returning to user
mode fails.

machdep.c:
In syscalls, allow changing only the eflags that can be changed on
486's in user mode (no longer attempt to allow benign IOPL changes;
allow changing the nasty PSL_NT; don't allow changing the i586
bits).

Don't attempt to check all the cases involving invalid selectors
and %eip's.  Just check for privilege violations and let the invalid
things cause a trap.

procfs_machdep.c:
Call the ptrace register functions to do all the work for reading
and writing ordinary registers and for single stepping.

trap.c:
Ignore traps caused by PSL_NT being set.  Previously, users could
cause a fatal trap in user mode by setting PSL_NT and executing an
iret, and a fatal trap in kernel mode by setting PSL_NT and making
a syscall.  PSL_NT was cleared too late and not in enough modes to
fix the problem.

Make all traps in user mode (except T_NMI) nonfatal.

Recover from traps caused by attempting to load invalid user
registers in doreti by restarting the traps so that they appear to
occur in user mode.
---

Fix bogons that I noticed while fixing the above:

psl.h:
Fix some comments.

Uniformize idempotency ifdef.

exception.s, machdep.c:
Remove rsvd[0-14].  rsvd0 hasn't been reserved since the 486 came
out.  Replace rsvd0 by `align'.  rsvd[0-11] used wrong (magic
non-unique) trap numbers.  Replace rsvd[1-14] by rsvd.

locore.s:
Enable alignment check flag on 486's and 586's.

machdep.c:
Use a better type for kstack[].

Use TFREGP() to find the registers.

Reformat ptrace functions from SEF to something closer to KNF.

procfs_machdep.c:
The wrong pointer to the registers got fixed as a side effect.

Implement reading and writing of FP registers.

/proc/*/*regs now work (only) for processes that are in memory.

Clean up comments.

trap.c, trap.h:
Remove unused trap types.
1995-01-14 13:20:26 +00:00
Jordan K. Hubbard
9949564470 Remove bogus scd0 driver - I should have looked at LINT first, anyway. 1995-01-14 10:48:56 +00:00
Bruce Evans
3117fbd98e Enable define of CR0_AM to prepare for implementing alignment checking.
Uniformize idempotency ifdef.
1995-01-14 10:44:55 +00:00
Bruce Evans
c277f99332 Declare a real `struct fpreg' to prepare for implementing reading and
writing of FP regs for procfs.

Uniformize idempotency ifdef.
1995-01-14 10:41:41 +00:00
Bruce Evans
1e1a3d012d Remove reference to impossible trap type T_KDBTRAP. We don't support
watchpoints.

Uniformize idempotency ifdef.
1995-01-14 10:34:52 +00:00
Bruce Evans
9bf308efab Eliminate T_KDBTRAP, which will soon go away. It was only used for an
unreachable case label in kdb_trap().

Use the correct case labels in kdb_trap() so that normal ddb entry doesn't
print a message.

Change all printf's to db_printf's.  Now you can put a breakpoint at printf,
and ddb entry messages don't spam the syslog output.

Cosmetic:

Use ISPL() instead of magic numbers.

Don't compile the unused function kdb_kbd_trap().

Improve some asms.

Print the arg to Debugger().
1995-01-14 10:24:48 +00:00