Commit Graph

478 Commits

Author SHA1 Message Date
Poul-Henning Kamp
a12dee4de7 Cosmetics. Added a prototype. 1994-10-10 01:06:48 +00:00
Søren Schmidt
c96f129304 Updated to convert errno return in syscall if conversion tabel present. 1994-10-09 22:02:06 +00:00
David Greenman
35c10d2239 Got rid of map.h. It's a leftover from the rmap code, and we use rlists.
Changed swapmap into swaplist.
1994-10-09 07:35:18 +00:00
Poul-Henning Kamp
82b695b22d A couple of prototypes moved out from here. 1994-10-08 22:27:58 +00:00
Poul-Henning Kamp
50a1a05445 Added prototypes. 1994-10-08 22:21:34 +00:00
Poul-Henning Kamp
3fb3086e98 db_disasm.c: Unused var zapped.
pmap.c: tons of unused vars zapped, various other warnings silenced.
trap.c: unused vars zapped.
vm_machdep.c:  A wrong argument, which by chance did the right thing, was
corrected.
1994-10-08 22:19:51 +00:00
Rodney W. Grimes
80fb3d79f6 Correct #ifdef for nfs_disless support is #ifdef NFS, there will be no
option DISKLESS for the 2.0 nfs diskless support.   A 2.0 diskless kernel
simple needs NFS linked in statically.
1994-10-08 06:20:52 +00:00
David Greenman
f8f472c265 #ifdef DISKLESS the copying of the nfs_diskless structure. Not the best
solution, but the only one I have time for at the moment.
1994-10-07 05:45:27 +00:00
Rodney W. Grimes
0b62704dc3 1. Eliminate unused esym global from locore, our boot code never supported
that and when it does it will be done differently.

2.  The kernel now does a frame setup on entry so it ``looks'' like a
    real function call.  This will be needed by future boot code and
    debuggers.

3.  Clean up stack offsets to all be in decimal and use %ebp when copying
    parameters in from the boot code.

4.  Implement version 1 of the uniform boot code passing mechanism with
    support for kernelname passing and nfs_diskless structure passing.

5.  Document the 3 different ways the kernel is called depending on what code
    is calling it.
1994-10-06 09:22:47 +00:00
Andrey A. Chernov
03e4d516a4 Add code to handle CPU_DISRTCSET 1994-10-04 18:44:21 +00:00
Andrey A. Chernov
fd34b8e78c Add disable_rtc_set variable to block resettodr() call, needed for
adjkerntz -i, per Bruce suggestion
1994-10-04 18:39:10 +00:00
Andrey A. Chernov
f80d8a2e88 CPU_DISRTCSET added to disable resettodr(), needed in adjkerntz -i,
per Bruce suggestion
1994-10-04 18:25:51 +00:00
Andrey A. Chernov
3bbe7b72df RTC_CENTURY usage ifdefed out by USE_RTC_CENTURY compile option,
pointed by Bruce
1994-10-04 13:59:44 +00:00
Poul-Henning Kamp
45a0b89468 Avoid ddb getting a panic if the code-segment isn't the usual one... 1994-10-02 19:36:30 +00:00
David Greenman
336f97b7ad Patch from HOSOKAWA Tatsumi to fix bug in the size of apm_current_gdt_pdesc
Submitted by:	HOSOKAWA Tatsumi
1994-10-02 18:57:15 +00:00
Poul-Henning Kamp
abd358cd49 apm_bios.h: removed the equiv-stuff. Not needed now that the kernel module
works correctly.

clock.h & reg.h: prototypes.
1994-10-02 17:31:29 +00:00
Poul-Henning Kamp
01d0532b97 Unused variables, except one with a omnious comment. 1994-10-02 17:29:51 +00:00
Rodney W. Grimes
4c61f5466f If you are building a kernel without NFS statically linked in you
must #define NFS before including <sys/mount.h> to pick up some of
the definitions needed for struct diskless.  Be sure to undef it after this
so you do not effect other code.

This is kinda sick, but it does the job.  Problem found by davidg.
1994-10-02 07:19:43 +00:00
David Greenman
7216391e49 "idle priority" support. Based on code from Henrik Vestergaard Draboel,
but substantially rewritten by me.
1994-10-02 04:48:21 +00:00
Rodney W. Grimes
21abf3d3ce 1. Remove all references to cyloffset, it has been unused for some time.
2.  New detection code so we know what boot code called us.

3.  Remove old DISKLESS support code and halt if we are called by that boot
    code as it will NOT work with the new nfs_diskless structure.

This is really in preperation for new boot code and new diskless support.

Reviewed by:	davidg
1994-10-02 01:32:53 +00:00
Rodney W. Grimes
723b616383 Add code to generate NFSDISKLESS_SIZE for use in locore for copying the
nfs_diskless structure in from the boot code.
Reviewed by:	davidg
1994-10-02 01:28:38 +00:00
David Greenman
22414e535a Laptop Advanced Power Management support by HOSOKAWA Tatsumi.
Submitted by:	HOSOKAWA Tatsumi
1994-10-01 02:56:21 +00:00
Steven Wallace
085d9ce09a Add #ifndef ALLOW_CONFLICT_IRQ
Reviewed by:	jkh
1994-09-30 05:35:55 +00:00
Søren Schmidt
336abda6cd Updated pcaudio.c to latest from 1.1.5.1
Enabled timer reprogramming in clock.c (this could use more work).

Obtained from: FreeBSD-1.1.5.1
1994-09-29 08:24:45 +00:00
Bruce Evans
e04520cef3 Ensure normal selection and alignment of the text and data sections before
including files.  vector.s sometimes left the data section misaligned
(depending on the configuration) so all the time-critical globals in icu.s
were sometimes misaligned.
1994-09-28 03:37:49 +00:00
Paul Traina
d43f5ad71e Make Cyrix CPU flush internal cache any time it goes into hold state.
(Meant to commit this a long time ago... oh well).
1994-09-26 16:56:22 +00:00
David Greenman
7bfaa9cdaf Inlined ins/outs functions.
Obtained from:	NetBSD
1994-09-25 21:31:55 +00:00
David Greenman
d5c97aea74 Undo last change: the ins/outs functions DO NOT return a pointer! 1994-09-25 20:03:41 +00:00
Poul-Henning Kamp
bb56ec4a05 While in the real world, I had a bad case of being swapped out for a lot of
cycles.  While waiting there I added a lot of the extra ()'s I have, (I have
never used LISP to any extent).  So I compiled the kernel with -Wall and
shut up a lot of "suggest you add ()'s", removed a bunch of unused var's
and added a couple of declarations here and there.  Having a lap-top is
highly recommended.  My kernel still runs, yell at me if you kernel breaks.
1994-09-25 19:34:02 +00:00
David Greenman
bc6d744470 Shuffled macros and definitions around to facilitate architecture
independance.
1994-09-24 21:37:01 +00:00
David Greenman
5a8420c53e Nuked splnet before sync. Not only is this unnecessary, but it appears
to cause problems by making it impossible to sync NFS related buffers
when rebooting.
1994-09-24 12:22:47 +00:00
David Greenman
a6cd0a2477 Increased SHMMAXPGS from 512 to 1024 now that there is plenty of kernel
virtual memory.
1994-09-23 07:00:12 +00:00
David Greenman
6ce81dd1b2 From 1.1.5:
>revision 1.8
>date: 1994/06/03 06:42:30;  author: davidg;  state: Exp;  lines: +2 -2
>Patch from Bruce Evans: npxintr() needs to mask softclock().
1994-09-22 14:44:16 +00:00
Bruce Evans
8793135f2d Don't provide bogus source operands in some asms. This probably shouldn't
matter, but similar bogusness in npx.c causes compiling without -O to fail.

Use __volatile in all asms.

Parenthesize macro args.

Change the names of the macros to avoid namespace pollution.

Remove unnecessary "#ifdef __i386__".

Sort #defines.

Add comments.
1994-09-20 22:26:37 +00:00
Bruce Evans
38a03467df Don't supply the `usermode' arg to softclock(). The 2.0 softclock() doesn't
take an arg.
1994-09-20 21:35:49 +00:00
Bruce Evans
7fecb8e845 Don't lose the RTC interrupt in resettodr(). 1994-09-20 21:20:46 +00:00
Bruce Evans
2b3d0249bd Remove the alias splnone() for spl0(). It was used only once. 1994-09-20 05:07:32 +00:00
Andrey A. Chernov
e79033e4cf resettodr() now exists, enable it 1994-09-20 00:32:40 +00:00
Andrey A. Chernov
7b915aa631 resettodr() implemented, inittodr() fixed
Submitted by: me & chris@gnome.co.uk
1994-09-20 00:31:07 +00:00
Bruce Evans
8ebeb948c5 The previous revision got the wrong log message (for clock.c). It should
have got the following:

Back out the changes in the previous revision.  Function-like macros
were replaced by compound statements that work in less contexts.

Unoformize idempotency #ifdef.
1994-09-18 23:18:32 +00:00
Bruce Evans
eb51e37703 Remove some unnecessary #includes.
Restore the simple leap year calculation as a macro and document it so
that it doesn't become complicated again.  The simple version works
for all leap years covered by 32-bit time_t's.  The complicated version
doesn't work for all leap years covered by 64-bit time_t's since among
other reasons, the solar system is not stable for long enough.

Fix declarations.

Nuke spinwait().
1994-09-18 23:08:56 +00:00
Bruce Evans
e4b7e53da8 Clean up #includes. <machine/spl.h> has to be included by almost everything
in case an spl inline is used, so this is not the place to include it.

Uniformize idempotency #ifdef.
1994-09-18 21:37:56 +00:00
Garrett Wollman
3f31c649d1 Redo Kernel NTP PLL support, kernel side.
This code is mostly taken from the 1.1 port (which was in turn taken from
Dave Mills's kern.tar.Z example).  A few significant differences:

1) ntp_gettime() is now a MIB variable rather than a system call.  A few
fiddles are done in libc to make it behave the same.

2) mono_time does not participate in the PLL adjustments.

