xref: /original-bsd/sys/vm/vm_init.c (revision dd262573)
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.1 (Berkeley) 12/05/90
14  */
15 
16 /*
17  *	Initialize the Virtual Memory subsystem.
18  */
19 
20 #include "types.h"
21 #include "../vm/vm_param.h"
22 #include "lock.h"
23 #include "../vm/vm_object.h"
24 #include "../vm/vm_map.h"
25 #include "../vm/vm_page.h"
26 #include "../vm/vm_kern.h"
27 
28 /*
29  *	vm_init initializes the virtual memory system.
30  *	This is done only by the first cpu up.
31  *
32  *	The start and end address of physical memory is passed in.
33  */
34 
35 void vm_mem_init()
36 {
37 	extern vm_offset_t	avail_start, avail_end;
38 	extern vm_offset_t	virtual_avail, virtual_end;
39 
40 	/*
41 	 *	Initializes resident memory structures.
42 	 *	From here on, all physical memory is accounted for,
43 	 *	and we use only virtual addresses.
44 	 */
45 
46 	virtual_avail = vm_page_startup(avail_start, avail_end, virtual_avail);
47 	/*
48 	 * Initialize other VM packages
49 	 */
50 	vm_object_init();
51 	vm_map_init();
52 	kmem_init(virtual_avail, virtual_end);
53 	pmap_init(avail_start, avail_end);
54 	vm_pager_init();
55 }
56