Chameleon

Chameleon Commit Details

Date:2015-02-27 00:06:22 (4 years 5 months ago)
Author:ErmaC
Commit:2583
Parents: 2582
Message:Typo.
Changes:
M/trunk/i386/libsaio/smbios.h
M/trunk/i386/boot2/graphics.c
M/trunk/i386/util/segsize.c
M/trunk/i386/libsaio/xml.h
M/trunk/i386/libsaio/ntfs_private.h
M/trunk/i386/modules/AcpiCodec/acpi_codec.c
M/trunk/i386/libsaio/nvidia.c
M/trunk/i386/boot2/modules.c
M/trunk/i386/libsaio/pci.c
M/trunk/i386/util/dyldsymboltool.c
M/trunk/i386/libsaio/pci_root.c
M/trunk/i386/boot2/modules.h
M/trunk/i386/boot2/mboot.c
M/trunk/i386/libsaio/disk.c
M/trunk/i386/boot2/lzvn.c
M/trunk/i386/modules/Resolution/Resolution.c

File differences

trunk/i386/libsaio/xml.h
22
33
44
5
5
66
77
88
......
1010
1111
1212
13
13
1414
1515
1616
......
1818
1919
2020
21
21
2222
2323
2424
......
4040
4141
4242
43
43
4444
45
45
4646
4747
4848
49
49
5050
5151
5252
......
6363
6464
6565
66
67
68
69
70
71
66
67
68
69
70
71
7272
73
74
75
76
77
78
79
80
81
82
8373
8474
8575
86
76
8777
8878
8979
......
9888
9989
10090
101
91
10292
10393
10494
......
10898
10999
110100
111
101
112102
113103
114104
......
119109
120110
121111
122
112
123113
124114
125115
126
116
127117
128118
129119
* Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
*
* Portions Copyright (c) 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
* 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,
* 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@
*/
struct string_ref
{
char* string;
char *string;
int id;
struct string_ref* next;
struct string_ref *next;
};
typedef struct string_ref string_ref;
extern string_ref* ref_strings;
extern string_ref *ref_strings;
#define kXMLTagPList "plist "
#define kXMLTagDict "dict"
#define kXMLStringID "ID="
#define kXMLStringIDRef "IDREF="
#define kPropCFBundleIdentifier ("CFBundleIdentifier")
#define kPropCFBundleExecutable ("CFBundleExecutable")
#define kPropOSBundleRequired ("OSBundleRequired")
#define kPropOSBundleLibraries ("OSBundleLibraries")
#define kPropIOKitPersonalities ("IOKitPersonalities")
#define kPropIONameMatch ("IONameMatch")
#define kPropCFBundleIdentifier("CFBundleIdentifier")
#define kPropCFBundleExecutable("CFBundleExecutable")
#define kPropOSBundleRequired("OSBundleRequired")
#define kPropOSBundleLibraries("OSBundleLibraries")
#define kPropIOKitPersonalities("IOKitPersonalities")
#define kPropIONameMatch("IONameMatch")
/*
struct Tag {
long type;
char *string;
struct Tag *tag;
struct Tag *tagNext;
};
typedef struct Tag Tag, *TagPtr;
*/
extern long gImageFirstBootXAddr;
extern long gImageLastKernelAddr;
TagPtr XMLGetProperty( TagPtr dict, const char * key );
TagPtr XMLGetProperty( TagPtr dict, const char *key );
TagPtr XMLGetElement( TagPtr dict, int id );
TagPtr XMLGetKey( TagPtr dict, int id );
TagPtr XMLGetValueForKey(TagPtr key);
int XMLCastInteger ( TagPtr dict );
TagPtr XMLCastDict ( TagPtr dict );
TagPtr XMLCastArray( TagPtr dict );
char* XMLCastData( TagPtr dict, int* length );
char* XMLCastData( TagPtr dict, int *length );
bool XMLIsBoolean(TagPtr entry);
bool XMLIsString (TagPtr entry);
bool XMLIsData (TagPtr entry);
bool XMLAddTagToDictionary(TagPtr dict, char* key, TagPtr value);
bool XMLAddTagToDictionary(TagPtr dict, char *key, TagPtr value);
long XMLParseNextTag(char *buffer, TagPtr *tag);
void XMLFreeTag(TagPtr tag);
// Puts the first dictionary it finds in the
// tag pointer and returns 0, or returns -1 if not found.
//
long XMLParseFile( char * buffer, TagPtr * dict );
long XMLParseFile( char *buffer, TagPtr *dict );
//==========================================================================
// ParseTag*
long ParseTagBoolean( char * buffer, TagPtr * tag, long type );
long ParseTagBoolean( char *buffer, TagPtr *tag, long type );
#endif /* __LIBSAIO_XML_H */
trunk/i386/libsaio/ntfs_private.h
147147
148148
149149
150
150
151151
152152
153153
u_int64_t t_write;
u_int64_t t_mftwrite;
u_int64_t t_access;
} ntfs_times_t;
} ntfs_times_t;
#define NTFS_FFLAG_RDONLY0x01LL
#define NTFS_FFLAG_HIDDEN0x02LL
trunk/i386/libsaio/pci_root.c
4949
5050
5151
52
52
5353
5454
5555
void *new_dsdt;
const char *val;
int len,fsize;
int len, fsize;
const char * dsdt_filename = NULL;
extern int search_and_get_acpi_fd(const char *, const char **);
trunk/i386/libsaio/nvidia.c
19631963
19641964
19651965
1966
19671966
19681967
19691968
unsigned long long mem_detect(volatile uint8_t *regs, uint8_t nvCardType, pci_dt_t *nvda_dev, uint32_t device_id, uint32_t subsys_id)
{
uint64_t vram_size = 0;
// unsigned long long vram_size = 0;
// First check if any value exist in the plist
cardList_t * nvcard = FindCardWithIds(device_id, subsys_id);
trunk/i386/libsaio/disk.c
975975
976976
977977
978
978
979
980
981
982
983
984
979985
980986
981987
......
14301436
14311437
14321438
1433
1439
14341440
14351441
14361442
......
14931499
14941500
14951501
1502
1503
14961504
14971505
14981506
......
22182226
22192227
22202228
2221
2229
22222230
22232231
22242232
{
// Create a new mapping.
map = (struct DiskBVMap *)malloc(sizeof(*map));
map = (struct DiskBVMap *) malloc(sizeof(*map));
if ( !map )
{
return NULL;
}
if ( map )
{
map->biosdev = biosdev;
// Determine whether the partition header signature is present.
if (memcmp(headerMap->hdr_sig, GPT_HDR_SIG, strlen(GPT_HDR_SIG)))
if ( memcmp(headerMap->hdr_sig, GPT_HDR_SIG, strlen(GPT_HDR_SIG)) )
{
goto scanErr;
}
goto scanErr;
}
bzero(buffer,bufferSize);
if (readBytes(biosdev, gptBlock, 0, bufferSize, buffer) != 0)
{
goto scanErr;
* hd(x,y)|uuid|"label" "alias";hd(m,n)|uuid|"label" "alias"; etc...
*/
bool getVolumeLabelAlias(BVRef bvr, char* str, long strMaxLen)
static bool getVolumeLabelAlias(BVRef bvr, char* str, long strMaxLen)
{
char *aliasList, *entryStart, *entryNext;
trunk/i386/libsaio/smbios.h
833833
834834
835835
836
836
837837
838838
839839
typedef struct SMBOemProcessorBusSpeed
{
SMB_STRUCT_HEADER// Type 132
SMBWord ProcessorBusSpeed; // MT/s unit
SMBWord ProcessorBusSpeed;// MT/s unit
} __attribute__((packed)) SMBOemProcessorBusSpeed;
//----------------------------------------------------------------------------------------------------------
trunk/i386/libsaio/pci.c
1616
1717
1818
19
19
2020
2121
2222
#if DEBUG_PCI
#define DBG(x...)printf(x)
#else
#define DBG(x...)
#define DBG(x...)msglog(x)
#endif
pci_dt_t*root_pci_dev;
trunk/i386/boot2/graphics.c
11201120
11211121
11221122
1123
1124
1123
1124
11251125
11261126
11271127
unsigned long numbers[],
unsigned long maxArrayCount )
{
char *propStr;
unsigned long count = 0;
char*propStr;
unsigned longcount = 0;
propStr = newStringForKey((char *)propKey , &bootInfo->chameleonConfig);
trunk/i386/boot2/mboot.c
290290
291291
292292
293
294
293
294
295295
296296
297297
......
404404
405405
406406
407
407
408408
409409
410410
......
415415
416416
417417
418
419
418
419
420420
421421
422422
continue_at_low_address();
// Now fix our return address.
// JrCs: this macro should be rewritten because the code generated by XCode 4.x
// change the value of the argument passed as parameter (multiboot_magic)
// JrCs: this macro should be rewritten because the code generated by XCode 4.x
// change the value of the argument passed as parameter (multiboot_magic)
// FIX_RETURN_ADDRESS_USING_FIRST_ARG(multiboot_magic);
// We can now do just about anything, including return to our caller correctly.
else
doSelectDevice = true;
}
if(getValueForBootKey(mi->mi_cmdline, "timeout", &val, &size))
{
char *endptr;
multiboot_timeout = intVal;
multiboot_timeout_set = 1;
}
}
}
if(getValueForBootKey(mi->mi_cmdline, "partno", &val, &size))
{
char *endptr;
trunk/i386/boot2/lzvn.c
5757
5858
5959
60
60
6161
62
62
6363
6464
6565
} while (0)
size_t lzvn_decode(void * dst,
size_t lzvn_decode(void *dst,
size_t dst_size,
const void * src,
const void *src,
size_t src_size)
{
size_t rax = 0;
trunk/i386/boot2/modules.c
2525
2626
2727
28
29
28
29
3030
3131
3232
......
118118
119119
120120
121
121
122122
123123
124124
......
271271
272272
273273
274
274
275275
276276
277277
......
300300
301301
302302
303
303
304304
305305
306306
......
12291229
12301230
12311231
1232
1233
1234
1232
1233
1234
12351235
12361236
12371237
#define DBGPAUSE()
#endif
static inline voidrebase_location(UInt32* location, char* base, int type);
static inline voidbind_location(UInt32* location, char* value, UInt32 addend, int type);
static inline voidrebase_location(UInt32 *location, char *base, int type);
static inline voidbind_location(UInt32 *location, char *value, UInt32 addend, int type);
// NOTE: Global so that modules can link with this
static UInt64 textAddress = 0;
last = mod->mm_string;
}
char* name = strdup(last);
char *name = strdup(last);
name[strlen(last) - sizeof("dylib")] = 0;
DBG("Loading multiboot module %s\n", name);
* adjust it's internal symbol list (sort) to optimize locating new symbols
* NOTE: returns the address if the symbol is "start", else returns 0xFFFFFFFF
*/
long long add_symbol(char* symbol, long long addr, char is64)
long long add_symbol(char *symbol, long long addr, char is64)
{
// This only can handle 32bit symbols
symbolList_t* entry;
*/
void module_loaded(const char* name, void* start, const char* author, const char* description, UInt32 version, UInt32 compat)
{
moduleList_t* new_entry = malloc(sizeof(moduleList_t));
moduleList_t *new_entry = malloc(sizeof(moduleList_t));
new_entry->next = loadedModules;
loadedModules = new_entry;
return 0;
}
void start_built_in_module(const char* name,
const char* author,
const char* description,
void start_built_in_module(const char *name,
const char *author,
const char *description,
UInt32 version,
UInt32 compat,
void(*start_function)(void))
trunk/i386/boot2/modules.h
3434
3535
3636
37
37
3838
3939
4040
4141
42
43
44
42
43
44
4545
4646
4747
......
6868
6969
7070
71
71
7272
7373
7474
......
7676
7777
7878
79
80
79
80
8181
8282
8383
8484
8585
8686
87
87
8888
8989
90
90
9191
9292
93
93
9494
9595
96
96
9797
98
98
9999
100100
101101
102102
103103
104
105
106
107
104
105
106
107
108108
109109
110110
typedef struct callbackList_t
{
void(*callback)(void*, void*, void*, void*);
struct callbackList_t* next;
struct callbackList_t *next;
} callbackList_t;
typedef struct moduleHook_t
{
const char* name;
callbackList_t* callbacks;
struct moduleHook_t* next;
const char *name;
callbackList_t *callbacks;
struct moduleHook_t *next;
} moduleHook_t;
typedef struct modulesList_t
int load_module(char* module);
int is_module_loaded(const char* name);
void module_loaded(const char* name, void* start, const char* author, const char* description, UInt32 version, UInt32 compat);
void module_loaded(const char *name, void *start, const char *author, const char *description, UInt32 version, UInt32 compat);
/********************************************************************************/
/*Symbol Functions*/
/********************************************************************************/
long longadd_symbol(char* symbol, long long addr, char is64);
unsigned intlookup_all_symbols(const char* name);
long longadd_symbol(char *symbol, long long addr, char is64);
unsigned intlookup_all_symbols(const char *name);
/********************************************************************************/
/*Macho Parser*/
/********************************************************************************/
void*parse_mach(void* binary,
void*parse_mach(void *binary,
int(*dylib_loader)(char*),
long long(*symbol_handler)(char*, long long, char),
void (*section_handler)(char* section, char* segment, void* cmd, UInt64 offset, UInt64 address)
void (*section_handler)(char *section, char *segment, void *cmd, UInt64 offset, UInt64 address)
);
unsigned inthandle_symtable(UInt32 base,
struct symtab_command* symtabCommand,
struct symtab_command *symtabCommand,
long long(*symbol_handler)(char*, long long, char),
char is64);
voidrebase_macho(void* base, char* rebase_stream, UInt32 size);
voidrebase_macho(void *base, char *rebase_stream, UInt32 size);
voidbind_macho(void* base, UInt8* bind_stream, UInt32 size);
voidbind_macho(void *base, UInt8 *bind_stream, UInt32 size);
/********************************************************************************/
/*Module Interface*/
/********************************************************************************/
intreplace_function(const char* symbol, void* newAddress);
intexecute_hook(const char* name, void*, void*, void*, void*);
voidregister_hook_callback(const char* name, void(*callback)(void*, void*, void*, void*));
moduleHook_t*hook_exists(const char* name);
intreplace_function(const char *symbol, void *newAddress);
intexecute_hook(const char *name, void*, void*, void*, void*);
voidregister_hook_callback(const char* name, void(*callback)(void*, void*, void*, void*));
moduleHook_t*hook_exists(const char* name);
#if DEBUG_MODULES
voidprint_hook_list();
trunk/i386/modules/Resolution/Resolution.c
99
1010
1111
12
13
12
13
1414
15
16
17
15
16
17
1818
1919
void Resolution_start();
void Resolution_start()
{
UInt32 bp = 0;
UInt32 x, y;
UInt32 bp = 0;
UInt32 x, y;
patchVideoBios();
getResolution(&x, &y, &bp);
gui.screen.width = x;
gui.screen.height = y;
getResolution(&x, &y, &bp);
gui.screen.width = x;
gui.screen.height = y;
}
trunk/i386/modules/AcpiCodec/acpi_codec.c
43304330
43314331
43324332
4333
4333
43344334
43354335
43364336
{
DropTables_p = XMLCastDict(XMLGetProperty(bootInfo->chameleonConfig.dictionary, (const char*)"ACPIDropTables"));
if (DropTables_p) DropTables_tag_count = XMLTagCount(DropTables_p) ;
}
}
U32 new_table = 0ul;
U8 new_table_index = 0, table_added = 0;
trunk/i386/util/dyldsymboltool.c
135135
136136
137137
138
139
140
138
139
140
141141
142142
143143
dylib.dylib_info.cmd = LC_ID_DYLIB;
dylib.dylib_info.cmdsize = sizeof(struct dylib_command) + sizeof(dylib.module_name);// todo: verify
dylib.dylib_info.dylib.name.offset = sizeof(struct dylib_command);
dylib.dylib_info.dylib.timestamp = 0;// TODO: populate with time
dylib.dylib_info.dylib.current_version = 0;// TODO
dylib.dylib_info.dylib.compatibility_version = 0;// TODO
dylib.dylib_info.dylib.timestamp = 0;// TODO: populate with time
dylib.dylib_info.dylib.current_version = 0;// TODO
dylib.dylib_info.dylib.compatibility_version = 0;// TODO
//int offset = dylib.dylib_info.cmdsize%4 ? 4 - (dylib.dylib_info.cmdsize % 4) : 0;
trunk/i386/util/segsize.c
103103
104104
105105
106
106
107107
108108
109109
// boolisDATA;
// unsignedvmsize;
#define lcp((struct load_command *)cp)
#define lcp((struct load_command *)cp)
switch(swap(lcp->cmd)) {
case LC_SEGMENT:

Archive Download the corresponding diff file

Revision: 2583