3) A new interface has been defined (in <machine/clock.h>) for doing
possibly machine-dependent things around the time of the clock update.
This is used in Pentium kernels to disable interrupts, set `time', and
reset the CPU cycle counter as quickly as possible to avoid jitter in
microtime().  Measurements show an apparent resolution of a bit more than
8.14usec, which is reasonable given system-call overhead.
1994-09-18 20:40:01 +00:00
David Greenman
df9ab3049d Removed inclusion of pio.h and cpufunc.h (cpufunc.h is included from
systm.h). Merged functionality of pio.h into cpufunc.h. Cleaned up some
related code.
1994-09-16 13:33:56 +00:00
Jordan K. Hubbard
f6e8d525a8 Deal with outw being defined - the declaration clashes. 1994-09-16 11:22:33 +00:00
Poul-Henning Kamp
fe95e21fed Made the kernel compile even without "ether". 1994-09-16 05:47:06 +00:00
Andrey A. Chernov
dd067f0809 CPU_ADJKERNTZ added for resettodtr() 1994-09-16 01:05:24 +00:00
Andrey A. Chernov
3826e6e5f0 CPU_ADJKERNTZ added to cpu_sysctl 1994-09-16 01:00:38 +00:00
Paul Richards
e69c40d865 Include pio.h so that all those drivers that only include cpufunc.h
get the faster io macros/inline code rather than call the routines
in support.s

This whole area needs some going over.....
1994-09-15 17:55:47 +00:00
Paul Richards
ff89e6613e Removed some macros that are now in cpufunc.h
Reviewed by:	Bruce
1994-09-15 16:32:07 +00:00
Paul Richards
8db02de884 Added MCOUNT_ENTER and MCOUNT_EXIT macros to profile.h
Removed inb function since it's more correctly in pio.h

Copied write_eflags and read_eflags over from npx.c

(Some changes to the macros suggested by Bruce were not made at this
time since his suggestions probably apply to all the macros and
these inlined/macro definitions need a lot of cleaning up at some
point in the future.)

Reviewed by:	Bruce
1994-09-15 16:27:14 +00:00
David Greenman
ab443e53b6 Brought over from 1.1.5:
From Bruce Evans:
Protect against reentering Debugger().
1994-09-15 11:38:59 +00:00
David Greenman
3443a7b245 Brought over from 1.1.5:
Fix from Bruce Evans. There were missing sets of parantheses:

1. The checks for the standard data selectors were botched, so %ss == 0
   and probably %cs == 0 were allowed.  A fix is enclosed.  The checks
   for the standard selectors could be omitted without losing anything
   since the standard selectors pass the valid_ldt_sel() tests.
1994-09-15 10:52:46 +00:00
Søren Schmidt
4f683116b4 Added support for many more videomodes, including graphic modes up til
320x200 256col VGA. This is nessesary for the iBCS stuff to work right.
(And we get the benefit of more video modes). Uses the videocard BIOS
to optain mode tables.
Added a "green" saver, switches off the syncs for "green" monitors.

Reviewed by:
Submitted by:
Obtained from:
1994-09-15 07:26:40 +00:00
Garrett Wollman
82a2eb57c0 Beginnings of support for loadable protocol domains. In particular,
don't hard-code netisr values in icu.s, but rather, use an array of
function pointers and set them all up in machdep.c for statically-linked
protocol families.  (This will eventually be done differently.)
1994-09-14 23:56:08 +00:00
Andrey A. Chernov
82a4cf2359 1. adjkerntz variable added for preparation to resettodr() implementation
2. Leap year calculations fixed
1994-09-14 23:09:06 +00:00
Poul-Henning Kamp
70fd1674ef Reversed my patch from yesterday. "eisa" if >= 0x1000.
pas0 will be in "eisa", even though it isn't.
1994-09-13 17:06:47 +00:00
Poul-Henning Kamp
1b4997efff Only say eisa if ((ioaddr & 0xfff) >= 0x400) 1994-09-13 06:43:57 +00:00
David Greenman
cde7257454 Eliminated a whole pile of ancient (we're taking 4.3BSD) VM system
related #define constants. Corrected incorrect VM_MAX_KERNEL_ADDRESS.

Reviewed by:	John Dyson
1994-09-12 11:38:31 +00:00
David Greenman
f7d6afc696 Be more careful about dereferencing curproc, p_vmspace, and curpcb,
otherwise the machine will overflow the stack in a recursive fault loop
(causing the machine to spontaneously reboot because of the stack fault
that ultimately happens).

Submitted by:	Inspired by Bruce Evans, but this change is different
		than what he suggested.
1994-09-11 11:26:18 +00:00
Garrett Wollman
501c23938c Define new MIB variable, hw.floatingpoint, which is true if FP hardware
is present, and false if an emulator is being used.
1994-09-09 23:13:03 +00:00
Bruce Evans
ab9678ac9d Get all the definitions from DEFS.h and not directly from asmacros.h
if KERNEL is not defined.  lib/msun/i387/*.S include asmacros.h to
get the definitions of ENTRY(), etc.  This is bogus since asmacros.h
is only supposed to give definitions suitable for the kernel.  The
current definitions for the kernel almost worked but are missing
the ".type" declarations.  This caused the linker to print warnings
about doubtful relocations for almost anything linked to libm[sun].

Uniformize name and use of idempotence identifier.
1994-09-08 12:25:18 +00:00
Bruce Evans
fe7bb84c74 Remove <machine/eflags.h> and all dependencies on it. eflags.h is just
the Mach/i386 version of the BSD/vax(?) <machine/psl.h>.  The Mach
version has slightly better names for many macros but is now out of
date and little used.  It was originally used even less (for spelling
PSL_T as EFL_TF in <machine/db_machdep.h>).
1994-09-08 11:49:04 +00:00
Bruce Evans
350ce31055 Fix comments. 1994-09-05 14:09:41 +00:00
David Greenman
426c995032 DOn't allow I/O register access in process 1 (oops). 1994-09-05 05:20:29 +00:00
David Greenman
654f13335e Improved some comments. 1994-09-04 23:10:27 +00:00
Paul Traina
c784172318 Detect if we're running on a Cyrix 486DLC and enable automatic cache
negation whenever we access memory between 640k and 1M.

Original code from NetBSD 1.0-BETA.  The exact origins are unclear but
Theo de Raadt, Charles, and Michael V. may have contributed to it.

Submitted by:	pst
1994-09-04 19:59:24 +00:00
David Greenman
7a5f7b0656 Rewrote last vestige of code that used gs (copyinstr). The use of gs in
this routine caused problems for machines that don't set it up properly
before boot (such was the case on an EVEREX machine sitting next to me).
1994-09-04 10:24:22 +00:00
David Greenman
9cbeeedde3 Added pmap_mapdev() function to map device memory. 1994-09-04 04:11:57 +00:00
David Greenman
5c06a7a368 Initialize eflags register - brought over from 1.1.5. 1994-09-04 00:33:00 +00:00
Andreas Schulz
3d76654d68 Reviewed by:
Submitted by:
1) if_ie.c:
	Changed a printf and put a space in it. Formerly the "<3C507>"
	confused the syslog. He tried to see that as the priority to
	log that message.

2) isa_device.h:
	Changed the iobase variable from short to u_short. EISA
	Adresses can go up to 0xf000 and the sign extension doesn't
	look good in the probe output. Example:
	ep1 at 0xffff8000-0xffff8000f is not good :-), i like more a
	ep1 at 0x8000-0x8000f.

3) isa.c:
	Changed a string constant from "probe" to "prob", it gets
	later already an "ed" tagged on the end.
1994-09-02 22:13:34 +00:00
David Greenman
35aee0800d Converted P_LINK -> P_FORW, P_RLINK -> P_BACK, minor optimization. 1994-09-02 05:58:51 +00:00
David Greenman
2c7a40c7ca Removed all vestiges of tlbflush(). Replaced them with calls to pmap_update().
Made pmap_update an inline assembly function.
1994-09-02 04:12:26 +00:00
David Greenman
9ee9202471 It's not necessary to make page tables write-through, so get rid of this
(this was an experimental change which probably shouldn't have been
committed). I/O pages are still marked non-cacheable, however.
1994-09-02 01:29:20 +00:00
David Greenman
e8fb0b2c17 Realtime priority scheduling support.
Submitted by:	Henrik Vestergaard Draboel
1994-09-01 05:12:53 +00:00
David Greenman
431be400a7 Got rid of some old, unused junk. 1994-09-01 03:16:40 +00:00
Stefan Eßer
2b9fc9390f Reviewed by: Stefan Esser <se>
Submitted by:	Wolfgang Stanglmeier <wolf@dentaro.GUN.de>
Added PCI support (call of pci_config(), if NPCI > 0).
1994-08-31 23:36:56 +00:00
David Greenman
ac47fce534 Fixed bug that surfaced with last commit for NOBOUNCE -> BOUNCE_BUFFERS by
adding appropriate #ifdefs and changing some variables to externs (as they
should have always been).
1994-08-31 15:55:29 +00:00
David Greenman
9aba88bf29 Rather than exclude bounce buffers support with NOBOUNCE, include it
with BOUNCE_BUFFERS. This is more intuitive, and is better for future
multiplatform support. Added BOUNCE_BUFFERS option to the GENERIC and
LINT kernel config files.
1994-08-31 06:17:49 +00:00
Bruce Evans
8fdce837c3 Don't define LOCORE (as nothing) in sources. It is now defined
consistently (as 1) in Makefile.i386 for all assembler sources.
1994-08-30 17:19:10 +00:00
Andrey A. Chernov
0e91a83462 Fake floppy partition RAW_PART=2 now 1994-08-29 21:47:11 +00:00
Bruce Evans
406d45e059 Don't test if a u_int is < 0. The remaining test is sufficient and the
extra one caused a warning.
1994-08-28 16:16:33 +00:00
David Greenman
8a129caed5 1) Changed ddb into a option rather than a pseudo-device (use options DDB
in your kernel config now).
2) Added ps ddb function from 1.1.5. Cleaned it up a bit and moved into its
   own file.
3) Added \r handing in db_printf.
4) Added missing memory usage stats to statclock().
5) Added dummy function to pseudo_set so it will be emitted if there
   are no other pseudo declarations.
1994-08-27 16:14:39 +00:00
Søren Schmidt
f3f0ca6051 Changes preparing for iBCS support
Reviewed by:
Submitted by:
1994-08-24 11:52:21 +00:00
Søren Schmidt
25ae122558 Changes preparing for iBCS2 support
Reviewed by:
Submitted by:
1994-08-24 11:45:19 +00:00
David Greenman
329b62ac1c Corrected some comments regarding ptes/pdes. 1994-08-23 16:27:15 +00:00
Paul Richards
d184e84f7e Re-enabled inlining of inb.
Changed u_int_inb to just inb and deleted define.

The code generated is identical to that generated with the cast so
the problem was obviously fixed at some point after gcc 1.4

Reviewed by:
Submitted by:
1994-08-23 13:41:37 +00:00
Paul Richards
bffa0592e2 I've disabled this piece of code since it's what's
hosing syscons. Doesn anyone know anything about this
or can we just delete it now?

/*
 * This roundabout method of returning a u_char helps stop gcc-1.40 from
 * generating unnecessary movzbl's.
 */
#ifdef disable_for_gcc-2_6_0
#define inb(port)       ((u_char) u_int_inb(port))
#endif

static inline u_int
u_int_inb(u_int port)
{
        u_char  data;
        /*
         * We use %%dx and not %1 here because i/o is done at %dx and
not at
         * %edx, while gcc-2.2.2 generates inferior code (movw instead
of movl)
         * if we tell it to load (u_short) port.
         */
        __asm __volatile("inb %%dx,%0" : "=a" (data) : "d" (port));
        return data;
}

Reviewed by:
Submitted by:
1994-08-23 11:57:19 +00:00
Bruce Evans
1353e8ff44 Pad `_cpu_vendor' to finish on a 32-bit boundary so that most of the
locore globals aren't misaligned.
1994-08-22 14:28:57 +00:00
Paul Richards
836dc83b6a Made idempotent.
Reviewed by:
Submitted by:
1994-08-21 04:55:31 +00:00
David Greenman
e0e9c42112 Implemented filesystem clean bit via:
machdep.c:
	Changed printf's a little and call vfs_unmountall() if the sync was
	successful.

cd9660_vfsops.c, ffs_vfsops.c, nfs_vfsops.c, lfs_vfsops.c:
	Allow dismount of root FS. It is now disallowed at a higher level.

