]> git.saurik.com Git - apple/bootx.git/blob - bootx.tproj/include.subproj/boot_args.h
BootX-81.tar.gz
[apple/bootx.git] / bootx.tproj / include.subproj / boot_args.h
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
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.
11 *
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
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22 /*
23 * boot_args.h - Data stuctures for the information passed to the kernel.
24 *
25 * Copyright (c) 1998-2003 Apple Computer, Inc.
26 *
27 * DRI: Josh de Cesare
28 */
29
30 #ifndef _BOOTX_BOOT_ARGS_H_
31 #define _BOOTX_BOOT_ARGS_H_
32
33 // Video information..
34
35 struct Boot_Video {
36 unsigned long v_baseAddr; /* Base address of video memory */
37 unsigned long v_display; /* Display Code (if Applicable */
38 unsigned long v_rowBytes; /* Number of bytes per pixel row */
39 unsigned long v_width; /* Width */
40 unsigned long v_height; /* Height */
41 unsigned long v_depth; /* Pixel Depth */
42 };
43 typedef struct Boot_Video Boot_Video, *Boot_Video_Ptr;
44
45
46 // DRAM Bank definitions - describes physical memory layout.
47 #define kMaxDRAMBanks (26) /* maximum number of DRAM banks */
48
49 struct DRAMBank {
50 unsigned long base; /* physical base of DRAM bank */
51 unsigned long size; /* size of bank */
52 };
53 typedef struct DRAMBank DRAMBank, *DRAMBankPtr;
54
55
56 // Boot argument structure - passed into kernel at boot time.
57
58 #define kBootArgsRevision (1)
59 #define kBootArgsVersion1 (1)
60 #define kBootArgsVersion2 (2)
61
62 #define BOOT_LINE_LENGTH (256)
63
64 struct boot_args {
65 unsigned short Revision; /* Revision of boot_args structure */
66 unsigned short Version; /* Version of boot_args structure */
67 char CommandLine[BOOT_LINE_LENGTH]; /* Passed in command line */
68 DRAMBank PhysicalDRAM[kMaxDRAMBanks]; /* base/range pairs for the 26 DRAM banks */
69 Boot_Video Video; /* Video Information */
70 unsigned long machineType; /* Machine Type (gestalt) */
71 void *deviceTreeP; /* Base of flattened device tree */
72 unsigned long deviceTreeLength; /* Length of flattened tree */
73 unsigned long topOfKernelData; /* Last address of kernel data area*/
74 };
75 typedef struct boot_args boot_args, *boot_args_ptr;
76
77 struct compressed_kernel_header {
78 u_int32_t signature;
79 u_int32_t compress_type;
80 u_int32_t adler32;
81 u_int32_t uncompressed_size;
82 u_int32_t compressed_size;
83 u_int32_t reserved[11];
84 char platform_name[64];
85 char root_path[256];
86 u_int8_t data[0];
87 };
88 typedef struct compressed_kernel_header compressed_kernel_header;
89
90 #endif /* ! _BOOTX_BOOT_ARGS_H_ */