Index: branches/azimutz/trunkAutoResolution/i386/libsaio/Makefile =================================================================== --- branches/azimutz/trunkAutoResolution/i386/libsaio/Makefile (revision 1440) +++ branches/azimutz/trunkAutoResolution/i386/libsaio/Makefile (revision 1441) @@ -31,6 +31,7 @@ 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 \ Index: branches/azimutz/trunkAutoResolution/i386/libsaio/befs.c =================================================================== --- branches/azimutz/trunkAutoResolution/i386/libsaio/befs.c (revision 0) +++ branches/azimutz/trunkAutoResolution/i386/libsaio/befs.c (revision 1441) @@ -0,0 +1,43 @@ +/* + * befs.c + * + * + * Created by scorpius + * Copyright 2010 + * + */ + +#include "libsaio.h" +#include "sl.h" +#include "befs.h" + +#define BeFSProbeSize 2048 + +#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); +} Index: branches/azimutz/trunkAutoResolution/i386/libsaio/befs.h =================================================================== --- branches/azimutz/trunkAutoResolution/i386/libsaio/befs.h (revision 0) +++ branches/azimutz/trunkAutoResolution/i386/libsaio/befs.h (revision 1441) @@ -0,0 +1,11 @@ +/* + * befs.h + * + * + * Created by scorpius + * Copyright 2010 + * + */ + +extern bool BeFSProbe (const void *buf); +extern void BeFSGetDescription(CICell ih, char *str, long strMaxLen); Index: branches/azimutz/trunkAutoResolution/i386/libsaio/fdisk.h =================================================================== --- branches/azimutz/trunkAutoResolution/i386/libsaio/fdisk.h (revision 1440) +++ branches/azimutz/trunkAutoResolution/i386/libsaio/fdisk.h (revision 1441) @@ -51,6 +51,9 @@ #define FDISK_FAT32 0x0c /* FAT32 partition */ #define FDISK_DOS16SLBA 0x0e #define FDISK_LINUX 0x83 +#define FDISK_OPENBSD 0xa6 /* OpenBSD FFS partition */ +#define FDISK_FREEBSD 0xa5 /* FreeBSD UFS2 partition */ +#define FDISK_BEFS 0xeb /* Haiku BeFS partition */ #define FDISK_UFS 0xa8 /* Apple UFS partition */ #define FDISK_HFS 0xaf /* Apple HFS partition */ #define FDISK_BOOTER 0xab /* Apple booter partition */ Index: branches/azimutz/trunkAutoResolution/i386/libsaio/disk.c =================================================================== --- branches/azimutz/trunkAutoResolution/i386/libsaio/disk.c (revision 1440) +++ branches/azimutz/trunkAutoResolution/i386/libsaio/disk.c (revision 1441) @@ -73,6 +73,9 @@ #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 @@ -899,6 +902,39 @@ 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, @@ -1099,8 +1135,14 @@ 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) @@ -1692,12 +1734,15 @@ { 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 */ }; //========================================================================== Index: branches/azimutz/trunkAutoResolution/i386/libsaio/openbsd.c =================================================================== --- branches/azimutz/trunkAutoResolution/i386/libsaio/openbsd.c (revision 0) +++ branches/azimutz/trunkAutoResolution/i386/libsaio/openbsd.c (revision 1441) @@ -0,0 +1,32 @@ +#include "libsaio.h" +#include "sl.h" +#include "openbsd.h" + +#define OpenBSDProbeSize 2048 + +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); +} Index: branches/azimutz/trunkAutoResolution/i386/libsaio/openbsd.h =================================================================== --- branches/azimutz/trunkAutoResolution/i386/libsaio/openbsd.h (revision 0) +++ branches/azimutz/trunkAutoResolution/i386/libsaio/openbsd.h (revision 1441) @@ -0,0 +1,2 @@ +extern bool OpenBSDProbe (const void *buf); +extern void OpenBSDGetDescription(CICell ih, char *str, long strMaxLen); \ No newline at end of file Index: branches/azimutz/trunkAutoResolution/i386/libsaio/freebsd.c =================================================================== --- branches/azimutz/trunkAutoResolution/i386/libsaio/freebsd.c (revision 0) +++ branches/azimutz/trunkAutoResolution/i386/libsaio/freebsd.c (revision 1441) @@ -0,0 +1,32 @@ +#include "libsaio.h" +#include "sl.h" +#include "freebsd.h" + +#define FreeBSDProbeSize 2048 + +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); +} Index: branches/azimutz/trunkAutoResolution/i386/libsaio/freebsd.h =================================================================== --- branches/azimutz/trunkAutoResolution/i386/libsaio/freebsd.h (revision 0) +++ branches/azimutz/trunkAutoResolution/i386/libsaio/freebsd.h (revision 1441) @@ -0,0 +1,2 @@ +extern bool FreeBSDProbe (const void *buf); +extern void FreeBSDGetDescription(CICell ih, char *str, long strMaxLen); \ No newline at end of file Index: branches/azimutz/trunkAutoResolution/i386/libsaio/saio_types.h =================================================================== --- branches/azimutz/trunkAutoResolution/i386/libsaio/saio_types.h (revision 1440) +++ branches/azimutz/trunkAutoResolution/i386/libsaio/saio_types.h (revision 1441) @@ -217,7 +217,10 @@ kPartitionTypeHPFS = 0x07, kPartitionTypeFAT16 = 0x06, kPartitionTypeFAT32 = 0x0c, - kPartitionTypeEXT3 = 0x83 + kPartitionTypeEXT3 = 0x83, + kPartitionTypeBEFS = 0xEB, + kPartitionTypeFreeBSD = 0xa5, + kPartitionTypeOpenBSD = 0xa6 }; //#define BIOS_DEV_TYPE(d) ((d) & kBIOSDevTypeMask) Index: branches/azimutz/trunkAutoResolution/i386/boot2/boot.c =================================================================== --- branches/azimutz/trunkAutoResolution/i386/boot2/boot.c (revision 1440) +++ branches/azimutz/trunkAutoResolution/i386/boot2/boot.c (revision 1441) @@ -453,7 +453,7 @@ while (1) { bool tryresume, tryresumedefault, forceresume; - bool usecache = false;//true; + bool useKernelCache = false; // by default don't use prelink kernel cache const char *val; int len, trycache, ret = -1; long flags, cachetime, kerneltime, exttime, sleeptime, time; @@ -579,8 +579,16 @@ 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] == '\\') { @@ -590,11 +598,11 @@ 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"); @@ -629,7 +637,7 @@ } // Check for cache file. - trycache = (usecache && + trycache = (useKernelCache && ((gBootMode & kBootModeSafe) == 0) && !gOverrideKernel && (gBootFileType == kBlockDeviceType) && @@ -637,37 +645,36 @@ (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 { Index: branches/azimutz/trunkAutoResolution/i386/boot2/gui.c =================================================================== --- branches/azimutz/trunkAutoResolution/i386/boot2/gui.c (revision 1440) +++ branches/azimutz/trunkAutoResolution/i386/boot2/gui.c (revision 1441) @@ -45,6 +45,12 @@ 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, @@ -94,6 +100,12 @@ {.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}, @@ -305,6 +317,12 @@ 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); @@ -784,6 +802,18 @@ 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; Index: branches/azimutz/trunkAutoResolution/artwork/themes/default/device_befs.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: branches/azimutz/trunkAutoResolution/artwork/themes/default/device_befs.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: branches/azimutz/trunkAutoResolution/artwork/themes/default/device_freebsd_o.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: branches/azimutz/trunkAutoResolution/artwork/themes/default/device_freebsd_o.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: branches/azimutz/trunkAutoResolution/artwork/themes/default/device_openbsd.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: branches/azimutz/trunkAutoResolution/artwork/themes/default/device_openbsd.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: branches/azimutz/trunkAutoResolution/artwork/themes/default/device_freebsd.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: branches/azimutz/trunkAutoResolution/artwork/themes/default/device_freebsd.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: branches/azimutz/trunkAutoResolution/artwork/themes/default/device_befs_o.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: branches/azimutz/trunkAutoResolution/artwork/themes/default/device_befs_o.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: branches/azimutz/trunkAutoResolution/artwork/themes/default/device_openbsd_o.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: branches/azimutz/trunkAutoResolution/artwork/themes/default/device_openbsd_o.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: branches/azimutz/trunkAutoResolution/CREDITS =================================================================== --- branches/azimutz/trunkAutoResolution/CREDITS (revision 1440) +++ branches/azimutz/trunkAutoResolution/CREDITS (revision 1441) @@ -7,7 +7,7 @@ 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: --------- Property changes on: branches/azimutz/trunkAutoResolution ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r1437-1440 Index: branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/Makefile =================================================================== --- branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/Makefile (revision 1440) +++ branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/Makefile (revision 1441) @@ -31,6 +31,7 @@ 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 \ Index: branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/befs.c =================================================================== --- branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/befs.c (revision 0) +++ branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/befs.c (revision 1441) @@ -0,0 +1,43 @@ +/* + * befs.c + * + * + * Created by scorpius + * Copyright 2010 + * + */ + +#include "libsaio.h" +#include "sl.h" +#include "befs.h" + +#define BeFSProbeSize 2048 + +#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); +} Index: branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/befs.h =================================================================== --- branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/befs.h (revision 0) +++ branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/befs.h (revision 1441) @@ -0,0 +1,11 @@ +/* + * befs.h + * + * + * Created by scorpius + * Copyright 2010 + * + */ + +extern bool BeFSProbe (const void *buf); +extern void BeFSGetDescription(CICell ih, char *str, long strMaxLen); Index: branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/fdisk.h =================================================================== --- branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/fdisk.h (revision 1440) +++ branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/fdisk.h (revision 1441) @@ -51,6 +51,9 @@ #define FDISK_FAT32 0x0c /* FAT32 partition */ #define FDISK_DOS16SLBA 0x0e #define FDISK_LINUX 0x83 +#define FDISK_OPENBSD 0xa6 /* OpenBSD FFS partition */ +#define FDISK_FREEBSD 0xa5 /* FreeBSD UFS2 partition */ +#define FDISK_BEFS 0xeb /* Haiku BeFS partition */ #define FDISK_UFS 0xa8 /* Apple UFS partition */ #define FDISK_HFS 0xaf /* Apple HFS partition */ #define FDISK_BOOTER 0xab /* Apple booter partition */ Index: branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/disk.c =================================================================== --- branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/disk.c (revision 1440) +++ branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/disk.c (revision 1441) @@ -73,6 +73,9 @@ #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 @@ -899,6 +902,39 @@ 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, @@ -1099,8 +1135,14 @@ 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) @@ -1692,12 +1734,15 @@ { 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 */ }; //========================================================================== Index: branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/openbsd.c =================================================================== --- branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/openbsd.c (revision 0) +++ branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/openbsd.c (revision 1441) @@ -0,0 +1,32 @@ +#include "libsaio.h" +#include "sl.h" +#include "openbsd.h" + +#define OpenBSDProbeSize 2048 + +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); +} Index: branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/openbsd.h =================================================================== --- branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/openbsd.h (revision 0) +++ branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/openbsd.h (revision 1441) @@ -0,0 +1,2 @@ +extern bool OpenBSDProbe (const void *buf); +extern void OpenBSDGetDescription(CICell ih, char *str, long strMaxLen); \ No newline at end of file Index: branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/freebsd.c =================================================================== --- branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/freebsd.c (revision 0) +++ branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/freebsd.c (revision 1441) @@ -0,0 +1,32 @@ +#include "libsaio.h" +#include "sl.h" +#include "freebsd.h" + +#define FreeBSDProbeSize 2048 + +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); +} Index: branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/freebsd.h =================================================================== --- branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/freebsd.h (revision 0) +++ branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/freebsd.h (revision 1441) @@ -0,0 +1,2 @@ +extern bool FreeBSDProbe (const void *buf); +extern void FreeBSDGetDescription(CICell ih, char *str, long strMaxLen); \ No newline at end of file Index: branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/saio_types.h =================================================================== --- branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/saio_types.h (revision 1440) +++ branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/saio_types.h (revision 1441) @@ -217,7 +217,10 @@ kPartitionTypeHPFS = 0x07, kPartitionTypeFAT16 = 0x06, kPartitionTypeFAT32 = 0x0c, - kPartitionTypeEXT3 = 0x83 + kPartitionTypeEXT3 = 0x83, + kPartitionTypeBEFS = 0xEB, + kPartitionTypeFreeBSD = 0xa5, + kPartitionTypeOpenBSD = 0xa6 }; //#define BIOS_DEV_TYPE(d) ((d) & kBIOSDevTypeMask) Index: branches/azimutz/trunkGraphicsEnablerModules/i386/boot2/boot.c =================================================================== --- branches/azimutz/trunkGraphicsEnablerModules/i386/boot2/boot.c (revision 1440) +++ branches/azimutz/trunkGraphicsEnablerModules/i386/boot2/boot.c (revision 1441) @@ -364,7 +364,7 @@ while (1) { bool tryresume, tryresumedefault, forceresume; - bool usecache = false;//true; + bool useKernelCache = false; // by default don't use prelink kernel cache const char *val; int len, trycache, ret = -1; long flags, cachetime, kerneltime, exttime, sleeptime, time; @@ -487,8 +487,16 @@ 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] == '\\') { @@ -498,11 +506,11 @@ 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"); @@ -537,7 +545,7 @@ } // Check for cache file. - trycache = (usecache && + trycache = (useKernelCache && ((gBootMode & kBootModeSafe) == 0) && !gOverrideKernel && (gBootFileType == kBlockDeviceType) && @@ -545,37 +553,36 @@ (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 { Index: branches/azimutz/trunkGraphicsEnablerModules/i386/boot2/gui.c =================================================================== --- branches/azimutz/trunkGraphicsEnablerModules/i386/boot2/gui.c (revision 1440) +++ branches/azimutz/trunkGraphicsEnablerModules/i386/boot2/gui.c (revision 1441) @@ -44,6 +44,12 @@ 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, @@ -93,6 +99,12 @@ {.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}, @@ -304,6 +316,12 @@ 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); @@ -763,6 +781,18 @@ 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; Index: branches/azimutz/trunkGraphicsEnablerModules/artwork/themes/default/device_befs.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: branches/azimutz/trunkGraphicsEnablerModules/artwork/themes/default/device_befs.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: branches/azimutz/trunkGraphicsEnablerModules/artwork/themes/default/device_freebsd_o.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: branches/azimutz/trunkGraphicsEnablerModules/artwork/themes/default/device_freebsd_o.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: branches/azimutz/trunkGraphicsEnablerModules/artwork/themes/default/device_openbsd.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: branches/azimutz/trunkGraphicsEnablerModules/artwork/themes/default/device_openbsd.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: branches/azimutz/trunkGraphicsEnablerModules/artwork/themes/default/device_freebsd.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: branches/azimutz/trunkGraphicsEnablerModules/artwork/themes/default/device_freebsd.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: branches/azimutz/trunkGraphicsEnablerModules/artwork/themes/default/device_befs_o.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: branches/azimutz/trunkGraphicsEnablerModules/artwork/themes/default/device_befs_o.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: branches/azimutz/trunkGraphicsEnablerModules/artwork/themes/default/device_openbsd_o.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: branches/azimutz/trunkGraphicsEnablerModules/artwork/themes/default/device_openbsd_o.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: branches/azimutz/trunkGraphicsEnablerModules/CREDITS =================================================================== --- branches/azimutz/trunkGraphicsEnablerModules/CREDITS (revision 1440) +++ branches/azimutz/trunkGraphicsEnablerModules/CREDITS (revision 1441) @@ -7,7 +7,7 @@ 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: --------- Property changes on: branches/azimutz/trunkGraphicsEnablerModules ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r1437-1440 Index: branches/azimutz/Package/artwork/themes/default/device_befs.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: branches/azimutz/Package/artwork/themes/default/device_befs.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: branches/azimutz/Package/artwork/themes/default/device_freebsd_o.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: branches/azimutz/Package/artwork/themes/default/device_freebsd_o.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: branches/azimutz/Package/artwork/themes/default/device_openbsd.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: branches/azimutz/Package/artwork/themes/default/device_openbsd.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: branches/azimutz/Package/artwork/themes/default/device_freebsd.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: branches/azimutz/Package/artwork/themes/default/device_freebsd.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: branches/azimutz/Package/artwork/themes/default/device_befs_o.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: branches/azimutz/Package/artwork/themes/default/device_befs_o.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: branches/azimutz/Package/artwork/themes/default/device_openbsd_o.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: branches/azimutz/Package/artwork/themes/default/device_openbsd_o.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: branches/azimutz/Package/i386/libsaio/Makefile =================================================================== --- branches/azimutz/Package/i386/libsaio/Makefile (revision 1440) +++ branches/azimutz/Package/i386/libsaio/Makefile (revision 1441) @@ -31,6 +31,7 @@ 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 \ Index: branches/azimutz/Package/i386/libsaio/befs.c =================================================================== --- branches/azimutz/Package/i386/libsaio/befs.c (revision 0) +++ branches/azimutz/Package/i386/libsaio/befs.c (revision 1441) @@ -0,0 +1,43 @@ +/* + * befs.c + * + * + * Created by scorpius + * Copyright 2010 + * + */ + +#include "libsaio.h" +#include "sl.h" +#include "befs.h" + +#define BeFSProbeSize 2048 + +#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); +} Index: branches/azimutz/Package/i386/libsaio/befs.h =================================================================== --- branches/azimutz/Package/i386/libsaio/befs.h (revision 0) +++ branches/azimutz/Package/i386/libsaio/befs.h (revision 1441) @@ -0,0 +1,11 @@ +/* + * befs.h + * + * + * Created by scorpius + * Copyright 2010 + * + */ + +extern bool BeFSProbe (const void *buf); +extern void BeFSGetDescription(CICell ih, char *str, long strMaxLen); Index: branches/azimutz/Package/i386/libsaio/fdisk.h =================================================================== --- branches/azimutz/Package/i386/libsaio/fdisk.h (revision 1440) +++ branches/azimutz/Package/i386/libsaio/fdisk.h (revision 1441) @@ -51,6 +51,9 @@ #define FDISK_FAT32 0x0c /* FAT32 partition */ #define FDISK_DOS16SLBA 0x0e #define FDISK_LINUX 0x83 +#define FDISK_OPENBSD 0xa6 /* OpenBSD FFS partition */ +#define FDISK_FREEBSD 0xa5 /* FreeBSD UFS2 partition */ +#define FDISK_BEFS 0xeb /* Haiku BeFS partition */ #define FDISK_UFS 0xa8 /* Apple UFS partition */ #define FDISK_HFS 0xaf /* Apple HFS partition */ #define FDISK_BOOTER 0xab /* Apple booter partition */ Index: branches/azimutz/Package/i386/libsaio/disk.c =================================================================== --- branches/azimutz/Package/i386/libsaio/disk.c (revision 1440) +++ branches/azimutz/Package/i386/libsaio/disk.c (revision 1441) @@ -73,6 +73,9 @@ #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 @@ -899,6 +902,39 @@ 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, @@ -1099,8 +1135,14 @@ 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) @@ -1692,12 +1734,15 @@ { 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 */ }; //========================================================================== Index: branches/azimutz/Package/i386/libsaio/openbsd.c =================================================================== --- branches/azimutz/Package/i386/libsaio/openbsd.c (revision 0) +++ branches/azimutz/Package/i386/libsaio/openbsd.c (revision 1441) @@ -0,0 +1,32 @@ +#include "libsaio.h" +#include "sl.h" +#include "openbsd.h" + +#define OpenBSDProbeSize 2048 + +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); +} Index: branches/azimutz/Package/i386/libsaio/openbsd.h =================================================================== --- branches/azimutz/Package/i386/libsaio/openbsd.h (revision 0) +++ branches/azimutz/Package/i386/libsaio/openbsd.h (revision 1441) @@ -0,0 +1,2 @@ +extern bool OpenBSDProbe (const void *buf); +extern void OpenBSDGetDescription(CICell ih, char *str, long strMaxLen); \ No newline at end of file Index: branches/azimutz/Package/i386/libsaio/freebsd.c =================================================================== --- branches/azimutz/Package/i386/libsaio/freebsd.c (revision 0) +++ branches/azimutz/Package/i386/libsaio/freebsd.c (revision 1441) @@ -0,0 +1,32 @@ +#include "libsaio.h" +#include "sl.h" +#include "freebsd.h" + +#define FreeBSDProbeSize 2048 + +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); +} Index: branches/azimutz/Package/i386/libsaio/freebsd.h =================================================================== --- branches/azimutz/Package/i386/libsaio/freebsd.h (revision 0) +++ branches/azimutz/Package/i386/libsaio/freebsd.h (revision 1441) @@ -0,0 +1,2 @@ +extern bool FreeBSDProbe (const void *buf); +extern void FreeBSDGetDescription(CICell ih, char *str, long strMaxLen); \ No newline at end of file Index: branches/azimutz/Package/i386/libsaio/saio_types.h =================================================================== --- branches/azimutz/Package/i386/libsaio/saio_types.h (revision 1440) +++ branches/azimutz/Package/i386/libsaio/saio_types.h (revision 1441) @@ -217,7 +217,10 @@ kPartitionTypeHPFS = 0x07, kPartitionTypeFAT16 = 0x06, kPartitionTypeFAT32 = 0x0c, - kPartitionTypeEXT3 = 0x83 + kPartitionTypeEXT3 = 0x83, + kPartitionTypeBEFS = 0xEB, + kPartitionTypeFreeBSD = 0xa5, + kPartitionTypeOpenBSD = 0xa6 }; //#define BIOS_DEV_TYPE(d) ((d) & kBIOSDevTypeMask) Index: branches/azimutz/Package/i386/boot2/boot.c =================================================================== --- branches/azimutz/Package/i386/boot2/boot.c (revision 1440) +++ branches/azimutz/Package/i386/boot2/boot.c (revision 1441) @@ -364,7 +364,7 @@ while (1) { bool tryresume, tryresumedefault, forceresume; - bool usecache = false;//true; + bool useKernelCache = false; // by default don't use prelink kernel cache const char *val; int len, trycache, ret = -1; long flags, cachetime, kerneltime, exttime, sleeptime, time; @@ -487,8 +487,16 @@ 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] == '\\') { @@ -498,11 +506,11 @@ 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"); @@ -537,7 +545,7 @@ } // Check for cache file. - trycache = (usecache && + trycache = (useKernelCache && ((gBootMode & kBootModeSafe) == 0) && !gOverrideKernel && (gBootFileType == kBlockDeviceType) && @@ -545,37 +553,36 @@ (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 { Index: branches/azimutz/Package/i386/boot2/gui.c =================================================================== --- branches/azimutz/Package/i386/boot2/gui.c (revision 1440) +++ branches/azimutz/Package/i386/boot2/gui.c (revision 1441) @@ -44,6 +44,12 @@ 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, @@ -93,6 +99,12 @@ {.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}, @@ -304,6 +316,12 @@ 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); @@ -763,6 +781,18 @@ 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; Index: branches/azimutz/Package/CREDITS =================================================================== --- branches/azimutz/Package/CREDITS (revision 1440) +++ branches/azimutz/Package/CREDITS (revision 1441) @@ -7,7 +7,7 @@ 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: ---------