Commit Graph

598 Commits

Author SHA1 Message Date
Poul-Henning Kamp
b59d7f4673 A mixed bag of changes, relating to getting the state in "lsdev" right,
and pccard support to work sensibly.  Better by far, but still not good.
1995-10-21 00:55:36 +00:00
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