Chameleon

Chameleon Commit Details

Date:2011-08-19 22:05:11 (12 years 7 months ago)
Author:Azimutz
Commit:1441
Parents: 1440
Message:Sync these with trunk (r1440).
Changes:
C/trunk/artwork/themes/default/device_freebsd.png → /branches/azimutz/trunkGraphicsEnablerModules/artwork/themes/default/device_freebsd.png
C/trunk/artwork/themes/default/device_freebsd_o.png → /branches/azimutz/Package/artwork/themes/default/device_freebsd_o.png
C/trunk/i386/libsaio/freebsd.c → /branches/azimutz/Package/i386/libsaio/freebsd.c
C/trunk/artwork/themes/default/device_openbsd.png → /branches/azimutz/Package/artwork/themes/default/device_openbsd.png
C/trunk/i386/libsaio/befs.c → /branches/azimutz/trunkAutoResolution/i386/libsaio/befs.c
C/trunk/artwork/themes/default/device_befs_o.png → /branches/azimutz/trunkGraphicsEnablerModules/artwork/themes/default/device_befs_o.png
C/trunk/i386/libsaio/freebsd.h → /branches/azimutz/Package/i386/libsaio/freebsd.h
C/trunk/artwork/themes/default/device_openbsd_o.png → /branches/azimutz/trunkAutoResolution/artwork/themes/default/device_openbsd_o.png
C/trunk/i386/libsaio/befs.h → /branches/azimutz/trunkAutoResolution/i386/libsaio/befs.h
C/trunk/artwork/themes/default/device_befs.png → /branches/azimutz/trunkGraphicsEnablerModules/artwork/themes/default/device_befs.png
C/trunk/i386/libsaio/openbsd.c → /branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/openbsd.c
C/trunk/i386/libsaio/openbsd.h → /branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/openbsd.h
M/branches/azimutz/Package/i386/boot2/gui.c
M/branches/azimutz/trunkAutoResolution
M/branches/azimutz/trunkAutoResolution/i386/libsaio/fdisk.h
M/branches/azimutz/Package/i386/libsaio/disk.c
M/branches/azimutz/trunkAutoResolution/i386/boot2/boot.c
M/branches/azimutz/Package/i386/libsaio/Makefile
M/branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/saio_types.h
M/branches/azimutz/Package/CREDITS
M/branches/azimutz/trunkGraphicsEnablerModules/i386/boot2/gui.c
M/branches/azimutz/Package/i386/libsaio/fdisk.h
M/branches/azimutz/trunkGraphicsEnablerModules
M/branches/azimutz/trunkAutoResolution/i386/libsaio/disk.c
M/branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/fdisk.h
M/branches/azimutz/trunkGraphicsEnablerModules/i386/boot2/boot.c
M/branches/azimutz/trunkAutoResolution/i386/libsaio/Makefile
M/branches/azimutz/Package/i386/libsaio/saio_types.h
M/branches/azimutz/trunkAutoResolution/CREDITS
M/branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/disk.c
M/branches/azimutz/Package/i386/boot2/boot.c
M/branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/Makefile
M/branches/azimutz/trunkAutoResolution/i386/libsaio/saio_types.h
M/branches/azimutz/trunkGraphicsEnablerModules/CREDITS
M/branches/azimutz/trunkAutoResolution/i386/boot2/gui.c

File differences

