Chameleon Applications

Chameleon Applications Commit Details

Date:2011-06-01 14:49:45 (12 years 10 months ago)
Author:ErmaC
Commit:308
Parents: 307
Message:Organizing the script builddmg, and update from main chameleon trunk
Changes:
A/branches/iFabio/Chameleon/i386/libsaio/ati.h
A/branches/iFabio/Chameleon/i386/libsaio/mem.h
A/branches/iFabio/Chameleon/i386/libsaio/smbios_patcher.h
M/branches/iFabio/Chameleon/i386/libsaio/bootstruct.h
M/branches/iFabio/Chameleon/i386/libsaio/xml.c
M/branches/iFabio/Chameleon/package/buildpkg
M/branches/iFabio/Chameleon/Makefile
M/branches/iFabio/Chameleon/i386/boot2/drivers.c
M/branches/iFabio/Chameleon/i386/boot2/boot.c
M/branches/iFabio/Chameleon/package/builddmg

File differences

branches/iFabio/Chameleon/i386/libsaio/xml.c
909909
910910
911911
912
913912
914
915
916
917913
918914
919915
......
991987
992988
993989
994
995990
996
997
998
999991
1000992
1001993
if (gTagsFree == 0)
{
#if USEMALLOC
tag = (TagPtr)malloc(kTagsPerBlock * sizeof(Tag));
#else
tag = (TagPtr)AllocateBootXMemory(kTagsPerBlock * sizeof(Tag));
#endif
if (tag == 0) return 0;
// Initalize the new tags.
// Add the new symbol.
if (symbol == 0)
{
#if USEMALLOC
symbol = (SymbolPtr)malloc(sizeof(Symbol) + 1 + strlen(string));
#else
symbol = (SymbolPtr)AllocateBootXMemory(sizeof(Symbol) + 1 + strlen(string));
#endif
if (symbol == 0) //return 0;
stop("NULL symbol!");
branches/iFabio/Chameleon/i386/libsaio/bootstruct.h
1
1
22
33
44
......
3030
3131
3232
33
34
33
34
3535
3636
3737
3838
3939
4040
41
4142
43
44
45
46
47
4248
4349
4450
......
100106
101107
102108
103
104
109
110
105111
106
112
107113
108114
109115
......
133139
134140
135141
136
142
137143
138144
/*
/** <-- JavaDoc style (doxygen) //Azi
* Copyright (c) 2002-2003 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
#include "bios.h"
#include "device_tree.h"
/*
* Kernel boot args global also used by booter for its own data.
/*! <-- QT style (doxygen) //Azi
Kernel boot args global also used by booter for its own data.
*/
extern boot_args *bootArgs;
extern boot_args_pre_lion *bootArgsPreLion;
extern Node *gMemoryMapNode;
#define VGA_TEXT_MODE 0
//defined in /usr/../boot.h
//#define GRAPHICS_MODE 1
//#define FB_TEXT_MODE 2
/*
* Maximum number of boot drivers that can be loaded.
*/
/*!
PrivateBootInfo has fields used by the booter that used to be part of
KernelBootArgs_t *bootArgs. When the switch was made to EFI the structure
completely changed to boot_args *bootArgs. This (new to boot-132) structure
KernelBootArgs_t *bootArgs. When the switch was made to EFI the structure
completely changed to boot_args *bootArgs. This (new to boot-132) structure
contains the fields the kernel no longer cares about but the booter still
uses internally. Some fields (e.g. the video information) remain interesting
uses internally. Some fields (e.g. the video information) remain interesting
to the kernel and are thus located in bootArgs although with different field names.
*/
typedef struct PrivateBootInfo {
config_file_t ramdiskConfig; // RAMDisk.plist
} PrivateBootInfo_t;
extern PrivateBootInfo_t *bootInfo;
extern PrivateBootInfo_t *bootInfo;
#endif /* __BOOTSTRUCT_H */
branches/iFabio/Chameleon/i386/libsaio/smbios_patcher.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
/*
* Copyright 2008 mackerintel
*/
/*
* AsereBLN: cleanup
*/
#ifndef __LIBSAIO_SMBIOS_PATCHER_H
#define __LIBSAIO_SMBIOS_PATCHER_H
#include "libsaio.h"
#include "SMBIOS.h"
extern char MacModel[8];
extern unsigned int ModelRev;
extern uint64_t smbios_p;
/* From Foundation/Efi/Guid/Smbios/SmBios.h */
/* Modified to wrap Data4 array init with {} */
#define EFI_SMBIOS_TABLE_GUID {0xeb9d2d31, 0x2d88, 0x11d3, 0x9a, 0x16, {0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d}}
#define SMBIOS_RANGE_START 0x000F0000
#define SMBIOS_RANGE_END 0x000FFFFF
#define SMBIOS_ORIGINAL0
#define SMBIOS_PATCHED1
struct smbios_table_header
{
uint8_ttype;
uint8_tlength;
uint16_thandle;
} __attribute__ ((packed));
struct smbios_property
{
const char*name;
uint8_ttable_type;
enum {SMSTRING, SMWORD, SMBYTE, SMOWORD} value_type;
intoffset;
int(*auto_int) (const char *name, int table_num);
const char*(*auto_str) (const char *name, int table_num);
const char*(*auto_oword) (const char *name, int table_num);
};
struct smbios_table_description
{
uint8_ttype;
intlen;
int(*numfunc)(int tablen);
};
/** call with flag SMBIOS_ORIGINAL to get orig. entrypoint
or call with flag SMBIOS_PATCHED to get patched smbios entrypoint
*/
extern struct SMBEntryPoint*getSmbios(int);
extern struct DMIHeader* FindNextDmiTableOfType(int type, int minlen);
extern struct DMIHeader* FindFirstDmiTableOfType(int type, int minlen);
extern void getSmbiosProductName();
const char *smbiosStringAtIndex(DMIHeader*, int index, int *length );
extern bool scanDMI(void);
extern void scan_cpu_DMI(void); //PlatformInfo_t *); //Slice
#endif /* !__LIBSAIO_SMBIOS_PATCHER_H */
branches/iFabio/Chameleon/i386/libsaio/mem.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/*
* Copyright 2010 AsereBLN. All rights reserved. <aserebln@googlemail.com>
*
* mem.h
*/
#ifndef __LIBSAIO_MEM_H
#define __LIBSAIO_MEM_H
#include "platform.h"
extern void scan_memory(); //PlatformInfo_t *);
#endif/* __LIBSAIO_MEM_H */
branches/iFabio/Chameleon/i386/libsaio/ati.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
/*
* ATI injector
*
* Copyright (C) 2009 Jasmin Fazlic, iNDi, netkas
*
* ATI injector is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ATI driver and injector is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ATI injector. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Alternatively you can choose to comply with APSL
*/
#ifndef __LIBSAIO_ATI_H
#define __LIBSAIO_ATI_H
bool setup_ati_devprop(pci_dt_t *ati_dev);
struct ati_chipsets_t {
unsigned device;
char *name;
};
struct ati_data_key {
uint32_t size;
char *name;
uint8_t data[];
};
#define REG8(reg) ((volatile uint8_t *)regs)[(reg)]
#define REG16(reg) ((volatile uint16_t *)regs)[(reg) >> 1]
#define REG32R(reg) ((volatile uint32_t *)regs)[(reg) >> 2]
#define REG32W(reg, val) ((volatile uint32_t *)regs)[(reg) >> 2] = (val)
#endif /* !__LIBSAIO_ATI_H */
branches/iFabio/Chameleon/i386/boot2/drivers.c
210210
211211
212212
213
214
213
214
215215
216
217
218
219
220
216
217
218
219
220
221
222
221223
222
223
224
225
226
227
228
229
230
231
232
233
224234
225
226
227
228
229
230
231
235
236
232237
233
234
238
239
240
241
242
243
235244
245
246
247
248
249
250
251
236252
237
238
239
240
241
242
243253
244254
245255
......
808818
809819
810820
811
821
822
823
824
812825
813826
814827
}
}
// Also try to load Extensions from boot helper partitions.
if (gBootVolume->flags & kBVFlagBooter)
if(!gHaveKernelCache)
{
strcpy(dirSpecExtra, "/com.apple.boot.P/System/Library/");
if (FileLoadDrivers(dirSpecExtra, 0) != 0)
{
strcpy(dirSpecExtra, "/com.apple.boot.R/System/Library/");
if (FileLoadDrivers(dirSpecExtra, 0) != 0)
// Non-prelinked kernel, load system mkext.
// NOTE: In it's default state, XNU cannot be both prelinked, and load additional drivers
// from the bootloader. There is, however, a patch that changes this and allows
// for both to occure.
// Also try to load Extensions from boot helper partitions.
if (gBootVolume->flags & kBVFlagBooter)
{
strcpy(dirSpecExtra, "/com.apple.boot.S/System/Library/");
FileLoadDrivers(dirSpecExtra, 0);
strcpy(dirSpecExtra, "/com.apple.boot.P/System/Library/");
if (FileLoadDrivers(dirSpecExtra, 0) != 0)
{
strcpy(dirSpecExtra, "/com.apple.boot.R/System/Library/");
if (FileLoadDrivers(dirSpecExtra, 0) != 0)
{
strcpy(dirSpecExtra, "/com.apple.boot.S/System/Library/");
FileLoadDrivers(dirSpecExtra, 0);
}
}
}
}
}
if (gMKextName[0] != '\0')
{
verbose("LoadDrivers: Loading from [%s]\n", gMKextName);
if ( LoadDriverMKext(gMKextName) != 0 )
if (gMKextName[0] != '\0')
{
error("Could not load %s\n", gMKextName);
return -1;
verbose("LoadDrivers: Loading from [%s]\n", gMKextName);
if ( LoadDriverMKext(gMKextName) != 0 )
{
error("Could not load %s\n", gMKextName);
return -1;
}
}
else
{
strcpy(gExtensionsSpec, dirSpec);
strcat(gExtensionsSpec, "System/Library/");
FileLoadDrivers(gExtensionsSpec, 0);
}
}
else
{
strcpy(gExtensionsSpec, dirSpec);
strcat(gExtensionsSpec, "System/Library/");
FileLoadDrivers(gExtensionsSpec, 0);
}
}
else
{
return -1;
}
}
// Notify modules that the kernel has been decompressed, is about to be decoded
execute_hook("DecodeKernel", (void*)binary, NULL, NULL, NULL);
ret = ThinFatFile(&binary, &len);
if (ret == 0 && len == 0 && archCpuType==CPU_TYPE_X86_64)
{
branches/iFabio/Chameleon/i386/boot2/boot.c
155155
156156
157157
158
159
158
160159
161160
162161
......
486485
487486
488487
489
488
490489
491490
492491
execute_hook("DecodedKernel", (void*)binary, NULL, NULL, NULL);
// Load boot drivers from the specifed root path.
if (!gHaveKernelCache)
LoadDrivers("/");
LoadDrivers("/");
clearActivityIndicator();
break;
}
if(getBoolForKey(kUseKernelCache, &usecache, &bootInfo->bootConfig)) {
if(getBoolForKey(kUseKernelCache, &usecache, &bootInfo->bootConfig) && usecache) {
if (getValueForKey(kKernelCacheKey, &val, &len, &bootInfo->bootConfig)) {
strlcpy(gBootKernelCacheFile, val, len+1);
}
branches/iFabio/Chameleon/package/buildpkg
1010
1111
1212
13
13
1414
1515
1616
COL_BLACK="\x1b[30;01m"
COL_RED="\x1b[31;01m"
COL_GREEN="\x1b[32;01m" #COL_GREEN="\x1b[32;01m"
COL_GREEN="\x1b[32;01m"
COL_YELLOW="\x1b[33;01m"
COL_MAGENTA="\x1b[35;01m"
COL_CYAN="\x1b[36;01m"
branches/iFabio/Chameleon/package/builddmg
11
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
#!/bin/bash
# $1 Path to store built dmg
DMG_ROOT="${0%/*}"
OPENUP_TOOL=${1%/*}/i386/openUp
SRC_FOLDER=$DMG_ROOT/source
VOLUME_NAME="Chameleon"
DMG_TEMP_NAME=${DMG_ROOT}/rw.${DMG_NAME}
#
# ==========================
#
COL_BLACK="\x1b[30;01m"
COL_RED="\x1b[31;01m"
COL_GREEN="\x1b[32;01m"
COL_YELLOW="\x1b[33;01m"
COL_MAGENTA="\x1b[35;01m"
COL_CYAN="\x1b[36;01m"
COL_WHITE="\x1b[37;01m"
COL_BLUE="\x1b[34;01m"
COL_RESET="\x1b[39;49;00m"
#
# ==========================
#
version=$( cat version )
stage=${version##*-}
revision=$( grep I386BOOT_CHAMELEONREVISION sym/i386/vers.h | awk '{ print $3 }' | tr -d '\"' )
builddate=$( grep I386BOOT_BUILDDATE sym/i386/vers.h | awk '{ print $3,$4 }' | tr -d '\"' )
timestamp=$( date -j -f "%Y-%m-%d %H:%M:%S" "${builddate}" "+%s" )
#
# Create a read-only disk image of the contents of a folder
#
echo "=========== BUILD .DMG TEST ==========="
echo ""
echo "- Version:$version"
echo "- Stage:$stage"
echo "- Revision:$revision"
echo "- Build date:$builddate"
echo "- Time stamp:$timestamp"
echo ""
echo "- DMG path:$DMG_ROOT"
echo "- Source dir:$SRC_FOLDER"
echo "- Volume name:$VOLUME_NAME"
echo "- Temp dmg:$DMG_TEMP_NAME"
echo ""
echo "- OpenUp path:$OPENUP_TOOL"
echo ""
echo "================= END ================="
echo ""
exit 0
branches/iFabio/Chameleon/Makefile
103103
104104
105105
106
106107
107108
108109
dmg: all
@if [ -e "$(SYMROOT)" ]; then \
sudo `pwd`/package/slimpkg `pwd`/sym/package; \
sudo `pwd`/package/builddmg `pwd`/sym/package; \
fi;
.PHONY: $(SYMROOT)/i386/vers.h

Archive Download the corresponding diff file

Revision: 308