Chameleon

Chameleon Commit Details

Date:2012-02-21 09:29:53 (9 years 2 months ago)
Author:armel cadet-petit
Commit:1824
Parents: 1823
Message:few updates
Changes:
D/branches/cparm/i386/libsaio/bootLion.h
D/branches/cparm/i386/libsa/error.c
A/branches/cparm/artwork/themes/default/device_hfsraid_ml.png
A/branches/cparm/artwork/themes/default/device_hfsplus_ml.png
A/branches/cparm/artwork/themes/LoginToLion/device_hfsraid_ml.png
A/branches/cparm/artwork/themes/LoginToLion/device_hfsplus_ml.png
A/branches/cparm/artwork/themes/default/device_hfsraid_ml_o.png
A/branches/cparm/artwork/themes/default/device_hfsplus_ml_o.png
A/branches/cparm/i386/libsaio/bootXnu.h
A/branches/cparm/artwork/themes/LoginToLion/device_hfsraid_ml_o.png
A/branches/cparm/artwork/themes/LoginToLion/device_hfsplus_ml_o.png
M/branches/cparm/i386/libsaio/bootstruct.h
M/branches/cparm/i386/boot2/modules.h
M/branches/cparm/i386/libsaio/saio_types.h
M/branches/cparm/Chameleon.xcodeproj/project.pbxproj
M/branches/cparm/i386/modules/ACPIPatcher/acpi_patcher.c
M/branches/cparm/i386/libsaio/bios.h
M/branches/cparm/i386/boot2/graphics.c
M/branches/cparm/i386/libsa/Makefile
M/branches/cparm/i386/boot2/boot.c
M/branches/cparm/TODO
M/branches/cparm/i386/modules/ACPICodec/acpi_codec.c
M/branches/cparm/i386/boot2/modules.c

File differences

