xref: /csrg-svn/sys/vm/vm_init.c (revision 63379)
145748Smckusick /*
2*63379Sbostic  * Copyright (c) 1991, 1993
3*63379Sbostic  *	The Regents of the University of California.  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  *
848493Smckusick  * %sccs.include.redist.c%
945748Smckusick  *
10*63379Sbostic  *	@(#)vm_init.c	8.1 (Berkeley) 06/11/93
1148493Smckusick  *
1248493Smckusick  *
1348493Smckusick  * Copyright (c) 1987, 1990 Carnegie-Mellon University.
1448493Smckusick  * All rights reserved.
1548493Smckusick  *
1648493Smckusick  * Authors: Avadis Tevanian, Jr., Michael Wayne Young
1748493Smckusick  *
1848493Smckusick  * Permission to use, copy, modify and distribute this software and
1948493Smckusick  * its documentation is hereby granted, provided that both the copyright
2048493Smckusick  * notice and this permission notice appear in all copies of the
2148493Smckusick  * software, derivative works or modified versions, and any portions
2248493Smckusick  * thereof, and that both notices appear in supporting documentation.
2348493Smckusick  *
2448493Smckusick  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
2548493Smckusick  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
2648493Smckusick  * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
2748493Smckusick  *
2848493Smckusick  * Carnegie Mellon requests users of this software to return to
2948493Smckusick  *
3048493Smckusick  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
3148493Smckusick  *  School of Computer Science
3248493Smckusick  *  Carnegie Mellon University
3348493Smckusick  *  Pittsburgh PA 15213-3890
3448493Smckusick  *
3548493Smckusick  * any improvements or extensions that they make and grant Carnegie the
3648493Smckusick  * rights to redistribute these changes.
3745748Smckusick  */
3845748Smckusick 
3945748Smckusick /*
4045748Smckusick  *	Initialize the Virtual Memory subsystem.
4145748Smckusick  */
4245748Smckusick 
4353349Sbostic #include <sys/param.h>
4445748Smckusick 
4553349Sbostic #include <vm/vm.h>
4653349Sbostic #include <vm/vm_page.h>
4753349Sbostic #include <vm/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 
vm_mem_init()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 	 */
6650545Smckusick 	vm_set_page_size();
6750935Swilliam 	vm_page_startup(&avail_start, &avail_end);
6850935Swilliam 
6945748Smckusick 	/*
7045748Smckusick 	 * Initialize other VM packages
7145748Smckusick 	 */
7252198Smarc 	vm_object_init(virtual_end - VM_MIN_KERNEL_ADDRESS);
7348386Skarels 	vm_map_startup();
7445748Smckusick 	kmem_init(virtual_avail, virtual_end);
7545748Smckusick 	pmap_init(avail_start, avail_end);
7645748Smckusick 	vm_pager_init();
7745748Smckusick }
78