]>
git.saurik.com Git - apple/xnu.git/blob - osfmk/mach/boot_info.h
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
31 * Revision 1.1.1.1 1998/09/22 21:05:31 wsanchez
32 * Import of Mac OS X kernel (~semeria)
34 * Revision 1.1.1.1 1998/03/07 02:25:45 wsanchez
35 * Import of OSF Mach kernel (~mburg)
37 * Revision 1.2.16.4 1996/01/09 19:21:29 devrcs
38 * Added bootstrap map for alpha.
39 * This probably should be moved to some MD include file.
40 * It's not really machine dependent, just a different
41 * way of doing things.
42 * [1995/12/01 19:49:04 jfraser]
44 * Merged '64-bit safe' changes from DEC alpha port.
45 * [1995/11/21 18:08:36 jfraser]
47 * Revision 1.2.16.3 1995/01/06 19:50:04 devrcs
48 * mk6 CR668 - 1.3b26 merge
49 * Added region_desc structure;
50 * [1994/10/14 03:42:28 dwm]
52 * Revision 1.2.16.2 1994/09/23 02:34:18 ezf
53 * change marker to not FREE
54 * [1994/09/22 21:39:03 ezf]
56 * Revision 1.2.16.1 1994/06/13 20:49:19 dlb
58 * [1994/06/13 20:24:22 dlb]
60 * Revision 1.2.14.1 1994/02/08 11:01:06 bernadat
61 * Checked in NMK16_1 changes
64 * Revision 1.2.12.1 1993/12/23 08:56:06 bernadat
68 * Revision 1.2.3.2 1993/06/24 16:14:07 gm
69 * CR9371: Moved here from default_pager.
70 * [1993/06/24 16:08:52 gm]
72 * Revision 1.2.3.2 1993/06/09 02:10:53 gm
73 * Added to OSF/1 R1.3 from NMK15.0.
74 * [1993/06/02 20:41:54 gm]
76 * Revision 1.2 1993/04/19 16:31:50 devrcs
77 * Added ROSE support: we need several symbol table entries since ROSE
78 * can have up to 3 symbol section.
82 * [1993/03/03 12:12:37 bernadat]
84 * Fixed History Revision Comments
87 * Created for external default pager.
88 * [1993/02/09 15:40:42 bruel]
94 * Revision 2.2 92/01/03 20:19:42 dbg
103 * Mach Operating System
104 * Copyright (c) 1991 Carnegie Mellon University
105 * All Rights Reserved.
107 * Permission to use, copy, modify and distribute this software and its
108 * documentation is hereby granted, provided that both the copyright
109 * notice and this permission notice appear in all copies of the
110 * software, derivative works or modified versions, and any portions
111 * thereof, and that both notices appear in supporting documentation.
113 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
114 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
115 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
117 * Carnegie Mellon requests users of this software to return to
119 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
120 * School of Computer Science
121 * Carnegie Mellon University
122 * Pittsburgh PA 15213-3890
124 * any improvements or extensions that they make and grant Carnegie Mellon
125 * the rights to redistribute these changes.
128 #ifndef _MACH_BOOT_INFO_H_
129 #define _MACH_BOOT_INFO_H_
131 #include <mach/machine/vm_types.h>
132 #include <mach/vm_prot.h>
133 #include <mach/boolean.h>
136 * The boot loader uses several instances of the following structure to
137 * provide a description of the bootstrap task virtual address space,
138 * consisting of memory regions that need to be mapped from physical pages
139 * filled by the boot loader, or regions that need to be allocated in the
143 vm_offset_t addr
; /* virtual address */
144 vm_offset_t offset
; /* offset within object */
145 vm_size_t size
; /* size */
146 vm_prot_t prot
; /* protection */
147 boolean_t mapped
; /* mapped or zero-filled */
151 typedef long physaddr_t
;
152 #define NBOOT_REGIONS 5
160 struct bootstrap_map
{
161 physaddr_t boot_location
;
165 long boot_region_count
;
166 struct region_desc boot_regions
[NBOOT_REGIONS
];
171 #define BOOT_INFO_COMPAT 1
174 * Old compat code for makeboot produced images
178 * Structure of Mach kernel boot file.
180 #include <mach/machine/vm_types.h>
183 * A Mach kernel boot file consists of the Mach
184 * kernel image and the bootstrap image, glued
187 * The first part of the file is a normal executable
188 * (bootable) file: a.out, coff, or whatever. The
189 * text and data sizes are set to include the entire
190 * file. (Some machines do not allow a zero-length
193 * The rest of the file sits where the kernel BSS
194 * should be. A boot_info record describes the
195 * sizes of the next 3 sections. Following this
196 * are the kernel symbol table, the bootstrap image
197 * (including its symbol table), and the loader
198 * information for the bootstrap image. Each
199 * of these sections is padded to an integer (4-byte)
202 * When the file is loaded into memory, the kernel
203 * text and data segments are at their normal locations.
205 * The boot_info structure appears at the start of
206 * the bss (at 'edata[]'):
210 vm_size_t sym_size
; /* size of kernel symbols */
211 vm_size_t boot_size
; /* size of bootstrap image */
212 vm_size_t load_info_size
; /* size of loader information
213 for bootstrap image */
217 * The 3 sections must be moved out of BSS for the kernel to run:
219 * The kernel symbol table follows the BSS (at 'end[]').
221 * The bootstrap image is on the first page boundary (machine page
222 * size) following the kernel symbol table.
224 * The loader information immediately follows the bootstrap image.
228 * Loader information for bootstrap image:
236 int format
; /* symbol table format (A.OUT or ROSE) */
237 vm_offset_t text_start
; /* text start in memory */
238 vm_size_t text_size
; /* text size */
239 vm_offset_t text_offset
; /* text offset in file */
240 vm_offset_t data_start
; /* data+bss start in memory */
241 vm_size_t data_size
; /* data size */
242 vm_offset_t data_offset
; /* data offset in file */
243 vm_size_t bss_size
; /* BSS size */
244 vm_offset_t str_offset
; /* strings table offset in file */
245 vm_size_t str_size
; /* strings table size */
246 vm_offset_t sym_offset
[4]; /* symbol table offset in file */
247 vm_size_t sym_size
[4]; /* symbol table size */
248 vm_offset_t entry_1
; /* 2 words for entry address */
252 #define EX_NOT_EXECUTABLE 6000
254 #endif /* BOOT_INFO_COMPAT */
256 #endif /* _MACH_BOOT_INFO_H_ */