xref: /original-bsd/sys/vm/vm_init.c (revision f8c91da1)
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.4 (Berkeley) 07/25/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 	virtual_avail = vm_page_startup(avail_start, avail_end, virtual_avail);
68 	/*
69 	 * Initialize other VM packages
70 	 */
71 	vm_object_init();
72 	vm_map_startup();
73 	kmem_init(virtual_avail, virtual_end);
74 	pmap_init(avail_start, avail_end);
75 	vm_pager_init();
76 }
77