xref: /original-bsd/sys/vm/vm_init.c (revision 1b11f3a3)
1 /*
2  * Copyright (c) 1991 Regents of the University of California.
3  * All rights reserved.
4  *
5  * This code is derived from software contributed to Berkeley by
6  * The Mach Operating System project at Carnegie-Mellon University.
7  *
8  * %sccs.include.redist.c%
9  *
10  *	@(#)vm_init.c	7.5 (Berkeley) 08/29/91
11  *
12  *
13  * Copyright (c) 1987, 1990 Carnegie-Mellon University.
14  * All rights reserved.
15  *
16  * Authors: Avadis Tevanian, Jr., Michael Wayne Young
17  *
18  * Permission to use, copy, modify and distribute this software and
19  * its documentation is hereby granted, provided that both the copyright
20  * notice and this permission notice appear in all copies of the
21  * software, derivative works or modified versions, and any portions
22  * thereof, and that both notices appear in supporting documentation.
23  *
24  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
25  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
26  * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
27  *
28  * Carnegie Mellon requests users of this software to return to
29  *
30  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
31  *  School of Computer Science
32  *  Carnegie Mellon University
33  *  Pittsburgh PA 15213-3890
34  *
35  * any improvements or extensions that they make and grant Carnegie the
36  * rights to redistribute these changes.
37  */
38 
39 /*
40  *	Initialize the Virtual Memory subsystem.
41  */
42 
43 #include "param.h"
44 
45 #include "vm.h"
46 #include "vm_page.h"
47 #include "vm_kern.h"
48 
49 /*
50  *	vm_init initializes the virtual memory system.
51  *	This is done only by the first cpu up.
52  *
53  *	The start and end address of physical memory is passed in.
54  */
55 
56 void vm_mem_init()
57 {
58 	extern vm_offset_t	avail_start, avail_end;
59 	extern vm_offset_t	virtual_avail, virtual_end;
60 
61 	/*
62 	 *	Initializes resident memory structures.
63 	 *	From here on, all physical memory is accounted for,
64 	 *	and we use only virtual addresses.
65 	 */
66 	vm_set_page_size();
67 	vm_page_startup(&avail_start, &avail_end);
68 
69 	/*
70 	 * Initialize other VM packages
71 	 */
72 	vm_object_init();
73 	vm_map_startup();
74 	kmem_init(virtual_avail, virtual_end);
75 	pmap_init(avail_start, avail_end);
76 	vm_pager_init();
77 }
78