Chameleon

Chameleon Commit Details

Date:2011-07-31 23:49:27 (8 years 19 days ago)
Author:ErmaC
Commit:1245
Parents: 1244
Message:Some edit from ChameleonApplications. Added (Proper Haiku Detection with Custom Icons) http://forum.voodooprojects.org/index.php/topic,1882.0.html Added (Proper FreeBSD & OpenBSD with Custom Icons) from valv branch http://forge.voodooprojects.org/p/chameleon/source/tree/HEAD/branches /valv some typo fix.
Changes:
A/branches/ErmaC/i386/libsaio/openbsd.c
A/branches/ErmaC/i386/libsaio/openbsd.h
A/branches/ErmaC/artwork/themes/default/device_freebsd_o.png
A/branches/ErmaC/artwork/themes/default/device_openbsd.png
A/branches/ErmaC/artwork/themes/default/device_befs_o.png
A/branches/ErmaC/i386/libsaio/freebsd.c
A/branches/ErmaC/i386/libsaio/befs.c
A/branches/ErmaC/i386/libsaio/freebsd.h
A/branches/ErmaC/artwork/themes/default/device_openbsd_o.png
A/branches/ErmaC/artwork/themes/default/device_freebsd.png
A/branches/ErmaC/i386/libsaio/befs.h
A/branches/ErmaC/artwork/themes/default/device_befs.png
M/branches/ErmaC/i386/libsaio/disk.c
M/branches/ErmaC/i386/libsaio/Makefile
M/branches/ErmaC/doc/BootHelp.txt
M/branches/ErmaC/i386/libsaio/fdisk.h
M/branches/ErmaC/CHANGES
M/branches/ErmaC/i386/libsaio/pci.h
M/branches/ErmaC/Makefile
M/branches/ErmaC/i386/modules/Makefile
M/branches/ErmaC/i386/libsaio/saio_types.h
M/branches/ErmaC/i386/boot2/gui.c

File differences