branches/cparm/TODO
11
22
33
4
4
55
66
77
TODO List for Chameleon Boot Loader
====================================
- (re-)Implement a watchdog library set (clear the watchdog at the right moment can avoid infinite loop made for unknow reasons by the compiler)
- (re-)Implement a watchdog library set (clear the watchdog , can avoid infinite loop made for unknow reasons by the compiler or cpu reset)
- Implement a Host like in bits to avoid some return issues
branches/cparm/Chameleon.xcodeproj/project.pbxproj
4545
4646
4747
48
4948
5049
5150
......
6867
6968
7069
71
7270
7371
7472
......
293291
294292
295293
294
296295
297296
298297
......
561560
562561
563562
564
565563
566564
567565
......
592590
593591
594592
595
596593
597594
595
598596
599597
600598
AB43B2DD14C37E520018D529 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
AB43B2DF14C37E520018D529 /* efi_tables.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = efi_tables.c; sourceTree = "<group>"; };
AB43B2E014C37E520018D529 /* efi_tables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = efi_tables.h; sourceTree = "<group>"; };
AB43B2E114C37E520018D529 /* error.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = error.c; sourceTree = "<group>"; };
AB43B2E214C37E520018D529 /* libsa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libsa.h; sourceTree = "<group>"; };
AB43B2E314C37E520018D529 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = "<group>"; };
AB43B2E414C37E520018D529 /* memory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = memory.h; sourceTree = "<group>"; };
AB43B2F614C37E520018D529 /* bios.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bios.h; sourceTree = "<group>"; };
AB43B2F714C37E520018D529 /* bios.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = bios.s; sourceTree = "<group>"; };
AB43B2F814C37E520018D529 /* biosfn.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = biosfn.c; sourceTree = "<group>"; };
AB43B2F914C37E520018D529 /* bootLion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bootLion.h; sourceTree = "<group>"; };
AB43B2FA14C37E520018D529 /* bootstruct.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bootstruct.c; sourceTree = "<group>"; };
AB43B2FB14C37E520018D529 /* bootstruct.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bootstruct.h; sourceTree = "<group>"; };
AB43B2FC14C37E520018D529 /* cache.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cache.c; sourceTree = "<group>"; };
AB43B3F314C383120018D529 /* umoddi3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = umoddi3.c; sourceTree = "<group>"; };
AB43B3F814C384040018D529 /* stack_protector.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = stack_protector.c; sourceTree = "<group>"; };
AB43B42A14C3A8080018D529 /* arc4random.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = arc4random.c; sourceTree = "<group>"; };
AB79217514F38CF200F5EB39 /* bootXnu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bootXnu.h; sourceTree = "<group>"; };
B0056CD611F3868000754B65 /* boot */ = {isa = PBXFileReference; lastKnownFileType = text; path = boot; sourceTree = "<group>"; };
B0056CD711F3868000754B65 /* boot.sys */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.preload"; path = boot.sys; sourceTree = "<group>"; };
B0056CD811F3868000754B65 /* boot0 */ = {isa = PBXFileReference; lastKnownFileType = text; path = boot0; sourceTree = "<group>"; };
AB43B3F314C383120018D529 /* umoddi3.c */,
AB43B2DF14C37E520018D529 /* efi_tables.c */,
AB43B2E014C37E520018D529 /* efi_tables.h */,
AB43B2E114C37E520018D529 /* error.c */,
AB43B2E214C37E520018D529 /* libsa.h */,
AB43B2E314C37E520018D529 /* Makefile */,
AB43B2E414C37E520018D529 /* memory.h */,
AB43B2F614C37E520018D529 /* bios.h */,
AB43B2F714C37E520018D529 /* bios.s */,
AB43B2F814C37E520018D529 /* biosfn.c */,
AB43B2F914C37E520018D529 /* bootLion.h */,
AB43B2FA14C37E520018D529 /* bootstruct.c */,
AB43B2FB14C37E520018D529 /* bootstruct.h */,
AB79217514F38CF200F5EB39 /* bootXnu.h */,
AB43B2FC14C37E520018D529 /* cache.c */,
AB43B2FD14C37E520018D529 /* console.c */,
AB43B2FE14C37E520018D529 /* convert.c */,
branches/cparm/i386/libsaio/bootLion.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
/*
* Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. The rights granted to you under the License
* may not be used to create, or enable the creation or redistribution of,
* unlawful or unlicensed copies of an Apple operating system, or to
* circumvent, violate, or enable the circumvention or violation of, any
* terms of an Apple operating system software license agreement.
*
* Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_END@
*/
#ifndef _PEXPERT_I386_BOOT_H
#define _PEXPERT_I386_BOOT_H
#include <stdint.h>
/*
* What the booter leaves behind for the kernel.
*/
/*
* Types of boot driver that may be loaded by the booter.
*/
enum {
kBootDriverTypeInvalid = 0,
kBootDriverTypeKEXT = 1,
kBootDriverTypeMKEXT = 2
};
enum {
kEfiReservedMemoryType= 0,
kEfiLoaderCode= 1,
kEfiLoaderData= 2,
kEfiBootServicesCode= 3,
kEfiBootServicesData= 4,
kEfiRuntimeServicesCode= 5,
kEfiRuntimeServicesData= 6,
kEfiConventionalMemory= 7,
kEfiUnusableMemory= 8,
kEfiACPIReclaimMemory= 9,
kEfiACPIMemoryNVS= 10,
kEfiMemoryMappedIO= 11,
kEfiMemoryMappedIOPortSpace = 12,
kEfiPalCode= 13,
kEfiMaxMemoryType= 14
};
/*
* Memory range descriptor.
*/
typedef struct EfiMemoryRange {
uint32_t Type;
uint32_t Pad;
uint64_t PhysicalStart;
uint64_t VirtualStart;
uint64_t NumberOfPages;
uint64_t Attribute;
} EfiMemoryRange;
#define BOOT_LINE_LENGTH 1024
#define BOOT_STRING_LEN BOOT_LINE_LENGTH
/*
* Video information..
*/
struct Boot_Video {
uint32_tv_baseAddr;/* Base address of video memory */
uint32_tv_display;/* Display Code (if Applicable */
uint32_tv_rowBytes;/* Number of bytes per pixel row */
uint32_tv_width;/* Width */
uint32_tv_height;/* Height */
uint32_tv_depth;/* Pixel Depth */
};
typedef struct Boot_VideoBoot_Video;
/* Values for v_display */
#define GRAPHICS_MODE 1
#define FB_TEXT_MODE 2
/* Boot argument structure - passed into Mach kernel at boot time.
* "Revision" can be incremented for compatible changes
*/
#define kBootArgsRevision0
#define kBootArgsVersion2
/* Snapshot constants of previous revisions that are supported */
#define kBootArgsVersion11
#define kBootArgsVersion22
#define kBootArgsRevision2_00
#define kBootArgsEfiMode32 32
#define kBootArgsEfiMode64 64
typedef struct boot_args_Legacy {
uint16_t Revision;/* Revision of boot_args structure */
uint16_t Version;/* Version of boot_args structure */
char CommandLine[BOOT_LINE_LENGTH];/* Passed in command line */
uint32_t MemoryMap; /* Physical address of memory map */
uint32_t MemoryMapSize;
uint32_t MemoryMapDescriptorSize;
uint32_t MemoryMapDescriptorVersion;
Boot_VideoVideo;/* Video Information */
uint32_t deviceTreeP; /* Physical address of flattened device tree */
uint32_t deviceTreeLength; /* Length of flattened tree */
uint32_t kaddr; /* Physical address of beginning of kernel text */
uint32_t ksize; /* Size of combined kernel text+data+efi */
uint32_t efiRuntimeServicesPageStart; /* physical address of defragmented runtime pages */
uint32_t efiRuntimeServicesPageCount;
uint32_t efiSystemTable; /* physical address of system table in runtime area */
uint8_t efiMode; /* 32 = 32-bit, 64 = 64-bit */
uint8_t __reserved1[3];
uint32_t __reserved2[1];
uint32_t performanceDataStart; /* physical address of log */
uint32_t performanceDataSize;
uint64_t efiRuntimeServicesVirtualPageStart; /* virtual address of defragmented runtime pages */
uint32_t __reserved3[2];
} boot_args_Legacy;
typedef struct boot_args {
uint16_t Revision;/* Revision of boot_args structure */
uint16_t Version;/* Version of boot_args structure */
uint8_t efiMode; /* 32 = 32-bit, 64 = 64-bit */
uint8_t debugMode; /* Bit field with behavior changes */
uint8_t __reserved1[2];
char CommandLine[BOOT_LINE_LENGTH];/* Passed in command line */
uint32_t MemoryMap; /* Physical address of memory map */
uint32_t MemoryMapSize;
uint32_t MemoryMapDescriptorSize;
uint32_t MemoryMapDescriptorVersion;
Boot_VideoVideo;/* Video Information */
uint32_t deviceTreeP; /* Physical address of flattened device tree */
uint32_t deviceTreeLength; /* Length of flattened tree */
uint32_t kaddr; /* Physical address of beginning of kernel text */
uint32_t ksize; /* Size of combined kernel text+data+efi */
uint32_t efiRuntimeServicesPageStart; /* physical address of defragmented runtime pages */
uint32_t efiRuntimeServicesPageCount;
uint64_t efiRuntimeServicesVirtualPageStart; /* virtual address of defragmented runtime pages */
uint32_t efiSystemTable; /* physical address of system table in runtime area */
uint32_t __reserved2;
uint32_t performanceDataStart; /* physical address of log */
uint32_t performanceDataSize;
uint32_t keyStoreDataStart; /* physical address of key store data */
uint32_t keyStoreDataSize;
uint64_tbootMemStart;
uint64_tbootMemSize;
uint64_t PhysicalMemorySize;
uint64_t FSBFrequency;
uint32_t __reserved4[734];
} boot_args_107;
typedef struct boot_args_header {
uint16_t Revision;/* Revision of boot_args structure */
uint16_t Version;/* Version of boot_args structure */
} boot_args_header;
typedef struct boot_args_10x {
boot_args_header Header;
Boot_VideoVideo;/* Video Information */
uint32_t MemoryMap; /* Physical address of memory map */
uint32_t MemoryMapSize;
uint32_t MemoryMapDescriptorSize;
uint32_t MemoryMapDescriptorVersion;
uint8_t debugMode; /* Bit field with behavior changes */
uint8_t efiMode; /* 32 = 32-bit, 64 = 64-bit */
uint32_t deviceTreeP; /* Physical address of flattened device tree */
uint32_t deviceTreeLength; /* Length of flattened tree */
char CommandLine[BOOT_LINE_LENGTH];/* Passed in command line */
uint32_t keyStoreDataStart; /* physical address of key store data */
uint32_t keyStoreDataSize;
uint32_t efiRuntimeServicesPageStart; /* physical address of defragmented runtime pages */
uint32_t efiRuntimeServicesPageCount;
uint64_t efiRuntimeServicesVirtualPageStart; /* virtual address of defragmented runtime pages */
uint32_t efiSystemTable; /* physical address of system table in runtime area */
uint64_t FSBFrequency;
uint32_t performanceDataSize;
uint32_t performanceDataStart; /* physical address of log */
uint32_t kaddr; /* Physical address of beginning of kernel text */
uint32_t ksize; /* Size of combined kernel text+data+efi */
uint64_tbootMemStart;
uint64_tbootMemSize;
uint64_t PhysicalMemorySize;
} boot_args_10x;
typedef struct boot_args_10x boot_args_common;
extern char assert_boot_args_107_size_is_4096[sizeof(boot_args_107) == 4096 ? 1 : -1];
#endif /* _PEXPERT_I386_BOOT_H */
branches/cparm/i386/libsaio/bootstruct.h
2525
2626
2727
28
28
2929
3030
3131
#ifndef __BOOTSTRUCT_H
#define __BOOTSTRUCT_H
#include "bootLion.h"
#include "bootXnu.h"
#include "saio_types.h"
#include "bios.h"
#include "device_tree.h"
branches/cparm/i386/libsaio/bios.h
2929
3030
3131
32
32
3333
3434
3535
#ifndef __LIBSAIO_BIOS_H
#define __LIBSAIO_BIOS_H
#include "bootLion.h"
#include "bootXnu.h"
typedef union {
unsigned int rx;
branches/cparm/i386/libsaio/bootXnu.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
/*
* Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. The rights granted to you under the License
* may not be used to create, or enable the creation or redistribution of,
* unlawful or unlicensed copies of an Apple operating system, or to
* circumvent, violate, or enable the circumvention or violation of, any
* terms of an Apple operating system software license agreement.
*
* Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_END@
*/
#ifndef _PEXPERT_I386_BOOT_H
#define _PEXPERT_I386_BOOT_H
#include <stdint.h>
/*
* What the booter leaves behind for the kernel.
*/
/*
* Types of boot driver that may be loaded by the booter.
*/
enum {
kBootDriverTypeInvalid = 0,
kBootDriverTypeKEXT = 1,
kBootDriverTypeMKEXT = 2
};
enum {
kEfiReservedMemoryType= 0,
kEfiLoaderCode= 1,
kEfiLoaderData= 2,
kEfiBootServicesCode= 3,
kEfiBootServicesData= 4,
kEfiRuntimeServicesCode= 5,
kEfiRuntimeServicesData= 6,
kEfiConventionalMemory= 7,
kEfiUnusableMemory= 8,
kEfiACPIReclaimMemory= 9,
kEfiACPIMemoryNVS= 10,
kEfiMemoryMappedIO= 11,
kEfiMemoryMappedIOPortSpace = 12,
kEfiPalCode= 13,
kEfiMaxMemoryType= 14
};
/*
* Memory range descriptor.
*/
typedef struct EfiMemoryRange {
uint32_t Type;
uint32_t Pad;
uint64_t PhysicalStart;
uint64_t VirtualStart;
uint64_t NumberOfPages;
uint64_t Attribute;
} EfiMemoryRange;
#define BOOT_LINE_LENGTH 1024
#define BOOT_STRING_LEN BOOT_LINE_LENGTH
/*
* Video information..
*/
struct Boot_Video {
uint32_tv_baseAddr;/* Base address of video memory */
uint32_tv_display;/* Display Code (if Applicable */
uint32_tv_rowBytes;/* Number of bytes per pixel row */
uint32_tv_width;/* Width */
uint32_tv_height;/* Height */
uint32_tv_depth;/* Pixel Depth */
};
typedef struct Boot_VideoBoot_Video;
/* Values for v_display */
#define GRAPHICS_MODE 1
#define FB_TEXT_MODE 2
/* Boot argument structure - passed into Mach kernel at boot time.
* "Revision" can be incremented for compatible changes
*/
#define kBootArgsRevision0
#define kBootArgsVersion2
/* Snapshot constants of previous revisions that are supported */
#define kBootArgsVersion11
#define kBootArgsVersion22
#define kBootArgsRevision2_00
#define kBootArgsEfiMode32 32
#define kBootArgsEfiMode64 64
typedef struct boot_args_Legacy {
uint16_t Revision;/* Revision of boot_args structure */
uint16_t Version;/* Version of boot_args structure */
char CommandLine[BOOT_LINE_LENGTH];/* Passed in command line */
uint32_t MemoryMap; /* Physical address of memory map */
uint32_t MemoryMapSize;
uint32_t MemoryMapDescriptorSize;
uint32_t MemoryMapDescriptorVersion;
Boot_VideoVideo;/* Video Information */
uint32_t deviceTreeP; /* Physical address of flattened device tree */
uint32_t deviceTreeLength; /* Length of flattened tree */
uint32_t kaddr; /* Physical address of beginning of kernel text */
uint32_t ksize; /* Size of combined kernel text+data+efi */
uint32_t efiRuntimeServicesPageStart; /* physical address of defragmented runtime pages */
uint32_t efiRuntimeServicesPageCount;
uint32_t efiSystemTable; /* physical address of system table in runtime area */
uint8_t efiMode; /* 32 = 32-bit, 64 = 64-bit */
uint8_t __reserved1[3];
uint32_t __reserved2[1];
uint32_t performanceDataStart; /* physical address of log */
uint32_t performanceDataSize;
uint64_t efiRuntimeServicesVirtualPageStart; /* virtual address of defragmented runtime pages */
uint32_t __reserved3[2];
} boot_args_Legacy;
typedef struct boot_args {
uint16_t Revision;/* Revision of boot_args structure */
uint16_t Version;/* Version of boot_args structure */
uint8_t efiMode; /* 32 = 32-bit, 64 = 64-bit */
uint8_t debugMode; /* Bit field with behavior changes */
uint8_t __reserved1[2];
char CommandLine[BOOT_LINE_LENGTH];/* Passed in command line */
uint32_t MemoryMap; /* Physical address of memory map */
uint32_t MemoryMapSize;
uint32_t MemoryMapDescriptorSize;
uint32_t MemoryMapDescriptorVersion;
Boot_VideoVideo;/* Video Information */
uint32_t deviceTreeP; /* Physical address of flattened device tree */
uint32_t deviceTreeLength; /* Length of flattened tree */
uint32_t kaddr; /* Physical address of beginning of kernel text */
uint32_t ksize; /* Size of combined kernel text+data+efi */
uint32_t efiRuntimeServicesPageStart; /* physical address of defragmented runtime pages */
uint32_t efiRuntimeServicesPageCount;
uint64_t efiRuntimeServicesVirtualPageStart; /* virtual address of defragmented runtime pages */
uint32_t efiSystemTable; /* physical address of system table in runtime area */
uint32_t __reserved2;
uint32_t performanceDataStart; /* physical address of log */
uint32_t performanceDataSize;
uint32_t keyStoreDataStart; /* physical address of key store data */
uint32_t keyStoreDataSize;
uint64_tbootMemStart;
uint64_tbootMemSize;
uint64_t PhysicalMemorySize;
uint64_t FSBFrequency;
uint32_t __reserved4[734];
} boot_args_107;
typedef struct boot_args_header {
uint16_t Revision;/* Revision of boot_args structure */
uint16_t Version;/* Version of boot_args structure */
} boot_args_header;
typedef struct boot_args_10x {
boot_args_header Header;
Boot_VideoVideo;/* Video Information */
uint32_t MemoryMap; /* Physical address of memory map */
uint32_t MemoryMapSize;
uint32_t MemoryMapDescriptorSize;
uint32_t MemoryMapDescriptorVersion;
uint8_t debugMode; /* Bit field with behavior changes */
uint8_t efiMode; /* 32 = 32-bit, 64 = 64-bit */
uint32_t deviceTreeP; /* Physical address of flattened device tree */
uint32_t deviceTreeLength; /* Length of flattened tree */
char CommandLine[BOOT_LINE_LENGTH];/* Passed in command line */
uint32_t keyStoreDataStart; /* physical address of key store data */
uint32_t keyStoreDataSize;
uint32_t efiRuntimeServicesPageStart; /* physical address of defragmented runtime pages */
uint32_t efiRuntimeServicesPageCount;
uint64_t efiRuntimeServicesVirtualPageStart; /* virtual address of defragmented runtime pages */
uint32_t efiSystemTable; /* physical address of system table in runtime area */
uint64_t FSBFrequency;
uint32_t performanceDataSize;
uint32_t performanceDataStart; /* physical address of log */
uint32_t kaddr; /* Physical address of beginning of kernel text */
uint32_t ksize; /* Size of combined kernel text+data+efi */
uint64_tbootMemStart;
uint64_tbootMemSize;
uint64_t PhysicalMemorySize;
} boot_args_10x;
typedef struct boot_args_10x boot_args_common;
extern char assert_boot_args_107_size_is_4096[sizeof(boot_args_107) == 4096 ? 1 : -1];
#endif /* _PEXPERT_I386_BOOT_H */
branches/cparm/i386/libsaio/saio_types.h
3434
3535
3636
37
37
3838
3939
4040
#else
#include <IOKit/IOTypes.h>
#endif
#include "bootLion.h"
#include "bootXnu.h"
#if DEBUG
#define DEBUG_DISK(x) printf x
branches/cparm/i386/boot2/graphics.c
649649
650650
651651
652
652
653653
654654
655655
//==========================================================================
// Return the current video mode, VGA_TEXT_MODE or GRAPHICS_MODE.
inline int getVideoMode(void)
int getVideoMode(void)
{
return bootArgs->Video.v_display;
}
branches/cparm/i386/boot2/boot.c
10671067
10681068
10691069
1070
1071
1070
1071
1072
10721073
10731074
10741075
// If a kext is found in /Extra/Extentions return true
// If a mkext is found in /Extra return true
// Otherwise return false
// Tips (if you still use extra kext(s)/mkext(s) ): With Lion it's recommended to create a system mkext (see the kextcache commandline) to decrease boot time,
// otherwise it will act like a -f each time a extra kext/kext is detected
// Tips (if you still want to use extra kext(s)/mkext(s) ):
// With Lion and earlier, the default boot cache is a kernelcache, no mkext is created anymore by kextd automaticaly (kextd still update the existing mkexts),
// so it's recommended to create a system mkext by yourself to decrease boot time (see the kextcache commandline)
static bool found_extra_kext(void)
{
#define EXTENSIONS "Extensions"
branches/cparm/i386/boot2/modules.c
10631063
10641064
10651065
1066
1066
10671067
10681068
10691069
......
10771077
10781078
10791079
1080
1080
10811081
10821082
10831083
}
}
inline void rebase_location(UInt32* location, char* base, int type)
void rebase_location(UInt32* location, char* base, int type)
{
switch(type)
{
}
}
inline void bind_location(UInt32* location, char* value, UInt32 addend, int type)
void bind_location(UInt32* location, char* value, UInt32 addend, int type)
{
// do actual update
char* newValue = value + addend;
branches/cparm/i386/boot2/modules.h
7171
7272
7373
74
75
74
75
7676
7777
7878
EFI_STATUS execute_hook(const char* name, void*, void*, void*, void*, void*, void*);
VOID register_hook_callback(const char* name, void(*callback)(void*, void*, void*, void*, void*, void*));
inline void rebase_location(UInt32* location, char* base, int type);
inline void bind_location(UInt32* location, char* value, UInt32 addend, int type);
void rebase_location(UInt32* location, char* base, int type);
void bind_location(UInt32* location, char* value, UInt32 addend, int type);
void rebase_macho(void* base, char* rebase_stream, UInt32 size);
void bind_macho(void* base, char* bind_stream, UInt32 size);
branches/cparm/i386/modules/ACPIPatcher/acpi_patcher.c
150150
151151
152152
153
153
154154
155155
156156
#define __RES(s, u)\
inline unsigned u\
static inline unsigned u\
resolve_##s(unsigned u defaultentry, char *str, int base) \
{\
unsigned u entry = defaultentry;\
branches/cparm/i386/modules/ACPICodec/acpi_codec.c
180180
181181
182182
183
183
184184
185185
186186
//#define ULONG_MAX_32 4294967295UL
#define __RES(s, u)\
inline unsigned u\
static inline unsigned u\
resolve_##s(unsigned u defaultentry, char *str, int base) \
{\
unsigned u entry = defaultentry;\
branches/cparm/i386/libsa/error.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
* Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights
* Reserved. This file contains Original Code and/or Modifications of
* Original Code as defined in and that are subject to the Apple Public
* Source License Version 2.0 (the "License"). You may not use this file
* except in compliance with the License. Please obtain a copy of the
* License at http://www.apple.com/publicsource and read it before using
* this file.
*
* The Original Code and all software distributed under the License are
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/* error handling */
#include "libsa.h"
#if UNUSED
int errno;
char * strerror(int errnum)
{
static char error_string[16];
sprintf(error_string,"Error %d", errnum);
return error_string;
}
#endif
branches/cparm/i386/libsa/Makefile
3232
3333
3434
35
35
3636
3737
3838
SFILES = setjmp.s bzero.s bcopy.s
CFILES = qdivrem.c umoddi3.c udivdi3.c divdi3.c moddi3.c prf.c printf.c zalloc.c \
string.c strtol.c error.c \
string.c strtol.c \
qsort.c efi_tables.c
HFILES = memory.h

Archive Download the corresponding diff file

Revision: 1824