xref: /original-bsd/sys/vm/vm_init.c (revision 56b48dd2)
1 /*
2  * Copyright (c) 1985, Avadis Tevanian, Jr., Michael Wayne Young
3  * Copyright (c) 1987 Carnegie-Mellon University
4  * Copyright (c) 1991 Regents of the University of California.
5  * All rights reserved.
6  *
7  * This code is derived from software contributed to Berkeley by
8  * The Mach Operating System project at Carnegie-Mellon University.
9  *
10  * The CMU software License Agreement specifies the terms and conditions
11  * for use and redistribution.
12  *
13  *	@(#)vm_init.c	7.2 (Berkeley) 04/20/91
14  */
15 
16 /*
17  *	Initialize the Virtual Memory subsystem.
18  */
19 
20 #include "param.h"
21 
22 #include "vm.h"
23 #include "vm_page.h"
24 #include "vm_kern.h"
25 
26 /*
27  *	vm_init initializes the virtual memory system.
28  *	This is done only by the first cpu up.
29  *
30  *	The start and end address of physical memory is passed in.
31  */
32 
33 void vm_mem_init()
34 {
35 	extern vm_offset_t	avail_start, avail_end;
36 	extern vm_offset_t	virtual_avail, virtual_end;
37 
38 	/*
39 	 *	Initializes resident memory structures.
40 	 *	From here on, all physical memory is accounted for,
41 	 *	and we use only virtual addresses.
42 	 */
43 
44 	virtual_avail = vm_page_startup(avail_start, avail_end, virtual_avail);
45 	/*
46 	 * Initialize other VM packages
47 	 */
48 	vm_object_init();
49 	vm_map_startup();
50 	kmem_init(virtual_avail, virtual_end);
51 	pmap_init(avail_start, avail_end);
52 	vm_pager_init();
53 }
54