branches/ErmaC/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/ErmaC/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/ErmaC/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/ErmaC/i386/libsaio/fdisk.h
3535
3636
3737
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
5760
5861
5962
#ifndef __LIBSAIO_FDISK_H
#define __LIBSAIO_FDISK_H
#define DISK_BLK00/* blkno of boot block */
#define DISK_BLK0SZ512/* size of boot block */
#define DISK_BOOTSZ446/* size of boot code in boot block */
#define DISK_SIGNATURE0xAA55/* signature of the boot record */
#define FDISK_NPART4/* number of entries in fdisk table */
#define FDISK_ACTIVE0x80/* indicator of active partition */
#define FDISK_NEXTNAME0xA7/* indicator of NeXT partition */
#define FDISK_DOS120x01/* 12-bit fat < 10MB dos partition */
#define FDISK_DOS16S0x04/* 16-bit fat < 32MB dos partition */
#define FDISK_DOSEXT0x05/* extended dos partition */
#define FDISK_DOS16B0x06/* 16-bit fat >= 32MB dos partition */
#define FDISK_NTFS0x07/* NTFS partition */
#define FDISK_SMALLFAT320x0b /* FAT32 partition */
#define FDISK_FAT320x0c/* FAT32 partition */
#define FDISK_DOS16SLBA 0x0e
#define FDISK_LINUX0x83
#define FDISK_UFS0xa8/* Apple UFS partition */
#define FDISK_HFS0xaf/* Apple HFS partition */
#define FDISK_BOOTER0xab/* Apple booter partition */
#define DISK_BLK00 /* blkno of boot block */
#define DISK_BLK0SZ512 /* size of boot block */
#define DISK_BOOTSZ446 /* size of boot code in boot block */
#define DISK_SIGNATURE0xAA55 /* signature of the boot record */
#define FDISK_NPART4 /* number of entries in fdisk table */
#define FDISK_ACTIVE0x80 /* indicator of active partition */
#define FDISK_NEXTNAME0xA7 /* indicator of NeXT partition */
#define FDISK_DOS120x01 /* 12-bit fat < 10MB dos partition */
#define FDISK_DOS16S0x04 /* 16-bit fat < 32MB dos partition */
#define FDISK_DOSEXT0x05 /* extended dos partition */
#define FDISK_DOS16B0x06 /* 16-bit fat >= 32MB dos partition */
#define FDISK_NTFS0x07 /* NTFS partition */
#define FDISK_SMALLFAT320x0b /* FAT32 partition */
#define FDISK_FAT320x0c /* FAT32 partition */
#define FDISK_DOS16SLBA0x0e
#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 */
/*
* Format of fdisk partion entry (if present).
branches/ErmaC/i386/libsaio/disk.c
7373
7474
7575
76
77
78
7679
7780
7881
......
898901
899902
900903
901
904
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
......
16851727
16861728
16871729
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
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
(BVFree)free,
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)
static const struct NamedValue fdiskTypes[] =
{
{ FDISK_NTFS, "Windows NTFS" },
{ FDISK_DOS12, "Windows FAT12" },
{ FDISK_DOS16B, "Windows FAT16" },
{ FDISK_DOS16S, "Windows FAT16" },
{ FDISK_DOS16SLBA, "Windows FAT16" },
{ FDISK_SMALLFAT32, "Windows FAT32" },
{ FDISK_FAT32, "Windows FAT32" },
{ 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_NTFS,"Windows NTFS" },
{ FDISK_DOS12,"Windows FAT12" },
{ FDISK_DOS16B,"Windows FAT16" },
{ FDISK_DOS16S,"Windows FAT16" },
{ 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" },
{ FDISK_BEFS,"Haiku" },
{ 0xCD,"CD-ROM" },
{ 0x00,0 } /* must be last */
};
//==========================================================================
branches/ErmaC/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/ErmaC/i386/libsaio/openbsd.h
1
2
extern bool OpenBSDProbe (const void *buf);
extern void OpenBSDGetDescription(CICell ih, char *str, long strMaxLen);
branches/ErmaC/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/ErmaC/i386/libsaio/freebsd.h
1
2
extern bool FreeBSDProbe (const void *buf);
extern void FreeBSDGetDescription(CICell ih, char *str, long strMaxLen);
branches/ErmaC/i386/libsaio/pci.h
99
1010
1111
12
13
14
15
12
13
14
15
1616
1717
1818
......
5151
5252
5353
54
55
56
57
58
59
54
55
56
57
58
59
6060
6161
6262
63
64
65
66
67
68
63
64
65
66
67
68
6969
7070
7171
typedef struct {
uint32_t:2;
uint32_treg :6;
uint32_tfunc:3;
uint32_tdev :5;
uint32_tbus :8;
uint32_treg:6;
uint32_tfunc:3;
uint32_tdev:5;
uint32_tbus:8;
uint32_t:7;
uint32_teb:1;
} pci_addr_t;
extern uint8_tpci_config_read8(uint32_t, uint8_t);
extern uint16_tpci_config_read16(uint32_t, uint8_t);
extern uint32_tpci_config_read32(uint32_t, uint8_t);
extern voidpci_config_write8(uint32_t, uint8_t, uint8_t);
extern voidpci_config_write16(uint32_t, uint8_t, uint16_t);
extern voidpci_config_write32(uint32_t, uint8_t, uint32_t);
extern char*get_pci_dev_path(pci_dt_t *);
extern voidbuild_pci_dt(void);
extern voiddump_pci_dt(pci_dt_t *);
extern voidpci_config_write8(uint32_t, uint8_t, uint8_t);
extern voidpci_config_write16(uint32_t, uint8_t, uint16_t);
extern voidpci_config_write32(uint32_t, uint8_t, uint32_t);
extern char*get_pci_dev_path(pci_dt_t *);
extern voidbuild_pci_dt(void);
extern voiddump_pci_dt(pci_dt_t *);
/* Option ROM header */
typedef struct {
uint16_tsignature;// 0xAA55
uint8_trom_size;
uint32_tentry_point;
uint8_treserved[15];
uint16_tpci_header_offset;
uint16_texpansion_header_offset;
uint16_tsignature;// 0xAA55
uint8_trom_size;
uint32_tentry_point;
uint8_treserved[15];
uint16_tpci_header_offset;
uint16_texpansion_header_offset;
} option_rom_header_t;
/* Option ROM PCI Data Structure */
branches/ErmaC/i386/libsaio/saio_types.h
213213
214214
215215
216
217
218
219
220
216
217
218
219
220
221
222
223
224
221225
222226
223227
};
enum {
kPartitionTypeHFS= 0xAF,
kPartitionTypeHPFS= 0x07,
kPartitionTypeFAT16= 0x06,
kPartitionTypeFAT32= 0x0c,
kPartitionTypeEXT3= 0x83
kPartitionTypeHFS = 0xAF,
kPartitionTypeHPFS = 0x07,
kPartitionTypeFAT16 = 0x06,
kPartitionTypeFAT32 = 0x0c,
kPartitionTypeEXT3 = 0x83,
kPartitionTypeBEFS = 0xEB,
kPartitionTypeFreeBSD = 0xa5,
kPartitionTypeOpenBSD = 0xa6,
};
//#define BIOS_DEV_TYPE(d)((d) & kBIOSDevTypeMask)
branches/ErmaC/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
......
760778
761779
762780
763
781
764782
765783
784
785
786
787
788
789
790
791
792
793
794
795
766796
767
797
768798
769799
770800
771
801
772802
773803
774804
775
805
776806
777807
778808
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);
break;
case kPartitionTypeHPFS:
devicetype = iDeviceNTFS;// Use HPFS / NTFS icon
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
devicetype = iDeviceFAT16;// Use FAT16 icon
break;
case kPartitionTypeFAT32:
devicetype = iDeviceFAT32;// Use FAT32 icon
devicetype = iDeviceFAT32;// Use FAT32 icon
break;
case kPartitionTypeEXT3:
devicetype = iDeviceEXT3;// Use EXT2/3 icon
devicetype = iDeviceEXT3;// Use EXT2/3 icon
break;
default:
branches/ErmaC/i386/modules/Makefile
1818
1919
2020
21
21
2222
2323
2424
DEFINES=
CONFIG = hd
LIBSAIODIR = $(SRCROOT)/i386/libsaio
INC = -I$(LIBSAIODIR)
INC = -I$(LIBSAIODIR)
ifeq (${CONFIG_MODULES}, y)
branches/ErmaC/doc/BootHelp.txt
7272
7373
7474
75
75
76
7677
7778
7879
ignore /E/E and /S/L/E/Extensions.mkext.
GraphicsEnabler=Yes|No Automatic device-properties generation for gfx cards.
AtiConfig=<cardcfg> Use a different card config
AtiConfig=<cardcfg> Use a different card config, e.g. AtiConfig=Megalodon.
AtiPorts=<value> Specify the number of ports, e.g. AtiPorts=2.
UseAtiROM=Yes|No Use an alternate Ati ROM image
(path: /Extra/<vendorid>_<devid>_<subsysid>.rom)
UseNvidiaROM=Yes|No Use an alternate Nvidia ROM image
branches/ErmaC/CHANGES
1
2
3
4
15
26
37
- Added AtiPorts option to GraphicsEnabler, so users can override the default number of ports. It proved
to be useful when used to limit the number of ports that a framebuffer registers, which seems to be a
requirement on laptops that can only use 2 ports at the same time. Thanks to AniV for the tip:
http://forum.voodooprojects.org/index.php/topic,1959.msg10402.html#msg10402
- Added NVidia ION AHCI controllers dev id to AHCIPortInjector kext.
Forgot to mention source on the commit: http://forum.voodooprojects.org/index.php/topic,1170.0.html
- Renamed com.apple.Boot.plist to org.chameleon.Boot.plist.
branches/ErmaC/Makefile
132132
133133
134134
135
135
136136
137
138
139
140
141
137142
138143
139144
......
147152
148153
149154
155
pkg installer: all
@# TODO: remove sudo
sudo ${SRCROOT}/package/buildpkg.sh ${SYMROOT}/package;
${SRCROOT}/package/buildpkg.sh ${SYMROOT}/package;
dmg: all
@# TODO: remove sudo
${SRCROOT}/package/slimpkg.sh ${SYMROOT}/package;
${SRCROOT}/package/builddmg.sh ${SYMROOT}/package;
$(SYMROOT)/i386/vers.h: version
@echo "#define I386BOOT_VERSION \"5.0.132\"" > $@
@echo "#define I386BOOT_BUILDDATE \"`date \"+%Y-%m-%d %H:%M:%S\"`\"" >> $@
.PHONY: image
.PHONY: pkg
.PHONY: installer
.PHONY: dmg

Archive Download the corresponding diff file

Revision: 1245