vfs_conf.c:
	Removed unused rootfs global.

vfs_subr.c:
	Added new routines vfs_unmountall and vfs_unmountroot. Filesystems
	are now dismounted if the machine is properly rebooted.

ffs_vfsops.c:
	Toggle clean bit at the appropriate places. Print warning if an
	unclean FS is mounted.

ffs_vfsops.c, lfs_vfsops.c:
	Fix bug in selecting proper flags for VOP_CLOSE().

vfs_syscalls.c:
	Disallow dismounting root FS via umount syscall.
1994-08-20 16:03:26 +00:00
David Greenman
27774cbbf4 Removed bogus save of CMAP2. 1994-08-19 22:49:42 +00:00
David Greenman
3edb235c09 Terry Lambert's loadable kernel module support w/improvements from the
NetBSD group.
1994-08-19 11:45:29 +00:00
Jordan K. Hubbard
6605d9f3db 1. Make this idempotent.
2. Hack.

	Hack is to define RCSID() to null macro so that new msun stuff
	will compile.  This does NOT belong here, and I DON'T want it to
	stay, I just need to put this here for now to enable msun and we need
	to talk about what our RCSID story is supposed to be.  We talked about
	supporting RCSID() one day, and everyone seemed to like the idea
	reasonably well of making it a macro you could just no-op this way,
	but we never did anything.  Now I see that JTCs code has it and I'm
	loath to remove it or do anything until we've discussed it some more.

	Well, so how about it?  What's our story vis-a-vis RCSID() going to
	be?

Submitted by:	jkh
1994-08-19 11:20:11 +00:00
Garrett Wollman
f23b4c91c4 Fix up some sloppy coding practices:
- Delete redundant declarations.
- Add -Wredundant-declarations to Makefile.i386 so they don't come back.
- Delete sloppy COMMON-style declarations of uninitialized data in
  header files.
- Add a few prototypes.
- Clean up warnings resulting from the above.

NB: ioconf.c will still generate a redundant-declaration warning, which
is unavoidable unless somebody volunteers to make `config' smarter.
1994-08-18 22:36:09 +00:00
David Greenman
8912c0ed61 Bruce Evans' dynamic interrupt support.
/usr/src/sys/i386/isa/clock.c:
	o Garrett's statclock changes.
	o Wire xxxintr, not Vclk.
	o Wire using register_intr(), not setidt().

/usr/src/sys/i386/isa/icu.s:
	o Garrett's statclock changes.
	o Removed unused variable high_imask.
	o Fake int 8 for rtc as well as int 0 for clk.  Required for kernel
	  profiling with statclock, harmless otherwise.

/usr/src/sys/i386/isa/isa.c:
	o Allow isdp->id_irq and other things in *isdp to be changed by
	  probes.  Changing interrupts later requires direct calls to
	  register_intr() and unregister_intr() and more care.
	  ALLOW_CONFLICT_* is brought over from 1.1.5, except
	  ALLOW_CONFLICT_IRQ is not supported.  IRQ conflict checking is
	  delayed until after probing so that drivers can change the IRQ
	  to a free one; real conflicts require more cooperation between
	  drivers to handle.
	o Too many details to list.
	o This file requires splitting and a lot more work.

/usr/src/sys/i386/isa/isa_device.h:
	o Declare more things more completely.

/usr/src/sys/i386/isa/sio.c:
	o Prepare to register interrupt handlers as fast.

/usr/src/sys/i386/isa/vector.s:
	o Generate entry code for 16 fast interrupt handlers and 16 normal
	  interrupt handlers.  Changed some constants to variables:
	  # $unit is now intr_unit[intr].  Type is int.  Someday it should
	    be a cookie suitable for the handler (e.g., a struct com_s for
	    sio).
	  # $handler is now intr_handler[intr].
	  # intrcnt_actv[id_num] is now *intr_countp[intr].  The indirection
	    is required to get a contiguous range of counters for vmstat
	    and so that the drivers depend more in the driver than on the
	    interrupt number (drivers could take turns using an interrupt
	    and the counts would remain correct).  There is a separate
	    counter for each device and for each stray interrupt.  In
	    1.1.5, stray interrupt 7 clobbers the count for device 7 or
	    something worse if there is no device 7 :-(.
	  # mask is now intr_mask[intr] (was already indirect).
	 o Entry points are now _XintrI and _XfastintrI (I = intr = 0-15),
	   not _VdevU (U = unit).
	 o Removed BUILD_VECTORS stuff.  There's a trace of it left for
	   the string table for vmstat but config now generates the
	   string in one piece because nothing more is required.
	 o Removed old handling of stray interrupts and older comments
	   about it.

Submitted by:	 Bruce Evans
1994-08-18 05:09:36 +00:00
Garrett Wollman
8ea838500f Enable use of the RTC chip for the statistical clock. While this does
not provide the full accuracy of a randomized statistical clock, it does
provide greater accuracy than the previous method, while not significantly
increasing overhead.  It also provides profiling support at 1024 Hz.

You must re-compile config before making a new kernel, or you will end
up with unresolved symbols.

Reviewed uy:	Bruce evans said it worked for him.
1994-08-15 03:15:20 +00:00
Andreas Schulz
021d975d03 Submitted by: Bruce Evans
Delete the ifdef GPL_EMULATE case here and made the padding work for
both types of emulators so that there is no longer a need to compile
ps and friends new if you are using the GPL math emulator instead the
normal one.
1994-08-14 23:32:45 +00:00
David Greenman
0e42760866 Made the kernel compile cleanly with gcc 2.6.0. Thanks go to Bruce
Evans for suggesting a method to detect various versions of gcc.
1994-08-13 14:21:58 +00:00
Garrett Wollman
f540b1065a Change all #includes to follow the current Berkeley style. Some of these
``changes'' are actually not changes at all, but CVS sometimes has trouble
telling the difference.

This also includes support for second-directory compiles.  This is not
quite complete yet, as `config' doesn't yet do the right thing.  You can
still make it work trivially, however, by doing the following:

rm /sys/compile
mkdir /usr/obj/sys/compile
ln -s M-. /sys/compile
cd /sys/i386/conf
config MYKERNEL
cd ../../compile/MYKERNEL
ln -s /sys @
rm machine
ln -s @/i386/include machine
make depend
make
1994-08-13 03:50:34 +00:00
Jordan K. Hubbard
f9f0c18d31 Change outb() as per Bruce's instructions so that it doesn't explicitly
try to pass its argument in the ax register.
Reviewed by:
Submitted by:
1994-08-11 02:26:08 +00:00
Garrett Wollman
fba73571bd For Pentium machines, use a faster version of microtime with 8 usec
resolution (can probably be improved somewhat).  Other machines take
a three-instruction hit if I586_CPU is defined, none otherwise.
1994-08-11 00:28:24 +00:00
Garrett Wollman
a4f90f4d45 Tell Pentium users their CPU speed. (More changes to make use of this
to come later.)
1994-08-10 23:28:33 +00:00
Garrett Wollman
5c8b38d41d Handle NMI's in accordance with data in van Gilluwe book. 1994-08-10 04:39:52 +00:00
Garrett Wollman
2e0cc1821d Some programs (like GNU configure programs) depend on the output of
`uname -s' to be something reasonable (traditionally, `i386') rather
than `PC-Class'.  Make it so.
1994-08-10 03:53:33 +00:00
Garrett Wollman
29c0a86011 Add back in CPU detection copde from 1.1.5. As an added bonus, the
hw.model MIB variable is now declared correctly.
1994-08-10 03:51:18 +00:00
Jordan K. Hubbard
52cd438439 Merge in the necessary bits from 1.1.5.1 to make exec.h and reloc.h
happy campers again (e.g. match our own exec format).  This should
make ld happy.
Submitted by:	jkh
1994-08-09 14:39:57 +00:00
David Greenman
95b671fc95 Removed ntohl and ntohs functions. These were already inlined assembly in
endian.h.
1994-08-09 11:21:44 +00:00
David Greenman
8339815ff9 Made pmap_kenter "TLB safe". ...and then removed all the pmap_updates that
are no longer needed because of this.
1994-08-07 14:53:27 +00:00
David Greenman
a481f20029 Provide support for upcoming merged VM/buffer cache, and fixed a few bugs
that haven't appeared to manifest themselves (yet).

Submitted by:	John Dyson
1994-08-07 13:10:43 +00:00
David Greenman
c564966bf0 Don't kremove process VM pages (oops!). This was the cause of the instability
that was introduced last night.

Submitted by:	 John Dyson
1994-08-07 03:31:52 +00:00
David Greenman
c87801fe54 Fixed various prototype problems with the pmap functions and the subsequent
problems that fixing them caused.
1994-08-06 10:25:50 +00:00
David Greenman
ae92ea446f Incorporated 1.1.5 improvements to the bounce buffer code (i.e. make it
actually work), and additionally improved it's performance via new pmap
routines and "pbuf" allocation policy.

Submitted by:	John Dyson
1994-08-06 09:20:56 +00:00
David Greenman
ed3f895438 Made the tmpstk start at tmpstk. Not doing so causes problems for the
debugger.

Submitted by:	John Dyson
1994-08-06 09:17:44 +00:00
David Greenman
16f62314cd Incorporated post 1.1.5 work from John Dyson. This includes performance
improvements via the new routines pmap_qenter/pmap_qremove and pmap_kenter/
pmap_kremove. These routine allow fast mapping of pages for those
architectures that have "normal" MMUs. Also included is a fix to the
pageout daemon to properly check a queue end condition.

Submitted by:	John Dyson
1994-08-06 09:15:42 +00:00
Garrett Wollman
f5c789f5a9 Delete redundant #ifdef __i386__, be consistent about idempotency
protection.

Submitted by:	Bruce Evans
1994-08-05 14:36:04 +00:00
David Greenman
86cadec5dc Added assembly versions of ffs() and bcmp(). 1994-08-04 19:51:01 +00:00
David Greenman
ee06dc6013 Inlined insque and remque. 1994-08-04 19:46:57 +00:00
Garrett Wollman
50f44fa07d Move ieeefp.h over, and put it in the correct subdirectory this time.
Submitted by:	Andrew Moore
1994-08-04 19:16:37 +00:00
David Greenman
15e1ca20e4 Nuked #if 0'd _insque and _remque routines - they are now inlined in
cpufunc.h.
1994-08-04 06:10:27 +00:00
David Greenman
d23d07ef95 Merged in post-1.1.5 work done by myself and John Dyson. This includes:
me:
1) TLB flush optimization that effectively eliminates half of all of the
   TLB flushes. This works by only flushing the TLB when a page is "present"
   in memory (i.e. the valid bit is set in the page table entry). See section
   5.3.5 of the Intel 386 Programmer's Reference Manual.
2) The handling of "CMAP" has been improved to catch attempts at multiple
   simultaneous use.

John:
1) Added pmap_qenter/pmap_qremove functions for fast mapping of pages into
   the kernel. This is for future optimizations and support for the upcoming
   merged VM/buffer cache.

Reviewed by:	John Dyson
1994-08-03 02:45:30 +00:00
David Greenman
3c4dd3568f Added $Id$ 1994-08-02 07:55:43 +00:00
David Greenman
03e6c2532f Removed all code related to the pagescan daemon, and changed 'act_count'
adjustments to compensate for a world without the pagescan daemon.
1994-08-01 11:25:45 +00:00
David Greenman
600f527fc6 Fix from Bruce Evans:
Set npx_exists = 0 in the case of broken error reporting.
1994-06-11 05:17:15 +00:00
David Greenman
8c481329f7 Fixed minor spelling error. 1994-06-11 05:13:33 +00:00
David Greenman
e2a2a04ad3 Bruce found a bug in my changes to stop using the gs selector.
From Bruce Evans:

fu[i]byte() checked the wrong register.  This caused interesting behaviour
in the GPL math emulator.  The emulator does not check the values returned
by fu*() or su*() (:-() and it interpreted the address of -12(%ebp) as
-1(%ebp).  The same probably occurs for all signed 8-bit offsets from
registers.

I cleaned up the new bzero() a bit.
1994-06-11 05:12:15 +00:00
David Greenman
667f0edb2b Added some missing cld's (OOPS!) and changed the position of some of
the others to make them easier to spot.
1994-06-06 15:08:51 +00:00
David Greenman
3c256f5395 trap.c:
Vastly improved trap.c from me. This rewritten version has a variety of
features, amoung them: higher performance and much higher code quality.

support.s, cpufunc.h:
No longer use gs override to enforce range limits - compare directly
against VM_MAXUSER_ADDRESS instead. The old way caused problems in
preserving the gs selector...and this method is just as fast or faster.
1994-06-06 14:54:41 +00:00
David Greenman
2e4fabc7c7 Back out previous change for the moment - I need to commit some other
changes first.
1994-06-06 14:23:49 +00:00
David Greenman
baa2452312 Added some missing cld's (OOPS!) and changed the position of some of
the others to make them easier to spot.
1994-06-06 14:12:50 +00:00
David Greenman
8b7da9b52b Removed extra (bogus) declaration of Xrsvd14 that was confusing me. 1994-06-04 11:01:15 +00:00
Rodney W. Grimes
26f9a76710 The big 4.4BSD Lite to FreeBSD 2.0.0 (Development) patch.
Reviewed by:	Rodney W. Grimes
Submitted by:	John Dyson and David Greenman
1994-05-25 09:21:21 +00:00
Rodney W. Grimes
6cda32c071 BSD 4.4 Lite Kernel Sources 1994-05-25 01:34:38 +00:00
Andreas Schulz
61f969e858 Add two routines insl and outsl, that should do 32bit string ins and outs.
Both are completely untested in the moment. They are used from the
if_ep.c driver for the EISA card.
1994-05-03 00:00:53 +00:00
Søren Schmidt
bc36c8064b Update the reprogram timer stuff, now the frequency of timer 0
can only be changed at the "right" times. Accuracy should be
assured.
1994-05-02 09:41:24 +00:00
David Greenman
bb50891974 Removed some tlbflush optimizations as some of them were bogus and lead
to some strange behavior.
1994-05-02 05:31:03 +00:00
Gary Clark II
1099e6c189 Deleted on ifdef dontdef
Added ifdef for GPL_MATH_EMULATE so we get the extra padding that is needed
in the save87 struct.
1994-04-29 21:44:23 +00:00
Gary Clark II
9f82ad3dfb Added ifdef for GPL_MATH_EMULATE to keep the sytem from panicing when
using it.
1994-04-29 21:39:55 +00:00
David Greenman
a4f7a4c990 From John Dyson:
Fixed physio in the 386 case - write faults weren't properly implemented.
1994-04-25 23:48:20 +00:00
Garrett Wollman
9ad380ab4c Define new option, INACCURATE_MICROTIME_IS_OK. When this is defined,
the NTP kernel PLL is disabled, and acquire_timer0() is enabled, thus
opening the door for microtime() (and hence gettimeofday()) to return
bogus timestamps.  This option is necessary for the `pca' driver to
work, but is implemented to underscore the fact that accurate timekeeping
and the `pca' driver are incompatible at present.  If someone writes a version
of microtime() that works when the `pca' driver is being used, this can get
junked.
1994-04-23 21:39:18 +00:00
Søren Schmidt
57d26a14e9 Added IO_PPI define, pulled timer related stuff 1994-04-21 14:20:54 +00:00
Søren Schmidt
f1106e3848 Pulled out timer related functions -> now in clock.c 1994-04-21 14:20:07 +00:00
Søren Schmidt
5194771d25 New support for sharing the timers
acquire_timer / release_timer

