Commit Graph

59 Commits

Author SHA1 Message Date
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
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
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
da73bf46a5 Fixed PHYSTOKV, addition operator on pointers is the wrong thing to do
here.  This is really a crock, but it works.
1993-10-12 12:08:16 +00:00
Rodney W. Grimes
d529c3d85c Add PHYSTOKV used in scsi drivers with a correct definition based on
KERNBASE.

Change #define<tab> to #define<space> on lines that had it wrong
1993-10-12 07:13:12 +00:00
Rodney W. Grimes
c77ba36045 Fix definitions to be in terms of a minimum number of constants by
using the SHIFT value as the basis for the other values, for example
instead of:
#define		NBPG		4096
#define		PGSHIFT		12
use:
#define		PGSHIFT		12
#define		NBPG		(1 << PGSHIFT)

===================================================================
RCS file: /a/cvs/386BSD/src/sys/i386/include/param.h,v
retrieving revision 1.3
diff -c -r1.3 param.h
*** 1.3	1993/10/08 12:49:55
--- param.h	1993/10/08 12:53:19
***************
*** 52,76 ****
  #define ALIGNBYTES	(sizeof(int) - 1)
  #define ALIGN(p)	(((u_int)(p) + ALIGNBYTES) &~ ALIGNBYTES)

- #define	NBPG		4096		/* bytes/page */
- #define	PGOFSET		(NBPG-1)	/* byte offset into page */
  #define	PGSHIFT		12		/* LOG2(NBPG) */
  #define	NPTEPG		(NBPG/(sizeof (struct pte)))

- #define NBPDR		(1024*NBPG)	/* bytes/page dir */
- #define	PDROFSET	(NBPDR-1)	/* byte offset into page dir */
  #define	PDRSHIFT	22		/* LOG2(NBPDR) */

  #define	KERNBASE	0xFE000000	/* start of kernel virtual */
  #define	BTOPKERNBASE	((u_long)KERNBASE >> PGSHIFT)

! #define	DEV_BSIZE	512
  #define	DEV_BSHIFT	9		/* log2(DEV_BSIZE) */
  #define BLKDEV_IOSIZE	2048
  #define	MAXPHYS		(64 * 1024)	/* max raw I/O transfer size */

- #define	CLSIZE		1
  #define	CLSIZELOG2	0

  /* NOTE: SSIZE, SINCR and UPAGES must be multiples of CLSIZE */
  #define	SSIZE	1		/* initial stack size/NBPG */
--- 52,79 ----
  #define ALIGNBYTES	(sizeof(int) - 1)
  #define ALIGN(p)	(((u_int)(p) + ALIGNBYTES) &~ ALIGNBYTES)

  #define	PGSHIFT		12		/* LOG2(NBPG) */
+ #define	NBPG		(1 << PGSHIFT)	/* bytes/page */
+ #define	PGOFSET		(NBPG-1)	/* byte offset into page */
  #define	NPTEPG		(NBPG/(sizeof (struct pte)))

  #define	PDRSHIFT	22		/* LOG2(NBPDR) */
+ #define NBPDR		(1 << PDRSHIFT)	/* bytes/page dir */
+ #define	PDROFSET	(NBPDR-1)	/* byte offset into page dir */

  #define	KERNBASE	0xFE000000	/* start of kernel virtual */
  #define	BTOPKERNBASE	((u_long)KERNBASE >> PGSHIFT)

! #define	KERNSIZE	0x00C00000	/* size of kernel virtual */
!
  #define	DEV_BSHIFT	9		/* log2(DEV_BSIZE) */
+ #define	DEV_BSIZE	(1 << DEV_BSHIFT)
+
  #define BLKDEV_IOSIZE	2048
  #define	MAXPHYS		(64 * 1024)	/* max raw I/O transfer size */

  #define	CLSIZELOG2	0
+ #define	CLSIZE		(1 << CLSIZELOG2)

  /* NOTE: SSIZE, SINCR and UPAGES must be multiples of CLSIZE */
  #define	SSIZE	1		/* initial stack size/NBPG */
***************
*** 92,99 ****
  #ifndef	MCLSHIFT
  #define	MCLSHIFT	11		/* convert bytes to m_buf clusters */
  #endif	/* MCLSHIFT */
! #define	MCLBYTES	(1 << MCLSHIFT)	/* size of a m_buf cluster */
! #define	MCLOFSET	(MCLBYTES - 1)	/* offset within a m_buf cluster */

  #ifndef NMBCLUSTERS
  #ifdef GATEWAY
--- 95,102 ----
  #ifndef	MCLSHIFT
  #define	MCLSHIFT	11		/* convert bytes to m_buf clusters */
  #endif	/* MCLSHIFT */
! #define	MCLBYTES	(1 << MCLSHIFT)	/* size of an m_buf cluster */
! #define	MCLOFSET	(MCLBYTES - 1)	/* offset within an m_buf cluster */

  #ifndef NMBCLUSTERS
  #ifdef GATEWAY
1993-10-08 13:01:34 +00:00
Rodney W. Grimes
89ec6ec6bf Removed patch kit header. Cleaned up tabbing and removed extra blank
lines to match NetBSD.  Added $Id$.
Added MID_MACHINE from NetBSD.
Removed definition of DELAY() for non-kernel soures.
Fixed some small english errors that had been corrected in NetBSD.
File is now identical to NetBSD's, but will be changing soon for some
of my clean up work.
1993-10-08 12:49:55 +00:00
Nate Williams
f798d06073 fts(3) integration patches 1993-07-28 01:42:17 +00:00
Rodney W. Grimes
5b81b6b301 Initial import, 0.1 + pk 0.2.4-B1 1993-06-12 14:58:17 +00:00