]>
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 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
28 * Revision 1.1.1.1 1998/09/22 21:05:31 wsanchez
29 * Import of Mac OS X kernel (~semeria)
31 * Revision 1.1.1.1 1998/03/07 02:25:45 wsanchez
32 * Import of OSF Mach kernel (~mburg)
34 * Revision 1.2.16.4 1996/01/09 19:21:29 devrcs
35 * Added bootstrap map for alpha.
36 * This probably should be moved to some MD include file.
37 * It's not really machine dependent, just a different
38 * way of doing things.
39 * [1995/12/01 19:49:04 jfraser]
41 * Merged '64-bit safe' changes from DEC alpha port.
42 * [1995/11/21 18:08:36 jfraser]
44 * Revision 1.2.16.3 1995/01/06 19:50:04 devrcs
45 * mk6 CR668 - 1.3b26 merge
46 * Added region_desc structure;
47 * [1994/10/14 03:42:28 dwm]
49 * Revision 1.2.16.2 1994/09/23 02:34:18 ezf
50 * change marker to not FREE
51 * [1994/09/22 21:39:03 ezf]
53 * Revision 1.2.16.1 1994/06/13 20:49:19 dlb
55 * [1994/06/13 20:24:22 dlb]
57 * Revision 1.2.14.1 1994/02/08 11:01:06 bernadat
58 * Checked in NMK16_1 changes
61 * Revision 1.2.12.1 1993/12/23 08:56:06 bernadat
65 * Revision 1.2.3.2 1993/06/24 16:14:07 gm
66 * CR9371: Moved here from default_pager.
67 * [1993/06/24 16:08:52 gm]
69 * Revision 1.2.3.2 1993/06/09 02:10:53 gm
70 * Added to OSF/1 R1.3 from NMK15.0.
71 * [1993/06/02 20:41:54 gm]
73 * Revision 1.2 1993/04/19 16:31:50 devrcs
74 * Added ROSE support: we need several symbol table entries since ROSE
75 * can have up to 3 symbol section.
79 * [1993/03/03 12:12:37 bernadat]
81 * Fixed History Revision Comments
84 * Created for external default pager.
85 * [1993/02/09 15:40:42 bruel]
91 * Revision 2.2 92/01/03 20:19:42 dbg
100 * Mach Operating System
101 * Copyright (c) 1991 Carnegie Mellon University
102 * All Rights Reserved.
104 * Permission to use, copy, modify and distribute this software and its
105 * documentation is hereby granted, provided that both the copyright
106 * notice and this permission notice appear in all copies of the
107 * software, derivative works or modified versions, and any portions
108 * thereof, and that both notices appear in supporting documentation.
110 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
111 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
112 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
114 * Carnegie Mellon requests users of this software to return to
116 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
117 * School of Computer Science
118 * Carnegie Mellon University
119 * Pittsburgh PA 15213-3890
121 * any improvements or extensions that they make and grant Carnegie Mellon
122 * the rights to redistribute these changes.
125 #ifndef _MACH_BOOT_INFO_H_
126 #define _MACH_BOOT_INFO_H_
128 #include <mach/machine/vm_types.h>
129 #include <mach/vm_prot.h>
130 #include <mach/boolean.h>
133 * The boot loader uses several instances of the following structure to
134 * provide a description of the bootstrap task virtual address space,
135 * consisting of memory regions that need to be mapped from physical pages
136 * filled by the boot loader, or regions that need to be allocated in the
140 vm_offset_t addr
; /* virtual address */
141 vm_offset_t offset
; /* offset within object */
142 vm_size_t size
; /* size */
143 vm_prot_t prot
; /* protection */
144 boolean_t mapped
; /* mapped or zero-filled */
148 typedef long physaddr_t
;
149 #define NBOOT_REGIONS 5
157 struct bootstrap_map
{
158 physaddr_t boot_location
;
162 long boot_region_count
;
163 struct region_desc boot_regions
[NBOOT_REGIONS
];
168 #define BOOT_INFO_COMPAT 1
171 * Old compat code for makeboot produced images
175 * Structure of Mach kernel boot file.
177 #include <mach/machine/vm_types.h>
180 * A Mach kernel boot file consists of the Mach
181 * kernel image and the bootstrap image, glued
184 * The first part of the file is a normal executable
185 * (bootable) file: a.out, coff, or whatever. The
186 * text and data sizes are set to include the entire
187 * file. (Some machines do not allow a zero-length
190 * The rest of the file sits where the kernel BSS
191 * should be. A boot_info record describes the
192 * sizes of the next 3 sections. Following this
193 * are the kernel symbol table, the bootstrap image
194 * (including its symbol table), and the loader
195 * information for the bootstrap image. Each
196 * of these sections is padded to an integer (4-byte)
199 * When the file is loaded into memory, the kernel
200 * text and data segments are at their normal locations.
202 * The boot_info structure appears at the start of
203 * the bss (at 'edata[]'):
207 vm_size_t sym_size
; /* size of kernel symbols */
208 vm_size_t boot_size
; /* size of bootstrap image */
209 vm_size_t load_info_size
; /* size of loader information
210 for bootstrap image */
214 * The 3 sections must be moved out of BSS for the kernel to run:
216 * The kernel symbol table follows the BSS (at 'end[]').
218 * The bootstrap image is on the first page boundary (machine page
219 * size) following the kernel symbol table.
221 * The loader information immediately follows the bootstrap image.
225 * Loader information for bootstrap image:
233 int format
; /* symbol table format (A.OUT or ROSE) */
234 vm_offset_t text_start
; /* text start in memory */
235 vm_size_t text_size
; /* text size */
236 vm_offset_t text_offset
; /* text offset in file */
237 vm_offset_t data_start
; /* data+bss start in memory */
238 vm_size_t data_size
; /* data size */
239 vm_offset_t data_offset
; /* data offset in file */
240 vm_size_t bss_size
; /* BSS size */
241 vm_offset_t str_offset
; /* strings table offset in file */
242 vm_size_t str_size
; /* strings table size */
243 vm_offset_t sym_offset
[4]; /* symbol table offset in file */
244 vm_size_t sym_size
[4]; /* symbol table size */
245 vm_offset_t entry_1
; /* 2 words for entry address */
249 #define EX_NOT_EXECUTABLE 6000
251 #endif /* BOOT_INFO_COMPAT */
253 #endif /* _MACH_BOOT_INFO_H_ */