Commit | Line | Data |
---|---|---|
175f072e | 1 | /* |
175f072e KM |
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 | * | |
0e24ad83 | 8 | * %sccs.include.redist.c% |
175f072e | 9 | * |
68cffe82 | 10 | * @(#)vm_init.c 7.7 (Berkeley) %G% |
0e24ad83 KM |
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. | |
175f072e KM |
37 | */ |
38 | ||
39 | /* | |
40 | * Initialize the Virtual Memory subsystem. | |
41 | */ | |
42 | ||
68cffe82 | 43 | #include <sys/param.h> |
ffe0d082 | 44 | |
68cffe82 KB |
45 | #include <vm/vm.h> |
46 | #include <vm/vm_page.h> | |
47 | #include <vm/vm_kern.h> | |
175f072e KM |
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 | */ | |
9e49d939 | 66 | vm_set_page_size(); |
7d41c460 WN |
67 | vm_page_startup(&avail_start, &avail_end); |
68 | ||
175f072e KM |
69 | /* |
70 | * Initialize other VM packages | |
71 | */ | |
930fc8e7 | 72 | vm_object_init(virtual_end - VM_MIN_KERNEL_ADDRESS); |
ffe0d082 | 73 | vm_map_startup(); |
175f072e KM |
74 | kmem_init(virtual_avail, virtual_end); |
75 | pmap_init(avail_start, avail_end); | |
76 | vm_pager_init(); | |
77 | } |