Pulled in timer related functions from isa.c
1994-04-21 14:19:16 +00:00
David Greenman
0e195446b7 Bug fixes and performance improvements from John Dyson and myself:
1) check va before clearing the page clean flag. Not doing so was
	causing the vnode pager error 5 messages when paging from
	NFS. (pmap.c)
2) put back interrupt protection in idle_loop. Bruce didn't think
	it was necessary, John insists that it is (and I agree). (swtch.s)
3) various improvements to the clustering code (vm_machdep.c). It's
	now enabled/used by default.
4) bad disk blocks are now handled properly when doing clustered IOs.
	(wd.c, vm_machdep.c)
5) bogus bad block handling fixed in wd.c.
6) algorithm improvements to the pageout/pagescan daemons. It's amazing
	how well 4MB machines work now.
1994-04-20 07:06:57 +00:00
David Greenman
f690bbace7 Changes from John Dyson and myself:
1) Removed all instances of disable_intr()/enable_intr() and changed
	them back to splimp/splx. The previous method was done to improve
	the performance, but Bruces recent changes to inline spl* have
	made this unnecessary.
2) Cleaned up vm_machdep.c considerably. Probably fixed a few bugs, too.
3) Added a new mechanism for collecting page statistics - now done by
	a new system process "pagescan". Previously this was done by the
	pageout daemon, but this proved to be impractical.
4) Improved the page usage statistics gathering mechanism - performance is
	much improved in small memory machines.
5) Modified mbuf.h to enable the support for an external free routine when
	using mbuf clusters. Added appropriate glue in various places to
	allow this to work.
6) Adapted a suggested change to the NFS code from Yuval Yurom to take
	advantage of #5.
7) Added fault/swap statistics support.
1994-04-14 07:49:40 +00:00
David Greenman
2862674874 Make Bruce happy: silently enter ddb on a BPT or trace trap if ddb is
configured in the kernel.
1994-04-07 10:51:00 +00:00
David Greenman
1561d038b1 from John Dyson:
1) fixed some bugs related to the bounce buffer code
2) vnode pager now supports clustered pageouts
3) experimental code for clustering all I/O via a new "cldisksort"
4) added >16MB check to Bustek driver
5) made some experimental algorithmic changes to the pageout daemon
6) fixed bugs in truncating mapped files (esp when mapped via NFS)
7) reorganized vnode pager I/O code
1994-04-05 03:23:32 +00:00
Andrey A. Chernov
e42b7b4096 Change from Bruce:
isa_dmarangecheck() is off by one error.
> ISARAM_END should be >= ISARAM_END. Only the first page above 16M
was mishandled.
1994-04-02 20:43:25 +00:00
David Greenman
d230622648 New interrupt code from Bruce Evans. In additional to Bruce's attached
list of changes, I've made the following additional changes:

1) i386/include/ipl.h renamed to spl.h as the name conflicts with the
   file of the same name in i386/isa/ipl.h.
2) changed all use of *mask (i.e. netmask, biomask, ttymask, etc) to
   *_imask (net_imask, etc).
3) changed vestige of splnet use in if_is to splimp.
4) got rid of "impmask" completely (Bruce had gotten rid of netmask),
   and are now using net_imask instead.
5) dozens of minor cruft to glue in Bruce's changes.

   These require changes I made to config(8) as well, and thus it must
be rebuilt.

-DG

from Bruce Evans:

sio:
	o No diff is supplied.  Remove the define of setsofttty().  I hope
	  that is enough.

*.s:
	o i386/isa/debug.h no longer exists.  The event counters became too
	  much trouble to maintain.  All function call entry and exception
	  entry counters can be recovered by using profiling kernel (the new
	  profiling supports all entry points; however, it is too slow to
	  leave enabled all the time; it also).  Only BDBTRAP() from debug.h
	  is now used.  That is moved to exception.s.  It might be worth
	  preserving SHOW_BITS() and calling it from _mcount() (if enabled).
	o T_ASTFLT is now only set just before calling trap().
	o All exception handlers set SWI_AST_MASK in cpl as soon as possible
	  after entry and arrange for _doreti to restore it atomically with
	  exiting.  It is not possible to set it atomically with entering
	  the kernel, so it must be checked against the user mode bits in
	  the trap frame before committing to using it.  There is no place
	  to store the old value of cpl for syscalls or traps, so there are
	  some complications restoring it.

Profiling stuff (mostly in *.s):
	o Changes to kern/subr_mcount.c, gcc and gprof are not supplied yet.
	o All interesting labels `foo' are renamed `_foo' and all
	  uninteresting labels `_bar' are renamed `bar'.  A small change
	  to gprof allows ignoring labels not starting with underscores.
	o MCOUNT_LABEL() is to provide names for counters for times spent
	  in exception handlers.
	o FAKE_MCOUNT() is a version of MCOUNT() suitable for exception
	  handlers.  Its arg is the pc where the exception occurred.  The
	  new mcount() pretends that this was a call from that pc to a
	  suitable MCOUNT_LABEL().
	o MEXITCOUNT is to turn off any timer started by MCOUNT().

/usr/src/sys/i386/i386/exception.s:
	o The non-BDB BPTTRAP() macros were doing a sti even when interrupts
	  were disabled when the trap occurred.  The sti (fixed) sti is
	  actually a no-op unless you have my changes to machdep.c that make
	  the debugger trap gates interrupt gates, but fixing that would
	  make the ifdefs messier.  ddb seems to be unharmed by both
	  interrupts always disabled and always enabled (I had the branch in
	  the fix back to front for some time :-().
	o There is no known pushal bug.
	o tf_err can be left as garbage for syscalls.

/usr/src/sys/i386/i386/locore.s:
	o Fix and update BDE_DEBUGGER support.
	o ENTRY(btext) before initialization was dangerous.
	o Warm boot shot was longer than intended.

/usr/src/sys/i386/i386/machdep.c:
	o DON'T APPLY ALL OF THIS DIFF.  It's what I'm using, but may require
	  other changes.
	  Use the following:
		o Remove aston() and setsoftclock().
	  Maybe use the following:
		o No netisr.h.
		o Spelling fix.
		o Delay to read the Rebooting message.
		o Fix for vm system unmapping a reduced area of memory
		  after bounds_check_with_label() reduces the size of
		  a physical i/o for a partition boundary.  A similar
		  fix is required in kern_physio.c.
		o Correct use of __CONCAT.  It never worked here for non-
		  ANSI cpp's.  Is it time to drop support for non-ANSI?
		o gdt_segs init.  0xffffffffUL is bogus because ssd_limit
		  is not 32 bits.  The replacement may have the same
		  value :-), but is more natural.
		o physmem was one page too low.  Confusing variable names.
	  Don't use the following:
		o Better numbers of buffers.  Each 8K page requires up to
		  16 buffer headers.  On my system, this results in 5576
		  buffers containing [up to] 2854912 bytes of memory.
		  The usual allocation of about 384 buffers only holds
		  192K of disk if you use it on an fs with a block size
		  of 512.
		o gdt changes for bdb.
		o *TGT -> *IDT changes for bdb.
		o #ifdefed changes for bdb.