branches/azimutz/trunkAutoResolution/i386/libsaio/Makefile
3131
3232
3333
34
3435
3536
3637
SAIO_OBJS = table.o asm.o bios.o biosfn.o \
disk.o sys.o cache.o bootstruct.o \
stringTable.o load.o pci.o allocate.o misc.o \
befs.o freebsd.o openbsd.o \
vbe.o nbp.o hfs.o hfs_compare.o \
xml.o ntfs.o msdos.o md5c.o device_tree.o \
cpu.o platform.o acpi_patcher.o \
branches/azimutz/trunkAutoResolution/i386/libsaio/befs.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
37
38
39
40
41
42
43
/*
* befs.c
*
*
* Created by scorpius
* Copyright 2010
*
*/
#include "libsaio.h"
#include "sl.h"
#include "befs.h"
#define BeFSProbeSize2048
#define SUPER_BLOCK_MAGIC1 0x42465331 /* BFS1 */
#define SUPER_BLOCK_MAGIC2 0xdd121031
#define SUPER_BLOCK_MAGIC3 0x15b6830e
/* Find BeFS signature */
bool BeFSProbe (const void *buf)
{
return (OSReadLittleInt32(buf+0x220,0)==SUPER_BLOCK_MAGIC1);
}
/* Find BeFS volume label */
void BeFSGetDescription(CICell ih, char *str, long strMaxLen)
{
char * buf=malloc (BeFSProbeSize);
str[0]=0;
if (!buf)
return;
Seek(ih, 0);
Read(ih, (long)buf, BeFSProbeSize);
if (!BeFSProbe (buf))
{
free (buf);
return;
}
str[strMaxLen]=0;
strncpy (str, buf+0x200, MIN (strMaxLen, 32));
free (buf);
}
branches/azimutz/trunkAutoResolution/i386/libsaio/befs.h
1
2
3
4
5
6
7
8
9
10
11
/*
* befs.h
*
*
* Created by scorpius
* Copyright 2010
*
*/
extern bool BeFSProbe (const void *buf);
extern void BeFSGetDescription(CICell ih, char *str, long strMaxLen);
branches/azimutz/trunkAutoResolution/i386/libsaio/fdisk.h
5151
5252
5353
54
55
56
5457
5558
5659
#define FDISK_FAT320x0c/* FAT32 partition */
#define FDISK_DOS16SLBA 0x0e
#define FDISK_LINUX0x83
#define FDISK_OPENBSD0xa6 /* OpenBSD FFS partition */
#define FDISK_FREEBSD0xa5 /* FreeBSD UFS2 partition */
#define FDISK_BEFS0xeb /* Haiku BeFS partition */
#define FDISK_UFS0xa8/* Apple UFS partition */
#define FDISK_HFS0xaf/* Apple HFS partition */
#define FDISK_BOOTER0xab/* Apple booter partition */
branches/azimutz/trunkAutoResolution/i386/libsaio/disk.c
7373
7474
7575
76
77
78
7679
7780
7881
......
899902
900903
901904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
902938
903939
904940
......
10991135
11001136
11011137
1138
1139
1140
1141
11021142
11031143
1144
1145
11041146
11051147
11061148
......
16921734
16931735
16941736
1737
1738
16951739
16961740
16971741
16981742
1699
1700
1743
1744
1745
17011746
17021747
17031748
#include "ntfs.h"
#include "msdos.h"
#include "ext2fs.h"
#include "befs.h"
#include "freebsd.h"
#include "openbsd.h"
#include "xml.h"
#include "disk.h"
// For EFI_GUID
0, kBIOSDevTypeHardDrive, 0);
break;
case FDISK_BEFS:
bvr = newFDiskBVRef(
biosdev, partno,
part->relsect,
part,
0, 0, 0, 0, 0, 0,
BeFSGetDescription,
(BVFree)free,
0, kBIOSDevTypeHardDrive, 0);
break;
case FDISK_FREEBSD:
bvr = newFDiskBVRef(
biosdev, partno,
part->relsect,
part,
0, 0, 0, 0, 0, 0,
FreeBSDGetDescription,
(BVFree)free,
0, kBIOSDevTypeHardDrive, 0);
break;
case FDISK_OPENBSD:
bvr = newFDiskBVRef(
biosdev, partno,
part->relsect,
part,
0, 0, 0, 0, 0, 0,
OpenBSDGetDescription,
(BVFree)free,
0, kBIOSDevTypeHardDrive, 0);
break;
default:
bvr = newFDiskBVRef(
biosdev, partno,
result = FDISK_HFS;
else if (EX2Probe(probeBuffer))
result = FDISK_LINUX;
else if (FreeBSDProbe(probeBuffer))
result = FDISK_FREEBSD;
else if (OpenBSDProbe(probeBuffer))
result = FDISK_OPENBSD;
else if (NTFSProbe(probeBuffer))
result = FDISK_NTFS;
else if (BeFSProbe(probeBuffer))
result = FDISK_BEFS;
else if (fatbits=MSDOSProbe(probeBuffer))
{
switch (fatbits)
{ FDISK_DOS16SLBA,"Windows FAT16" },
{ FDISK_SMALLFAT32,"Windows FAT32" },
{ FDISK_FAT32,"Windows FAT32" },
{ FDISK_FREEBSD,"FreeBSD" },
{ FDISK_OPENBSD,"OpenBSD" },
{ FDISK_LINUX,"Linux" },
{ FDISK_UFS,"Apple UFS" },
{ FDISK_HFS,"Apple HFS" },
{ FDISK_BOOTER,"Apple Boot/UFS" },
{ 0xCD,"CD-ROM" },
{ 0x00,0 } /* must be last */
{ FDISK_BEFS,"Haiku" },
{ 0xCD,"CD-ROM" },
{ 0x00,0 } /* must be last */
};
//==========================================================================
branches/azimutz/trunkAutoResolution/i386/libsaio/openbsd.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
#include "libsaio.h"
#include "sl.h"
#include "openbsd.h"
#define OpenBSDProbeSize2048
bool OpenBSDProbe (const void *buf)
{
return (OSReadLittleInt32(buf+0x200,0)==0x82564557);
}
void OpenBSDGetDescription(CICell ih, char *str, long strMaxLen)
{
char * buf=malloc(OpenBSDProbeSize);
str[0]=0;
if (!buf)
return;
Seek(ih, 0);
Read(ih, (long)buf, OpenBSDProbeSize);
if (!OpenBSDProbe (buf))
{
free (buf);
return;
}
if (OSReadLittleInt32 (buf+0x44c,0)<1)
{
free (buf);
return;
}
str[strMaxLen]=0;
strncpy (str, buf+0x478, MIN (strMaxLen, 32));
free (buf);
}
branches/azimutz/trunkAutoResolution/i386/libsaio/openbsd.h
1
2
extern bool OpenBSDProbe (const void *buf);
extern void OpenBSDGetDescription(CICell ih, char *str, long strMaxLen);
branches/azimutz/trunkAutoResolution/i386/libsaio/freebsd.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
#include "libsaio.h"
#include "sl.h"
#include "freebsd.h"
#define FreeBSDProbeSize2048
bool FreeBSDProbe (const void *buf)
{
return (OSReadLittleInt32(buf+0xA55C,0)==0x19540119);
}
void FreeBSDGetDescription(CICell ih, char *str, long strMaxLen)
{
char * buf=malloc(FreeBSDProbeSize);
str[0]=0;
if (!buf)
return;
Seek(ih, 0);
Read(ih, (long)buf, FreeBSDProbeSize);
if (!FreeBSDProbe (buf))
{
free (buf);
return;
}
if (OSReadLittleInt32 (buf+0x44c,0)<1)
{
free (buf);
return;
}
str[strMaxLen]=0;
strncpy (str, buf+0x478, MIN (strMaxLen, 32));
free (buf);
}
branches/azimutz/trunkAutoResolution/i386/libsaio/freebsd.h
1
2
extern bool FreeBSDProbe (const void *buf);
extern void FreeBSDGetDescription(CICell ih, char *str, long strMaxLen);
branches/azimutz/trunkAutoResolution/i386/libsaio/saio_types.h
217217
218218
219219
220
220
221
222
223
221224
222225
223226
kPartitionTypeHPFS= 0x07,
kPartitionTypeFAT16= 0x06,
kPartitionTypeFAT32= 0x0c,
kPartitionTypeEXT3= 0x83
kPartitionTypeEXT3= 0x83,
kPartitionTypeBEFS= 0xEB,
kPartitionTypeFreeBSD= 0xa5,
kPartitionTypeOpenBSD= 0xa6
};
//#define BIOS_DEV_TYPE(d)((d) & kBIOSDevTypeMask)
branches/azimutz/trunkAutoResolution/i386/boot2/boot.c
453453
454454
455455
456
456
457457
458458
459459
......
579579
580580
581581
582
583
582
583
584
585
586
587
588
589
590
591
584592
585593
586594
......
590598
591599
592600
593
601
594602
595603
596604
597
605
598606
599607
600608
......
629637
630638
631639
632
640
633641
634642
635643
......
637645
638646
639647
640
648
649
650
651
641652
642
643
644
653
654
655
656
645657
646658
647659
648
649
650
651
660
661
662
663
664
665
652666
653667
654668
655
669
656670
657
658
671
672
673
674
659675
660676
661677
662
663
664
665
666
667
668
669
670
671678
672679
673680
while (1)
{
booltryresume, tryresumedefault, forceresume;
boolusecache = false;//true;
booluseKernelCache = false; // by default don't use prelink kernel cache
const char*val;
intlen, trycache, ret = -1;
longflags, cachetime, kerneltime, exttime, sleeptime, time;
break;
}
getBoolForKey(kUseKernelCache, &usecache, &bootInfo->chameleonConfig);
if (usecache) {
// If boot from boot helper partitions and OS is Lion use prelink kernel.
// We need to find a solution to load extra mkext with a prelink kernel.
if (gBootVolume->flags & kBVFlagBooter && checkOSVersion("10.7")) {
verbose("Booting from Lion RAID volume so forcing to use KernelCache\n");
useKernelCache = true;
} else {
getBoolForKey(kUseKernelCache, &useKernelCache, &bootInfo->chameleonConfig);
}
if (useKernelCache) {
if (getValueForKey(kKernelCacheKey, &val, &len, &bootInfo->bootConfig)) {
if (val[0] == '\\')
{
strlcpy(gBootKernelCacheFile, val, len + 1);
}
else {
//Lion
// Lion prelink kernel cache file
if (checkOSVersion("10.7")) {
sprintf(gBootKernelCacheFile, "%skernelcache", kDefaultCachePathSnow);
}
// Snow Leopard
// Snow Leopard prelink kernel cache file
else if (checkOSVersion("10.6")) {
sprintf(gBootKernelCacheFile, "kernelcache_%s", (archCpuType == CPU_TYPE_I386)
? "i386" : "x86_64");
}
// Check for cache file.
trycache = (usecache &&
trycache = (useKernelCache &&
((gBootMode & kBootModeSafe) == 0) &&
!gOverrideKernel &&
(gBootFileType == kBlockDeviceType) &&
(gBootKernelCacheFile[0] != '\0'));
verbose("Loading Darwin %s\n", gMacOSVersion);
// Check if the kernel cache file exists and is more recent (mtime) than
// the kernel file or the S/L/E directory
if (trycache) do {
ret = GetFileInfo(NULL, bootInfo->bootFile, &flags, &kerneltime);
if (ret != 0) kerneltime = 0;
else if ((flags & kFileTypeMask) != kFileTypeFlat) {
ret = GetFileInfo(NULL, gBootKernelCacheFile, &flags, &cachetime);
// Check if the kernel cache file exist
if ((ret != 0) || ((flags & kFileTypeMask) != kFileTypeFlat)) {
trycache = 0;
break;
}
ret = GetFileInfo(NULL, gBootKernelCacheFile, &flags, &cachetime);
if ((ret != 0) || ((flags & kFileTypeMask) != kFileTypeFlat)
|| (cachetime < kerneltime)) {
ret = GetFileInfo(NULL, bootInfo->bootFile, &flags, &kerneltime);
if ((ret != 0) || ((flags & kFileTypeMask) != kFileTypeFlat))
kerneltime = -1;
// Check if the kernel file is more recent than the cache file
if (kerneltime > cachetime) {
trycache = 0;
break;
}
ret = GetFileInfo("/System/Library/", "Extensions", &flags, &exttime);
if ((ret == 0) && ((flags & kFileTypeMask) == kFileTypeDirectory)
&& (cachetime < exttime)) {
if ((ret != 0) && ((flags & kFileTypeMask) != kFileTypeDirectory))
exttime = -1;
// Check if the S/L/E directory time is more recent than the cache file
if (exttime > cachetime) {
trycache = 0;
break;
}
if (ret == 0 && kerneltime > exttime) {
exttime = kerneltime;
}
if (ret == 0 && cachetime != (exttime + 1)) {
trycache = 0;
break;
}
} while (0);
do {
branches/azimutz/trunkAutoResolution/i386/boot2/gui.c
4545
4646
4747
48
49
50
51
52
53
4854
4955
5056
......
94100
95101
96102
103
104
105
106
107
108
97109
98110
99111
......
305317
306318
307319
320
321
322
323
324
325
308326
309327
310328
......
784802
785803
786804
805
806
807
808
809
810
811
812
813
814
815
816
787817
788818
789819
iDeviceHFSRAID_o,
iDeviceEXT3,
iDeviceEXT3_o,
iDeviceFreeBSD, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
iDeviceFreeBSD_o, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
iDeviceOpenBSD, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
iDeviceOpenBSD_o, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
iDeviceBEFS, /* Haiku detection and Icon credits to scorpius */
iDeviceBEFS_o, /* Haiku detection and Icon credits to scorpius */
iDeviceFAT,
iDeviceFAT_o,
iDeviceFAT16,
{.name = "device_hfsraid_o", .image = NULL},
{.name = "device_ext3", .image = NULL},
{.name = "device_ext3_o", .image = NULL},
{.name = "device_freebsd", .image = NULL}, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
{.name = "device_freebsd_o", .image = NULL}, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
{.name = "device_openbsd", .image = NULL}, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
{.name = "device_openbsd_o", .image = NULL}, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
{.name = "device_befs", .image = NULL}, /* Haiku detection and Icon credits to scorpius */
{.name = "device_befs_o", .image = NULL}, /* Haiku detection and Icon credits to scorpius */
{.name = "device_fat", .image = NULL},
{.name = "device_fat_o", .image = NULL},
{.name = "device_fat16", .image = NULL},
LOADPNG(device_hfsraid_o, iDeviceHFSRAID);
LOADPNG(device_ext3, iDeviceGeneric);
LOADPNG(device_ext3_o, iDeviceEXT3);
LOADPNG(device_freebsd, iDeviceGeneric); /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
LOADPNG(device_freebsd_o, iDeviceFreeBSD); /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
LOADPNG(device_openbsd, iDeviceGeneric); /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
LOADPNG(device_openbsd_o, iDeviceOpenBSD); /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
LOADPNG(device_befs, iDeviceGeneric); /* Haiku detection and Icon credits to scorpius */
LOADPNG(device_befs_o, iDeviceBEFS); /* Haiku detection and Icon credits to scorpius */
LOADPNG(device_fat, iDeviceGeneric);
LOADPNG(device_fat_o, iDeviceFAT);
LOADPNG(device_fat16, iDeviceFAT);
devicetype = iDeviceNTFS;// Use HPFS / NTFS icon
break;
case kPartitionTypeBEFS: /* Haiku detection and Icon credits to scorpius */
devicetype = iDeviceBEFS;// Use BEFS / Haiku icon
break;
case kPartitionTypeFreeBSD: /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
devicetype = iDeviceFreeBSD; // Use FreeBSD icon
break;
case kPartitionTypeOpenBSD: /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
devicetype = iDeviceOpenBSD; // Use OpenBSD icon
break;
case kPartitionTypeFAT16:
devicetype = iDeviceFAT16;// Use FAT16 icon
break;
branches/azimutz/trunkAutoResolution/CREDITS
77
88
99
10
10
1111
1212
1313
Thanks to:
---------
JrCs, mercurysquad, munky, rekursor, kalyway, Krazubu, XyZ, blackosx, DHP
JrCs, mercurysquad, munky, rekursor, cosmolt, kalyway, Krazubu, THeKiNG, XyZ, blackosx, DHP, cparm, nawcom, anval, scorpius
Package:
---------
branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/Makefile
3131
3232
3333
34
3435
3536
3637
SAIO_OBJS = table.o asm.o bios.o biosfn.o \
disk.o sys.o cache.o bootstruct.o \
stringTable.o load.o pci.o allocate.o misc.o \
befs.o freebsd.o openbsd.o \
vbe.o nbp.o hfs.o hfs_compare.o \
xml.o ntfs.o msdos.o md5c.o device_tree.o \
cpu.o platform.o acpi_patcher.o \
branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/befs.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
37
38
39
40
41
42
43
/*
* befs.c
*
*
* Created by scorpius
* Copyright 2010
*
*/
#include "libsaio.h"
#include "sl.h"
#include "befs.h"
#define BeFSProbeSize2048
#define SUPER_BLOCK_MAGIC1 0x42465331 /* BFS1 */
#define SUPER_BLOCK_MAGIC2 0xdd121031
#define SUPER_BLOCK_MAGIC3 0x15b6830e
/* Find BeFS signature */
bool BeFSProbe (const void *buf)
{
return (OSReadLittleInt32(buf+0x220,0)==SUPER_BLOCK_MAGIC1);
}
/* Find BeFS volume label */
void BeFSGetDescription(CICell ih, char *str, long strMaxLen)
{
char * buf=malloc (BeFSProbeSize);
str[0]=0;
if (!buf)
return;
Seek(ih, 0);
Read(ih, (long)buf, BeFSProbeSize);
if (!BeFSProbe (buf))
{
free (buf);
return;
}
str[strMaxLen]=0;
strncpy (str, buf+0x200, MIN (strMaxLen, 32));
free (buf);
}
branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/befs.h
1
2
3
4
5
6
7
8
9
10
11
/*
* befs.h
*
*
* Created by scorpius
* Copyright 2010
*
*/
extern bool BeFSProbe (const void *buf);
extern void BeFSGetDescription(CICell ih, char *str, long strMaxLen);
branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/fdisk.h
5151
5252
5353
54
55
56
5457
5558
5659
#define FDISK_FAT320x0c/* FAT32 partition */
#define FDISK_DOS16SLBA 0x0e
#define FDISK_LINUX0x83
#define FDISK_OPENBSD0xa6 /* OpenBSD FFS partition */
#define FDISK_FREEBSD0xa5 /* FreeBSD UFS2 partition */
#define FDISK_BEFS0xeb /* Haiku BeFS partition */
#define FDISK_UFS0xa8/* Apple UFS partition */
#define FDISK_HFS0xaf/* Apple HFS partition */
#define FDISK_BOOTER0xab/* Apple booter partition */
branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/disk.c
7373
7474
7575
76
77
78
7679
7780
7881
......
899902
900903
901904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
902938
903939
904940
......
10991135
11001136
11011137
1138
1139
1140
1141
11021142
11031143
1144
1145
11041146
11051147
11061148
......
16921734
16931735
16941736
1737
1738
16951739
16961740
16971741
16981742
1699
1700
1743
1744
1745
17011746
17021747
17031748
#include "ntfs.h"
#include "msdos.h"
#include "ext2fs.h"
#include "befs.h"
#include "freebsd.h"
#include "openbsd.h"
#include "xml.h"
#include "disk.h"
// For EFI_GUID
0, kBIOSDevTypeHardDrive, 0);
break;
case FDISK_BEFS:
bvr = newFDiskBVRef(
biosdev, partno,
part->relsect,
part,
0, 0, 0, 0, 0, 0,
BeFSGetDescription,
(BVFree)free,
0, kBIOSDevTypeHardDrive, 0);
break;
case FDISK_FREEBSD:
bvr = newFDiskBVRef(
biosdev, partno,
part->relsect,
part,
0, 0, 0, 0, 0, 0,
FreeBSDGetDescription,
(BVFree)free,
0, kBIOSDevTypeHardDrive, 0);
break;
case FDISK_OPENBSD:
bvr = newFDiskBVRef(
biosdev, partno,
part->relsect,
part,
0, 0, 0, 0, 0, 0,
OpenBSDGetDescription,
(BVFree)free,
0, kBIOSDevTypeHardDrive, 0);
break;
default:
bvr = newFDiskBVRef(
biosdev, partno,
result = FDISK_HFS;
else if (EX2Probe(probeBuffer))
result = FDISK_LINUX;
else if (FreeBSDProbe(probeBuffer))
result = FDISK_FREEBSD;
else if (OpenBSDProbe(probeBuffer))
result = FDISK_OPENBSD;
else if (NTFSProbe(probeBuffer))
result = FDISK_NTFS;
else if (BeFSProbe(probeBuffer))
result = FDISK_BEFS;
else if (fatbits=MSDOSProbe(probeBuffer))
{
switch (fatbits)
{ FDISK_DOS16SLBA,"Windows FAT16" },
{ FDISK_SMALLFAT32,"Windows FAT32" },
{ FDISK_FAT32,"Windows FAT32" },
{ FDISK_FREEBSD,"FreeBSD" },
{ FDISK_OPENBSD,"OpenBSD" },
{ FDISK_LINUX,"Linux" },
{ FDISK_UFS,"Apple UFS" },
{ FDISK_HFS,"Apple HFS" },
{ FDISK_BOOTER,"Apple Boot/UFS" },
{ 0xCD,"CD-ROM" },
{ 0x00,0 } /* must be last */
{ FDISK_BEFS,"Haiku" },
{ 0xCD,"CD-ROM" },
{ 0x00,0 } /* must be last */
};
//==========================================================================
branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/openbsd.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
#include "libsaio.h"
#include "sl.h"
#include "openbsd.h"
#define OpenBSDProbeSize2048
bool OpenBSDProbe (const void *buf)
{
return (OSReadLittleInt32(buf+0x200,0)==0x82564557);
}
void OpenBSDGetDescription(CICell ih, char *str, long strMaxLen)
{
char * buf=malloc(OpenBSDProbeSize);
str[0]=0;
if (!buf)
return;
Seek(ih, 0);
Read(ih, (long)buf, OpenBSDProbeSize);
if (!OpenBSDProbe (buf))
{
free (buf);
return;
}
if (OSReadLittleInt32 (buf+0x44c,0)<1)
{
free (buf);
return;
}
str[strMaxLen]=0;
strncpy (str, buf+0x478, MIN (strMaxLen, 32));
free (buf);
}
branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/openbsd.h
1
2
extern bool OpenBSDProbe (const void *buf);
extern void OpenBSDGetDescription(CICell ih, char *str, long strMaxLen);
branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/freebsd.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
#include "libsaio.h"
#include "sl.h"
#include "freebsd.h"
#define FreeBSDProbeSize2048
bool FreeBSDProbe (const void *buf)
{
return (OSReadLittleInt32(buf+0xA55C,0)==0x19540119);
}
void FreeBSDGetDescription(CICell ih, char *str, long strMaxLen)
{
char * buf=malloc(FreeBSDProbeSize);
str[0]=0;
if (!buf)
return;
Seek(ih, 0);
Read(ih, (long)buf, FreeBSDProbeSize);
if (!FreeBSDProbe (buf))
{
free (buf);
return;
}
if (OSReadLittleInt32 (buf+0x44c,0)<1)
{
free (buf);
return;
}
str[strMaxLen]=0;
strncpy (str, buf+0x478, MIN (strMaxLen, 32));
free (buf);
}
branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/freebsd.h
1
2
extern bool FreeBSDProbe (const void *buf);
extern void FreeBSDGetDescription(CICell ih, char *str, long strMaxLen);
branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/saio_types.h
217217
218218
219219
220
220
221
222
223
221224
222225
223226
kPartitionTypeHPFS= 0x07,
kPartitionTypeFAT16= 0x06,
kPartitionTypeFAT32= 0x0c,
kPartitionTypeEXT3= 0x83
kPartitionTypeEXT3= 0x83,
kPartitionTypeBEFS= 0xEB,
kPartitionTypeFreeBSD= 0xa5,
kPartitionTypeOpenBSD= 0xa6
};
//#define BIOS_DEV_TYPE(d)((d) & kBIOSDevTypeMask)
branches/azimutz/trunkGraphicsEnablerModules/i386/boot2/boot.c
364364
365365
366366
367
367
368368
369369
370370
......
487487
488488
489489
490
491
490
491
492
493
494
495
496
497
498
499
492500
493501
494502
......
498506
499507
500508
501
509
502510
503511
504512
505
513
506514
507515
508516
......
537545
538546
539547
540
548
541549
542550
543551
......
545553
546554
547555
548
556
557
558
559
549560
550
551
552
561
562
563
564
553565
554566
555567
556
557
558
559
568
569
570
571
572
573
560574
561575
562576
563
577
564578
565
566
579
580
581
582
567583
568584
569585
570
571
572
573
574
575
576
577
578
579586
580587
581588
while (1)
{
booltryresume, tryresumedefault, forceresume;
boolusecache = false;//true;
booluseKernelCache = false; // by default don't use prelink kernel cache
const char*val;
intlen, trycache, ret = -1;
longflags, cachetime, kerneltime, exttime, sleeptime, time;
break;
}
getBoolForKey(kUseKernelCache, &usecache, &bootInfo->chameleonConfig);
if (usecache) {
// If boot from boot helper partitions and OS is Lion use prelink kernel.
// We need to find a solution to load extra mkext with a prelink kernel.
if (gBootVolume->flags & kBVFlagBooter && checkOSVersion("10.7")) {
verbose("Booting from Lion RAID volume so forcing to use KernelCache\n");
useKernelCache = true;
} else {
getBoolForKey(kUseKernelCache, &useKernelCache, &bootInfo->chameleonConfig);
}
if (useKernelCache) {
if (getValueForKey(kKernelCacheKey, &val, &len, &bootInfo->bootConfig)) {
if (val[0] == '\\')
{
strlcpy(gBootKernelCacheFile, val, len + 1);
}
else {
//Lion
// Lion prelink kernel cache file
if (checkOSVersion("10.7")) {
sprintf(gBootKernelCacheFile, "%skernelcache", kDefaultCachePathSnow);
}
// Snow Leopard
// Snow Leopard prelink kernel cache file
else if (checkOSVersion("10.6")) {
sprintf(gBootKernelCacheFile, "kernelcache_%s", (archCpuType == CPU_TYPE_I386)
? "i386" : "x86_64");
}
// Check for cache file.
trycache = (usecache &&
trycache = (useKernelCache &&
((gBootMode & kBootModeSafe) == 0) &&
!gOverrideKernel &&
(gBootFileType == kBlockDeviceType) &&
(gBootKernelCacheFile[0] != '\0'));
verbose("Loading Darwin %s\n", gMacOSVersion);
// Check if the kernel cache file exists and is more recent (mtime) than
// the kernel file or the S/L/E directory
if (trycache) do {
ret = GetFileInfo(NULL, bootInfo->bootFile, &flags, &kerneltime);
if (ret != 0) kerneltime = 0;
else if ((flags & kFileTypeMask) != kFileTypeFlat) {
ret = GetFileInfo(NULL, gBootKernelCacheFile, &flags, &cachetime);
// Check if the kernel cache file exist
if ((ret != 0) || ((flags & kFileTypeMask) != kFileTypeFlat)) {
trycache = 0;
break;
}
ret = GetFileInfo(NULL, gBootKernelCacheFile, &flags, &cachetime);
if ((ret != 0) || ((flags & kFileTypeMask) != kFileTypeFlat)
|| (cachetime < kerneltime)) {
ret = GetFileInfo(NULL, bootInfo->bootFile, &flags, &kerneltime);
if ((ret != 0) || ((flags & kFileTypeMask) != kFileTypeFlat))
kerneltime = -1;
// Check if the kernel file is more recent than the cache file
if (kerneltime > cachetime) {
trycache = 0;
break;
}
ret = GetFileInfo("/System/Library/", "Extensions", &flags, &exttime);
if ((ret == 0) && ((flags & kFileTypeMask) == kFileTypeDirectory)
&& (cachetime < exttime)) {
if ((ret != 0) && ((flags & kFileTypeMask) != kFileTypeDirectory))
exttime = -1;
// Check if the S/L/E directory time is more recent than the cache file
if (exttime > cachetime) {
trycache = 0;
break;
}
if (ret == 0 && kerneltime > exttime) {
exttime = kerneltime;
}
if (ret == 0 && cachetime != (exttime + 1)) {
trycache = 0;
break;
}
} while (0);
do {
branches/azimutz/trunkGraphicsEnablerModules/i386/boot2/gui.c
4444
4545
4646
47
48
49
50
51
52
4753
4854
4955
......
9399
94100
95101
102
103
104
105
106
107
96108
97109
98110
......
304316
305317
306318
319
320
321
322
323
324
307325
308326
309327
......
763781
764782
765783
784
785
786
787
788
789
790
791
792
793
794
795
766796
767797
768798
iDeviceHFSRAID_o,
iDeviceEXT3,
iDeviceEXT3_o,
iDeviceFreeBSD, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
iDeviceFreeBSD_o, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
iDeviceOpenBSD, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
iDeviceOpenBSD_o, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
iDeviceBEFS, /* Haiku detection and Icon credits to scorpius */
iDeviceBEFS_o, /* Haiku detection and Icon credits to scorpius */
iDeviceFAT,
iDeviceFAT_o,
iDeviceFAT16,
{.name = "device_hfsraid_o", .image = NULL},
{.name = "device_ext3", .image = NULL},
{.name = "device_ext3_o", .image = NULL},
{.name = "device_freebsd", .image = NULL}, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
{.name = "device_freebsd_o", .image = NULL}, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
{.name = "device_openbsd", .image = NULL}, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
{.name = "device_openbsd_o", .image = NULL}, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
{.name = "device_befs", .image = NULL}, /* Haiku detection and Icon credits to scorpius */
{.name = "device_befs_o", .image = NULL}, /* Haiku detection and Icon credits to scorpius */
{.name = "device_fat", .image = NULL},
{.name = "device_fat_o", .image = NULL},
{.name = "device_fat16", .image = NULL},
LOADPNG(device_hfsraid_o, iDeviceHFSRAID);
LOADPNG(device_ext3, iDeviceGeneric);
LOADPNG(device_ext3_o, iDeviceEXT3);
LOADPNG(device_freebsd, iDeviceGeneric); /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
LOADPNG(device_freebsd_o, iDeviceFreeBSD); /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
LOADPNG(device_openbsd, iDeviceGeneric); /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
LOADPNG(device_openbsd_o, iDeviceOpenBSD); /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
LOADPNG(device_befs, iDeviceGeneric); /* Haiku detection and Icon credits to scorpius */
LOADPNG(device_befs_o, iDeviceBEFS); /* Haiku detection and Icon credits to scorpius */
LOADPNG(device_fat, iDeviceGeneric);
LOADPNG(device_fat_o, iDeviceFAT);
LOADPNG(device_fat16, iDeviceFAT);
devicetype = iDeviceNTFS;// Use HPFS / NTFS icon
break;
case kPartitionTypeBEFS: /* Haiku detection and Icon credits to scorpius */
devicetype = iDeviceBEFS;// Use BEFS / Haiku icon
break;
case kPartitionTypeFreeBSD: /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
devicetype = iDeviceFreeBSD; // Use FreeBSD icon
break;
case kPartitionTypeOpenBSD: /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
devicetype = iDeviceOpenBSD; // Use OpenBSD icon
break;
case kPartitionTypeFAT16:
devicetype = iDeviceFAT16;// Use FAT16 icon
break;
branches/azimutz/trunkGraphicsEnablerModules/CREDITS
77
88
99
10
10
1111
1212
1313
Thanks to:
---------
JrCs, mercurysquad, munky, rekursor, kalyway, Krazubu, XyZ, blackosx, DHP
JrCs, mercurysquad, munky, rekursor, cosmolt, kalyway, Krazubu, THeKiNG, XyZ, blackosx, DHP, cparm, nawcom, anval, scorpius
Package:
---------
branches/azimutz/Package/i386/libsaio/Makefile
3131
3232
3333
34
3435
3536
3637
SAIO_OBJS = table.o asm.o bios.o biosfn.o \
disk.o sys.o cache.o bootstruct.o \
stringTable.o load.o pci.o allocate.o misc.o \
befs.o freebsd.o openbsd.o \
vbe.o nbp.o hfs.o hfs_compare.o \
xml.o ntfs.o msdos.o md5c.o device_tree.o \
cpu.o platform.o acpi_patcher.o \
branches/azimutz/Package/i386/libsaio/befs.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
37
38
39
40
41
42
43
/*
* befs.c
*
*
* Created by scorpius
* Copyright 2010
*
*/
#include "libsaio.h"
#include "sl.h"
#include "befs.h"
#define BeFSProbeSize2048
#define SUPER_BLOCK_MAGIC1 0x42465331 /* BFS1 */
#define SUPER_BLOCK_MAGIC2 0xdd121031
#define SUPER_BLOCK_MAGIC3 0x15b6830e
/* Find BeFS signature */
bool BeFSProbe (const void *buf)
{
return (OSReadLittleInt32(buf+0x220,0)==SUPER_BLOCK_MAGIC1);
}
/* Find BeFS volume label */
void BeFSGetDescription(CICell ih, char *str, long strMaxLen)
{
char * buf=malloc (BeFSProbeSize);
str[0]=0;
if (!buf)
return;
Seek(ih, 0);
Read(ih, (long)buf, BeFSProbeSize);
if (!BeFSProbe (buf))
{
free (buf);
return;
}
str[strMaxLen]=0;
strncpy (str, buf+0x200, MIN (strMaxLen, 32));
free (buf);
}
branches/azimutz/Package/i386/libsaio/befs.h
1
2
3
4
5
6
7
8
9
10
11
/*
* befs.h
*
*
* Created by scorpius
* Copyright 2010
*
*/
extern bool BeFSProbe (const void *buf);
extern void BeFSGetDescription(CICell ih, char *str, long strMaxLen);
branches/azimutz/Package/i386/libsaio/fdisk.h
5151
5252
5353
54
55
56
5457
5558
5659
#define FDISK_FAT320x0c/* FAT32 partition */
#define FDISK_DOS16SLBA 0x0e
#define FDISK_LINUX0x83
#define FDISK_OPENBSD0xa6 /* OpenBSD FFS partition */
#define FDISK_FREEBSD0xa5 /* FreeBSD UFS2 partition */
#define FDISK_BEFS0xeb /* Haiku BeFS partition */
#define FDISK_UFS0xa8/* Apple UFS partition */
#define FDISK_HFS0xaf/* Apple HFS partition */
#define FDISK_BOOTER0xab/* Apple booter partition */
branches/azimutz/Package/i386/libsaio/disk.c
7373
7474
7575
76
77
78
7679
7780
7881
......
899902
900903
901904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
902938
903939
904940
......
10991135
11001136
11011137
1138
1139
1140
1141
11021142
11031143
1144
1145
11041146
11051147
11061148
......
16921734
16931735
16941736
1737
1738
16951739
16961740
16971741
16981742
1699
1700
1743
1744
1745
17011746
17021747
17031748
#include "ntfs.h"
#include "msdos.h"
#include "ext2fs.h"
#include "befs.h"
#include "freebsd.h"
#include "openbsd.h"
#include "xml.h"
#include "disk.h"
// For EFI_GUID
0, kBIOSDevTypeHardDrive, 0);
break;
case FDISK_BEFS:
bvr = newFDiskBVRef(
biosdev, partno,
part->relsect,
part,
0, 0, 0, 0, 0, 0,
BeFSGetDescription,
(BVFree)free,
0, kBIOSDevTypeHardDrive, 0);
break;
case FDISK_FREEBSD:
bvr = newFDiskBVRef(
biosdev, partno,
part->relsect,
part,
0, 0, 0, 0, 0, 0,
FreeBSDGetDescription,
(BVFree)free,
0, kBIOSDevTypeHardDrive, 0);
break;
case FDISK_OPENBSD:
bvr = newFDiskBVRef(
biosdev, partno,
part->relsect,
part,
0, 0, 0, 0, 0, 0,
OpenBSDGetDescription,
(BVFree)free,
0, kBIOSDevTypeHardDrive, 0);
break;
default:
bvr = newFDiskBVRef(
biosdev, partno,
result = FDISK_HFS;
else if (EX2Probe(probeBuffer))
result = FDISK_LINUX;
else if (FreeBSDProbe(probeBuffer))
result = FDISK_FREEBSD;
else if (OpenBSDProbe(probeBuffer))
result = FDISK_OPENBSD;
else if (NTFSProbe(probeBuffer))
result = FDISK_NTFS;
else if (BeFSProbe(probeBuffer))
result = FDISK_BEFS;
else if (fatbits=MSDOSProbe(probeBuffer))
{
switch (fatbits)
{ FDISK_DOS16SLBA,"Windows FAT16" },
{ FDISK_SMALLFAT32,"Windows FAT32" },
{ FDISK_FAT32,"Windows FAT32" },
{ FDISK_FREEBSD,"FreeBSD" },
{ FDISK_OPENBSD,"OpenBSD" },
{ FDISK_LINUX,"Linux" },
{ FDISK_UFS,"Apple UFS" },
{ FDISK_HFS,"Apple HFS" },
{ FDISK_BOOTER,"Apple Boot/UFS" },
{ 0xCD,"CD-ROM" },
{ 0x00,0 } /* must be last */
{ FDISK_BEFS,"Haiku" },
{ 0xCD,"CD-ROM" },
{ 0x00,0 } /* must be last */
};
//==========================================================================
branches/azimutz/Package/i386/libsaio/openbsd.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
#include "libsaio.h"
#include "sl.h"
#include "openbsd.h"
#define OpenBSDProbeSize2048
bool OpenBSDProbe (const void *buf)
{
return (OSReadLittleInt32(buf+0x200,0)==0x82564557);
}
void OpenBSDGetDescription(CICell ih, char *str, long strMaxLen)
{
char * buf=malloc(OpenBSDProbeSize);
str[0]=0;
if (!buf)
return;
Seek(ih, 0);
Read(ih, (long)buf, OpenBSDProbeSize);
if (!OpenBSDProbe (buf))
{
free (buf);
return;
}
if (OSReadLittleInt32 (buf+0x44c,0)<1)
{
free (buf);
return;
}
str[strMaxLen]=0;
strncpy (str, buf+0x478, MIN (strMaxLen, 32));
free (buf);
}
branches/azimutz/Package/i386/libsaio/openbsd.h
1
2
extern bool OpenBSDProbe (const void *buf);
extern void OpenBSDGetDescription(CICell ih, char *str, long strMaxLen);
branches/azimutz/Package/i386/libsaio/freebsd.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
#include "libsaio.h"
#include "sl.h"
#include "freebsd.h"
#define FreeBSDProbeSize2048
bool FreeBSDProbe (const void *buf)
{
return (OSReadLittleInt32(buf+0xA55C,0)==0x19540119);
}
void FreeBSDGetDescription(CICell ih, char *str, long strMaxLen)
{
char * buf=malloc(FreeBSDProbeSize);
str[0]=0;
if (!buf)
return;
Seek(ih, 0);
Read(ih, (long)buf, FreeBSDProbeSize);
if (!FreeBSDProbe (buf))
{
free (buf);
return;
}
if (OSReadLittleInt32 (buf+0x44c,0)<1)
{
free (buf);
return;
}
str[strMaxLen]=0;
strncpy (str, buf+0x478, MIN (strMaxLen, 32));
free (buf);
}
branches/azimutz/Package/i386/libsaio/freebsd.h
1
2
extern bool FreeBSDProbe (const void *buf);
extern void FreeBSDGetDescription(CICell ih, char *str, long strMaxLen);
branches/azimutz/Package/i386/libsaio/saio_types.h
217217
218218
219219
220
220
221
222
223
221224
222225
223226
kPartitionTypeHPFS= 0x07,
kPartitionTypeFAT16= 0x06,
kPartitionTypeFAT32= 0x0c,
kPartitionTypeEXT3= 0x83
kPartitionTypeEXT3= 0x83,
kPartitionTypeBEFS= 0xEB,
kPartitionTypeFreeBSD= 0xa5,
kPartitionTypeOpenBSD= 0xa6
};
//#define BIOS_DEV_TYPE(d)((d) & kBIOSDevTypeMask)
branches/azimutz/Package/i386/boot2/boot.c
364364
365365
366366
367
367
368368
369369
370370
......
487487
488488
489489
490
491
490
491
492
493
494
495
496
497
498
499
492500
493501
494502
......
498506
499507
500508
501
509
502510
503511
504512
505
513
506514
507515
508516
......
537545
538546
539547
540
548
541549
542550
543551
......
545553
546554
547555
548
556
557
558
559
549560
550
551
552
561
562
563
564
553565
554566
555567
556
557
558
559
568
569
570
571
572
573
560574
561575
562576
563
577
564578
565
566
579
580
581
582
567583
568584
569585
570
571
572
573
574
575
576
577
578
579586
580587
581588
while (1)
{
booltryresume, tryresumedefault, forceresume;
boolusecache = false;//true;
booluseKernelCache = false; // by default don't use prelink kernel cache
const char*val;
intlen, trycache, ret = -1;
longflags, cachetime, kerneltime, exttime, sleeptime, time;
break;
}
getBoolForKey(kUseKernelCache, &usecache, &bootInfo->chameleonConfig);
if (usecache) {
// If boot from boot helper partitions and OS is Lion use prelink kernel.
// We need to find a solution to load extra mkext with a prelink kernel.
if (gBootVolume->flags & kBVFlagBooter && checkOSVersion("10.7")) {
verbose("Booting from Lion RAID volume so forcing to use KernelCache\n");
useKernelCache = true;
} else {
getBoolForKey(kUseKernelCache, &useKernelCache, &bootInfo->chameleonConfig);
}
if (useKernelCache) {
if (getValueForKey(kKernelCacheKey, &val, &len, &bootInfo->bootConfig)) {
if (val[0] == '\\')
{
strlcpy(gBootKernelCacheFile, val, len + 1);
}
else {
//Lion
// Lion prelink kernel cache file
if (checkOSVersion("10.7")) {
sprintf(gBootKernelCacheFile, "%skernelcache", kDefaultCachePathSnow);
}
// Snow Leopard
// Snow Leopard prelink kernel cache file
else if (checkOSVersion("10.6")) {
sprintf(gBootKernelCacheFile, "kernelcache_%s", (archCpuType == CPU_TYPE_I386)
? "i386" : "x86_64");
}
// Check for cache file.
trycache = (usecache &&
trycache = (useKernelCache &&
((gBootMode & kBootModeSafe) == 0) &&
!gOverrideKernel &&
(gBootFileType == kBlockDeviceType) &&
(gBootKernelCacheFile[0] != '\0'));
verbose("Loading Darwin %s\n", gMacOSVersion);
// Check if the kernel cache file exists and is more recent (mtime) than
// the kernel file or the S/L/E directory
if (trycache) do {
ret = GetFileInfo(NULL, bootInfo->bootFile, &flags, &kerneltime);
if (ret != 0) kerneltime = 0;
else if ((flags & kFileTypeMask) != kFileTypeFlat) {
ret = GetFileInfo(NULL, gBootKernelCacheFile, &flags, &cachetime);
// Check if the kernel cache file exist
if ((ret != 0) || ((flags & kFileTypeMask) != kFileTypeFlat)) {
trycache = 0;
break;
}
ret = GetFileInfo(NULL, gBootKernelCacheFile, &flags, &cachetime);
if ((ret != 0) || ((flags & kFileTypeMask) != kFileTypeFlat)
|| (cachetime < kerneltime)) {
ret = GetFileInfo(NULL, bootInfo->bootFile, &flags, &kerneltime);
if ((ret != 0) || ((flags & kFileTypeMask) != kFileTypeFlat))
kerneltime = -1;
// Check if the kernel file is more recent than the cache file
if (kerneltime > cachetime) {
trycache = 0;
break;
}
ret = GetFileInfo("/System/Library/", "Extensions", &flags, &exttime);
if ((ret == 0) && ((flags & kFileTypeMask) == kFileTypeDirectory)
&& (cachetime < exttime)) {
if ((ret != 0) && ((flags & kFileTypeMask) != kFileTypeDirectory))
exttime = -1;
// Check if the S/L/E directory time is more recent than the cache file
if (exttime > cachetime) {
trycache = 0;
break;
}
if (ret == 0 && kerneltime > exttime) {
exttime = kerneltime;
}
if (ret == 0 && cachetime != (exttime + 1)) {
trycache = 0;
break;
}
} while (0);
do {
branches/azimutz/Package/i386/boot2/gui.c
4444
4545
4646
47
48
49
50
51
52
4753
4854
4955
......
9399
94100
95101
102
103
104
105
106
107
96108
97109
98110
......
304316
305317
306318
319
320
321
322
323
324
307325
308326
309327
......
763781
764782
765783
784
785
786
787
788
789
790
791
792
793
794
795
766796
767797
768798
iDeviceHFSRAID_o,
iDeviceEXT3,
iDeviceEXT3_o,
iDeviceFreeBSD, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
iDeviceFreeBSD_o, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
iDeviceOpenBSD, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
iDeviceOpenBSD_o, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
iDeviceBEFS, /* Haiku detection and Icon credits to scorpius */
iDeviceBEFS_o, /* Haiku detection and Icon credits to scorpius */
iDeviceFAT,
iDeviceFAT_o,
iDeviceFAT16,
{.name = "device_hfsraid_o", .image = NULL},
{.name = "device_ext3", .image = NULL},
{.name = "device_ext3_o", .image = NULL},
{.name = "device_freebsd", .image = NULL}, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
{.name = "device_freebsd_o", .image = NULL}, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
{.name = "device_openbsd", .image = NULL}, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
{.name = "device_openbsd_o", .image = NULL}, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
{.name = "device_befs", .image = NULL}, /* Haiku detection and Icon credits to scorpius */
{.name = "device_befs_o", .image = NULL}, /* Haiku detection and Icon credits to scorpius */
{.name = "device_fat", .image = NULL},
{.name = "device_fat_o", .image = NULL},
{.name = "device_fat16", .image = NULL},
LOADPNG(device_hfsraid_o, iDeviceHFSRAID);
LOADPNG(device_ext3, iDeviceGeneric);
LOADPNG(device_ext3_o, iDeviceEXT3);
LOADPNG(device_freebsd, iDeviceGeneric); /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
LOADPNG(device_freebsd_o, iDeviceFreeBSD); /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
LOADPNG(device_openbsd, iDeviceGeneric); /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
LOADPNG(device_openbsd_o, iDeviceOpenBSD); /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
LOADPNG(device_befs, iDeviceGeneric); /* Haiku detection and Icon credits to scorpius */
LOADPNG(device_befs_o, iDeviceBEFS); /* Haiku detection and Icon credits to scorpius */
LOADPNG(device_fat, iDeviceGeneric);
LOADPNG(device_fat_o, iDeviceFAT);
LOADPNG(device_fat16, iDeviceFAT);
devicetype = iDeviceNTFS;// Use HPFS / NTFS icon
break;
case kPartitionTypeBEFS: /* Haiku detection and Icon credits to scorpius */
devicetype = iDeviceBEFS;// Use BEFS / Haiku icon
break;
case kPartitionTypeFreeBSD: /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
devicetype = iDeviceFreeBSD; // Use FreeBSD icon
break;
case kPartitionTypeOpenBSD: /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
devicetype = iDeviceOpenBSD; // Use OpenBSD icon
break;
case kPartitionTypeFAT16:
devicetype = iDeviceFAT16;// Use FAT16 icon
break;
branches/azimutz/Package/CREDITS
77
88
99
10
10
1111
1212
1313
Thanks to:
---------
JrCs, mercurysquad, munky, rekursor, kalyway, Krazubu, XyZ, blackosx, DHP
JrCs, mercurysquad, munky, rekursor, cosmolt, kalyway, Krazubu, THeKiNG, XyZ, blackosx, DHP, cparm, nawcom, anval, scorpius
Package:
---------

Archive Download the corresponding diff file

Revision: 1441