xref: /csrg-svn/sys/vm/vm_init.c (revision 48493)
145748Smckusick /*
245748Smckusick  * Copyright (c) 1991 Regents of the University of California.
345748Smckusick  * All rights reserved.
445748Smckusick  *
545748Smckusick  * This code is derived from software contributed to Berkeley by
645748Smckusick  * The Mach Operating System project at Carnegie-Mellon University.
745748Smckusick  *
8*48493Smckusick  * %sccs.include.redist.c%
945748Smckusick  *
10*48493Smckusick  *	@(#)vm_init.c	7.3 (Berkeley) 04/21/91
11*48493Smckusick  *
12*48493Smckusick  *
13*48493Smckusick  * Copyright (c) 1987, 1990 Carnegie-Mellon University.
14*48493Smckusick  * All rights reserved.
15*48493Smckusick  *
16*48493Smckusick  * Authors: Avadis Tevanian, Jr., Michael Wayne Young
17*48493Smckusick  *
18*48493Smckusick  * Permission to use, copy, modify and distribute this software and
19*48493Smckusick  * its documentation is hereby granted, provided that both the copyright
20*48493Smckusick  * notice and this permission notice appear in all copies of the
21*48493Smckusick  * software, derivative works or modified versions, and any portions
22*48493Smckusick  * thereof, and that both notices appear in supporting documentation.
23*48493Smckusick  *
24*48493Smckusick  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
25*48493Smckusick  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
26*48493Smckusick  * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
27*48493Smckusick  *
28*48493Smckusick  * Carnegie Mellon requests users of this software to return to
29*48493Smckusick  *
30*48493Smckusick  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
31*48493Smckusick  *  School of Computer Science
32*48493Smckusick  *  Carnegie Mellon University
33*48493Smckusick  *  Pittsburgh PA 15213-3890
34*48493Smckusick  *
35*48493Smckusick  * any improvements or extensions that they make and grant Carnegie the
36*48493Smckusick  * rights to redistribute these changes.
3745748Smckusick  */
3845748Smckusick 
3945748Smckusick /*
4045748Smckusick  *	Initialize the Virtual Memory subsystem.
4145748Smckusick  */
4245748Smckusick 
4348386Skarels #include "param.h"
4445748Smckusick 
4548386Skarels #include "vm.h"
4648386Skarels #include "vm_page.h"
4748386Skarels #include "vm_kern.h"
4848386Skarels 
4945748Smckusick /*
5045748Smckusick  *	vm_init initializes the virtual memory system.
5145748Smckusick  *	This is done only by the first cpu up.
5245748Smckusick  *
5345748Smckusick  *	The start and end address of physical memory is passed in.
5445748Smckusick  */
5545748Smckusick 
5645748Smckusick void vm_mem_init()
5745748Smckusick {
5845748Smckusick 	extern vm_offset_t	avail_start, avail_end;
5945748Smckusick 	extern vm_offset_t	virtual_avail, virtual_end;
6045748Smckusick 
6145748Smckusick 	/*
6245748Smckusick 	 *	Initializes resident memory structures.
6345748Smckusick 	 *	From here on, all physical memory is accounted for,
6445748Smckusick 	 *	and we use only virtual addresses.
6545748Smckusick 	 */
6645748Smckusick 
6745748Smckusick 	virtual_avail = vm_page_startup(avail_start, avail_end, virtual_avail);
6845748Smckusick 	/*
6945748Smckusick 	 * Initialize other VM packages
7045748Smckusick 	 */
7145748Smckusick 	vm_object_init();
7248386Skarels 	vm_map_startup();
7345748Smckusick 	kmem_init(virtual_avail, virtual_end);
7445748Smckusick 	pmap_init(avail_start, avail_end);
7545748Smckusick 	vm_pager_init();
7645748Smckusick }
77