/usr/src/sys/i386/i386/microtime.s:
	o Use the correct asm macros.  I think asm.h was copied from Mach
	  just for microtime and isn't used now.  It certainly doesn't
	  belong in <sys>.  Various macros are also duplicated in
	  sys/i386/boot.h and libc/i386/*.h.
	o Don't switch to and from the IRR; it is guaranteed to be selected
	  (default after ICU init and explicitly selected in isa.c too, and
	  never changed until the old microtime clobbered it).

/usr/src/sys/i386/i386/support.s:
	o Non-essential changes (none related to spls or profiling).
	o Removed slow loads of %gs again.  The LDT support may require
	  not relying on %gs, but loading it is not the way to fix it!
	  Some places (copyin ...) forgot to load it.  Loading it clobbers
	  the user %gs.  trap() still loads it after certain types of
	  faults so that fuword() etc can rely on it without loading it
	  explicitly.  Exception handlers don't restore it.  If we want
	  to preserve the user %gs, then the fastest method is to not
	  touch it except for context switches.  Comparing with
	  VM_MAXUSER_ADDRESS and branching takes only 2 or 4 cycles on
	  a 486, while loading %gs takes 9 cycles and using it takes
	  another.
	o Fixed a signed branch to unsigned.

/usr/src/sys/i386/i386/swtch.s:
	o Move spl0() outside of idle loop.
	o Remove cli/sti from idle loop.  sw1 does a cli, and in the
	  unlikely event of an interrupt occurring and whichqs becoming
	  zero, sw1 will just jump back to _idle.
	o There's no spl0() function in asm any more, so use splz().
	o swtch() doesn't need to be superaligned, at least with the
	  new mcounting.
	o Fixed a signed branch to unsigned.
	o Removed astoff().

/usr/src/sys/i386/i386/trap.c:
	o The decentralized extern decls were inconsistent, of course.
	o Fixed typo MATH_EMULTATE in comments. */
	o Removed unused variables.
	o Old netmask is now impmask; print it instead.  Perhaps we
	  should print some of the new masks.
	o BTW, trap() should not print anything for normal debugger
	  traps.

/usr/src/sys/i386/include/asmacros.h:
	o DON'T APPLY ALL OF THIS DIFF.  Just use some of the null macros
	  as necessary.

/usr/src/sys/i386/include/cpu.h:
	o CLKF_BASEPRI() changes since cpl == SWI_AST_MASK is now normal
	  while the kernel is running.
	o Don't use var++ to set boolean variables.  It fails after a mere
	  4G times :-) and is slower than storing a constant on [3-4]86s.

/usr/src/sys/i386/include/cpufunc.h:
	o DON'T APPLY ALL OF THIS DIFF.  You need mainly the include of
	  <machine/ipl.h>.  Unfortunately, <machine/ipl.h> is needed by
	  almost everything for the inlines.

/usr/src/sys/i386/include/ipl.h:
	o New file.  Defines spl inlines and SWI macros and declares most
	  variables related to hard and soft interrupt masks.

/usr/src/sys/i386/isa/icu.h:
	o Moved definitions to <machine/ipl.h>

/usr/src/sys/i386/isa/icu.s:
	o Software interrupts (SWIs) and delayed hardware interrupts (HWIs)
	  are now handled uniformally, and dispatching them from splx() is
	  more like dispatching them from _doreti.  The dispatcher is
	  essentially *(handler[ffs(ipending & ~cpl)]().
	o More care (not quite enough) is taken to avoid unbounded nesting
	  of interrupts.
	o The interface to softclock() is changed so that a trap frame is
	  not required.
	o Fast interrupt handlers are now handled more uniformally.
	  Configuration is still too early (new handlers would require
	  bits in <machine/ipl.h> and functions to vector.s).
	o splnnn() and splx() are no longer here; they are inline functions
	  (could be macros for other compilers).  splz() is the nontrivial
	  part of the old splx().

/usr/src/sys/i386/isa/ipl.h
	o New file.  Supposed to have only bus-dependent stuff.  Perhaps
	  the h/w masks should be declared here.

/usr/src/sys/i386/isa/isa.c:
	o DON'T APPLY ALL OF THIS DIFF.  You need only things involving
	  *mask and *MASK and comments about them.  netmask is now a pure
	  software mask.  It works like the softclock mask.

/usr/src/sys/i386/isa/vector.s:
	o Reorganize AUTO_EOI* macros.
	o Option FAST_INTR_HANDLER_USERS_ES for people who don't trust
	  fastintr handlers.
	o fastintr handlers need to metamorphose into ordinary interrupt
	  handlers if their SWI bit has become set.  Previously, sio had
	  unintended latency for handling output completions and input
	  of SLIP framing characters because this was not done.

/usr/src/sys/net/netisr.h:
	o The machine-dependent stuff is now imported from <machine/ipl.h>.

/usr/src/sys/sys/systm.h
	o DON'T APPLY ALL OF THIS DIFF.  You need mainly the different
	  splx() prototype.  The spl*() prototypes are duplicated as
	  inlines in <machine/ipl.h> but they need to be duplicated here
	  in case there are no inlines.  I sent systm.h and cpufunc.h
	  to Garrett.  We agree that spl0 should be replaced by splnone
	  and not the other way around like I've done.

/usr/src/sys/kern/kern_clock.c
	o splsoftclock() now lowers cpl so the direct call to softclock()
	  works as intended.
	o softclock() interface changed to avoid passing the whole frame
	  (some machines may need another change for profile_tick()).
	o profiling renamed _profiling to avoid ANSI namespace pollution.
	  (I had to improve the mcount() interface and may as well fix it.)
	  The GUPROF variant doesn't actually reference profiling here,
	  but the 'U' in GUPROF should mean to select the microtimer
	  mcount() and not change the interface.
1994-04-02 07:00:53 +00:00
David Greenman
ac322158f5 Eliminated the "physstrat" wart and merged it into kern_physio.c. This
patch also fixes a bug which causes a kernel VM leak.
1994-03-30 02:47:13 +00:00
David Greenman
4a490e4c21 Eliminated the "physstrat" wart and merged it into kern_physio.c. This
patch also fixes a bug which causes a kernel VM leak.
1994-03-30 02:31:11 +00:00
David Greenman
6b4ac811ca New routine "pmap_kenter", designed to take advantage of the special
case of the kernel pmap.
1994-03-30 02:17:47 +00:00
David Greenman
dad5c5fe90 ifdef KERNEL the pmap_kextract inline function; ps is unhappy otherwise.
Pointed out by Frank Terhaar-Yonkers <fty@vislab.epa.gov>.
1994-03-25 22:08:59 +00:00
David Greenman
ed7fcbd079 From John Dyson: performance improvements to the new bounce buffer
code.
1994-03-24 23:12:48 +00:00
David Greenman
d5e26ef0ef Bounce buffers. From John Dyson with help from me. 1994-03-23 09:16:04 +00:00
Andrey A. Chernov
6ec145713c Now printf("changing root... indicates raw partition for floppy
f.e. fd1d
1994-03-21 15:02:47 +00:00
Andrey A. Chernov
3f0afdd835 Fix printf for root system mounted on second floppy 1994-03-21 14:53:08 +00:00
Andrey A. Chernov
10c7408ae0 Fix for root system mounted on second floppy 1994-03-21 14:37:01 +00:00
David Greenman
29360eb099 Changed dynamic stack grow code to grow by "SGROWSIZ" amount. Initially
allocate SGROWSIZ amount of stack. Also set vm_ssize to the initial
stack VM size. Increased DFLSSIZ stack rlimit default to 8MB.
1994-03-21 09:35:24 +00:00
Garrett Wollman
f0e96ca631 Added cpu_model and machine variables. 1994-03-19 23:58:58 +00:00
David Greenman
943a66f340 Performance improvements from John Dyson.
1) A new mechanism has been added to prevent pages from being paged
	out called "vm_page_hold". Similar to vm_page_wire, but
	much lower overhead.
2) Scheduling algorithm has been changed to improve interactive
	performance.
3) Paging algorithm improved.
4) Some vnode and swap pager bugs fixed.
1994-03-14 21:54:03 +00:00
David Greenman
5c09563e1e 1) enhanced in_cksum from Bruce Evans.
2) minor comment change in machdep.c
3) enhanced bzero from John Dyson (twice as fast on a 486DX/33)
1994-03-07 11:47:32 +00:00
David Greenman
04f1835605 1) "Pre-faulting" in of pages into process address space
Eliminates vm_fault overhead on process startup and
		mmap referenced data for in-memory pages.

		(process startup time using in-memory segments *much* faster)

	2)	Even more efficient pmap code.  Code partially cleaned up.
		More comments yet to follow.

		(generally more efficient pte management)

	3)	Pageout clustering ( in addition to the FreeBSD V1.1 pagein
		clustering.)

		(much faster paging performance on non-write behind disk
		subsystems, slightly faster performance on other systems.)

	4)	Slightly changed vm_pageout code for more efficiency and
		better statistics.  Also, resist swapout a little more.

		(less likely to pageout a recently used page)

	5)	Slight improvement to the page table page trap efficiency.

		(generally faster system VM fault performance)

	6)	Defer creation of unnamed anonymous regions pager until needed.

		(speeds up shared memory bss creation)

	7)	Remove possible deadlock from swap_pager initialization.

	8)	Enhanced procfs to provide "vminfo" about vm objects and user
		pmaps.

	9)	Increased MCLSHIFT/MCLBYTES from 2K to 4K to improve net &
		socket performance and to prepare for things to come.

John Dyson
dyson@implode.root.com
David Greenman
davidg@root.com
1994-03-07 11:38:49 +00:00
Jeffrey Hsu
ffe25c427d Correct definitions of flags used by sigreturn to validate sigcontext. 1994-02-24 00:21:12 +00:00
Jeffrey Hsu
8d27e59b01 validate sigcontext before restoring it 1994-02-24 00:18:04 +00:00
David Greenman
2c194b2e93 Fixed bug in handling of COW - the original code was bogus and it was
only accidental that it worked. Also, don't cache non-managed pages.
1994-02-13 08:29:33 +00:00
David Greenman
43ef94a93a Patch from John Dyson:
a pv chain was being traversed while interrupts were
	fully enabled in pmap_remove_all ... this is bogus, and
	has been fixed in pmap.c. (sorry for adding the splimp)
1994-02-10 03:03:44 +00:00
David Greenman
aae4685ae8 From: Dave Matthews <dave@prlng.co.uk>
Description:
The integer overflow instruction (into) and the interrupt instruction with
value 4 (int #4) both give rise to SIGBUS signals rather than SIGFPE.  The
problem is that overflow is a trap not a fault (unlike the BOUND instruction).
1994-02-08 12:58:44 +00:00
David Greenman
b9d60b3f59 Fixed bugs in stack grow code, and moved it back into a seperate function
like it was originally. Also added back call to "grow" in sendsig now
that this routine actually works.
1994-02-08 09:26:04 +00:00
David Greenman
98446d4e96 Fixes from John Dyson to fix out-of-memory hangs and other problems (such
as increased swap space usage) related to (incorrectly) paging out the
page tables.
1994-02-08 03:07:58 +00:00
David Greenman
24ab273fa1 Fixed calculation of physmem when the special MAXMEM kernel config overide
is used. This bug caused the buffer cache to be WAY too big when memory
was being restricted - resulting in hangs and other out of memory problems.
1994-02-07 07:44:42 +00:00
David Greenman
102cfb5c3e At the suggestion of Bruce Evans, don't zero RTC diag register. Doing so
was causing problems for some machines.
1994-02-06 22:48:13 +00:00
David Greenman
0172c219f1 Minor cleanup. Decode state information better in the case of a fatal
trap.
1994-02-01 23:07:35 +00:00
David Greenman
50dba10faf Bug fix from previous WINE commit. From Jeffrey Hsu. 1994-02-01 10:03:43 +00:00
David Greenman
418ac7dcac Removed all uses of "USE_486_WRITE_PROTECT" and made this automatic.
Reordered and removed some NOP's.
1994-02-01 04:09:07 +00:00
David Greenman
a301c9d5d4 Added four pattern memory test routine that is done at startup.
...added filli - "fill integer" support routine.
1994-01-31 23:48:23 +00:00
David Greenman
8f64d25d15 Added four pattern memory test routine that is done at startup. 1994-01-31 23:47:29 +00:00
David Greenman
da59a31c01 WINE/user LDT support from John Brezak, ported to FreeBSD by Jeffrey Hsu
<hsu@soda.berkeley.edu>.
1994-01-31 10:27:13 +00:00
David Greenman
43411a3db4 Make I/O memory explicitly non-cacheable. This is purely an asthetic
change.
1994-01-31 04:39:37 +00:00
David Greenman
ec120393a0 VM system performance improvements from John Dyson and myself. The
following is a summary:

1) increased object cache back up to a more reasonable value.
2) removed old & bogus cruft from machdep.c (clearseg, copyseg,
	physcopyseg, etc).
3) inlined many functions in pmap.c
4) changed "load_cr3(rcr3())" into tlbflush() and made tlbflush inline
	assembly.
5) changed the way that modified pages are tracked - now vm_page struct
	is kept updated directly - no more scanning page tables.
6) removed lots of unnecessary spl's
7) removed old unused functions from pmap.c
8) removed all use of page_size, page_shift, page_mask variables - replaced
	with PAGE_ constants.
9) moved trunc/round_page, atop, ptoa, out of vm_param.h and into i386/
	include/param.h, and optimized them.
10) numerous changes to sys/vm/ swap_pager, vnode_pager, pageout, fault
	code to improve performance. LRU algorithm modified to be more
	effective, read ahead/behind values tuned for better performance,
	etc, etc...
1994-01-31 04:19:00 +00:00
David Greenman
801276d0ae Removed no longer used "wire" element in pv struct. 1994-01-27 03:36:14 +00:00
David Greenman
5d7fe66e75 Made pmap_is_managed a static inline function. 1994-01-27 03:35:42 +00:00
Rodney W. Grimes
ce1105630d Now prints ``on eisa'' if id_iobase >= 0x1000, and made a slight code
cleanup for the other 2 cases of ``on motherboard'' and ``on isa''.
1994-01-22 21:52:04 +00:00
David Greenman
df8d467a49 Remove some old, unused, major UGLY code. 1994-01-21 17:11:38 +00:00
David Greenman
2ae37484c6 System V IPC code from Danny Boulet, chewed on a bit by the NetBSD group
and then some more by Jeffrey Hsu (who provided this port for FreeBSD).
1994-01-21 09:56:05 +00:00
David Greenman
a728f398c2 Pointed out by Wolfgang Solfrank:
Correct parameters of sync
1994-01-20 23:17:39 +00:00
David Greenman
f707f734a6 Removed some more old unused code/comments. Added hack to "fix" the
problem with some chipsets (UMC) remapping the 'hole' memory even when
you've got 16MB. People were led to believe that since there was only
16MB of memory in the machine, that they were okay wrt the ISA DMA
limit. This hack simply causes the extra memory to be ignored if it
appears around the 16MB limit.
1994-01-20 17:49:57 +00:00
David Greenman
4b9f17c5b5 Improved algorithm that calculates the pages in the base memory - If the
BIOS says that the amount is *between* 0-640K, believe it.  Cleaned up
the comments a bit, removed some old cruff, etc.
1994-01-20 17:21:28 +00:00
David Greenman
d64f660fac Improvements mostly from John Dyson, with a little bit from me.
* Removed pmap_is_wired
* added extra cli/sti protection in idle (swtch.s)
* slight code improvement in trap.c
* added lots of comments
* improved paging and other algorithms in VM system
1994-01-17 09:32:32 +00:00
Rodney W. Grimes
e7988dea10 Add missing paren so that it now compiles. 1994-01-17 05:49:20 +00:00
Andreas Schulz
e8f1fa7451 Updated the TODO file with missing things.
Changed the output of the isa probe routine, that only devices, that
have an IO address and are smaller than 0x100 to be on the motherboard.
The seagate SCSI adapter is an example of a card, that doesn't have
an IO address and works only memory mapped.
1994-01-16 11:25:06 +00:00
Martin Renters
c6863af480 NFS Diskless booting support added. 1994-01-16 02:21:58 +00:00
David Greenman
7f8cb36869 "New" VM system from John Dyson & myself. For a run-down of the
major changes, see the log of any effected file in the sys/vm
directory (swap_pager.c for instance).
1994-01-14 16:25:31 +00:00
Andrey A. Chernov
154f487097 Correct Vresume size, we have now 32 bits for it. 1994-01-10 23:15:09 +00:00
Rodney W. Grimes
3b6585764d Fixed comment that refered to 8252 (we really have 8253's).
Per some one on the mailing list.
1994-01-05 15:03:28 +00:00
David Greenman
e10a618657 Increased maximum and default 'size' limits to more reasonable values. 1994-01-03 16:00:52 +00:00
David Greenman
c8a13ecd00 Convert syscall to trapframe. Based on work done by John Brezak. 1994-01-03 07:55:47 +00:00
David Greenman
bb54009a35 Raised minimum buffer cache from 128k to 256k. 1993-12-22 13:12:04 +00:00
David Greenman
e2f27b409f Changed pointer type from caddr_t to void * for fillw, insw, outsw, and
outsb.
1993-12-21 21:27:04 +00:00
Garrett Wollman
a1f4319f4a Document use of counters 29 and 30 for CCITT netisrs. 1993-12-20 15:08:33 +00:00
Garrett Wollman
aaf08d94ca Make everything compile with -Wtraditional. Make it easier to distribute
a binary link-kit.  Make all non-optional options (pagers, procfs) standard,
and update LINT to reflect new symtab requirements.

NB: -Wtraditional will henceforth be forgotten.  This editing pass was
primarily intended to detect any constructions where the old code might
have been relying on traditional C semantics or syntax.  These were all
fixed, and the result of fixing some of them means that -Wall is now a
realistic possibility within a few weeks.
1993-12-19 00:55:01 +00:00
David Greenman
6aa5e70134 added some panics to catch the condition where pmap_pte returns null
- indicating that the page table page is non-resident.
1993-12-13 07:02:27 +00:00
David Greenman
6d01f02e51 1) Added proc file system from Paul Kranenburg with changes from
John Dyson to make it reliably work under FreeBSD.
2) Added and enabled PROCFS in the GENERICxx and LINT kernels.
3) New execve() from me. Still work to be done here, but this version
	works well and is needed before other changes can be made. For
	a description of the design behind this, see freebsd-arch or
	ask me.
4) Rewrote stack fault code; made user stack VM grow as needed rather
	than all up front; improves performance a little and reduces
	process memory requirements.
5) Incorporated fix from Gene Stark to fault/wire a user page table
	page to fix a problem in copyout. This is a temporary fix and
	is not appropriate for pageable page tables. For a description
	of the problem, see Gene's post to the freebsd-hackers mailing
	list.
6) Tighten up vm_page struct to reduce memory requirements for it. ifdef
	pager page lock code as it's not being used currently.
7) Introduced new element to vmspace struct - vm_minsaddr; initial
	(minimum) stack address. Compliment to vm_maxsaddr.
8) Added a panic if the allocation for process u-pages fails.
9) Improve performance and accuracy of kernel profiling by putting in
	a little inline assembly instead of spl().
10) Made serial console with sio driver work. Still has problems with
	serial input, but is almost useable.
11) Added -Bstatic to SYSTEM_LD in Makefile.i386 so that kernels will
	build properly with the new ld.
1993-12-12 12:22:57 +00:00
Andrew Moore
05e634ef64 From: Jeffrey Hsu <hsu@soda.berkeley.edu>
The following patch adds the addr argument to signal handlers.

The kernel with the patch is no more and no less in compliance or in
violation of POSIX and ANSI C than the kernel before the patch.

The added functionality this addr argument provides is quite useful.  It
enables an entire class of algorithms which use mprotect to trace memory
references.  Beside garbage collectors, I have heard of this technique being
applied to debuggers and profilers.  The only benchmarking I've performed is
using akcl to compile maxima:  without the kernel patch, it takes 7 hours to
compile maxima, while with stratified garbage collection, it only takes 50
minutes.

Basically, I can't think of a reason not to add the addr argument and there
is a compelling need for it.

If you find the patch acceptable, please let me know so I can send my
FreeBSD akcl config files to wfs for inclusion in the core akcl release.
The old 386BSD config files there won't work on either NetBSD or FreeBSD.
1993-12-03 05:10:08 +00:00
David Greenman
a9627169cd Patch from Gene Stark:
Subject: Page fault in PTE area fails in copyout
Index: sys/i386/i386/trap.c FreeBSD-1.0.2

Description:
	Reading files of several megabytes into Emacs, or many small
	files all at once, would fail with "IO error - bad address".

Repeat-By:
	The bug can be exercised by a test program that malloc()'s
	a 5MB chunk of memory, and then, without accessing the memory
	first, filling it with data from a file using read().
	(I read 64k chunks from /dev/wd0d into successive 64k regions
	of the 5MB chunk.)  The read() will fail with EFAULT at the first
	virtual address boundary that is a multiple of 0x400000.

Fix:
	The problem was code in sys/i386/i386/trap.c that tries to
	figure out what kind of trap occurred and to handle it appropriately.
	It was interpreting any page fault with virtual address
	>= vm->vm_maxsaddr as being a user stack segment fault.
	In fact, addresses >= USRSTACK are in the user structure/PTE area,
	and if they are handled as stack faults, the proper PTE will
	not be paged in when it is supposed to be.  This situation comes
	up in copyout() and copyoutstr(), if PTE's are accessed for the
	first time ever.  The page fault on accessing the nonexistent PTE
	is mishandled as a stack fault, and then the fault that occurs on
	the subsequent access to the page itself causes copyout to fail
	with EFAULT.
1993-11-28 09:28:54 +00:00
Garrett Wollman
381fe1aaf4 Make the LINT kernel compile with -W -Wreturn-type -Wcomment -Werror, and
add same (sans -Werror) to Makefile for future compilations.
1993-11-25 01:38:01 +00:00
David Greenman
b513c26294 patches from Julian Elischer -
Added support for mmapping /dev/mem
1993-11-22 09:46:45 +00:00
Garrett Wollman
35089dd415 Fixed comments that start within a comment, so code compiles cleanly with
-Wcomment.
1993-11-17 23:25:28 +00:00
Andrey A. Chernov
58e4f8835a If netmask == 0, new value changed from 0x8000 to 0x10000
(don't mess with IRQ15)
1993-11-17 00:21:03 +00:00
David Greenman
eee5a63430 new process tracing code from Sean Eric Fagen (sef@kithrup.com).
...also, fixed up the syscall args to make GCC happy.
1993-11-16 09:54:57 +00:00
Andrey A. Chernov
de0edfd4e3 if netmask == 0, then the loopback code can do some really
bad things.
workaround for this: if netmask == 0, set it to 0x8000,
which is value used by splsoftclock
1993-11-14 23:53:32 +00:00
Rodney W. Grimes
62f4ee2685 Add _bde_exists: label so that the global is really defined. Fix spelling
error (mount -> amount)
1993-11-14 02:27:22 +00:00
David Greenman
0967373e1c First steps in rewriting locore.s, and making info useful
when the machine panics.

i386/i386/locore.s:
1) got rid of most .set directives that were being used like
	#define's, and replaced them with appropriate #define's in
	the appropriate header files (accessed via genassym).
2) added comments to header inclusions and global definitions,
	and global variables
3) replaced some hardcoded constants with cpp defines (such as
	PDESIZE and others)
4) aligned all comments to the same column to make them easier to
	read
5) moved macro definitions for ENTRY, ALIGN, NOP, etc. to
	/sys/i386/include/asmacros.h
6) added #ifdef BDE_DEBUGGER around all of Bruce's debugger code
7) added new global '_KERNend' to store last location+1 of kernel
8) cleaned up zeroing of bss so that only bss is zeroed
9) fix zeroing of page tables so that it really does zero them all
	- not just if they follow the bss.
10) rewrote page table initialization code so that 1) works correctly
	and 2) write protects the kernel text by default
11) properly initialize the kernel page directory, upages, p0stack PT,
	and page tables. The previous scheme was more than a bit
	screwy.
12) change allocation of virtual area of IO hole so that it is
	fixed at KERNBASE + 0xa0000. The previous scheme put it
	right after the kernel page tables and then later expected
	it to be at KERNBASE +0xa0000
13) change multiple bogus settings of user read/write of various
	areas of kernel VM - including the IO hole; we should never
	be accessing the IO hole in user mode through the kernel
	page tables
14) split kernel support routines such as bcopy, bzero, copyin,
	copyout, etc. into a seperate file 'support.s'
15) split swtch and related routines into a seperate 'swtch.s'
16) split routines related to traps, syscalls, and interrupts
	into a seperate file 'exception.s'
17) remove some unused global variables from locore that got
	inserted by Garrett when he pulled them out of some .h
	files.

i386/isa/icu.s:
1) clean up global variable declarations
2) move in declaration of astpending and netisr

i386/i386/pmap.c:
1) fix calculation of virtual_avail. It previously was calculated
	to be right in the middle of the kernel page tables - not
	a good place to start allocating kernel VM.
2) properly allocate kernel page dir/tables etc out of kernel map
	- previously only took out 2 pages.

i386/i386/machdep.c:
1) modify boot() to print a warning that the system will reboot in
	PANIC_REBOOT_WAIT_TIME amount of seconds, and let the user
	abort with a key on the console. The machine will wait for
	ever if a key is typed before the reboot. The default is
	15 seconds, but can be set to 0 to mean don't wait at all,
	-1 to mean wait forever, or any positive value to wait for
	that many seconds.
2) print "Rebooting..." just before doing it.

kern/subr_prf.c:
1) remove PANICWAIT as it is deprecated by the change to machdep.c

i386/i386/trap.c:
1) add table of trap type strings and use it to print a real trap/
	panic message rather than just a number. Lot's of work to
	be done here, but this is the first step. Symbolic traceback
	is in the TODO.

i386/i386/Makefile.i386:
1) add support in to build support.s, exception.s and swtch.s

...and various changes to various header files to make all of the
	above happen.
1993-11-13 02:25:21 +00:00
Andrew Moore
2fc79c3815 Applied David Greenman's hack to disable IRQ conflict checking
when COM_MULTIPORT is defined.
1993-11-09 02:12:36 +00:00
Garrett Wollman
f4639581fd Get rid of WFJ's use of sleep() for more user-friendly tsleep(). 1993-11-07 21:47:19 +00:00
Garrett Wollman
13c0dce671 Made all header files idempotent and moved incorrect common data from
headers into a related source file.  Also fixed a bug in ed_probe() where
it was possible to fall off the end of the function
1993-11-07 17:44:34 +00:00
Garrett Wollman
6e393973f5 Made all header files idempotent and moved incorrect common data from
headers into a related source file.  Added cons.h as first step towards
moving i386/i386/cons.h to machine/cons.h where it belongs.
1993-11-07 17:43:17 +00:00
Garrett Wollman
e766e4d9f1 Made all header files idempotent and moved incorrect common data from
headers into a related source file.  (This is the only change to locore.s).
Also fixed pg() to be properly declared and use stdargs.
1993-11-07 17:41:36 +00:00
David Greenman
d19eeaea76 splnone()'s in the trap code can be deadly. Save/restore previous priority
instead.
1993-11-04 15:05:41 +00:00
Andrey A. Chernov
03d24cbca4 DST offset calculation removed, it is wrong in any case. 1993-11-04 01:56:31 +00:00
Paul Richards
19bcb5e4a2 Restored comments that were removed from npx.c using # comment
format rather than /* */, as per advise from Jordan.
1993-11-03 23:32:35 +00:00
Paul Richards
81fc6236e6 Removed comments from within asm block.
New gas fails to parse comments within asm blocks properly. Simply
remove them until gas gets fixed.
1993-11-03 00:29:19 +00:00
Christoph Robitschko
d73546248a Modified the "rude stack hack" that it only applies to addresses within
the stack area and not memory above VM_MAXUSER_ADDRESS.
That way, copyout and friends now work for pages whose page table entries
have not yet been allocated/been paged out.
1993-11-01 11:51:29 +00:00
David Greenman
97a0085a24 Whoops, the algorithm I last used was messed up - I left off parans, and
should have used PGSHIFT instead of PAGE_SHIFT.
1993-10-29 09:06:56 +00:00
David Greenman
03cfe1fd06 Change filesystem buffer cache size calculation to be less for 4MB
machines (now 20% of all memory after the first 3MB). This is necessary
in order for 4MB machine to be able to rebuild the entire source tree
and not run out of physical memory because of fixed memory requirements
of processes and kernel VM.
1993-10-29 08:58:34 +00:00
Rodney W. Grimes
965b29039e >From: Julian Elischer <julian@jules.dialix.oz.au>
Date: Tue, 19 Oct 1993 02:22:41 -40962758 (WST)

As the subject line says:
I can;t believe this typo is still here.

Has NOBODY used the isa_dmastart() routine for 16bit DMA?

I know I just hit the dma regs directly for the AHA1542,
and it appears that either everybody else does as well, or
they only use 8bit DMA (e.g. floppy)

Editors Note:
	The definition of DMA2_CHN was incorrectly using IO_DMA1!
1993-10-18 18:45:48 +00:00
Rodney W. Grimes
dd05fde699 Removed all patch kit headers, sccsid and rcsid strings, put $Id$ in, some
minor cleanup.  Added $Id$ to files that did not have any version info, etc
1993-10-16 19:17:18 +00:00
Rodney W. Grimes
34a8ed1be1 Removed all patch kit headers, sccsid and rcsid strings, put $Id$ in, some
minor cleanup.  Added $Id$ to files that did not have any version info, etc
1993-10-16 14:40:57 +00:00
Rodney W. Grimes
47cacd3854 Removed all patch kit headers, sccsid and rcsid strings, put $Id$ in, some
minor cleanup.  Added $Id$ to files that did not have any version info, etc
1993-10-16 14:15:10 +00:00
Rodney W. Grimes
6f78ca6026 Removed all patch kit headers, sccsid and rcsid strings, put $Id$ in, some
minor cleanup.  Added $Id$ to files that did not have any version info, etc
1993-10-16 13:48:52 +00:00
Rodney W. Grimes
960173b9b2 genassym.c:
Remove NKMEMCLUSTERS, it is no longer define or used.

locores.s:
	Fix comment on PTDpde and APTDpde to be pde instead of pte
	Add new equation for calculating location of Sysmap
	Remove Bill's old #ifdef garbage for counting up memory,
	that stuff will never be made to work and was just cluttering
	up the file.

	Add code that places the PTD, page table pages, and kernel
	stack below the 640k ISA hole if there is room for it, otherwise
	put this stuff all at 1MB.  This fixes the 28K bogusity in
	the boot blocks, that can now go away!

	Fix the caclulation of where first is to be dependent on
	NKPDE so that we can skip over the above mentioned areas.
	The 28K thing is now 44K in size due to the increase in
	kernel virtual memory space, but since we no longer have
	to worry about that this is no big deal.

	Use if NNPX > 0 instead of ifdef NPX for floating point code.

machdep.c
	Change the calculation of for the buffer cache to be
	20% of all memory above 2MB and add back the upper limit
	of 2/5's of the VM_KMEM_SIZE so that we do not eat ALL
	of the kernel memory space on large memory machines, note
	that this will not even come into effect unless you have
	more than 32MB.  The current buffer cache limit is 6.7MB
	due to this caclulation.

	It seems that we where erroniously allocating bufpages pages
	for buffer_map.  buffer_map is UNUSED in this implementation
	of the buffer cache, but since the map is referenced in
	several if statements a quick fix was to simply allocate
	1 vm page (but no real memory) to it.

pmap.h
	Remove rcsid, don't want them in the kernel files!

	Removed some cruft inside an #ifdef DEBUGx that caused
	compiler errors if you where compiling this for debug.

	Use the #defines for PD_SHIFT and PG_SHIFT in place of
	constants.

trap.c:
	Remove patch kit header and rcsid, fix $Id$.
	Now include "npx.h" and use NNPX for controlling the
	floating point code.

	Remove a now completly invalid check for a maximum virtual
	address, the virtual address now ends at 0xFFFFFFFF so
	there is no more MAX!!  (Thanks David, I completly missed
	that one!)

vm_machdep.c
	Remove patch kit header and rcsid, fix $Id$.
	Now include "npx.h" and use NNPX for controlling the
	floating point code.

	Replace several 0xFE00000 constants with KERNBASE
1993-10-15 10:34:29 +00:00
Rodney W. Grimes
d42d25c451 param.h:
Mark the fact that PGSHIFT and PDRSHIFT are really the same as
PG_SHIFT and PD_SHIFT, these should be collapsed some day soon.

Document that KERNBASE should really be KPTDPTDI << PDRSHIFT, for
now leave it as the constant 0xFE000000 until I make a seperate
common header file for this stuff (vmaddresses.h?)

Remove NKMEMCLUSTERS define, it was only being used to define
VM_KMEM_SIZE, so why have all the indirection.  Besides who wants
to work in CLBYTE sizes chuncks.


pmap.h:

Fix $Id$ and some other minor format clean ups.

Remove the XXX comment about NKPDE, since it now has the correct value
of 7.

Remove unused LASTPTDI and move the APTD into the very end of memory to
free up 4MB of kernel virtual address space.
Remove unused RSVDPTDI and free up 12MB of kernel virtual address space.


vmparam.h

Fix $Id$.

Increase SHMMAXPGS to 512 (2MB) now that there is room for it to be
bigger.  The XXX comment stays until the kernel moves down in memory
to free up enough space to use the proper default of 4MB.

VM_KMEM_SIZE is now a direct constant stating the size of the kernel
malloc region.  Increased the value from 3MB to 16MB.
1993-10-15 10:07:45 +00:00
Rodney W. Grimes
cd632cb9fb >From David Greenman
Bruce Evans had limited the kernel virtual address space to not include the
last 4MB since it was not being used.  Other changes are being made that will
reloate the Alternate Page Directory Table (APDT) into this area so the limit
is being fixed to be the last virtual address. (Infact with this patch you
can now do that relocation)
1993-10-14 18:15:35 +00:00
Rodney W. Grimes
5c644711a9 ALL:
Removed patch kit headers and rcsid strings, add $Id$.

isa.c:

Removed old #ifdef notyet isa_configure code, since it will never be
used, and I have done 90% of what it attempted to.

Add conflict checking code that searchs back through the devtab's looking
for any device that has already been found that may conflict with what
we are about to probe.  Checks are mode for I/O address, memory address,
IRQ, and DRQ.  This should stop the screwing up of any device that has
alread been found by other device probes.
Print out messages when we are not going to probe a device due to
a conflict so the user knows WHY something was not found.  For example:

aha0 not probed due to irq conflict with ahb0 at 11

Now print out a message when a device is not found so the user knows
that it was probed for, but could not be found.  For example:

ed1 not found at 0x320

For devices that have I/O address < 0x100 say that they are on the
motherboard, not on isa!  The 0x100 magic number is per ISA spec.  It
may seem funny that pc0 and sc0 report as being on the motherboard, but
this is due to the fact that the I/O address used is that of the keyboard
controller which IS on the motherboard.  We really need to split the
keyboard probe from the display probe.  It is completly legal to build
a pc with out one or the other, or even with out both!

npx.c:

Return -1 from the probe routine if we are using the Emulator so
that the i/o addresses are not printed, this is the same trick used
for 486's.

Do not print the ``Errors reported via Exception 16'', and
``Errors reported via IRQ 13'' messages any more, since these just lead
to more user confusion that anything.  It still prints the message
``Error reporting broken, using 387 emulator'' so that the person is
aware that there mother board is ill.
1993-10-13 15:59:30 +00:00
Rodney W. Grimes
e5ff3be604 Removed hack that did the R_SHIFT of unsigned numbers, no longer need
to do this as I have changed to using PDTI's as the bases for the vm
system layout.

Eliminate constants SYSPDROFF and SYSPDREND, now use NKPTE to control the size
of the kernel virtual space.

Eliminate constant PDRPDROFF, now use PDTDTPI to control location of PTD,
PTDmap and PTDpde

Eliminate constant APDRPDROFF, now use APTDPTDI to control location of APTD,
APTDmap and APTDpde.

Still need to fix Sysmap location (it is still a constant).

.globl statements are now consistent with respect to <comma><space>, the
<space> being removed from all .globl statements.

Document the fillkpt macro as to what registers control what.

Fix some comments that went past column 80, and clean/line some others up.

Remove constand for _Crtat, now use KERNBASE+constant, this still needs work.

Replace constants for offsets of sigcode parameters with symbolic names
from assym.s

Mark the sigreturn() call with XXX since we use the hardcoded constant
for the system call number, this is bogus and should be a #define or
something some place!

The kernel before and after this change was verified with cmp, not one
byte changed.  These are all cosmetic clean up changes that makes the
code more correct and easier to move the kernels virtual address space
and size.
1993-10-13 07:11:11 +00:00
Rodney W. Grimes
c1c1b7df77 Add Page Table Directory Indexes (NKPDE, KPTDI, PTDPTDI, APTDPTDI) to
be used to replace more constants in locore.
1993-10-12 15:33:18 +00:00
Rodney W. Grimes
a27df7823f KPTDI_LAST renamed to KPTDI 1993-10-12 15:09:37 +00:00
Rodney W. Grimes
988d75b3d6 Eliminate definition of I386_PAGE_SIZE and use NBPG instead
Cleaned up tabs vs spaces after #define to make file consistent.
Removed now unused definitions of I386_PAGE_SIZE and I386_PDR_SIZE

Note That these two where unused and had the wrong values anyway!
Changed I386_KPDES to NKPDE
Changed I386_UPDES to NUPDE

Redid constant assignments of *PTDI's to be sizeable and relative.
1993-10-12 13:58:01 +00:00
Rodney W. Grimes
9aa17d68ce Eliminate definition of I386_PAGE_SIZE and use NBPG instead
Replace 0xFE000000 constants with KERNBASE
Use new definition NKPDE in place of a first-last+1 calculation.
1993-10-12 13:53:25 +00:00
Rodney W. Grimes
1c622fc1dc SYSPDROFF and SYSPDREND are now calculated using KERNBASE, KERNSIZE and
PDRSHIFT.

The SYSTEM constant that was defined in this file has been replaced
with KERNBASE from param.h.

Changed almost all # style comments to /* */ C style comments.  Several
comments cleaned up so that they make a little more since.

In the comments that describe C calling conventions to assembler routines
used a comma space sequence to seperate arguments and removed the space
between the function name and the argument list.

Removed useless comments like /* clr eax */.

Changed all comma space sequences on assemble instructions to just be comma.

Removed spaces after $ operators to make the file consistent, this may need
to change again (ie: $KERNBASE should probably be $(KERNBASE), but for now
it all seems to work just fine.)  This may become a problem with the C
pre-processor.

Changed several double blank lines to single blank lines that where used
to seperate the I/O routines, these routines are blocked enough that we
don't need double blank lines between them.

Changed sequence of I/O routines to be all input functions, all output
functions instead of just the opposite.

Moved the SHOW_A_LOT debug stuff to near the end of the file.

Changed two occurances of the constant 0xfff to NBPG-1.
1993-10-10 06:07:57 +00:00
Rodney W. Grimes
845dee6b85 Added a compile time #error so that if the user does not specify on of
the proper I_X86CPU in the config file the following error will occur
while building the kernel: (had to line wrap the error for this message)

../../i386/i386/machdep.c:343: #error This kernel is not configured for one \
of the supported CPUs
1993-10-10 06:01:44 +00:00
Rodney W. Grimes
156812b7e4 Added PDRSHIFT and KERNSIZE so that the PDR offsets can be calculated in
locore.s instead of being constants (3F8, 3FA).
1993-10-10 02:09:44 +00:00
David Greenman
89ccb410d4 Correct spelling of "SHMMAXPGS" so the config override will actually work. 1993-10-09 15:29:04 +00:00
Rodney W. Grimes
09f07fb057 All:
Remove patch kit headers, and add $Id$
	This is mostly to align some more code with NetBSD.

cpu.h:
	Remove the old function vs. include configuration stuff that was
	ifdefed out when we went to inline functions.
	Remove the define of resettodr that made it a nop, there is
	already a function that makes it a nop, no need to #define one.
	Remove the #defines of processor types, they are now defined
	in cputypes.h, #include that file.
	Add struct cpu_nameclass for support of cpu types.

frame.h:
	include sys/signal.h, it will be needed in the future.
	put the sigframe structure here that was in machdep.c

pcb.h:
	Add multiple inclusion protection.
	Add pcb_ldt and pcb_ldt_len to pcb structure, this is for the
	user mode ldt.
1993-10-08 20:51:00 +00:00
Rodney W. Grimes
3409a2f663 All:
removed patch kit headers and sccsids, add $Id$.  This is a general
	clean up and reallignment with NetBSD-current where possible.

genassym.c:
	removed extranious include of reg.h
	removed old FP_* defines that have been ifdefed out since the patch kit
	removed PCB_SIGC that is not referenced anywhere
	add trapframe and sigframe defines
	add KERNBASE define for use in locore.s

locore.s:
	include npx.h and use NNPX for turning on and off FPU
	include machine/cputypes.h for the types of cpu (used in cpu_identify)
	change SYSPDREND to be one higher, this is really the base of the
	next area, and will be changing again next time I revise the file
	Reverse the NOP defines, you now get slow NOP's by default, this
	may be what is casuing us trouble with some systems.  If you want
	the NOPS to be null you now need to have options DUMMY_NOPS.
	Now get esym from the boot blocks which don't pass it yet, and
	it is not used, but this will be changing.
	Move the bit_colors stuff to be in with the rest of Bruces SHOW_A_LOT
	things for debugging.
	Added NetBSD's CPU type probe code, we now know what type of CPU
	we are running on.
	Adjust kernel pde calcuation to correct for change in SYSPDREND, no
	longer need the +1.

machdep.c
	include npx.h and use NNPX for turning on and off FPU
	include isa.h, map.h(new file), exec.h in preperation for
	changes that are still in process.
	Add some of the code for MACHINE_NONCONTIG that will alow us
	to better map around the BIOS memory area.
	Now print the version, cpu id, real memory and availiable memory
	during boot.
	Correct the calculation of bufpages, the code was mixing pages
	and bytes, it now does the right things.  Removed Bill's hack
	for limiting the erronous calculation.
	add the identifycpu print out code from NetBSD.
	remove the definition of the sigframe struct, it belongs in
	frame.h
	put in printf's about syncing disks on a halt/reboot.
	Change the halted message to be a little easier reading.
	Clean up of the dump messages, makes the source and the output
	much more readable.
	Change 0,0 in several places to have spaces after the commas.
1993-10-08 20:45:12 +00:00
Rodney W. Grimes
3225c4b443 Define the types of cpu's there are, from NetBSD 1993-10-08 13:40:54 +00:00
Rodney W. Grimes
f43bd59ec7 Architecture specific syscalls (i386) from NetBSD 1993-10-08 11:31:40 +00:00
Rodney W. Grimes
3331c2af28 Removed patch kit headers, and rcsid, add $Id$, relocate Terry Lamberts
copyright to match the location that it is in NetBSD.

Remove the __main() {} dummy function, it belongs in kern/init_main.c
1993-10-08 10:47:13 +00:00
Rodney W. Grimes
b145f751d3 This is a fix for the 32K DMA buffer region that was not accounted for,
it relocates it to be after the BIOS memory hole instead of right below
the 640K limit.
THANK YOU CHRIS!!!

From: <cgd@postgres.Berkeley.EDU>
Date: Wed, 29 Sep 93 18:49:58 -0700
basically, reserve a new 32k space right after firstaddr,
and put the buffer space there...

the diffs are below, and are in ~cgd/sys/i386/i386 (in machdep.c)
on freefall.  i obviously can't test them, so if some of you would
look the diffs over and try them out...
1993-09-30 23:16:17 +00:00
Rodney W. Grimes
b1929a9f4a Add symbolic name for system page directory end, and change constant to
a calculation for the system page directory tables.
1993-09-29 02:37:41 +00:00