Index: trunk/Chameleon.xcodeproj/project.pbxproj =================================================================== --- trunk/Chameleon.xcodeproj/project.pbxproj (revision 0) +++ trunk/Chameleon.xcodeproj/project.pbxproj (revision 192) @@ -0,0 +1,1042 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 45; + objects = { + +/* Begin PBXFileReference section */ + B0056CD611F3868000754B65 /* boot */ = {isa = PBXFileReference; lastKnownFileType = file; path = boot; sourceTree = ""; }; + B0056CD711F3868000754B65 /* boot.sys */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.preload"; path = boot.sys; sourceTree = ""; }; + B0056CD811F3868000754B65 /* boot0 */ = {isa = PBXFileReference; lastKnownFileType = file; path = boot0; sourceTree = ""; }; + B0056CD911F3868000754B65 /* boot0hfs */ = {isa = PBXFileReference; lastKnownFileType = file; path = boot0hfs; sourceTree = ""; }; + B0056CDA11F3868000754B65 /* boot1f32 */ = {isa = PBXFileReference; lastKnownFileType = file; path = boot1f32; sourceTree = ""; }; + B0056CDB11F3868000754B65 /* boot1h */ = {isa = PBXFileReference; lastKnownFileType = file; path = boot1h; sourceTree = ""; }; + B0056CDC11F3868000754B65 /* boot1he */ = {isa = PBXFileReference; lastKnownFileType = file; path = boot1he; sourceTree = ""; }; + B0056CDD11F3868000754B65 /* boot1hp */ = {isa = PBXFileReference; lastKnownFileType = file; path = boot1hp; sourceTree = ""; }; + B0056CDE11F3868000754B65 /* cdboot */ = {isa = PBXFileReference; lastKnownFileType = file; path = cdboot; sourceTree = ""; }; + B0056CDF11F3868000754B65 /* chain0 */ = {isa = PBXFileReference; lastKnownFileType = file; path = chain0; sourceTree = ""; }; + B0056CE011F3868000754B65 /* embedded.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = embedded.h; sourceTree = ""; }; + B0056CE111F3868000754B65 /* libsa.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libsa.a; sourceTree = ""; }; + B0056CE211F3868000754B65 /* libsaio.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libsaio.a; sourceTree = ""; }; + B0056CE311F3868000754B65 /* machOconv */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; path = machOconv; sourceTree = ""; }; + B0056CE411F3868000754B65 /* vers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vers.h; sourceTree = ""; }; + B0056CE711F3868000754B65 /* boot0.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = boot0.s; sourceTree = ""; }; + B0056CE811F3868000754B65 /* chain0.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = chain0.s; sourceTree = ""; }; + B0056CE911F3868000754B65 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + B0056CEB11F3868000754B65 /* boot1.asm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm.asm; path = boot1.asm; sourceTree = ""; }; + B0056CEC11F3868000754B65 /* boot1.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = boot1.s; sourceTree = ""; }; + B0056CED11F3868000754B65 /* boot1f32-install.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "boot1f32-install.sh"; sourceTree = ""; }; + B0056CEE11F3868000754B65 /* boot1f32.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = boot1f32.s; sourceTree = ""; }; + B0056CEF11F3868000754B65 /* boot1he.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = boot1he.s; sourceTree = ""; }; + B0056CF011F3868000754B65 /* boot1hp.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = boot1hp.s; sourceTree = ""; }; + B0056CF111F3868000754B65 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + B0056CF311F3868000754B65 /* appleboot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = appleboot.h; sourceTree = ""; }; + B0056CF411F3868000754B65 /* appleClut8.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = appleClut8.h; sourceTree = ""; }; + B0056CF511F3868000754B65 /* bmdecompress.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bmdecompress.c; sourceTree = ""; }; + B0056CF611F3868000754B65 /* boot.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = boot.c; sourceTree = ""; }; + B0056CF711F3868000754B65 /* boot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = boot.h; sourceTree = ""; }; + B0056CF811F3868000754B65 /* boot2.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = boot2.s; sourceTree = ""; }; + B0056CF911F3868000754B65 /* drivers.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = drivers.c; sourceTree = ""; }; + B0056CFA11F3868000754B65 /* graphic_utils.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = graphic_utils.c; sourceTree = ""; }; + B0056CFB11F3868000754B65 /* graphic_utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = graphic_utils.h; sourceTree = ""; }; + B0056CFC11F3868000754B65 /* graphics.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = graphics.c; sourceTree = ""; }; + B0056CFD11F3868000754B65 /* graphics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = graphics.h; sourceTree = ""; }; + B0056CFE11F3868000754B65 /* gui.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = gui.c; sourceTree = ""; }; + B0056CFF11F3868000754B65 /* gui.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = gui.h; sourceTree = ""; }; + B0056D0011F3868000754B65 /* IOHibernatePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOHibernatePrivate.h; sourceTree = ""; }; + B0056D0111F3868000754B65 /* lzss.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = lzss.c; sourceTree = ""; }; + B0056D0211F3868000754B65 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + B0056D0311F3868000754B65 /* mboot.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mboot.c; sourceTree = ""; }; + B0056D0411F3868000754B65 /* mboot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mboot.h; sourceTree = ""; }; + B0056D0511F3868000754B65 /* multiboot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = multiboot.h; sourceTree = ""; }; + B0056D0611F3868000754B65 /* options.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = options.c; sourceTree = ""; }; + B0056D0711F3868000754B65 /* picopng.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = picopng.c; sourceTree = ""; }; + B0056D0811F3868000754B65 /* picopng.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = picopng.h; sourceTree = ""; }; + B0056D0911F3868000754B65 /* prompt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = prompt.c; sourceTree = ""; }; + B0056D0A11F3868000754B65 /* ramdisk.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ramdisk.c; sourceTree = ""; }; + B0056D0B11F3868000754B65 /* ramdisk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ramdisk.h; sourceTree = ""; }; + B0056D0C11F3868000754B65 /* resume.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = resume.c; sourceTree = ""; }; + B0056D0D11F3868000754B65 /* WKdm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKdm.h; sourceTree = ""; }; + B0056D0E11F3868000754B65 /* WKdmDecompress.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = WKdmDecompress.c; sourceTree = ""; }; + B0056D1011F3868000754B65 /* cdboot.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = cdboot.s; sourceTree = ""; }; + B0056D1111F3868000754B65 /* cdboothdd.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = cdboothdd.s; sourceTree = ""; }; + B0056D1211F3868000754B65 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + B0056D1411F3868000754B65 /* Limits */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Limits; sourceTree = ""; }; + B0056D1511F3868000754B65 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = ""; }; + B0056D1711F3868000754B65 /* efi_tables.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = efi_tables.c; sourceTree = ""; }; + B0056D1811F3868000754B65 /* efi_tables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = efi_tables.h; sourceTree = ""; }; + B0056D1911F3868000754B65 /* error.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = error.c; sourceTree = ""; }; + B0056D1A11F3868000754B65 /* libsa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libsa.h; sourceTree = ""; }; + B0056D1B11F3868000754B65 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + B0056D1C11F3868000754B65 /* memory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = memory.h; sourceTree = ""; }; + B0056D1D11F3868000754B65 /* prf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = prf.c; sourceTree = ""; }; + B0056D1E11F3868000754B65 /* printf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = printf.c; sourceTree = ""; }; + B0056D1F11F3868000754B65 /* qsort.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = qsort.c; sourceTree = ""; }; + B0056D2011F3868000754B65 /* setjmp.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = setjmp.s; sourceTree = ""; }; + B0056D2111F3868000754B65 /* string.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = string.c; sourceTree = ""; }; + B0056D2211F3868000754B65 /* strtol.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strtol.c; sourceTree = ""; }; + B0056D2311F3868000754B65 /* zalloc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zalloc.c; sourceTree = ""; }; + B0056D2511F3868000754B65 /* acpi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = acpi.h; sourceTree = ""; }; + B0056D2611F3868000754B65 /* acpi_patcher.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = acpi_patcher.c; sourceTree = ""; }; + B0056D2711F3868000754B65 /* acpi_patcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = acpi_patcher.h; sourceTree = ""; }; + B0056D2811F3868000754B65 /* allocate.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = allocate.c; sourceTree = ""; }; + B0056D2911F3868000754B65 /* asm.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = asm.s; sourceTree = ""; }; + B0056D2A11F3868000754B65 /* ati.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ati.c; sourceTree = ""; }; + B0056D2B11F3868000754B65 /* ati.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ati.h; sourceTree = ""; }; + B0056D2C11F3868000754B65 /* bios.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bios.h; sourceTree = ""; }; + B0056D2D11F3868000754B65 /* bios.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = bios.s; sourceTree = ""; }; + B0056D2E11F3868000754B65 /* biosfn.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = biosfn.c; sourceTree = ""; }; + B0056D2F11F3868000754B65 /* bootstruct.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bootstruct.c; sourceTree = ""; }; + B0056D3011F3868000754B65 /* bootstruct.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bootstruct.h; sourceTree = ""; }; + B0056D3111F3868000754B65 /* cache.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cache.c; sourceTree = ""; }; + B0056D3211F3868000754B65 /* console.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = console.c; sourceTree = ""; }; + B0056D3311F3868000754B65 /* convert.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = convert.c; sourceTree = ""; }; + B0056D3411F3868000754B65 /* convert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = convert.h; sourceTree = ""; }; + B0056D3511F3868000754B65 /* cpu.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpu.c; sourceTree = ""; }; + B0056D3611F3868000754B65 /* cpu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpu.h; sourceTree = ""; }; + B0056D3711F3868000754B65 /* device_inject.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = device_inject.c; sourceTree = ""; }; + B0056D3811F3868000754B65 /* device_inject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = device_inject.h; sourceTree = ""; }; + B0056D3911F3868000754B65 /* device_tree.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = device_tree.c; sourceTree = ""; }; + B0056D3A11F3868000754B65 /* device_tree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = device_tree.h; sourceTree = ""; }; + B0056D3B11F3868000754B65 /* disk.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = disk.c; sourceTree = ""; }; + B0056D3C11F3868000754B65 /* efi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = efi.h; sourceTree = ""; }; + B0056D3D11F3868000754B65 /* ext2fs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ext2fs.c; sourceTree = ""; }; + B0056D3E11F3868000754B65 /* ext2fs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ext2fs.h; sourceTree = ""; }; + B0056D3F11F3868000754B65 /* fake_efi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = fake_efi.c; sourceTree = ""; }; + B0056D4011F3868000754B65 /* fake_efi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fake_efi.h; sourceTree = ""; }; + B0056D4111F3868000754B65 /* fdisk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fdisk.h; sourceTree = ""; }; + B0056D4211F3868000754B65 /* hfs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = hfs.c; sourceTree = ""; }; + B0056D4311F3868000754B65 /* hfs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hfs.h; sourceTree = ""; }; + B0056D4411F3868000754B65 /* hfs_CaseTables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hfs_CaseTables.h; sourceTree = ""; }; + B0056D4511F3868000754B65 /* hfs_compare.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = hfs_compare.c; sourceTree = ""; }; + B0056D4611F3868000754B65 /* hpet.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = hpet.c; sourceTree = ""; }; + B0056D4711F3868000754B65 /* hpet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hpet.h; sourceTree = ""; }; + B0056D4811F3868000754B65 /* io_inline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = io_inline.h; sourceTree = ""; }; + B0056D4911F3868000754B65 /* libsaio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libsaio.h; sourceTree = ""; }; + B0056D4A11F3868000754B65 /* load.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = load.c; sourceTree = ""; }; + B0056D4B11F3868000754B65 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + B0056D4C11F3868000754B65 /* md5c.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = md5c.c; sourceTree = ""; }; + B0056D4D11F3868000754B65 /* mem.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mem.c; sourceTree = ""; }; + B0056D4E11F3868000754B65 /* mem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mem.h; sourceTree = ""; }; + B0056D4F11F3868000754B65 /* memvendors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = memvendors.h; sourceTree = ""; }; + B0056D5011F3868000754B65 /* misc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = misc.c; sourceTree = ""; }; + B0056D5111F3868000754B65 /* msdos.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = msdos.c; sourceTree = ""; }; + B0056D5211F3868000754B65 /* msdos.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = msdos.h; sourceTree = ""; }; + B0056D5311F3868000754B65 /* msdos_private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = msdos_private.h; sourceTree = ""; }; + B0056D5411F3868000754B65 /* nbp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = nbp.c; sourceTree = ""; }; + B0056D5511F3868000754B65 /* nbp_cmd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nbp_cmd.h; sourceTree = ""; }; + B0056D5611F3868000754B65 /* ntfs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ntfs.c; sourceTree = ""; }; + B0056D5711F3868000754B65 /* ntfs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ntfs.h; sourceTree = ""; }; + B0056D5811F3868000754B65 /* ntfs_private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ntfs_private.h; sourceTree = ""; }; + B0056D5911F3868000754B65 /* nvidia.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = nvidia.c; sourceTree = ""; }; + B0056D5A11F3868000754B65 /* nvidia.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nvidia.h; sourceTree = ""; }; + B0056D5B11F3868000754B65 /* pci.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pci.c; sourceTree = ""; }; + B0056D5C11F3868000754B65 /* pci.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pci.h; sourceTree = ""; }; + B0056D5D11F3868000754B65 /* pci_root.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pci_root.c; sourceTree = ""; }; + B0056D5E11F3868000754B65 /* pci_root.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pci_root.h; sourceTree = ""; }; + B0056D5F11F3868000754B65 /* pci_setup.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pci_setup.c; sourceTree = ""; }; + B0056D6011F3868000754B65 /* platform.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = platform.c; sourceTree = ""; }; + B0056D6111F3868000754B65 /* platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = platform.h; sourceTree = ""; }; + B0056D6211F3868000754B65 /* saio_internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = saio_internal.h; sourceTree = ""; }; + B0056D6311F3868000754B65 /* saio_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = saio_types.h; sourceTree = ""; }; + B0056D6411F3868000754B65 /* sl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sl.h; sourceTree = ""; }; + B0056D6511F3868000754B65 /* SMBIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SMBIOS.h; sourceTree = ""; }; + B0056D6611F3868000754B65 /* smbios_patcher.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = smbios_patcher.c; sourceTree = ""; }; + B0056D6711F3868000754B65 /* smbios_patcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = smbios_patcher.h; sourceTree = ""; }; + B0056D6811F3868000754B65 /* spd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = spd.c; sourceTree = ""; }; + B0056D6911F3868000754B65 /* spd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = spd.h; sourceTree = ""; }; + B0056D6A11F3868000754B65 /* stringTable.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = stringTable.c; sourceTree = ""; }; + B0056D6B11F3868000754B65 /* sys.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sys.c; sourceTree = ""; }; + B0056D6C11F3868000754B65 /* table.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = table.c; sourceTree = ""; }; + B0056D6D11F3868000754B65 /* ufs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ufs.c; sourceTree = ""; }; + B0056D6E11F3868000754B65 /* ufs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ufs.h; sourceTree = ""; }; + B0056D6F11F3868000754B65 /* ufs_byteorder.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ufs_byteorder.c; sourceTree = ""; }; + B0056D7011F3868000754B65 /* ufs_byteorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ufs_byteorder.h; sourceTree = ""; }; + B0056D7111F3868000754B65 /* usb.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = usb.c; sourceTree = ""; }; + B0056D7211F3868000754B65 /* vbe.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = vbe.c; sourceTree = ""; }; + B0056D7311F3868000754B65 /* vbe.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vbe.h; sourceTree = ""; }; + B0056D7411F3868000754B65 /* xml.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = xml.c; sourceTree = ""; }; + B0056D7511F3868000754B65 /* xml.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xml.h; sourceTree = ""; }; + B0056D7611F3868000754B65 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + B0056D7711F3868000754B65 /* MakeInc.dir */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MakeInc.dir; sourceTree = ""; }; + B0056D7811F3868000754B65 /* MakePaths.dir */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MakePaths.dir; sourceTree = ""; }; + B0056D7A11F3868000754B65 /* machOconv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = machOconv.c; sourceTree = ""; }; + B0056D7B11F3868000754B65 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + B0056D7C11F3868000754B65 /* TODO */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = TODO; sourceTree = ""; }; + B0056D7D11F3868000754B65 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + B0056D7E11F3868000754B65 /* efisysinst.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = efisysinst.sh; sourceTree = ""; }; + B0056D7F11F3868000754B65 /* CREDITS */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CREDITS; sourceTree = ""; }; + B0056D8011F3868000754B65 /* coding_standards.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = coding_standards.txt; sourceTree = ""; }; + B0056D8111F3868000754B65 /* CHANGES */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CHANGES; sourceTree = ""; }; + B0056D8211F3868000754B65 /* APPLE_LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = APPLE_LICENSE; sourceTree = ""; }; + B0056D8411F3868000754B65 /* buildpkg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = buildpkg; sourceTree = ""; }; + B0056D8511F3868000754B65 /* Distribution */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = Distribution; sourceTree = ""; }; + B0056D8611F3868000754B65 /* fdisk */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; path = fdisk; sourceTree = ""; }; + B0056D8811F3868000754B65 /* AHCIPortInjector.kext */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.kernel-extension"; path = AHCIPortInjector.kext; sourceTree = ""; }; + B0056D8911F3868000754B65 /* ATAPortInjector.kext */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.kernel-extension"; path = ATAPortInjector.kext; sourceTree = ""; }; + B0056D8A11F3868000754B65 /* Disabler.kext */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.kernel-extension"; path = Disabler.kext; sourceTree = ""; }; + B0056D8B11F3868000754B65 /* IOAHCIBlockStorageInjector.kext */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.kernel-extension"; path = IOAHCIBlockStorageInjector.kext; sourceTree = ""; }; + B0056D8C11F3868000754B65 /* JMicronATAInjector.kext */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.kernel-extension"; path = JMicronATAInjector.kext; sourceTree = ""; }; + B0056D8E11F3868000754B65 /* background.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = background.tiff; sourceTree = ""; }; + B0056D9011F3868000754B65 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = English; path = English.lproj/Description.html; sourceTree = ""; }; + B0056D9211F3868000754B65 /* English */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = English; path = English.lproj/License.rtf; sourceTree = ""; }; + B0056D9411F3868000754B65 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/Localizable.strings; sourceTree = ""; }; + B0056D9611F3868000754B65 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = English; path = English.lproj/Welcome.rtfd; sourceTree = ""; }; + B0056D9711F3868000754B65 /* French */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = French; path = French.lproj/Description.html; sourceTree = ""; }; + B0056D9811F3868000754B65 /* French */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = French; path = French.lproj/License.rtf; sourceTree = ""; }; + B0056D9911F3868000754B65 /* French */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = French; path = French.lproj/Localizable.strings; sourceTree = ""; }; + B0056D9A11F3868000754B65 /* German */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = German; path = German.lproj/Description.html; sourceTree = ""; }; + B0056D9B11F3868000754B65 /* German */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = German; path = German.lproj/License.rtf; sourceTree = ""; }; + B0056D9C11F3868000754B65 /* German */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = German; path = German.lproj/Localizable.strings; sourceTree = ""; }; + B0056D9D11F3868000754B65 /* Spanish */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = Spanish; path = Spanish.lproj/Description.html; sourceTree = ""; }; + B0056D9E11F3868000754B65 /* Spanish */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = Spanish; path = Spanish.lproj/License.rtf; sourceTree = ""; }; + B0056D9F11F3868000754B65 /* Spanish */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = Spanish; path = Spanish.lproj/Localizable.strings; sourceTree = ""; }; + B0056DA011F3868000754B65 /* Spanish */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = Spanish; path = Spanish.lproj/Welcome.rtfd; sourceTree = ""; }; + B0056DA311F3868000754B65 /* postinstall */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = postinstall; sourceTree = ""; }; + B0056DA511F3868000754B65 /* postinstall */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = postinstall; sourceTree = ""; }; + B0056DA811F3868000754B65 /* postinstall */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = postinstall; sourceTree = ""; }; + B0056DAA11F3868000754B65 /* postinstall */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = postinstall; sourceTree = ""; }; + B0056DAC11F3868000754B65 /* postinstall */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = postinstall; sourceTree = ""; }; + B0056DAE11F3868000754B65 /* postinstall */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = postinstall; sourceTree = ""; }; + B0056DB011F3868000754B65 /* postinstall */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = postinstall; sourceTree = ""; }; + B0056DB211F3868000754B65 /* postinstall */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = postinstall; sourceTree = ""; }; + B0056DB411F3868000754B65 /* postinstall */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = postinstall; sourceTree = ""; }; + B0056DB611F3868000754B65 /* postinstall */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = postinstall; sourceTree = ""; }; + B0056DB811F3868000754B65 /* postinstall */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = postinstall; sourceTree = ""; }; + B0056DB911F3868000754B65 /* smbios.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = smbios.plist; sourceTree = ""; }; + B0056DBD11F3868000754B65 /* background.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = background.png; sourceTree = ""; }; + B0056DBE11F3868000754B65 /* boot.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = boot.png; sourceTree = ""; }; + B0056DBF11F3868000754B65 /* device_cdrom.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_cdrom.png; sourceTree = ""; }; + B0056DC011F3868000754B65 /* device_ext3.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_ext3.png; sourceTree = ""; }; + B0056DC111F3868000754B65 /* device_fat16.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_fat16.png; sourceTree = ""; }; + B0056DC211F3868000754B65 /* device_fat32.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_fat32.png; sourceTree = ""; }; + B0056DC311F3868000754B65 /* device_generic.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_generic.png; sourceTree = ""; }; + B0056DC411F3868000754B65 /* device_hfsplus.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_hfsplus.png; sourceTree = ""; }; + B0056DC511F3868000754B65 /* device_ntfs.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_ntfs.png; sourceTree = ""; }; + B0056DC611F3868000754B65 /* device_scroll_next.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_scroll_next.png; sourceTree = ""; }; + B0056DC711F3868000754B65 /* device_scroll_prev.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_scroll_prev.png; sourceTree = ""; }; + B0056DC811F3868000754B65 /* device_selection.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_selection.png; sourceTree = ""; }; + B0056DC911F3868000754B65 /* font_console.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = font_console.png; sourceTree = ""; }; + B0056DCA11F3868000754B65 /* font_small.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = font_small.png; sourceTree = ""; }; + B0056DCB11F3868000754B65 /* logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = logo.png; sourceTree = ""; }; + B0056DCC11F3868000754B65 /* menu_boot.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_boot.png; sourceTree = ""; }; + B0056DCD11F3868000754B65 /* menu_help.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_help.png; sourceTree = ""; }; + B0056DCE11F3868000754B65 /* menu_ignore_caches.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_ignore_caches.png; sourceTree = ""; }; + B0056DCF11F3868000754B65 /* menu_ignore_caches_disabled.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_ignore_caches_disabled.png; sourceTree = ""; }; + B0056DD011F3868000754B65 /* menu_memory_info.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_memory_info.png; sourceTree = ""; }; + B0056DD111F3868000754B65 /* menu_selection.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_selection.png; sourceTree = ""; }; + B0056DD211F3868000754B65 /* menu_single_user.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_single_user.png; sourceTree = ""; }; + B0056DD311F3868000754B65 /* menu_single_user_disabled.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_single_user_disabled.png; sourceTree = ""; }; + B0056DD411F3868000754B65 /* menu_verbose.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_verbose.png; sourceTree = ""; }; + B0056DD511F3868000754B65 /* menu_verbose_disabled.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_verbose_disabled.png; sourceTree = ""; }; + B0056DD611F3868000754B65 /* menu_video_info.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_video_info.png; sourceTree = ""; }; + B0056DD711F3868000754B65 /* progress_bar.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = progress_bar.png; sourceTree = ""; }; + B0056DD811F3868000754B65 /* progress_bar_background.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = progress_bar_background.png; sourceTree = ""; }; + B0056DD911F3868000754B65 /* text_scroll_next.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = text_scroll_next.png; sourceTree = ""; }; + B0056DDA11F3868000754B65 /* text_scroll_prev.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = text_scroll_prev.png; sourceTree = ""; }; + B0056DDB11F3868000754B65 /* theme.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = theme.plist; sourceTree = ""; }; + B0056DDD11F3868000754B65 /* background.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = background.png; sourceTree = ""; }; + B0056DDE11F3868000754B65 /* boot.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = boot.png; sourceTree = ""; }; + B0056DDF11F3868000754B65 /* device_cdrom.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_cdrom.png; sourceTree = ""; }; + B0056DE011F3868000754B65 /* device_ext3.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_ext3.png; sourceTree = ""; }; + B0056DE111F3868000754B65 /* device_fat16.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_fat16.png; sourceTree = ""; }; + B0056DE211F3868000754B65 /* device_fat32.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_fat32.png; sourceTree = ""; }; + B0056DE311F3868000754B65 /* device_generic.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_generic.png; sourceTree = ""; }; + B0056DE411F3868000754B65 /* device_hfsplus.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_hfsplus.png; sourceTree = ""; }; + B0056DE511F3868000754B65 /* device_ntfs.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_ntfs.png; sourceTree = ""; }; + B0056DE611F3868000754B65 /* device_scroll_next.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_scroll_next.png; sourceTree = ""; }; + B0056DE711F3868000754B65 /* device_scroll_prev.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_scroll_prev.png; sourceTree = ""; }; + B0056DE811F3868000754B65 /* device_selection.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_selection.png; sourceTree = ""; }; + B0056DE911F3868000754B65 /* font_console.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = font_console.png; sourceTree = ""; }; + B0056DEA11F3868000754B65 /* font_small.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = font_small.png; sourceTree = ""; }; + B0056DEB11F3868000754B65 /* logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = logo.png; sourceTree = ""; }; + B0056DEC11F3868000754B65 /* menu_boot.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_boot.png; sourceTree = ""; }; + B0056DED11F3868000754B65 /* menu_help.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_help.png; sourceTree = ""; }; + B0056DEE11F3868000754B65 /* menu_ignore_caches.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_ignore_caches.png; sourceTree = ""; }; + B0056DEF11F3868000754B65 /* menu_ignore_caches_disabled.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_ignore_caches_disabled.png; sourceTree = ""; }; + B0056DF011F3868000754B65 /* menu_memory_info.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_memory_info.png; sourceTree = ""; }; + B0056DF111F3868000754B65 /* menu_selection.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_selection.png; sourceTree = ""; }; + B0056DF211F3868000754B65 /* menu_single_user.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_single_user.png; sourceTree = ""; }; + B0056DF311F3868000754B65 /* menu_single_user_disabled.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_single_user_disabled.png; sourceTree = ""; }; + B0056DF411F3868000754B65 /* menu_verbose.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_verbose.png; sourceTree = ""; }; + B0056DF511F3868000754B65 /* menu_verbose_disabled.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_verbose_disabled.png; sourceTree = ""; }; + B0056DF611F3868000754B65 /* menu_video_info.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_video_info.png; sourceTree = ""; }; + B0056DF711F3868000754B65 /* progress_bar.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = progress_bar.png; sourceTree = ""; }; + B0056DF811F3868000754B65 /* progress_bar_background.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = progress_bar_background.png; sourceTree = ""; }; + B0056DF911F3868000754B65 /* text_scroll_next.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = text_scroll_next.png; sourceTree = ""; }; + B0056DFA11F3868000754B65 /* text_scroll_prev.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = text_scroll_prev.png; sourceTree = ""; }; + B0056DFB11F3868000754B65 /* theme.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = theme.plist; sourceTree = ""; }; + B0056DFD11F3868000754B65 /* logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = logo.png; sourceTree = ""; }; + B0056DFE11F3868000754B65 /* theme.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = theme.plist; sourceTree = ""; }; + B0056E0011F3868000754B65 /* logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = logo.png; sourceTree = ""; }; + B0056E0111F3868000754B65 /* theme.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = theme.plist; sourceTree = ""; }; + B0056E0311F3868000754B65 /* font_small.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = font_small.png; sourceTree = ""; }; + B0056E0411F3868000754B65 /* logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = logo.png; sourceTree = ""; }; + B0056E0511F3868000754B65 /* theme.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = theme.plist; sourceTree = ""; }; + B0056E0811F3868000754B65 /* Users_Guide0.4.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = Users_Guide0.4.pdf; sourceTree = ""; }; + B0056E0911F3868000754B65 /* Users_Guide_v0.3.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = Users_Guide_v0.3.pdf; sourceTree = ""; }; + B0056E0A11F3868000754B65 /* UsersGuide-v0.2.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = "UsersGuide-v0.2.pdf"; sourceTree = ""; }; + B0056E0B11F3868000754B65 /* BootHelp.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = BootHelp.txt; sourceTree = ""; }; + B0056E0C11F3868000754B65 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = ""; }; + B0056E0D11F3868000754B65 /* themeinfo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = themeinfo.png; sourceTree = ""; }; + B0056E0F11F3868000754B65 /* Chameleon 2 v0.4.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = "Chameleon 2 v0.4.xml"; sourceTree = ""; }; + B0056E1011F3868000754B65 /* Chameleon 2 v0.5.docx */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Chameleon 2 v0.5.docx"; sourceTree = ""; }; + B0056E1111F3868000754B65 /* chameleon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = chameleon.png; sourceTree = ""; }; + B0056E1211F3868000754B65 /* colorchart.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = colorchart.png; sourceTree = ""; }; + B0056E1311F3868000754B65 /* install_complete.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = install_complete.png; sourceTree = ""; }; + B0056E1411F3868000754B65 /* install_cust.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = install_cust.png; sourceTree = ""; }; + B0056E1511F3868000754B65 /* install_dest.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = install_dest.png; sourceTree = ""; }; + B0056E1611F3868000754B65 /* install_stand.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = install_stand.png; sourceTree = ""; }; + B0056E1711F3868000754B65 /* install_start.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = install_start.png; sourceTree = ""; }; + B0056E1811F3868000754B65 /* screen_format.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = screen_format.png; sourceTree = ""; }; + B0056E1911F3868000754B65 /* xnulogo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = xnulogo.png; sourceTree = ""; }; + B0056E1A11F3868000754B65 /* Users_Guide0.5.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = Users_Guide0.5.pdf; sourceTree = ""; }; + B00F494911F6089500B1D7C5 /* aml_generator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aml_generator.h; sourceTree = ""; }; + B00F494A11F6089500B1D7C5 /* aml_generator.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = aml_generator.c; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXGroup section */ + 08FB7794FE84155DC02AAC07 /* Chameleon */ = { + isa = PBXGroup; + children = ( + B0056DBA11F3868000754B65 /* artwork */, + B0056E0611F3868000754B65 /* doc */, + B0056CE511F3868000754B65 /* i386 */, + B0056D8311F3868000754B65 /* package */, + B0056CD411F3868000754B65 /* sym */, + B0056D7C11F3868000754B65 /* TODO */, + B0056D7D11F3868000754B65 /* Makefile */, + B0056D7E11F3868000754B65 /* efisysinst.sh */, + B0056D7F11F3868000754B65 /* CREDITS */, + B0056D8011F3868000754B65 /* coding_standards.txt */, + B0056D8111F3868000754B65 /* CHANGES */, + B0056D8211F3868000754B65 /* APPLE_LICENSE */, + ); + name = Chameleon; + sourceTree = ""; + }; + B0056CD411F3868000754B65 /* sym */ = { + isa = PBXGroup; + children = ( + B0056CD511F3868000754B65 /* i386 */, + ); + path = sym; + sourceTree = ""; + }; + B0056CD511F3868000754B65 /* i386 */ = { + isa = PBXGroup; + children = ( + B0056CD611F3868000754B65 /* boot */, + B0056CD711F3868000754B65 /* boot.sys */, + B0056CD811F3868000754B65 /* boot0 */, + B0056CD911F3868000754B65 /* boot0hfs */, + B0056CDA11F3868000754B65 /* boot1f32 */, + B0056CDB11F3868000754B65 /* boot1h */, + B0056CDC11F3868000754B65 /* boot1he */, + B0056CDD11F3868000754B65 /* boot1hp */, + B0056CDE11F3868000754B65 /* cdboot */, + B0056CDF11F3868000754B65 /* chain0 */, + B0056CE011F3868000754B65 /* embedded.h */, + B0056CE111F3868000754B65 /* libsa.a */, + B0056CE211F3868000754B65 /* libsaio.a */, + B0056CE311F3868000754B65 /* machOconv */, + B0056CE411F3868000754B65 /* vers.h */, + ); + path = i386; + sourceTree = ""; + }; + B0056CE511F3868000754B65 /* i386 */ = { + isa = PBXGroup; + children = ( + B0056CE611F3868000754B65 /* boot0 */, + B0056CEA11F3868000754B65 /* boot1 */, + B0056CF211F3868000754B65 /* boot2 */, + B0056D0F11F3868000754B65 /* cdboot */, + B0056D1311F3868000754B65 /* doc */, + B0056D1611F3868000754B65 /* libsa */, + B0056D2411F3868000754B65 /* libsaio */, + B0056D7911F3868000754B65 /* util */, + B0056D7611F3868000754B65 /* Makefile */, + B0056D7711F3868000754B65 /* MakeInc.dir */, + B0056D7811F3868000754B65 /* MakePaths.dir */, + ); + path = i386; + sourceTree = ""; + }; + B0056CE611F3868000754B65 /* boot0 */ = { + isa = PBXGroup; + children = ( + B0056CE711F3868000754B65 /* boot0.s */, + B0056CE811F3868000754B65 /* chain0.s */, + B0056CE911F3868000754B65 /* Makefile */, + ); + path = boot0; + sourceTree = ""; + }; + B0056CEA11F3868000754B65 /* boot1 */ = { + isa = PBXGroup; + children = ( + B0056CEB11F3868000754B65 /* boot1.asm */, + B0056CEC11F3868000754B65 /* boot1.s */, + B0056CED11F3868000754B65 /* boot1f32-install.sh */, + B0056CEE11F3868000754B65 /* boot1f32.s */, + B0056CEF11F3868000754B65 /* boot1he.s */, + B0056CF011F3868000754B65 /* boot1hp.s */, + B0056CF111F3868000754B65 /* Makefile */, + ); + path = boot1; + sourceTree = ""; + }; + B0056CF211F3868000754B65 /* boot2 */ = { + isa = PBXGroup; + children = ( + B0056CF311F3868000754B65 /* appleboot.h */, + B0056CF411F3868000754B65 /* appleClut8.h */, + B0056CF511F3868000754B65 /* bmdecompress.c */, + B0056CF611F3868000754B65 /* boot.c */, + B0056CF711F3868000754B65 /* boot.h */, + B0056CF811F3868000754B65 /* boot2.s */, + B0056CF911F3868000754B65 /* drivers.c */, + B0056CFA11F3868000754B65 /* graphic_utils.c */, + B0056CFB11F3868000754B65 /* graphic_utils.h */, + B0056CFC11F3868000754B65 /* graphics.c */, + B0056CFD11F3868000754B65 /* graphics.h */, + B0056CFE11F3868000754B65 /* gui.c */, + B0056CFF11F3868000754B65 /* gui.h */, + B0056D0011F3868000754B65 /* IOHibernatePrivate.h */, + B0056D0111F3868000754B65 /* lzss.c */, + B0056D0211F3868000754B65 /* Makefile */, + B0056D0311F3868000754B65 /* mboot.c */, + B0056D0411F3868000754B65 /* mboot.h */, + B0056D0511F3868000754B65 /* multiboot.h */, + B0056D0611F3868000754B65 /* options.c */, + B0056D0711F3868000754B65 /* picopng.c */, + B0056D0811F3868000754B65 /* picopng.h */, + B0056D0911F3868000754B65 /* prompt.c */, + B0056D0A11F3868000754B65 /* ramdisk.c */, + B0056D0B11F3868000754B65 /* ramdisk.h */, + B0056D0C11F3868000754B65 /* resume.c */, + B0056D0D11F3868000754B65 /* WKdm.h */, + B0056D0E11F3868000754B65 /* WKdmDecompress.c */, + ); + path = boot2; + sourceTree = ""; + }; + B0056D0F11F3868000754B65 /* cdboot */ = { + isa = PBXGroup; + children = ( + B0056D1011F3868000754B65 /* cdboot.s */, + B0056D1111F3868000754B65 /* cdboothdd.s */, + B0056D1211F3868000754B65 /* Makefile */, + ); + path = cdboot; + sourceTree = ""; + }; + B0056D1311F3868000754B65 /* doc */ = { + isa = PBXGroup; + children = ( + B0056D1411F3868000754B65 /* Limits */, + B0056D1511F3868000754B65 /* README */, + ); + path = doc; + sourceTree = ""; + }; + B0056D1611F3868000754B65 /* libsa */ = { + isa = PBXGroup; + children = ( + B0056D1711F3868000754B65 /* efi_tables.c */, + B0056D1811F3868000754B65 /* efi_tables.h */, + B0056D1911F3868000754B65 /* error.c */, + B0056D1A11F3868000754B65 /* libsa.h */, + B0056D1B11F3868000754B65 /* Makefile */, + B0056D1C11F3868000754B65 /* memory.h */, + B0056D1D11F3868000754B65 /* prf.c */, + B0056D1E11F3868000754B65 /* printf.c */, + B0056D1F11F3868000754B65 /* qsort.c */, + B0056D2011F3868000754B65 /* setjmp.s */, + B0056D2111F3868000754B65 /* string.c */, + B0056D2211F3868000754B65 /* strtol.c */, + B0056D2311F3868000754B65 /* zalloc.c */, + ); + path = libsa; + sourceTree = ""; + }; + B0056D2411F3868000754B65 /* libsaio */ = { + isa = PBXGroup; + children = ( + B0056D2511F3868000754B65 /* acpi.h */, + B0056D2611F3868000754B65 /* acpi_patcher.c */, + B0056D2711F3868000754B65 /* acpi_patcher.h */, + B0056D2811F3868000754B65 /* allocate.c */, + B00F494A11F6089500B1D7C5 /* aml_generator.c */, + B00F494911F6089500B1D7C5 /* aml_generator.h */, + B0056D2911F3868000754B65 /* asm.s */, + B0056D2A11F3868000754B65 /* ati.c */, + B0056D2B11F3868000754B65 /* ati.h */, + B0056D2C11F3868000754B65 /* bios.h */, + B0056D2D11F3868000754B65 /* bios.s */, + B0056D2E11F3868000754B65 /* biosfn.c */, + B0056D2F11F3868000754B65 /* bootstruct.c */, + B0056D3011F3868000754B65 /* bootstruct.h */, + B0056D3111F3868000754B65 /* cache.c */, + B0056D3211F3868000754B65 /* console.c */, + B0056D3311F3868000754B65 /* convert.c */, + B0056D3411F3868000754B65 /* convert.h */, + B0056D3511F3868000754B65 /* cpu.c */, + B0056D3611F3868000754B65 /* cpu.h */, + B0056D3711F3868000754B65 /* device_inject.c */, + B0056D3811F3868000754B65 /* device_inject.h */, + B0056D3911F3868000754B65 /* device_tree.c */, + B0056D3A11F3868000754B65 /* device_tree.h */, + B0056D3B11F3868000754B65 /* disk.c */, + B0056D3C11F3868000754B65 /* efi.h */, + B0056D3D11F3868000754B65 /* ext2fs.c */, + B0056D3E11F3868000754B65 /* ext2fs.h */, + B0056D3F11F3868000754B65 /* fake_efi.c */, + B0056D4011F3868000754B65 /* fake_efi.h */, + B0056D4111F3868000754B65 /* fdisk.h */, + B0056D4211F3868000754B65 /* hfs.c */, + B0056D4311F3868000754B65 /* hfs.h */, + B0056D4411F3868000754B65 /* hfs_CaseTables.h */, + B0056D4511F3868000754B65 /* hfs_compare.c */, + B0056D4611F3868000754B65 /* hpet.c */, + B0056D4711F3868000754B65 /* hpet.h */, + B0056D4811F3868000754B65 /* io_inline.h */, + B0056D4911F3868000754B65 /* libsaio.h */, + B0056D4A11F3868000754B65 /* load.c */, + B0056D4B11F3868000754B65 /* Makefile */, + B0056D4C11F3868000754B65 /* md5c.c */, + B0056D4D11F3868000754B65 /* mem.c */, + B0056D4E11F3868000754B65 /* mem.h */, + B0056D4F11F3868000754B65 /* memvendors.h */, + B0056D5011F3868000754B65 /* misc.c */, + B0056D5111F3868000754B65 /* msdos.c */, + B0056D5211F3868000754B65 /* msdos.h */, + B0056D5311F3868000754B65 /* msdos_private.h */, + B0056D5411F3868000754B65 /* nbp.c */, + B0056D5511F3868000754B65 /* nbp_cmd.h */, + B0056D5611F3868000754B65 /* ntfs.c */, + B0056D5711F3868000754B65 /* ntfs.h */, + B0056D5811F3868000754B65 /* ntfs_private.h */, + B0056D5911F3868000754B65 /* nvidia.c */, + B0056D5A11F3868000754B65 /* nvidia.h */, + B0056D5B11F3868000754B65 /* pci.c */, + B0056D5C11F3868000754B65 /* pci.h */, + B0056D5D11F3868000754B65 /* pci_root.c */, + B0056D5E11F3868000754B65 /* pci_root.h */, + B0056D5F11F3868000754B65 /* pci_setup.c */, + B0056D6011F3868000754B65 /* platform.c */, + B0056D6111F3868000754B65 /* platform.h */, + B0056D6211F3868000754B65 /* saio_internal.h */, + B0056D6311F3868000754B65 /* saio_types.h */, + B0056D6411F3868000754B65 /* sl.h */, + B0056D6511F3868000754B65 /* SMBIOS.h */, + B0056D6611F3868000754B65 /* smbios_patcher.c */, + B0056D6711F3868000754B65 /* smbios_patcher.h */, + B0056D6811F3868000754B65 /* spd.c */, + B0056D6911F3868000754B65 /* spd.h */, + B0056D6A11F3868000754B65 /* stringTable.c */, + B0056D6B11F3868000754B65 /* sys.c */, + B0056D6C11F3868000754B65 /* table.c */, + B0056D6D11F3868000754B65 /* ufs.c */, + B0056D6E11F3868000754B65 /* ufs.h */, + B0056D6F11F3868000754B65 /* ufs_byteorder.c */, + B0056D7011F3868000754B65 /* ufs_byteorder.h */, + B0056D7111F3868000754B65 /* usb.c */, + B0056D7211F3868000754B65 /* vbe.c */, + B0056D7311F3868000754B65 /* vbe.h */, + B0056D7411F3868000754B65 /* xml.c */, + B0056D7511F3868000754B65 /* xml.h */, + ); + path = libsaio; + sourceTree = ""; + }; + B0056D7911F3868000754B65 /* util */ = { + isa = PBXGroup; + children = ( + B0056D7A11F3868000754B65 /* machOconv.c */, + B0056D7B11F3868000754B65 /* Makefile */, + ); + path = util; + sourceTree = ""; + }; + B0056D8311F3868000754B65 /* package */ = { + isa = PBXGroup; + children = ( + B0056D8411F3868000754B65 /* buildpkg */, + B0056D8511F3868000754B65 /* Distribution */, + B0056D8611F3868000754B65 /* fdisk */, + B0056D8711F3868000754B65 /* Kexts */, + B0056D8D11F3868000754B65 /* Resources */, + B0056DA111F3868000754B65 /* Scripts */, + B0056DB911F3868000754B65 /* smbios.plist */, + ); + path = package; + sourceTree = ""; + }; + B0056D8711F3868000754B65 /* Kexts */ = { + isa = PBXGroup; + children = ( + B0056D8811F3868000754B65 /* AHCIPortInjector.kext */, + B0056D8911F3868000754B65 /* ATAPortInjector.kext */, + B0056D8A11F3868000754B65 /* Disabler.kext */, + B0056D8B11F3868000754B65 /* IOAHCIBlockStorageInjector.kext */, + B0056D8C11F3868000754B65 /* JMicronATAInjector.kext */, + ); + path = Kexts; + sourceTree = ""; + }; + B0056D8D11F3868000754B65 /* Resources */ = { + isa = PBXGroup; + children = ( + B0056D8E11F3868000754B65 /* background.tiff */, + B0056D8F11F3868000754B65 /* Description.html */, + B0056D9111F3868000754B65 /* License.rtf */, + B0056D9311F3868000754B65 /* Localizable.strings */, + B0056D9511F3868000754B65 /* Welcome.rtfd */, + ); + path = Resources; + sourceTree = ""; + }; + B0056DA111F3868000754B65 /* Scripts */ = { + isa = PBXGroup; + children = ( + B0056DA211F3868000754B65 /* FAT */, + B0056DA411F3868000754B65 /* HFS */, + B0056DA611F3868000754B65 /* Options */, + B0056DB511F3868000754B65 /* Post */, + B0056DB711F3868000754B65 /* Standard */, + ); + path = Scripts; + sourceTree = ""; + }; + B0056DA211F3868000754B65 /* FAT */ = { + isa = PBXGroup; + children = ( + B0056DA311F3868000754B65 /* postinstall */, + ); + path = FAT; + sourceTree = ""; + }; + B0056DA411F3868000754B65 /* HFS */ = { + isa = PBXGroup; + children = ( + B0056DA511F3868000754B65 /* postinstall */, + ); + path = HFS; + sourceTree = ""; + }; + B0056DA611F3868000754B65 /* Options */ = { + isa = PBXGroup; + children = ( + B0056DA711F3868000754B65 /* EHCIacquire */, + B0056DA911F3868000754B65 /* EthernetBuiltIn */, + B0056DAB11F3868000754B65 /* ForceHPET */, + B0056DAD11F3868000754B65 /* ForceWake */, + B0056DAF11F3868000754B65 /* GraphicsEnabler */, + B0056DB111F3868000754B65 /* GUI */, + B0056DB311F3868000754B65 /* UHCIreset */, + ); + path = Options; + sourceTree = ""; + }; + B0056DA711F3868000754B65 /* EHCIacquire */ = { + isa = PBXGroup; + children = ( + B0056DA811F3868000754B65 /* postinstall */, + ); + path = EHCIacquire; + sourceTree = ""; + }; + B0056DA911F3868000754B65 /* EthernetBuiltIn */ = { + isa = PBXGroup; + children = ( + B0056DAA11F3868000754B65 /* postinstall */, + ); + path = EthernetBuiltIn; + sourceTree = ""; + }; + B0056DAB11F3868000754B65 /* ForceHPET */ = { + isa = PBXGroup; + children = ( + B0056DAC11F3868000754B65 /* postinstall */, + ); + path = ForceHPET; + sourceTree = ""; + }; + B0056DAD11F3868000754B65 /* ForceWake */ = { + isa = PBXGroup; + children = ( + B0056DAE11F3868000754B65 /* postinstall */, + ); + path = ForceWake; + sourceTree = ""; + }; + B0056DAF11F3868000754B65 /* GraphicsEnabler */ = { + isa = PBXGroup; + children = ( + B0056DB011F3868000754B65 /* postinstall */, + ); + path = GraphicsEnabler; + sourceTree = ""; + }; + B0056DB111F3868000754B65 /* GUI */ = { + isa = PBXGroup; + children = ( + B0056DB211F3868000754B65 /* postinstall */, + ); + path = GUI; + sourceTree = ""; + }; + B0056DB311F3868000754B65 /* UHCIreset */ = { + isa = PBXGroup; + children = ( + B0056DB411F3868000754B65 /* postinstall */, + ); + path = UHCIreset; + sourceTree = ""; + }; + B0056DB511F3868000754B65 /* Post */ = { + isa = PBXGroup; + children = ( + B0056DB611F3868000754B65 /* postinstall */, + ); + path = Post; + sourceTree = ""; + }; + B0056DB711F3868000754B65 /* Standard */ = { + isa = PBXGroup; + children = ( + B0056DB811F3868000754B65 /* postinstall */, + ); + path = Standard; + sourceTree = ""; + }; + B0056DBA11F3868000754B65 /* artwork */ = { + isa = PBXGroup; + children = ( + B0056DBB11F3868000754B65 /* themes */, + ); + path = artwork; + sourceTree = ""; + }; + B0056DBB11F3868000754B65 /* themes */ = { + isa = PBXGroup; + children = ( + B0056DBC11F3868000754B65 /* bullet */, + B0056DDC11F3868000754B65 /* default */, + B0056DFC11F3868000754B65 /* msi_netbook */, + B0056DFF11F3868000754B65 /* pinktink */, + B0056E0211F3868000754B65 /* twilight */, + ); + path = themes; + sourceTree = ""; + }; + B0056DBC11F3868000754B65 /* bullet */ = { + isa = PBXGroup; + children = ( + B0056DBD11F3868000754B65 /* background.png */, + B0056DBE11F3868000754B65 /* boot.png */, + B0056DBF11F3868000754B65 /* device_cdrom.png */, + B0056DC011F3868000754B65 /* device_ext3.png */, + B0056DC111F3868000754B65 /* device_fat16.png */, + B0056DC211F3868000754B65 /* device_fat32.png */, + B0056DC311F3868000754B65 /* device_generic.png */, + B0056DC411F3868000754B65 /* device_hfsplus.png */, + B0056DC511F3868000754B65 /* device_ntfs.png */, + B0056DC611F3868000754B65 /* device_scroll_next.png */, + B0056DC711F3868000754B65 /* device_scroll_prev.png */, + B0056DC811F3868000754B65 /* device_selection.png */, + B0056DC911F3868000754B65 /* font_console.png */, + B0056DCA11F3868000754B65 /* font_small.png */, + B0056DCB11F3868000754B65 /* logo.png */, + B0056DCC11F3868000754B65 /* menu_boot.png */, + B0056DCD11F3868000754B65 /* menu_help.png */, + B0056DCE11F3868000754B65 /* menu_ignore_caches.png */, + B0056DCF11F3868000754B65 /* menu_ignore_caches_disabled.png */, + B0056DD011F3868000754B65 /* menu_memory_info.png */, + B0056DD111F3868000754B65 /* menu_selection.png */, + B0056DD211F3868000754B65 /* menu_single_user.png */, + B0056DD311F3868000754B65 /* menu_single_user_disabled.png */, + B0056DD411F3868000754B65 /* menu_verbose.png */, + B0056DD511F3868000754B65 /* menu_verbose_disabled.png */, + B0056DD611F3868000754B65 /* menu_video_info.png */, + B0056DD711F3868000754B65 /* progress_bar.png */, + B0056DD811F3868000754B65 /* progress_bar_background.png */, + B0056DD911F3868000754B65 /* text_scroll_next.png */, + B0056DDA11F3868000754B65 /* text_scroll_prev.png */, + B0056DDB11F3868000754B65 /* theme.plist */, + ); + path = bullet; + sourceTree = ""; + }; + B0056DDC11F3868000754B65 /* default */ = { + isa = PBXGroup; + children = ( + B0056DDD11F3868000754B65 /* background.png */, + B0056DDE11F3868000754B65 /* boot.png */, + B0056DDF11F3868000754B65 /* device_cdrom.png */, + B0056DE011F3868000754B65 /* device_ext3.png */, + B0056DE111F3868000754B65 /* device_fat16.png */, + B0056DE211F3868000754B65 /* device_fat32.png */, + B0056DE311F3868000754B65 /* device_generic.png */, + B0056DE411F3868000754B65 /* device_hfsplus.png */, + B0056DE511F3868000754B65 /* device_ntfs.png */, + B0056DE611F3868000754B65 /* device_scroll_next.png */, + B0056DE711F3868000754B65 /* device_scroll_prev.png */, + B0056DE811F3868000754B65 /* device_selection.png */, + B0056DE911F3868000754B65 /* font_console.png */, + B0056DEA11F3868000754B65 /* font_small.png */, + B0056DEB11F3868000754B65 /* logo.png */, + B0056DEC11F3868000754B65 /* menu_boot.png */, + B0056DED11F3868000754B65 /* menu_help.png */, + B0056DEE11F3868000754B65 /* menu_ignore_caches.png */, + B0056DEF11F3868000754B65 /* menu_ignore_caches_disabled.png */, + B0056DF011F3868000754B65 /* menu_memory_info.png */, + B0056DF111F3868000754B65 /* menu_selection.png */, + B0056DF211F3868000754B65 /* menu_single_user.png */, + B0056DF311F3868000754B65 /* menu_single_user_disabled.png */, + B0056DF411F3868000754B65 /* menu_verbose.png */, + B0056DF511F3868000754B65 /* menu_verbose_disabled.png */, + B0056DF611F3868000754B65 /* menu_video_info.png */, + B0056DF711F3868000754B65 /* progress_bar.png */, + B0056DF811F3868000754B65 /* progress_bar_background.png */, + B0056DF911F3868000754B65 /* text_scroll_next.png */, + B0056DFA11F3868000754B65 /* text_scroll_prev.png */, + B0056DFB11F3868000754B65 /* theme.plist */, + ); + path = default; + sourceTree = ""; + }; + B0056DFC11F3868000754B65 /* msi_netbook */ = { + isa = PBXGroup; + children = ( + B0056DFD11F3868000754B65 /* logo.png */, + B0056DFE11F3868000754B65 /* theme.plist */, + ); + path = msi_netbook; + sourceTree = ""; + }; + B0056DFF11F3868000754B65 /* pinktink */ = { + isa = PBXGroup; + children = ( + B0056E0011F3868000754B65 /* logo.png */, + B0056E0111F3868000754B65 /* theme.plist */, + ); + path = pinktink; + sourceTree = ""; + }; + B0056E0211F3868000754B65 /* twilight */ = { + isa = PBXGroup; + children = ( + B0056E0311F3868000754B65 /* font_small.png */, + B0056E0411F3868000754B65 /* logo.png */, + B0056E0511F3868000754B65 /* theme.plist */, + ); + path = twilight; + sourceTree = ""; + }; + B0056E0611F3868000754B65 /* doc */ = { + isa = PBXGroup; + children = ( + B0056E0711F3868000754B65 /* archive */, + B0056E0B11F3868000754B65 /* BootHelp.txt */, + B0056E0C11F3868000754B65 /* README */, + B0056E0D11F3868000754B65 /* themeinfo.png */, + B0056E0E11F3868000754B65 /* User_Guide_src */, + B0056E1A11F3868000754B65 /* Users_Guide0.5.pdf */, + ); + path = doc; + sourceTree = ""; + }; + B0056E0711F3868000754B65 /* archive */ = { + isa = PBXGroup; + children = ( + B0056E0811F3868000754B65 /* Users_Guide0.4.pdf */, + B0056E0911F3868000754B65 /* Users_Guide_v0.3.pdf */, + B0056E0A11F3868000754B65 /* UsersGuide-v0.2.pdf */, + ); + path = archive; + sourceTree = ""; + }; + B0056E0E11F3868000754B65 /* User_Guide_src */ = { + isa = PBXGroup; + children = ( + B0056E0F11F3868000754B65 /* Chameleon 2 v0.4.xml */, + B0056E1011F3868000754B65 /* Chameleon 2 v0.5.docx */, + B0056E1111F3868000754B65 /* chameleon.png */, + B0056E1211F3868000754B65 /* colorchart.png */, + B0056E1311F3868000754B65 /* install_complete.png */, + B0056E1411F3868000754B65 /* install_cust.png */, + B0056E1511F3868000754B65 /* install_dest.png */, + B0056E1611F3868000754B65 /* install_stand.png */, + B0056E1711F3868000754B65 /* install_start.png */, + B0056E1811F3868000754B65 /* screen_format.png */, + B0056E1911F3868000754B65 /* xnulogo.png */, + ); + path = User_Guide_src; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXLegacyTarget section */ + D28A88AD04BDD90700651E21 /* Chameleon */ = { + isa = PBXLegacyTarget; + buildArgumentsString = "$(ACTION)"; + buildConfigurationList = 1DEB918F08733D9F0010E9CD /* Build configuration list for PBXLegacyTarget "Chameleon" */; + buildPhases = ( + ); + buildToolPath = /usr/bin/make; + buildWorkingDirectory = ""; + dependencies = ( + ); + name = Chameleon; + passBuildSettingsInEnvironment = 1; + productName = Chameleon; + }; +/* End PBXLegacyTarget section */ + +/* Begin PBXProject section */ + 08FB7793FE84155DC02AAC07 /* Project object */ = { + isa = PBXProject; + buildConfigurationList = 1DEB919308733D9F0010E9CD /* Build configuration list for PBXProject "Chameleon" */; + compatibilityVersion = "Xcode 3.1"; + hasScannedForEncodings = 1; + knownRegions = ( + English, + Japanese, + French, + German, + Spanish, + ); + mainGroup = 08FB7794FE84155DC02AAC07 /* Chameleon */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + D28A88AD04BDD90700651E21 /* Chameleon */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXVariantGroup section */ + B0056D8F11F3868000754B65 /* Description.html */ = { + isa = PBXVariantGroup; + children = ( + B0056D9011F3868000754B65 /* English */, + B0056D9711F3868000754B65 /* French */, + B0056D9A11F3868000754B65 /* German */, + B0056D9D11F3868000754B65 /* Spanish */, + ); + name = Description.html; + sourceTree = ""; + }; + B0056D9111F3868000754B65 /* License.rtf */ = { + isa = PBXVariantGroup; + children = ( + B0056D9211F3868000754B65 /* English */, + B0056D9811F3868000754B65 /* French */, + B0056D9B11F3868000754B65 /* German */, + B0056D9E11F3868000754B65 /* Spanish */, + ); + name = License.rtf; + sourceTree = ""; + }; + B0056D9311F3868000754B65 /* Localizable.strings */ = { + isa = PBXVariantGroup; + children = ( + B0056D9411F3868000754B65 /* English */, + B0056D9911F3868000754B65 /* French */, + B0056D9C11F3868000754B65 /* German */, + B0056D9F11F3868000754B65 /* Spanish */, + ); + name = Localizable.strings; + sourceTree = ""; + }; + B0056D9511F3868000754B65 /* Welcome.rtfd */ = { + isa = PBXVariantGroup; + children = ( + B0056D9611F3868000754B65 /* English */, + B0056DA011F3868000754B65 /* Spanish */, + ); + name = Welcome.rtfd; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 1DEB919008733D9F0010E9CD /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = NO; + DEBUGGING_SYMBOLS = YES; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + PRODUCT_NAME = Chameleon; + }; + name = Debug; + }; + 1DEB919108733D9F0010E9CD /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = YES; + GCC_ENABLE_FIX_AND_CONTINUE = NO; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + PRODUCT_NAME = Chameleon; + }; + name = Release; + }; + 1DEB919408733D9F0010E9CD /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + ONLY_ACTIVE_ARCH = YES; + PREBINDING = NO; + SDKROOT = macosx10.6; + }; + name = Debug; + }; + 1DEB919508733D9F0010E9CD /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + PREBINDING = NO; + SDKROOT = macosx10.6; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 1DEB918F08733D9F0010E9CD /* Build configuration list for PBXLegacyTarget "Chameleon" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1DEB919008733D9F0010E9CD /* Debug */, + 1DEB919108733D9F0010E9CD /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 1DEB919308733D9F0010E9CD /* Build configuration list for PBXProject "Chameleon" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1DEB919408733D9F0010E9CD /* Debug */, + 1DEB919508733D9F0010E9CD /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 08FB7793FE84155DC02AAC07 /* Project object */; +} Index: trunk/i386/libsaio/dsdt_patcher.c =================================================================== --- trunk/i386/libsaio/dsdt_patcher.c (revision 191) +++ trunk/i386/libsaio/dsdt_patcher.c (revision 192) @@ -1,506 +0,0 @@ -/* - * Copyright 2008 mackerintel - */ - -#include "libsaio.h" -#include "boot.h" -#include "bootstruct.h" -#include "acpi.h" -#include "efi_tables.h" -#include "fake_efi.h" -#include "dsdt_patcher.h" -#include "platform.h" - -#ifndef DEBUG_DSDT -#define DEBUG_DSDT 0 -#endif - -#if DEBUG_DSDT==2 -#define DBG(x...) {printf(x); sleep(1);} -#elif DEBUG_DSDT==1 -#define DBG(x...) printf(x) -#else -#define DBG(x...) -#endif - -/* Gets the ACPI 1.0 RSDP address */ -static struct acpi_2_rsdp* getAddressOfAcpiTable() -{ - /* TODO: Before searching the BIOS space we are supposed to search the first 1K of the EBDA */ - - void *acpi_addr = (void*)ACPI_RANGE_START; - for(; acpi_addr <= (void*)ACPI_RANGE_END; acpi_addr += 16) - { - if(*(uint64_t *)acpi_addr == ACPI_SIGNATURE_UINT64_LE) - { - uint8_t csum = checksum8(acpi_addr, 20); - if(csum == 0) - { - // Only return the table if it is a true version 1.0 table (Revision 0) - if(((struct acpi_2_rsdp*)acpi_addr)->Revision == 0) - return acpi_addr; - } - } - } - return NULL; -} - -/* Gets the ACPI 2.0 RSDP address */ -static struct acpi_2_rsdp* getAddressOfAcpi20Table() -{ - /* TODO: Before searching the BIOS space we are supposed to search the first 1K of the EBDA */ - - void *acpi_addr = (void*)ACPI_RANGE_START; - for(; acpi_addr <= (void*)ACPI_RANGE_END; acpi_addr += 16) - { - if(*(uint64_t *)acpi_addr == ACPI_SIGNATURE_UINT64_LE) - { - uint8_t csum = checksum8(acpi_addr, 20); - - /* Only assume this is a 2.0 or better table if the revision is greater than 0 - * NOTE: ACPI 3.0 spec only seems to say that 1.0 tables have revision 1 - * and that the current revision is 2.. I am going to assume that rev > 0 is 2.0. - */ - - if(csum == 0 && (((struct acpi_2_rsdp*)acpi_addr)->Revision > 0)) - { - uint8_t csum2 = checksum8(acpi_addr, sizeof(struct acpi_2_rsdp)); - if(csum2 == 0) - return acpi_addr; - } - } - } - return NULL; -} -/** The folowing ACPI Table search algo. should be reused anywhere needed:*/ -int search_and_get_acpi_fd(const char * filename, const char ** outDirspec) -{ - int fd = 0; - const char * override_name = NULL; - static char dirspec[512] = ""; - int len = 0; - - // Try using the file specified with the DSDT option - if (getValueForKey(kDSDT, &override_name, &len, &bootInfo->bootConfig)) - { - sprintf(dirspec, "%s", override_name); - fd = open(dirspec, 0); - if (fd >= 0) goto success_fd; - } - // Try finding 'filename' in the usual places - else - { - // Start searching any potential location for ACPI Table - // search the Extra folders first - sprintf(dirspec, "/Extra/%s", filename); - fd = open(dirspec, 0); - if (fd >= 0) goto success_fd; - - sprintf(dirspec, "/%s", filename); // search root - fd = open(dirspec, 0); - if (fd >= 0) goto success_fd; - - sprintf(dirspec, "bt(0,0)/Extra/%s", filename); - fd = open(dirspec, 0); - if (fd >= 0) goto success_fd; - } - - // NOT FOUND: - verbose("ACPI Table not found\n"); - - if (outDirspec) *outDirspec = ""; - return -1; - - // FOUND -success_fd: - if (outDirspec) *outDirspec = dirspec; - return fd; -} - -void *loadACPITable (const char * filename) -{ - void *tableAddr; - const char * dirspec=NULL; - - int fd = search_and_get_acpi_fd(filename, &dirspec); - - if (fd>=0) - { - tableAddr=(void*)AllocateKernelMemory(file_size (fd)); - if (tableAddr) - { - if (read (fd, tableAddr, file_size (fd))!=file_size (fd)) - { - printf("Couldn't read table %s\n",dirspec); - free (tableAddr); - close (fd); - return NULL; - } - - DBG("Table %s read and stored at: %x\n", dirspec, tableAddr); - close (fd); - return tableAddr; - } - close (fd); - printf("Couldn't allocate memory for table \n", dirspec); - } - return NULL; -} - - -struct acpi_2_fadt * -patch_fadt(struct acpi_2_fadt *fadt, void *new_dsdt) -{ - - extern void setupSystemType(); - - struct acpi_2_fadt *fadt_mod; - bool fadt_rev2_needed = false; - bool fix_restart; - const char * value; - - // Restart Fix - if (Platform.CPU.Vendor == 0x756E6547) { /* Intel */ - fix_restart = true; - getBoolForKey(kRestartFix, &fix_restart, &bootInfo->bootConfig); - } else { - verbose ("Not an Intel platform: Restart Fix not applied !!!\n"); - fix_restart = false; - } - - if (fix_restart) fadt_rev2_needed = true; - - // Allocate new fadt table - if (fadt->Length < 0x84 && fadt_rev2_needed) - { - fadt_mod=(struct acpi_2_fadt *)AllocateKernelMemory(0x84); - memcpy(fadt_mod, fadt, fadt->Length); - fadt_mod->Length = 0x84; - fadt_mod->Revision = 0x02; // FADT rev 2 (ACPI 1.0B MS extensions) - } - else - { - fadt_mod=(struct acpi_2_fadt *)AllocateKernelMemory(fadt->Length); - memcpy(fadt_mod, fadt, fadt->Length); - } - // Determine system type / PM_Model - if ( (value=getStringForKey(kSystemType, &bootInfo->bootConfig))!=NULL) - { - if (Platform.Type > 6) - { - if(fadt_mod->PM_Profile<=6) - Platform.Type = fadt_mod->PM_Profile; // get the fadt if correct - else - Platform.Type = 1; /* Set a fixed value (Desktop) */ - verbose("Error: system-type must be 0..6. Defaulting to %d !\n", Platform.Type); - } - else - Platform.Type = (unsigned char) strtoul(value, NULL, 10); - } - // Set PM_Profile from System-type if only if user wanted this value to be forced - if (fadt_mod->PM_Profile != Platform.Type) - { - if (value) - { // user has overriden the SystemType so take care of it in FACP - verbose("FADT: changing PM_Profile from 0x%02x to 0x%02x\n", fadt_mod->PM_Profile, Platform.Type); - fadt_mod->PM_Profile = Platform.Type; - } - else - { // PM_Profile has a different value and no override has been set, so reflect the user value to ioregs - Platform.Type = fadt_mod->PM_Profile <= 6 ? fadt_mod->PM_Profile : 1; - } - } - // We now have to write the systemm-type in ioregs: we cannot do it before in setupDeviceTree() - // because we need to take care of facp original content, if it is correct. - setupSystemType(); - - // Patch FADT to fix restart - if (fix_restart) - { - fadt_mod->Flags|= 0x400; - fadt_mod->Reset_SpaceID = 0x01; // System I/O - fadt_mod->Reset_BitWidth = 0x08; // 1 byte - fadt_mod->Reset_BitOffset = 0x00; // Offset 0 - fadt_mod->Reset_AccessWidth = 0x01; // Byte access - fadt_mod->Reset_Address = 0x0cf9; // Address of the register - fadt_mod->Reset_Value = 0x06; // Value to write to reset the system - verbose("FADT: Restart Fix applied !\n"); - } - - // Patch DSDT Address - DBG("DSDT: Old @%x,%x, ",fadt_mod->DSDT,fadt_mod->X_DSDT); - - fadt_mod->DSDT=(uint32_t)new_dsdt; - if ((uint32_t)(&(fadt_mod->X_DSDT))-(uint32_t)fadt_mod+8<=fadt_mod->Length) - fadt_mod->X_DSDT=(uint32_t)new_dsdt; - - DBG("New @%x,%x\n",fadt_mod->DSDT,fadt_mod->X_DSDT); - - // Correct the checksum - fadt_mod->Checksum=0; - fadt_mod->Checksum=256-checksum8(fadt_mod,fadt_mod->Length); - - return fadt_mod; -} - -/* Setup ACPI without replacing DSDT. */ -int setupAcpiNoMod() -{ -// addConfigurationTable(&gEfiAcpiTableGuid, getAddressOfAcpiTable(), "ACPI"); -// addConfigurationTable(&gEfiAcpi20TableGuid, getAddressOfAcpi20Table(), "ACPI_20"); - /* XXX aserebln why uint32 cast if pointer is uint64 ? */ - acpi10_p = (uint32_t)getAddressOfAcpiTable(); - acpi20_p = (uint32_t)getAddressOfAcpi20Table(); - addConfigurationTable(&gEfiAcpiTableGuid, &acpi10_p, "ACPI"); - if(acpi20_p) addConfigurationTable(&gEfiAcpi20TableGuid, &acpi20_p, "ACPI_20"); - return 1; -} - -/* Setup ACPI. Replace DSDT if DSDT.aml is found */ -int setupAcpi(void) -{ - int version; - void *new_dsdt; - - bool drop_ssdt; - - // Load replacement DSDT - new_dsdt=loadACPITable("DSDT.aml"); - if (!new_dsdt) - { - return setupAcpiNoMod(); - } - - DBG("New DSDT Loaded in memory\n"); - - { - bool tmp; - drop_ssdt=getBoolForKey(kDropSSDT, &tmp, &bootInfo->bootConfig)&&tmp; - } - - // Do the same procedure for both versions of ACPI - for (version=0; version<2; version++) { - struct acpi_2_rsdp *rsdp, *rsdp_mod; - struct acpi_2_rsdt *rsdt, *rsdt_mod; - int rsdplength; - - // Find original rsdp - rsdp=(struct acpi_2_rsdp *)(version?getAddressOfAcpi20Table():getAddressOfAcpiTable()); - if (!rsdp) - { - DBG("No ACPI version %d found. Ignoring\n", version+1); - if (version) - addConfigurationTable(&gEfiAcpi20TableGuid, NULL, "ACPI_20"); - else - addConfigurationTable(&gEfiAcpiTableGuid, NULL, "ACPI"); - continue; - } - rsdplength=version?rsdp->Length:20; - - DBG("RSDP version %d found @%x. Length=%d\n",version+1,rsdp,rsdplength); - - /* FIXME: no check that memory allocation succeeded - * Copy and patch RSDP,RSDT, XSDT and FADT - * For more info see ACPI Specification pages 110 and following - */ - - rsdp_mod=(struct acpi_2_rsdp *) AllocateKernelMemory(rsdplength); - memcpy(rsdp_mod, rsdp, rsdplength); - rsdt=(struct acpi_2_rsdt *)(rsdp->RsdtAddress); - - DBG("RSDT @%x, Length %d\n",rsdt, rsdt->Length); - - if (rsdt && (uint32_t)rsdt !=0xffffffff && rsdt->Length<0x10000) - { - uint32_t *rsdt_entries; - int rsdt_entries_num; - int dropoffset=0, i; - - rsdt_mod=(struct acpi_2_rsdt *)AllocateKernelMemory(rsdt->Length); - memcpy (rsdt_mod, rsdt, rsdt->Length); - rsdp_mod->RsdtAddress=(uint32_t)rsdt_mod; - rsdt_entries_num=(rsdt_mod->Length-sizeof(struct acpi_2_rsdt))/4; - rsdt_entries=(uint32_t *)(rsdt_mod+1); - for (i=0;iLength); - - if (!fadt || (uint32_t)fadt == 0xffffffff || fadt->Length>0x10000) - { - printf("FADT incorrect. Not modified\n"); - continue; - } - - fadt_mod = patch_fadt(fadt, new_dsdt); - rsdt_entries[i-dropoffset]=(uint32_t)fadt_mod; - continue; - } - } - DBG("\n"); - - // Correct the checksum of RSDT - rsdt_mod->Length-=4*dropoffset; - - DBG("RSDT: Original checksum %d, ", rsdt_mod->Checksum); - - rsdt_mod->Checksum=0; - rsdt_mod->Checksum=256-checksum8(rsdt_mod,rsdt_mod->Length); - - DBG("New checksum %d at %x\n", rsdt_mod->Checksum,rsdt_mod); - } - else - { - rsdp_mod->RsdtAddress=0; - printf("RSDT not found or RSDT incorrect\n"); - } - - if (version) - { - struct acpi_2_xsdt *xsdt, *xsdt_mod; - - // FIXME: handle 64-bit address correctly - - xsdt=(struct acpi_2_xsdt*) ((uint32_t)rsdp->XsdtAddress); - DBG("XSDT @%x;%x, Length=%d\n", (uint32_t)(rsdp->XsdtAddress>>32),(uint32_t)rsdp->XsdtAddress, - xsdt->Length); - if (xsdt && (uint64_t)rsdp->XsdtAddress<0xffffffff && xsdt->Length<0x10000) - { - uint64_t *xsdt_entries; - int xsdt_entries_num, i; - int dropoffset=0; - - xsdt_mod=(struct acpi_2_xsdt*)AllocateKernelMemory(xsdt->Length); - memcpy(xsdt_mod, xsdt, xsdt->Length); - rsdp_mod->XsdtAddress=(uint32_t)xsdt_mod; - xsdt_entries_num=(xsdt_mod->Length-sizeof(struct acpi_2_xsdt))/8; - xsdt_entries=(uint64_t *)(xsdt_mod+1); - for (i=0;i>32),fadt, - fadt->Length); - - if (!fadt || (uint64_t)xsdt_entries[i] >= 0xffffffff || fadt->Length>0x10000) - { - verbose("FADT incorrect or after 4GB. Dropping XSDT\n"); - goto drop_xsdt; - } - - fadt_mod = patch_fadt(fadt, new_dsdt); - xsdt_entries[i-dropoffset]=(uint32_t)fadt_mod; - - DBG("TABLE %c%c%c%c@%x,",table[0],table[1],table[2],table[3],xsdt_entries[i]); - - continue; - } - - DBG("TABLE %c%c%c%c@%x,",table[0],table[1],table[2],table[3],xsdt_entries[i]); - - } - - // Correct the checksum of XSDT - xsdt_mod->Length-=8*dropoffset; - xsdt_mod->Checksum=0; - xsdt_mod->Checksum=256-checksum8(xsdt_mod,xsdt_mod->Length); - } - else - { - drop_xsdt: - - DBG("About to drop XSDT\n"); - - /*FIXME: Now we just hope that if MacOS doesn't find XSDT it reverts to RSDT. - * A Better strategy would be to generate - */ - - rsdp_mod->XsdtAddress=0xffffffffffffffffLL; - verbose("XSDT not found or XSDT incorrect\n"); - } - } - - // Correct the checksum of RSDP - - DBG("RSDP: Original checksum %d, ", rsdp_mod->Checksum); - - rsdp_mod->Checksum=0; - rsdp_mod->Checksum=256-checksum8(rsdp_mod,20); - - DBG("New checksum %d\n", rsdp_mod->Checksum); - - if (version) - { - DBG("RSDP: Original extended checksum %d", rsdp_mod->ExtendedChecksum); - - rsdp_mod->ExtendedChecksum=0; - rsdp_mod->ExtendedChecksum=256-checksum8(rsdp_mod,rsdp_mod->Length); - - DBG("New extended checksum %d\n", rsdp_mod->ExtendedChecksum); - - } - - verbose("Patched ACPI version %d DSDT\n", version+1); - if (version) - { - /* XXX aserebln why uint32 cast if pointer is uint64 ? */ - acpi20_p = (uint32_t)rsdp_mod; - addConfigurationTable(&gEfiAcpi20TableGuid, &acpi20_p, "ACPI_20"); - } - else - { - /* XXX aserebln why uint32 cast if pointer is uint64 ? */ - acpi10_p = (uint32_t)rsdp_mod; - addConfigurationTable(&gEfiAcpiTableGuid, &acpi10_p, "ACPI"); - } - } -#if DEBUG_DSDT - printf("Press a key to continue... (DEBUG_DSDT)\n"); - getc(); -#endif - return 1; -} Index: trunk/i386/libsaio/dsdt_patcher.h =================================================================== --- trunk/i386/libsaio/dsdt_patcher.h (revision 191) +++ trunk/i386/libsaio/dsdt_patcher.h (revision 192) @@ -1,20 +0,0 @@ -/* - * Copyright 2008 mackerintel - */ - -#ifndef __LIBSAIO_DSDT_PATCHER_H -#define __LIBSAIO_DSDT_PATCHER_H - -#include "libsaio.h" - -uint64_t acpi10_p; -uint64_t acpi20_p; -uint64_t smbios_p; -extern int setupAcpi(); - -extern EFI_STATUS addConfigurationTable(); - -extern EFI_GUID gEfiAcpiTableGuid; -extern EFI_GUID gEfiAcpi20TableGuid; - -#endif /* !__LIBSAIO_DSDT_PATCHER_H */ Index: trunk/i386/libsaio/acpi_patcher.c =================================================================== --- trunk/i386/libsaio/acpi_patcher.c (revision 0) +++ trunk/i386/libsaio/acpi_patcher.c (revision 192) @@ -0,0 +1,1131 @@ +/* + * Copyright 2008 mackerintel + */ + +#include "libsaio.h" +#include "boot.h" +#include "bootstruct.h" +#include "acpi.h" +#include "efi_tables.h" +#include "fake_efi.h" +#include "acpi_patcher.h" +#include "platform.h" +#include "cpu.h" +#include "aml_generator.h" + +#ifndef DEBUG_ACPI +#define DEBUG_ACPI 0 +#endif + +#if DEBUG_ACPI==2 +#define DBG(x...) {printf(x); sleep(1);} +#elif DEBUG_ACPI==1 +#define DBG(x...) printf(x) +#else +#define DBG(x...) +#endif + +// Slice: New signature compare function +boolean_t tableSign(char *table, const char *sgn) +{ + int i; + for (i=0; i<4; i++) { + if ((table[i] &~0x20) != (sgn[i] &~0x20)) { + return FALSE; + } + } + return TRUE; +} + +/* Gets the ACPI 1.0 RSDP address */ +static struct acpi_2_rsdp* getAddressOfAcpiTable() +{ + /* TODO: Before searching the BIOS space we are supposed to search the first 1K of the EBDA */ + + void *acpi_addr = (void*)ACPI_RANGE_START; + for(; acpi_addr <= (void*)ACPI_RANGE_END; acpi_addr += 16) + { + if(*(uint64_t *)acpi_addr == ACPI_SIGNATURE_UINT64_LE) + { + uint8_t csum = checksum8(acpi_addr, 20); + if(csum == 0) + { + // Only return the table if it is a true version 1.0 table (Revision 0) + if(((struct acpi_2_rsdp*)acpi_addr)->Revision == 0) + return acpi_addr; + } + } + } + return NULL; +} + +/* Gets the ACPI 2.0 RSDP address */ +static struct acpi_2_rsdp* getAddressOfAcpi20Table() +{ + /* TODO: Before searching the BIOS space we are supposed to search the first 1K of the EBDA */ + + void *acpi_addr = (void*)ACPI_RANGE_START; + for(; acpi_addr <= (void*)ACPI_RANGE_END; acpi_addr += 16) + { + if(*(uint64_t *)acpi_addr == ACPI_SIGNATURE_UINT64_LE) + { + uint8_t csum = checksum8(acpi_addr, 20); + + /* Only assume this is a 2.0 or better table if the revision is greater than 0 + * NOTE: ACPI 3.0 spec only seems to say that 1.0 tables have revision 1 + * and that the current revision is 2.. I am going to assume that rev > 0 is 2.0. + */ + + if(csum == 0 && (((struct acpi_2_rsdp*)acpi_addr)->Revision > 0)) + { + uint8_t csum2 = checksum8(acpi_addr, sizeof(struct acpi_2_rsdp)); + if(csum2 == 0) + return acpi_addr; + } + } + } + return NULL; +} +/** The folowing ACPI Table search algo. should be reused anywhere needed:*/ +int search_and_get_acpi_fd(const char * filename, const char ** outDirspec) +{ + int fd=0; + const char * overriden_pathname=NULL; + static char dirspec[512]=""; + static bool first_time =true; + int len=0; + + /// Take in accound user overriding if it's DSDT only + if (strstr(filename, "DSDT") && + getValueForKey(kDSDT, &overriden_pathname, &len, + &bootInfo->bootConfig)) + { + sprintf(dirspec, "%s", overriden_pathname); + fd=open (dirspec,0); + if (fd>=0) goto success_fd; + } + // Check that dirspec is not already assigned with a path + if (!first_time && *dirspec) + { // it is so start searching this cached patch first + //extract path + for (len=strlen(dirspec)-1; len; len--) + if (dirspec[len]=='/' || len==0) + { + dirspec[len]='\0'; + break; + } + // now concat with the filename + strncat(dirspec, "/", sizeof(dirspec)); + strncat(dirspec, filename, sizeof(dirspec)); + // and test to see if we don't have our big boy here: + fd=open (dirspec,0); + if (fd>=0) + { + // printf("ACPI file search cache hit: file found at %s\n", dirspec); + goto success_fd; + } + } + // Start searching any potential location for ACPI Table + // search the Extra folders first + sprintf(dirspec,"/Extra/%s",filename); + fd=open (dirspec,0); + if (fd>=0) goto success_fd; + + sprintf(dirspec,"bt(0,0)/Extra/%s",filename); + fd=open (dirspec,0); + if (fd>=0) goto success_fd; + + sprintf(dirspec, "%s", filename); // search current dir + fd=open (dirspec,0); + if (fd>=0) goto success_fd; + + sprintf(dirspec, "/%s", filename); // search root + fd=open (dirspec,0); + if (fd>=0) goto success_fd; + + // NOT FOUND: + //verbose("ACPI Table not found: %s\n", filename); + if (outDirspec) *outDirspec = ""; + first_time = false; + return -1; + // FOUND +success_fd: + first_time = false; + if (outDirspec) *outDirspec = dirspec; + return fd; +} + +void *loadACPITable (const char * filename) +{ + void *tableAddr; + const char * dirspec=NULL; + + int fd = search_and_get_acpi_fd(filename, &dirspec); + + if (fd>=0) + { + tableAddr=(void*)AllocateKernelMemory(file_size (fd)); + if (tableAddr) + { + if (read (fd, tableAddr, file_size (fd))!=file_size (fd)) + { + printf("Couldn't read table %s\n",dirspec); + free (tableAddr); + close (fd); + return NULL; + } + + DBG("Table %s read and stored at: %x\n", dirspec, tableAddr); + close (fd); + return tableAddr; + } + close (fd); + printf("Couldn't allocate memory for table \n", dirspec); + } + //printf("Couldn't find table %s\n", filename); + return NULL; +} + +uint8_t acpi_cpu_count = 0; +char* acpi_cpu_name[32]; + +void find_acpi_cpu_names(unsigned char* dsdt, int length) +{ + int i; + + for (i=0; iDSDT; + + if (dsdt == NULL) { + verbose ("DSDT not found: C-States not generated !!!\n"); + return NULL; + } + + if (acpi_cpu_count == 0) + find_acpi_cpu_names((void*)dsdt, dsdt->Length); + + if (acpi_cpu_count > 0) { + bool c2_enabled = fadt->C2_Latency < 100, c3_enabled = fadt->C3_Latency < 1000; + + // Setup C2 Latency + if (c2_enabled) + chunk_c2[27] = fadt->C2_Latency & 0xff; + + // Setup C3 Latency + if (c3_enabled) { + chunk_c3[27] = fadt->C3_Latency & 0xff; + chunk_c3[28] = (fadt->C3_Latency >> 8) & 0xff; + } + + // Generating SSDT + uint32_t package_length = + 4 + + sizeof(chunk_c1) + + c2_enabled * sizeof(chunk_c2) + + c3_enabled * sizeof(chunk_c3); + + if (package_length > 0x3f) + package_length++; + + uint32_t name_length = + 1 + + sizeof(chunk_name_body) + + 1 + package_length; + + if (name_length > 0x3f) + name_length++; + + uint32_t ssdt_size = + sizeof(ssdt_header) + + 1 + name_length + + acpi_cpu_count * sizeof(chunk_alias); + + struct acpi_2_ssdt *ssdt = (void*)AllocateKernelMemory(ssdt_size); + int fd = openmem((char*)ssdt, ssdt_size); + + // Header + write(fd, ssdt_header, sizeof(ssdt_header)); + + // Scope (\_PR) { Name (CST + writebyte(fd, 0x10); // id + if (name_length > 0x3f) + { + writebyte(fd, 0x40 | (name_length & 0xf)); // lo half-byte + writebyte(fd, name_length >> 4); // hi byte + } + else + { + writebyte(fd, name_length); // length + } + write(fd, chunk_name_body, sizeof(chunk_name_body)); + + //Package (0x04) { 0x03, + writebyte(fd, 0x12); // id + if (package_length > 0x3f) + { + writebyte(fd, 0x40 | (package_length & 0xf)); // lo half-byte + writebyte(fd, package_length >> 4); // hi byte + } + else + { + writebyte(fd, package_length); // length + } + uint8_t cstates_count = 1 + c2_enabled + c3_enabled; + writebyte(fd, cstates_count + 1); + writebyte(fd, 0x0A); // first entry - number of c-states + writebyte(fd, cstates_count); + + // C1 + write(fd, chunk_c1, sizeof(chunk_c1)); + + // C2 + if (c2_enabled) + write(fd, chunk_c2, sizeof(chunk_c2)); + + // C3 + if (c3_enabled) + write(fd, chunk_c3, sizeof(chunk_c3)); + + // Write aliases + int i; + for (i = 0; i < acpi_cpu_count; i++) { + int j; + for (j = 0; j < 4; j++) + chunk_alias[8+j] = acpi_cpu_name[i][j]; + write(fd, chunk_alias, sizeof(chunk_alias)); + } + + close(fd); + + ssdt->Length = ssdt_size; + ssdt->Checksum = 0; + ssdt->Checksum = 256 - checksum8(ssdt, ssdt->Length); + + //dumpPhysAddr("C-States SSDT content: ", ssdt, ssdt_size); + + verbose ("SSDT with CPU C-States generated successfully\n"); + + return ssdt; + } + else { + verbose ("DSDT CPUs not found: C-States not generated !!!\n"); + } + + return NULL; +} + +struct acpi_2_ssdt *generate_pss_ssdt(struct acpi_2_dsdt* dsdt) +{ + char ssdt_header[] = + { + 0x53, 0x53, 0x44, 0x54, 0x7E, 0x00, 0x00, 0x00, /* SSDT.... */ + 0x01, 0x6A, 0x50, 0x6D, 0x52, 0x65, 0x66, 0x00, /* ..PmRef. */ + 0x43, 0x70, 0x75, 0x50, 0x6D, 0x00, 0x00, 0x00, /* CpuPm... */ + 0x00, 0x30, 0x00, 0x00, 0x49, 0x4E, 0x54, 0x4C, /* .0..INTL */ + 0x31, 0x03, 0x10, 0x20, /* 1.._ */ + }; + + char chunk_name_body[] = + { + 0x5C, 0x5F, 0x50, 0x52, 0x5F, 0x08, 0x50, 0x53, /* \_PR_.PS */ + 0x53, 0x5F /* S_ */ + }; + + char chunk_alias[] = + { + 0x10, 0x14, 0x5C, 0x2E, 0x5F, 0x50, 0x52, 0x5F, /* ..\._PR_ */ + 0x43, 0x50, 0x55, 0x30, 0x06, 0x50, 0x53, 0x53, /* CPU0.PSS */ + 0x5F, 0x5F, 0x50, 0x53, 0x53 /* __PSS */ + }; + + if (Platform.CPU.Vendor != 0x756E6547) { + verbose ("Not an Intel platform: P-States will not be generated !!!\n"); + return NULL; + } + + if (!(Platform.CPU.Features & CPU_FEATURE_MSR)) { + verbose ("Unsupported CPU: P-States will not be generated !!!\n"); + return NULL; + } + + if (acpi_cpu_count == 0) + find_acpi_cpu_names((void*)dsdt, dsdt->Length); + + if (acpi_cpu_count > 0) + { + bool cpu_dynamic_fsb = false, cpu_noninteger_bus_ratio = (rdmsr64(MSR_IA32_PERF_STATUS) & (1ULL << 46)); + struct p_state initial, maximum, minimum, p_states[32]; + uint8_t p_states_count; + + // Retrieving P-States, ported from code by superhai (c) + + + + switch (Platform.CPU.Family) { + case 0x06: + { + switch (Platform.CPU.Model) + { + case 0x0F: // Intel Core (65nm) + case 0x17: // Intel Core (45nm) + case 0x1C: // Intel Atom (45nm) + case 0x1A: // Intel Core i7 LGA1366 (45nm) + case 0x1E: // Intel Core i5, i7 LGA1156 (45nm) + case 0x25: // Intel Core i3, i5, i7 LGA1156 (32nm) + case 0x2C: // Intel Core i7 LGA1366 (32nm) 6 Core + if (rdmsr64(MSR_IA32_EXT_CONFIG) & (1 << 27)) + { + wrmsr64(MSR_IA32_EXT_CONFIG, (rdmsr64(MSR_IA32_EXT_CONFIG) | (1 << 28))); + delay(1); + cpu_dynamic_fsb = rdmsr64(MSR_IA32_EXT_CONFIG) & (1 << 28); + } + break; + } + } + } + + initial.Control = rdmsr64(MSR_IA32_PERF_STATUS); + + maximum.Control = ((rdmsr64(MSR_IA32_PERF_STATUS) >> 32) & 0x1F3F) | (0x4000 * cpu_noninteger_bus_ratio); + maximum.CID = ((maximum.FID & 0x1F) << 1) | cpu_noninteger_bus_ratio; + + minimum.FID = ((rdmsr64(MSR_IA32_PERF_STATUS) >> 24) & 0x1F) | (0x80 * cpu_dynamic_fsb); + minimum.VID = ((rdmsr64(MSR_IA32_PERF_STATUS) >> 48) & 0x3F); + + if (minimum.FID == 0) + { + uint8_t i; + // Probe for lowest fid + for (i = maximum.FID; i >= 0x6; i--) + { + wrmsr64(MSR_IA32_PERF_CONTROL, (rdmsr64(MSR_IA32_PERF_CONTROL) & 0xFFFFFFFFFFFF0000ULL) | (i << 8) | minimum.VID); + intel_waitforsts(); + minimum.FID = (rdmsr64(MSR_IA32_PERF_STATUS) >> 8) & 0x1F; + delay(1); + } + + wrmsr64(MSR_IA32_PERF_CONTROL, (rdmsr64(MSR_IA32_PERF_CONTROL) & 0xFFFFFFFFFFFF0000ULL) | (maximum.FID << 8) | maximum.VID); + intel_waitforsts(); + } + + if (minimum.VID == maximum.VID) + { + uint8_t i; + // Probe for lowest vid + for (i = maximum.VID; i > 0xA; i--) + { + wrmsr64(MSR_IA32_PERF_CONTROL, (rdmsr64(MSR_IA32_PERF_CONTROL) & 0xFFFFFFFFFFFF0000ULL) | (minimum.FID << 8) | i); + intel_waitforsts(); + minimum.VID = rdmsr64(MSR_IA32_PERF_STATUS) & 0x3F; + delay(1); + } + + wrmsr64(MSR_IA32_PERF_CONTROL, (rdmsr64(MSR_IA32_PERF_CONTROL) & 0xFFFFFFFFFFFF0000ULL) | (maximum.FID << 8) | maximum.VID); + intel_waitforsts(); + } + + minimum.CID = ((minimum.FID & 0x1F) << 1) >> cpu_dynamic_fsb; + + // Sanity check + if (maximum.CID < minimum.CID) + { + DBG("Insane FID values!"); + p_states_count = 1; + } + else + { + // Finalize P-States + // Find how many P-States machine supports + p_states_count = maximum.CID - minimum.CID + 1; + + if (p_states_count > 32) + p_states_count = 32; + + uint8_t vidstep; + uint8_t i = 0, u, invalid = 0; + + vidstep = ((maximum.VID << 2) - (minimum.VID << 2)) / (p_states_count - 1); + + for (u = 0; u < p_states_count; u++) + { + i = u - invalid; + + p_states[i].CID = maximum.CID - u; + p_states[i].FID = (p_states[i].CID >> 1); + + if (p_states[i].FID < 0x6) + { + if (cpu_dynamic_fsb) + p_states[i].FID = (p_states[i].FID << 1) | 0x80; + } + else if (cpu_noninteger_bus_ratio) + { + p_states[i].FID = p_states[i].FID | (0x40 * (p_states[i].CID & 0x1)); + } + + if (i && p_states[i].FID == p_states[i-1].FID) + invalid++; + + p_states[i].VID = ((maximum.VID << 2) - (vidstep * u)) >> 2; + + uint32_t multiplier = p_states[i].FID & 0x1f; // = 0x08 + bool half = p_states[i].FID & 0x40; // = 0x01 + bool dfsb = p_states[i].FID & 0x80; // = 0x00 + uint32_t fsb = Platform.CPU.FSBFrequency / 1000000; // = 400 + uint32_t halffsb = (fsb + 1) >> 1; // = 200 + uint32_t frequency = (multiplier * fsb); // = 3200 + + p_states[i].Frequency = (frequency + (half * halffsb)) >> dfsb; // = 3200 + 200 = 3400 + } + + p_states_count -= invalid; + } + + // Generating SSDT + + if (p_states_count > 0) + { + uint32_t i, pss_entries_size = 33 * p_states_count, pss_package_length = pss_entries_size + 2; + + if (pss_package_length > 0x3f) pss_package_length++; // for chunks > 0x3f bytes length have 2 bytes encoding + + uint32_t pss_name_length = (1 /* id=0x12 */ + pss_package_length) + (1 + 10); + + if (pss_name_length > 0x3f) pss_name_length++; + + uint32_t ssdt_size = 36 + (1 /* id=0x10 */ + pss_name_length) + acpi_cpu_count * sizeof(chunk_alias); + + struct acpi_2_ssdt *ssdt = (void*)AllocateKernelMemory(ssdt_size); + int fd = openmem((char*)ssdt, ssdt_size); + + // write header + write(fd, ssdt_header, sizeof(ssdt_header)); + + // write Scope (\_PR) { Name (PSS, ... + writebyte(fd, 0x10); // id + if (pss_name_length > 0x3f) + { + writebyte(fd, 0x40 | (pss_name_length & 0xf)); // lo half-byte + writebyte(fd, pss_name_length >> 4); // hi byte + } + else + { + writebyte(fd, pss_name_length); // length + } + write(fd, chunk_name_body, sizeof(chunk_name_body)); + + // write Package(p_states_count) { ... + writebyte(fd, 0x12); // id + if (pss_package_length > 0x3f) + { + writebyte(fd, 0x40 | (pss_package_length & 0xf)); // lo half-byte + writebyte(fd, pss_package_length >> 4); // hi byte + } + else + { + writebyte(fd, pss_package_length); // length + } + writebyte(fd, p_states_count); // entries + + for (i = 0; i < p_states_count; i++) + { + DBG("P-State: Frequency %d MHz, FID 0x%x, VID 0x%x\n", p_states[i].Frequency, p_states[i].FID, p_states[i].VID); + + writebyte(fd, 0x12); // chunk id + writebyte(fd, 32); // chunk length without id + writebyte(fd, 6); // entries + + writebyte(fd, 0x0C); /* id */ writeint(fd, p_states[i].Frequency); // value + writebyte(fd, 0x0C); /* id */ writeint(fd, 0x00000000); // value + writebyte(fd, 0x0C); /* id */ writeint(fd, 0x0000000A); // value + writebyte(fd, 0x0C); /* id */ writeint(fd, 0x0000000A); // value + writebyte(fd, 0x0C); /* id */ writeint(fd, p_states[i].Control); // value + writebyte(fd, 0x0C); /* id */ writeint(fd, i + 1); // value + } + + // Write aliases + for (i = 0; i < acpi_cpu_count; i++) { + int j; + for (j = 0; j < 4; j++) + chunk_alias[8+j] = acpi_cpu_name[i][j]; + write(fd, chunk_alias, sizeof(chunk_alias)); + } + + ssdt->Length = ssdt_size; + ssdt->Checksum = 0; + ssdt->Checksum = 256 - checksum8(ssdt, ssdt->Length); + + //dumpPhysAddr("P-States SSDT content: ", ssdt, ssdt_size); + verbose ("SSDT with CPU P-States generated successfully\n"); + + return ssdt; + } + } + else { + verbose ("DSDT CPUs not found: P-States not generated !!!\n"); + } + + return NULL; +} + +struct acpi_2_fadt *patch_fadt(struct acpi_2_fadt *fadt, struct acpi_2_dsdt *new_dsdt) +{ + extern void setupSystemType(); + + struct acpi_2_fadt *fadt_mod; + bool fadt_rev2_needed = false; + bool fix_restart; + const char * value; + + // Restart Fix + if (Platform.CPU.Vendor == 0x756E6547) { /* Intel */ + fix_restart = true; + getBoolForKey(kRestartFix, &fix_restart, &bootInfo->bootConfig); + } else { + verbose ("Not an Intel platform: Restart Fix not applied !!!\n"); + fix_restart = false; + } + + if (fix_restart) fadt_rev2_needed = true; + + // Allocate new fadt table + if (fadt->Length < 0x84 && fadt_rev2_needed) + { + fadt_mod=(struct acpi_2_fadt *)AllocateKernelMemory(0x84); + memcpy(fadt_mod, fadt, fadt->Length); + fadt_mod->Length = 0x84; + fadt_mod->Revision = 0x02; // FADT rev 2 (ACPI 1.0B MS extensions) + } + else + { + fadt_mod=(struct acpi_2_fadt *)AllocateKernelMemory(fadt->Length); + memcpy(fadt_mod, fadt, fadt->Length); + } + // Determine system type / PM_Model + if ( (value=getStringForKey(kSystemType, &bootInfo->bootConfig))!=NULL) + { + if (Platform.Type > 6) + { + if(fadt_mod->PM_Profile<=6) + Platform.Type = fadt_mod->PM_Profile; // get the fadt if correct + else + Platform.Type = 1; /* Set a fixed value (Desktop) */ + verbose("Error: system-type must be 0..6. Defaulting to %d !\n", Platform.Type); + } + else + Platform.Type = (unsigned char) strtoul(value, NULL, 10); + } + // Set PM_Profile from System-type if only if user wanted this value to be forced + if (fadt_mod->PM_Profile != Platform.Type) + { + if (value) + { // user has overriden the SystemType so take care of it in FACP + verbose("FADT: changing PM_Profile from 0x%02x to 0x%02x\n", fadt_mod->PM_Profile, Platform.Type); + fadt_mod->PM_Profile = Platform.Type; + } + else + { // PM_Profile has a different value and no override has been set, so reflect the user value to ioregs + Platform.Type = fadt_mod->PM_Profile <= 6 ? fadt_mod->PM_Profile : 1; + } + } + // We now have to write the systemm-type in ioregs: we cannot do it before in setupDeviceTree() + // because we need to take care of facp original content, if it is correct. + setupSystemType(); + + // Patch FADT to fix restart + if (fix_restart) + { + fadt_mod->Flags|= 0x400; + fadt_mod->Reset_SpaceID = 0x01; // System I/O + fadt_mod->Reset_BitWidth = 0x08; // 1 byte + fadt_mod->Reset_BitOffset = 0x00; // Offset 0 + fadt_mod->Reset_AccessWidth = 0x01; // Byte access + fadt_mod->Reset_Address = 0x0cf9; // Address of the register + fadt_mod->Reset_Value = 0x06; // Value to write to reset the system + verbose("FADT: Restart Fix applied!\n"); + } + + // Patch DSDT Address if we have loaded DSDT.aml + if(new_dsdt) + { + DBG("DSDT: Old @%x,%x, ",fadt_mod->DSDT,fadt_mod->X_DSDT); + + fadt_mod->DSDT=(uint32_t)new_dsdt; + if ((uint32_t)(&(fadt_mod->X_DSDT))-(uint32_t)fadt_mod+8<=fadt_mod->Length) + fadt_mod->X_DSDT=(uint32_t)new_dsdt; + + DBG("New @%x,%x\n",fadt_mod->DSDT,fadt_mod->X_DSDT); + + verbose("FADT: Using custom DSDT!\n"); + } + + // Correct the checksum + fadt_mod->Checksum=0; + fadt_mod->Checksum=256-checksum8(fadt_mod,fadt_mod->Length); + + return fadt_mod; +} + +/* Setup ACPI without replacing DSDT. */ +int setupAcpiNoMod() +{ + // addConfigurationTable(&gEfiAcpiTableGuid, getAddressOfAcpiTable(), "ACPI"); + // addConfigurationTable(&gEfiAcpi20TableGuid, getAddressOfAcpi20Table(), "ACPI_20"); + /* XXX aserebln why uint32 cast if pointer is uint64 ? */ + acpi10_p = (uint32_t)getAddressOfAcpiTable(); + acpi20_p = (uint32_t)getAddressOfAcpi20Table(); + addConfigurationTable(&gEfiAcpiTableGuid, &acpi10_p, "ACPI"); + if(acpi20_p) addConfigurationTable(&gEfiAcpi20TableGuid, &acpi20_p, "ACPI_20"); + return 1; +} + +/* Setup ACPI. Replace DSDT if DSDT.aml is found */ +int setupAcpi(void) +{ + int version; + void *new_dsdt; + + // Load replacement DSDT + new_dsdt=loadACPITable("DSDT.aml"); + // Mozodojo: going to patch FACP and load SSDT's even if DSDT.aml is not present + /*if (!new_dsdt) + { + return setupAcpiNoMod(); + }*/ + + // Mozodojo: Load additional SSDTs + struct acpi_2_ssdt *new_ssdt[32]; // 30 + 2 additional tables for pss & cst + struct acpi_2_fadt *fadt; // will be used in CST generator + int ssdt_count=0; + bool drop_ssdt=false, generate_pstates=false, generate_cstates=false; + + getBoolForKey(kDropSSDT, &drop_ssdt, &bootInfo->bootConfig); + getBoolForKey(kGeneratePStates, &generate_pstates, &bootInfo->bootConfig); + getBoolForKey(kGenerateCStates, &generate_cstates, &bootInfo->bootConfig); + + { + int i; + + for (i=0; i<30; i++) + { + char *filename[512]; + + sprintf(filename, i>0?"SSDT-%d.aml":"SSDT.aml", i); + + if(new_ssdt[ssdt_count] = loadACPITable(filename)) + { + ssdt_count++; + } + else + { + break; + } + } + } + + // Do the same procedure for both versions of ACPI + for (version=0; version<2; version++) { + struct acpi_2_rsdp *rsdp, *rsdp_mod; + struct acpi_2_rsdt *rsdt, *rsdt_mod; + int rsdplength; + + // Find original rsdp + rsdp=(struct acpi_2_rsdp *)(version?getAddressOfAcpi20Table():getAddressOfAcpiTable()); + if (!rsdp) + { + DBG("No ACPI version %d found. Ignoring\n", version+1); + if (version) + addConfigurationTable(&gEfiAcpi20TableGuid, NULL, "ACPI_20"); + else + addConfigurationTable(&gEfiAcpiTableGuid, NULL, "ACPI"); + continue; + } + rsdplength=version?rsdp->Length:20; + + DBG("RSDP version %d found @%x. Length=%d\n",version+1,rsdp,rsdplength); + + /* FIXME: no check that memory allocation succeeded + * Copy and patch RSDP,RSDT, XSDT and FADT + * For more info see ACPI Specification pages 110 and following + */ + + rsdp_mod=(struct acpi_2_rsdp *) AllocateKernelMemory(rsdplength); + memcpy(rsdp_mod, rsdp, rsdplength); + rsdt=(struct acpi_2_rsdt *)(rsdp->RsdtAddress); + + DBG("RSDT @%x, Length %d\n",rsdt, rsdt->Length); + + if (rsdt && (uint32_t)rsdt !=0xffffffff && rsdt->Length<0x10000) + { + uint32_t *rsdt_entries; + int rsdt_entries_num; + int dropoffset=0, i; + + rsdt_mod=(struct acpi_2_rsdt *)AllocateKernelMemory(rsdt->Length); + memcpy (rsdt_mod, rsdt, rsdt->Length); + rsdp_mod->RsdtAddress=(uint32_t)rsdt_mod; + rsdt_entries_num=(rsdt_mod->Length-sizeof(struct acpi_2_rsdt))/4; + rsdt_entries=(uint32_t *)(rsdt_mod+1); + for (i=0;iLength); + + if (!fadt || (uint32_t)fadt == 0xffffffff || fadt->Length>0x10000) + { + printf("FADT incorrect. Not modified\n"); + continue; + } + + fadt_mod = patch_fadt(fadt, new_dsdt); + rsdt_entries[i-dropoffset]=(uint32_t)fadt_mod; + + // Generate _CST SSDT + if (generate_cstates && (new_ssdt[ssdt_count] = generate_cst_ssdt(fadt_mod))) + ssdt_count++; + + // Generating _PSS SSDT + if (generate_pstates && (new_ssdt[ssdt_count] = generate_pss_ssdt((void*)fadt_mod->DSDT))) + ssdt_count++; + + continue; + } + } + DBG("\n"); + + // Mozodojo: Insert additional SSDTs into RSDT + if(ssdt_count>0) + { + uint32_t j = rsdt_mod->Length; + bool add_new_ssdt = TRUE; + + rsdt_mod->Length+=4*ssdt_count-4*dropoffset; + + if (rsdt_mod->Length > j) + { + struct acpi_2_rsdt *rsdt_copy = (struct acpi_2_rsdt *)AllocateKernelMemory(rsdt_mod->Length); + if (rsdt_copy) + { + memcpy (rsdt_copy, rsdt_mod, rsdt_mod->Length); + free(rsdt_mod); rsdt_mod = rsdt_copy; + rsdp_mod->RsdtAddress=(uint32_t)rsdt_mod; + rsdt_entries_num=(rsdt_mod->Length-sizeof(struct acpi_2_rsdt))/4; + rsdt_entries=(uint32_t *)(rsdt_mod+1); + } + else + { + verbose("RSDT: Couldn't allocate memory for additional SSDT tables!\n"); + add_new_ssdt = FALSE; + } + } + + if (add_new_ssdt) + { + for (j=0; jLength-=4*dropoffset; + } + + // Correct the checksum of RSDT + DBG("RSDT: Original checksum %d, ", rsdt_mod->Checksum); + + rsdt_mod->Checksum=0; + rsdt_mod->Checksum=256-checksum8(rsdt_mod,rsdt_mod->Length); + + DBG("New checksum %d at %x\n", rsdt_mod->Checksum,rsdt_mod); + } + else + { + rsdp_mod->RsdtAddress=0; + printf("RSDT not found or RSDT incorrect\n"); + } + + if (version) + { + struct acpi_2_xsdt *xsdt, *xsdt_mod; + + // FIXME: handle 64-bit address correctly + + xsdt=(struct acpi_2_xsdt*) ((uint32_t)rsdp->XsdtAddress); + DBG("XSDT @%x;%x, Length=%d\n", (uint32_t)(rsdp->XsdtAddress>>32),(uint32_t)rsdp->XsdtAddress, + xsdt->Length); + if (xsdt && (uint64_t)rsdp->XsdtAddress<0xffffffff && xsdt->Length<0x10000) + { + uint64_t *xsdt_entries; + int xsdt_entries_num, i; + int dropoffset=0; + + xsdt_mod=(struct acpi_2_xsdt*)AllocateKernelMemory(xsdt->Length); + memcpy(xsdt_mod, xsdt, xsdt->Length); + rsdp_mod->XsdtAddress=(uint32_t)xsdt_mod; + xsdt_entries_num=(xsdt_mod->Length-sizeof(struct acpi_2_xsdt))/8; + xsdt_entries=(uint64_t *)(xsdt_mod+1); + for (i=0;i>32),fadt, + fadt->Length); + + if (!fadt || (uint64_t)xsdt_entries[i] >= 0xffffffff || fadt->Length>0x10000) + { + verbose("FADT incorrect or after 4GB. Dropping XSDT\n"); + goto drop_xsdt; + } + + fadt_mod = patch_fadt(fadt, new_dsdt); + xsdt_entries[i-dropoffset]=(uint32_t)fadt_mod; + + DBG("TABLE %c%c%c%c@%x,",table[0],table[1],table[2],table[3],xsdt_entries[i]); + + // Generate _CST SSDT + if (generate_cstates && (new_ssdt[ssdt_count] = generate_cst_ssdt(fadt_mod))) + ssdt_count++; + + // Generating _PSS SSDT + if (generate_pstates && (new_ssdt[ssdt_count] = generate_pss_ssdt((void*)fadt_mod->DSDT))) + ssdt_count++; + + continue; + } + + DBG("TABLE %c%c%c%c@%x,",table[0],table[1],table[2],table[3],xsdt_entries[i]); + + } + + // Mozodojo: Insert additional SSDTs into XSDT + if(ssdt_count>0) + { + int j = xsdt_mod->Length; + bool add_new_ssdt = TRUE; + + xsdt_mod->Length+=8*ssdt_count-8*dropoffset; + + if (xsdt_mod->Length > j) + { + struct acpi_2_xsdt *xsdt_copy = (struct acpi_2_xsdt *)AllocateKernelMemory(xsdt_mod->Length); + + if (xsdt_copy) + { + memcpy(xsdt_copy, xsdt_mod, xsdt_mod->Length); + free(xsdt_mod); xsdt_mod = xsdt_copy; + rsdp_mod->XsdtAddress=(uint32_t)xsdt_mod; + xsdt_entries_num=(xsdt_mod->Length-sizeof(struct acpi_2_xsdt))/8; + xsdt_entries=(uint64_t *)(xsdt_mod+1); + } + else + { + verbose("RSDT: Couldn't allocate memory for additional SSDT tables!\n"); + add_new_ssdt = FALSE; + } + } + + if (add_new_ssdt) + { + for (j=0; jLength-=8*dropoffset; + } + + // Correct the checksum of XSDT + xsdt_mod->Checksum=0; + xsdt_mod->Checksum=256-checksum8(xsdt_mod,xsdt_mod->Length); + } + else + { + drop_xsdt: + + DBG("About to drop XSDT\n"); + + /*FIXME: Now we just hope that if MacOS doesn't find XSDT it reverts to RSDT. + * A Better strategy would be to generate + */ + + rsdp_mod->XsdtAddress=0xffffffffffffffffLL; + verbose("XSDT not found or XSDT incorrect\n"); + } + } + + // Correct the checksum of RSDP + + DBG("RSDP: Original checksum %d, ", rsdp_mod->Checksum); + + rsdp_mod->Checksum=0; + rsdp_mod->Checksum=256-checksum8(rsdp_mod,20); + + DBG("New checksum %d\n", rsdp_mod->Checksum); + + if (version) + { + DBG("RSDP: Original extended checksum %d", rsdp_mod->ExtendedChecksum); + + rsdp_mod->ExtendedChecksum=0; + rsdp_mod->ExtendedChecksum=256-checksum8(rsdp_mod,rsdp_mod->Length); + + DBG("New extended checksum %d\n", rsdp_mod->ExtendedChecksum); + + } + + //verbose("Patched ACPI version %d DSDT\n", version+1); + if (version) + { + /* XXX aserebln why uint32 cast if pointer is uint64 ? */ + acpi20_p = (uint32_t)rsdp_mod; + addConfigurationTable(&gEfiAcpi20TableGuid, &acpi20_p, "ACPI_20"); + } + else + { + /* XXX aserebln why uint32 cast if pointer is uint64 ? */ + acpi10_p = (uint32_t)rsdp_mod; + addConfigurationTable(&gEfiAcpiTableGuid, &acpi10_p, "ACPI"); + } + } +#if DEBUG_ACPI + printf("Press a key to continue... (DEBUG_ACPI)\n"); + getc(); +#endif + return 1; +} Index: trunk/i386/libsaio/spd.c =================================================================== --- trunk/i386/libsaio/spd.c (revision 191) +++ trunk/i386/libsaio/spd.c (revision 192) @@ -177,34 +177,35 @@ if (!ret) sprintf(asciiSerial, "10000000%d", serialnum++); else sprintf(asciiSerial, "%d", ret); - return asciiSerial; + return strdup(asciiSerial); } /** Get DDR3 or DDR2 Part Number, always return a valid ptr */ const char * getDDRPartNum(const char* spd) { + static char asciiPartNo[32]; const char * sPart = NULL; - int i; - bool bZero = false; + int i, index = 0; - if (spd[SPD_MEMORY_TYPE]==SPD_MEMORY_TYPE_SDRAM_DDR3) - sPart = &spd[128]; - else if (spd[SPD_MEMORY_TYPE]==SPD_MEMORY_TYPE_SDRAM_DDR2) - sPart = &spd[73]; + if (spd[SPD_MEMORY_TYPE]==SPD_MEMORY_TYPE_SDRAM_DDR3) { + sPart = &spd[128]; + } + else if (spd[SPD_MEMORY_TYPE]==SPD_MEMORY_TYPE_SDRAM_DDR2) { + sPart = &spd[73]; + } + if (sPart) { // Check that the spd part name is zero terminated and that it is ascii: + bzero(asciiPartNo, 32); for (i=0; i<32; i++) { - if (sPart[i]==0) { - bZero = true; - break; - } - else if ( !isascii(sPart[i]) ) { - sPart = NULL; - break; - } - } + if (isalpha(sPart[i]) || isdigit(sPart[i])) // It seems that System Profiler likes only letters and digits... + asciiPartNo[index++] = sPart[i]; + else if (!isascii(sPart[i])) + break; + } + + return strdup(asciiPartNo); } - return ( sPart==NULL || !(*sPart) || !bZero ) ? - "N/A" : sPart; + return "N/A"; } int mapping []= {0,2,1,3,4,6,5,7,8,10,9,11}; @@ -260,9 +261,9 @@ spd_type = (slot->spd[SPD_MEMORY_TYPE] < ((char) 12) ? slot->spd[SPD_MEMORY_TYPE] : 0); slot->Type = spd_mem_to_smbios[spd_type]; - slot->PartNo = strdup(getDDRPartNum(slot->spd) ); - slot->Vendor = strdup(getVendorName(slot) ); - slot->SerialNo = strdup(getDDRSerial(slot->spd)); + slot->PartNo = getDDRPartNum(slot->spd); + slot->Vendor = getVendorName(slot); + slot->SerialNo = getDDRSerial(slot->spd); // determine spd speed speed = getDDRspeedMhz(slot->spd); Index: trunk/i386/libsaio/acpi_patcher.h =================================================================== --- trunk/i386/libsaio/acpi_patcher.h (revision 0) +++ trunk/i386/libsaio/acpi_patcher.h (revision 192) @@ -0,0 +1,37 @@ +/* + * Copyright 2008 mackerintel + */ + +#ifndef __LIBSAIO_ACPI_PATCHER_H +#define __LIBSAIO_ACPI_PATCHER_H + +#include "libsaio.h" + +uint64_t acpi10_p; +uint64_t acpi20_p; +uint64_t smbios_p; + +extern int setupAcpi(); + +extern EFI_STATUS addConfigurationTable(); + +extern EFI_GUID gEfiAcpiTableGuid; +extern EFI_GUID gEfiAcpi20TableGuid; + +struct p_state +{ + union + { + uint16_t Control; + struct + { + uint8_t VID; // Voltage ID + uint8_t FID; // Frequency ID + }; + }; + + uint8_t CID; // Compare ID + uint32_t Frequency; +}; + +#endif /* !__LIBSAIO_ACPI_PATCHER_H */ Index: trunk/i386/libsaio/Makefile =================================================================== --- trunk/i386/libsaio/Makefile (revision 191) +++ trunk/i386/libsaio/Makefile (revision 192) @@ -39,11 +39,11 @@ ufs.o ufs_byteorder.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 dsdt_patcher.o \ + cpu.o platform.o acpi_patcher.o \ smbios_patcher.o fake_efi.o ext2fs.o \ hpet.o spd.o usb.o pci_setup.o \ device_inject.o nvidia.o ati.o pci_root.o \ - convert.o mem.o + convert.o mem.o aml_generator.o SAIO_EXTERN_OBJS = console.o Index: trunk/i386/libsaio/smbios_patcher.c =================================================================== --- trunk/i386/libsaio/smbios_patcher.c (revision 191) +++ trunk/i386/libsaio/smbios_patcher.c (revision 192) @@ -144,14 +144,85 @@ static int sm_get_cputype (const char *name, int table_num) { - if (Platform.CPU.NoCores == 1) { - return 0x0101; // <01 01> Intel Core Solo? - } else if (Platform.CPU.NoCores == 2) { - return 0x0301; // <01 03> Intel Core 2 Duo - } else if (Platform.CPU.NoCores >= 4) { - return 0x0501; // <01 05> Quad-Core Intel Xeon + if (Platform.CPU.Vendor == 0x756E6547) { + int cores = Platform.CPU.NoCores; + int intelPM = Platform.CPU.Model; //+ (Platform.CPU.ExtModel<< 4);//verify this + + switch (intelPM) { + case 13: // Pentium M model D + return 0x0101; + break; + case 14: // Core Solo/Duo, "Yonah", 65nm + return 0x0201; + break; + case 15: // Pentium 4, Core 2, Xeon, "Merom", "Conroe", 65nm + switch (cores) { + case 1: // Core Solo + return 0x0201; + break; + case 2: // Core 2, 65nm + return 0x0301; + break; + case 4: // Quad Core, Xeon + return 0x0501; + break; + default: + return 0x0301; + break; + } + /* if (cores == 1) + return 0x0201; // Core Solo + else if (cores == 2) + return 0x0301; // Core 2, 65nm + else if (cores == 4) + return 0x0501; // Quad-Core Xeon + else + return 0x0301;*/ + break; + case 21: // EP80579 integrated processor + return 0x0301; // ??? + break; + case 22: // Core 2 Solo, "Merom-L", "Conroe-L", 45nm + return 0x0201; // ??? + break; + case 23: // Core 2 Extreme, Xeon, "Penryn", "Wolfdale", 45nm + return 0x0301; + break; + case 26: // Nehalem, Xeon 5500, "Bloomfield", 45nm + return 0x0701; + break; + case 29: // Six-Core Xeon 7400, "Dunnington", 45nm + return 0x0401; + break; + case 30: // Nehalem, Xeon, "Lynnfield", "Clarksfield", "Jasper", 45nm + return 0x0701; + break; + case 31: // Core i5, Xeon MP, "Havendale", "Auburndale", 45nm + return 0x0601; + break; + case 37: // Nehalem, "Clarkdale", 32nm + return 0x0301; // ??? + break; + case 44: // Nehalem, "Gulftown", 32nm + return 0x0601; + break; + case 46: // "Nehalem-ex", "Beckton", 45nm + return 0x0301; // ??? + break; + default: + goto core_ident; + } } else { - return 0x0301; // Default to Core 2 Duo + core_ident: + if (Platform.CPU.NoCores == 1) { + return 0x0201; // Core Solo + } else if (Platform.CPU.NoCores == 2) { + return 0x0301; // Core 2 Duo + } else if (Platform.CPU.NoCores >= 4) { + return 0x0501; // Quad-Core Xeon + } else { + return 0x0301; // Core 2 Duo + } } } @@ -166,6 +237,7 @@ return Platform.RAM.DIMM[map].Type; } } + return SMB_MEM_TYPE_DDR2; } @@ -777,7 +849,7 @@ DmiTablePairCount++; } else { - printf("DMI table entries list is full! Next entries won't be stored\n"); + printf("DMI table entries list is full! Next entries won't be stored.\n"); } #if DEBUG_SMBIOS printf("DMI header found for table type %d, length = %d\n", dmihdr->type, dmihdr->length); Index: trunk/i386/libsaio/aml_generator.c =================================================================== --- trunk/i386/libsaio/aml_generator.c (revision 0) +++ trunk/i386/libsaio/aml_generator.c (revision 192) @@ -0,0 +1,287 @@ +/* + * aml_generator.c + * Chameleon + * + * Created by Mozodojo on 20/07/10. + * Copyright 2010 mozo. All rights reserved. + * + */ + +#include "aml_generator.h" + +unsigned char aml_get_length_size(long length) +{ + if (length > 0x3F) + return 2; + else if (length > 0x3FFF) + return 3; + + return 1; +} + +void aml_add_to_parent(struct aml_chunk* parent, struct aml_chunk* node) +{ + if (parent && node) + { + if (!parent->First) + parent->First = node; + + if (parent->Last) + parent->Last->Next = node; + + parent->Last = node; + } +} + +struct aml_chunk* aml_create_node(struct aml_chunk* parent) +{ + struct aml_chunk* node = (void*)malloc(sizeof(struct aml_chunk)); + + aml_add_to_parent(parent, node); + + return node; +} + +int aml_add_buffer(struct aml_chunk* parent, const char* buffer, unsigned int size) +{ + struct aml_chunk* node = aml_create_node(parent); + + if (node) + { + node->Type = AML_CHUNK_NONE; + node->Length = size; + node->Buffer = malloc(node->Length); + memcpy(node->Buffer, buffer, size); + + return node->Length; + } + + return -1; +} + +int aml_add_byte(struct aml_chunk* parent, unsigned char value) +{ + struct aml_chunk* node = aml_create_node(parent); + + if (node) + { + node->Type = AML_CHUNK_BYTE; + node->Length = 1; + node->Buffer = malloc(node->Length); + + if (value == 0) + node->Buffer[0] = 0x00; + else if (value == 1) + node->Buffer[0] = 0x01; + else + node->Buffer[0] = value; + + return node->Length; + } + + return -1; +} + +int aml_add_word(struct aml_chunk* parent, unsigned int value) +{ + struct aml_chunk* node = aml_create_node(parent); + + if (node) + { + node->Type = AML_CHUNK_WORD; + node->Length = 2; + node->Buffer = malloc(node->Length); + node->Buffer[0] = value & 0xff; + node->Buffer[1] = value >> 8; + + return node->Length; + } + + return -1; +} + +int aml_add_dword(struct aml_chunk* parent, unsigned long value) +{ + struct aml_chunk* node = aml_create_node(parent); + + if (node) + { + node->Type = AML_CHUNK_DWORD; + node->Length = 4; + node->Buffer = malloc(node->Length); + node->Buffer[0] = value & 0xff; + node->Buffer[1] = (value >> 8) & 0xff; + node->Buffer[2] = (value >> 16) & 0xff; + node->Buffer[3] = (value >> 24) & 0xff; + + return node->Length; + } + + return -1; +} + +int aml_add_qword(struct aml_chunk* parent, unsigned long long value) +{ + struct aml_chunk* node = aml_create_node(parent); + + if (node) + { + node->Type = AML_CHUNK_QWORD; + node->Length = 8; + node->Buffer = malloc(node->Length); + node->Buffer[0] = value & 0xff; + node->Buffer[1] = (value >> 8) & 0xff; + node->Buffer[2] = (value >> 16) & 0xff; + node->Buffer[3] = (value >> 24) & 0xff; + node->Buffer[4] = (value >> 32) & 0xff; + node->Buffer[5] = (value >> 40) & 0xff; + node->Buffer[6] = (value >> 48) & 0xff; + node->Buffer[7] = (value >> 56) & 0xff; + + return node->Length; + } + + return -1; +} + +int aml_fill_simple_name(char* buffer, const char* name) +{ + int i, len = strlen(name), count = 0; + + for (i = 0; i < 4; i++) + { + if (i < len && aml_isvalidchar(name[i])) + { + buffer[count++] = name[i]; + } + else + { + buffer[3-i] = '_'; + } + } + + return 4; +} + +int aml_get_names_count(const char* name) +{ + int i, len = strlen(name), count = 0; + + for (i = 0; i < len; i++) + { + if (name[i] == '.') + { + count++; + } + else if (!aml_isvalidchar(name[i])) + { + len = i; + break; + } + } + + if (count == 0 && len > 0) + count++; + + return count; +} + +int aml_fill_name(struct aml_chunk* node, const char* name) +{ + int i, len = strlen(name), count = 0; + + for (i = 0; i < len; i++) + { + if (name[i] == '.') + { + count++; + } + else if (!aml_isvalidchar(name[i])) + { + len = i; + break; + } + } + + if (count == 0 && len > 0) + count++; + + int offset = 0; + + if (count == 1) + { + node->Length = 4; + node->Buffer = malloc(node->Length); + aml_fill_simple_string(node->Buffer, name); + return node->Length; + } + + if (count == 2) + { + node->Length = 2 + 8; + node->Buffer = malloc(node->Length); + node->Buffer[offset++] = '\\'; // Root + node->Buffer[offset++] = 0x2e; // Double name + } + else + { + node->Length = 3 + count*4; + node->Buffer[offset++] = '\\'; // Root + node->Buffer[offset++] = 0x2f; // Multi name + node->Buffer[offset++] = count; // Names count + } + + int j = 0; + + for (i = 0; i < count; i++) + { + while (name[j] != '.') + { + if (j < len) + { + j++; + } + else + { + verbose("aml_fill_name: unexpected end of names path!"); + return; + } + } + + offset += aml_fill_simple_name(node->Buffer + offset, name + j); + } + + return offset; +} + +int aml_add_name(struct aml_chunk* parent, const char* name, int count, ...) +{ + struct aml_chunk* node = aml_create_node(parent); + + if (node) + { + node->Type = AML_CHUNK_NAME; + + aml_fill_name(node, name); + + return node->Length; + } + + return -1; +} + +int aml_add_scope(struct aml_chunk* parent, const char* name) +{ + struct aml_chunk* node = aml_create_node(parent); + + if (node) + { + node->Type = AML_CHUNK_SCOPE; + + aml_fill_name(node, name); + + return node->Length; + } + + return -1; +} \ No newline at end of file Index: trunk/i386/libsaio/aml_generator.h =================================================================== --- trunk/i386/libsaio/aml_generator.h (revision 0) +++ trunk/i386/libsaio/aml_generator.h (revision 192) @@ -0,0 +1,46 @@ +/* + * aml_generator.h + * Chameleon + * + * Created by Mozodojo on 20/07/10. + * Copyright 2010 mozo. All rights reserved. + * + */ + +#ifndef __LIBSAIO_AML_GENERATOR_H +#define __LIBSAIO_AML_GENERATOR_H + +#include "libsaio.h" + +enum aml_chunk_type +{ + AML_CHUNK_NONE = -1, + AML_CHUNK_ZERO = 0x00, + AML_CHUNK_ONE = 0x01, + AML_CHUNK_ALIAS = 0x06, + AML_CHUNK_NAME = 0x08, + AML_CHUNK_BYTE = 0x0A, + AML_CHUNK_WORD = 0x0B, + AML_CHUNK_DWORD = 0x0C, + AML_CHUNK_STRING = 0x0D, + AML_CHUNK_QWORD = 0x0E, + AML_CHUNK_SCOPE = 0x10, + AML_CHUNK_PACKAGE = 0x12, +}; + +struct aml_chunk +{ + enum aml_chunk_type Type; + unsigned long Length; + char* Buffer; + struct aml_chunk* Next; + struct aml_chunk* First; + struct aml_chunk* Last; +}; + +static inline bool aml_isvalidchar(char c) +{ + return isupper(c) || isdigit(c) || c == '_'; +}; + +#endif /* !__LIBSAIO_AML_GENERATOR_H */ \ No newline at end of file Index: trunk/i386/libsaio/nvidia.c =================================================================== --- trunk/i386/libsaio/nvidia.c (revision 191) +++ trunk/i386/libsaio/nvidia.c (revision 192) @@ -337,8 +337,8 @@ { 0x10DE06F9, "Quadro FX 370 LP" }, { 0x10DE06FA, "Quadro NVS 450" }, { 0x10DE06FD, "Quadro NVS 295" }, - { 0x10DE087D, "ION 9400M" }, - { 0x10DE087E, "ION LE" }, + { 0x10DE087D, "ION 9400M" }, + { 0x10DE087E, "ION LE" }, { 0x10DE0A20, "GeForce GT220" }, { 0x10DE0A23, "GeForce 210" }, { 0x10DE0A28, "GeForce GT 230M" }, @@ -353,7 +353,18 @@ { 0x10DE0A78, "Quadro FX 380 LP" }, { 0x10DE0CA3, "GeForce GT 240" }, { 0x10DE0CA8, "GeForce GTS 260M" }, - { 0x10DE0CA9, "GeForce GTS 250M" } + { 0x10DE0CA9, "GeForce GTS 250M" }, + { 0x10DE0CA3, "GeForce GT240" }, + { 0x10DE06C0, "GeForce GTX 480" }, + { 0x10DE06CD, "GeForce GTX 470" }, + { 0x10DE06C4, "GeForce GTX 465" }, + { 0x10DE06CA, "GeForce GTX 480M" }, + { 0x10DE0E22, "GeForce GTX 460" }, + { 0x10DE0E24, "GeForce GTX 460" }, + { 0x10DE06D1, "Tesla C2050" }, // TODO: sub-device id: 0x0771 + { 0x10DE06D1, "Tesla C2070" }, // TODO: sub-device id: 0x0772 + { 0x10DE06DE, "Tesla M2050" }, // TODO: sub-device id: 0x0846 + { 0x10DE06DE, "Tesla M2070" } // TODO: sub-device id: ? }; static uint16_t swap16(uint16_t x) @@ -681,6 +692,22 @@ videoRam = (REG32(0x10020c) & 0xfff00000) >> 10; model = get_nvidia_model((nvda_dev->vendor_id << 16) | nvda_dev->device_id); + // FIXME: dirty fermi hack + if((nvda_dev->device_id & 0xFFE0) == 0x06C0 || + (nvda_dev->device_id & 0xFFE0) == 0x0E20) { + switch (nvda_dev->device_id) { + case 0x06C0: videoRam = 1572864; break; // gtx 480 + case 0x06CD: videoRam = 1310720; break; // gtx 470 + case 0x06C4: videoRam = 1048576; break; // gtx 465 + case 0x06CA: videoRam = 2097152; break; // gtx 480m + case 0x0E22: videoRam = 1048576; break; // gtx 460 + case 0x0E24: videoRam = 1048576; break; // gtx 460 + case 0x06D1: videoRam = 3145728; break; // tesla c2050/c2070 + case 0x06DE: videoRam = 3145728; break; // tesla m2050/m2070 + default: break; + } + } + verbose("nVidia %s %dMB NV%02x [%04x:%04x] :: %s\n", model, (videoRam / 1024), (REG32(0) >> 20) & 0x1ff, nvda_dev->vendor_id, nvda_dev->device_id, Index: trunk/i386/libsaio/sys.c =================================================================== --- trunk/i386/libsaio/sys.c (revision 191) +++ trunk/i386/libsaio/sys.c (revision 192) @@ -402,7 +402,6 @@ return io; } -#if UNUSED //========================================================================== // openmem() @@ -424,7 +423,6 @@ return fdesc; } -#endif //========================================================================== // open() - Open the file specified by 'path' for reading. @@ -601,6 +599,62 @@ } //========================================================================== +// write() - Write up to 'count' bytes of data to the file descriptor +// from the buffer pointed to by buf. + +int write(int fdesc, const char * buf, int count) +{ + struct iob * io; + + if ((io = iob_from_fdesc(fdesc)) == NULL) + return (-1); + + if ((io->i_offset + count) > (unsigned int)io->i_filesize) + count = io->i_filesize - io->i_offset; + + if (count <= 0) + return 0; // end of file + + bcopy(buf, io->i_buf + io->i_offset, count); + + io->i_offset += count; + + return count; +} + +int writebyte(int fdesc, char value) +{ + struct iob * io; + + if ((io = iob_from_fdesc(fdesc)) == NULL) + return (-1); + + if ((io->i_offset + 1) > (unsigned int)io->i_filesize) + return 0; // end of file + + io->i_buf[io->i_offset++] = value; + + return 1; +} + +int writeint(int fdesc, int value) +{ + struct iob * io; + + if ((io = iob_from_fdesc(fdesc)) == NULL) + return (-1); + + if ((io->i_offset + 4) > (unsigned int)io->i_filesize) + return 0; // end of file + + bcopy(&value, io->i_buf + io->i_offset, 4); + + io->i_offset += 4; + + return 4; +} + +//========================================================================== // file_size() - Returns the size of the file described by the file // descriptor. @@ -761,9 +815,9 @@ BVRef selectBootVolume( BVRef chain ) { - bool filteredChain = false; + bool filteredChain = false; bool foundPrimary = false; - BVRef bvr, bvr1 = 0, bvr2 = 0; + BVRef bvr, bvr1 = 0, bvr2 = 0; if (chain->filtered) filteredChain = true; @@ -777,54 +831,54 @@ * to override the default selection. * We accept only kBVFlagSystemVolume or kBVFlagForeignBoot volumes. */ - const char * val; - char testStr[64]; - int cnt; - - if (getValueForKey(kDefaultPartition, &val, &cnt, &bootInfo->bootConfig) && cnt >= 7 && filteredChain) - { - for ( bvr = chain; bvr; bvr = bvr->next ) - { - if ( bvr->biosdev >= 0x80 && bvr->biosdev < 0x100 - && ( bvr->flags & ( kBVFlagSystemVolume|kBVFlagForeignBoot ) ) ) - { - // Trying to match hd(x,y) format. - sprintf(testStr, "hd(%d,%d)", bvr->biosdev - 0x80, bvr->part_no); - if (strcmp(testStr, val) == 0) - return bvr; - - // Trying to match volume UUID. - if (bvr->fs_getuuid && bvr->fs_getuuid(bvr, testStr) == 0 && strcmp(testStr, val) == 0) - return bvr; - } - } - } - + const char * val; + char testStr[64]; + int cnt; + + if (getValueForKey(kDefaultPartition, &val, &cnt, &bootInfo->bootConfig) && cnt >= 7 && filteredChain) + { + for ( bvr = chain; bvr; bvr = bvr->next ) + { + if ( bvr->biosdev >= 0x80 && bvr->biosdev < 0x100 + && ( bvr->flags & ( kBVFlagSystemVolume|kBVFlagForeignBoot ) ) ) + { + // Trying to match hd(x,y) format. + sprintf(testStr, "hd(%d,%d)", bvr->biosdev - 0x80, bvr->part_no); + if (strcmp(testStr, val) == 0) + return bvr; + + // Trying to match volume UUID. + if (bvr->fs_getuuid && bvr->fs_getuuid(bvr, testStr) == 0 && strcmp(testStr, val) == 0) + return bvr; + } + } + } + /* * Scannig the volume chain backwards and trying to find * a HFS+ volume with valid boot record signature. * If not found any active partition then we will * select this volume as the boot volume. */ - for ( bvr = chain; bvr; bvr = bvr->next ) - { - if ( bvr->flags & kBVFlagPrimary && bvr->biosdev == gBIOSDev ) foundPrimary = true; - // zhell -- Undo a regression that was introduced from r491 to 492. - // if gBIOSBootVolume is set already, no change is required - if ( bvr->flags & (kBVFlagBootable|kBVFlagSystemVolume) - && gBIOSBootVolume - && (!filteredChain || (filteredChain && bvr->visible)) - && bvr->biosdev == gBIOSDev ) - bvr2 = bvr; - // zhell -- if gBIOSBootVolume is NOT set, we use the "if" statement - // from r491, - if ( bvr->flags & kBVFlagBootable - && ! gBIOSBootVolume - && bvr->biosdev == gBIOSDev ) - bvr2 = bvr; - } - - + for ( bvr = chain; bvr; bvr = bvr->next ) + { + if ( bvr->flags & kBVFlagPrimary && bvr->biosdev == gBIOSDev ) foundPrimary = true; + // zhell -- Undo a regression that was introduced from r491 to 492. + // if gBIOSBootVolume is set already, no change is required + if ( bvr->flags & (kBVFlagBootable|kBVFlagSystemVolume) + && gBIOSBootVolume + && (!filteredChain || (filteredChain && bvr->visible)) + && bvr->biosdev == gBIOSDev ) + bvr2 = bvr; + // zhell -- if gBIOSBootVolume is NOT set, we use the "if" statement + // from r491, + if ( bvr->flags & kBVFlagBootable + && ! gBIOSBootVolume + && bvr->biosdev == gBIOSDev ) + bvr2 = bvr; + } + + /* * Use the standrad method for selecting the boot volume. */ @@ -835,12 +889,12 @@ if ( bvr->flags & kBVFlagNativeBoot && bvr->biosdev == gBIOSDev ) bvr1 = bvr; if ( bvr->flags & kBVFlagPrimary && bvr->biosdev == gBIOSDev ) bvr2 = bvr; } - } - - bvr = bvr2 ? bvr2 : - bvr1 ? bvr1 : chain; - - return bvr; + } + + bvr = bvr2 ? bvr2 : + bvr1 ? bvr1 : chain; + + return bvr; } //========================================================================== @@ -1024,18 +1078,18 @@ int getDeviceStringFromBVR(const BVRef bvr, char *str) { - const struct devsw *dp; - - if (bvr) - { - *str = '\0'; - - for (dp = devsw; dp->name && bvr->biosdev >= dp->biosdev; dp++); - dp--; - if (dp->name) sprintf(str, "%s(%d,%d)", dp->name, bvr->biosdev - dp->biosdev, bvr->part_no); - - return true; - } - - return false; + const struct devsw *dp; + + if (bvr) + { + *str = '\0'; + + for (dp = devsw; dp->name && bvr->biosdev >= dp->biosdev; dp++); + dp--; + if (dp->name) sprintf(str, "%s(%d,%d)", dp->name, bvr->biosdev - dp->biosdev, bvr->part_no); + + return true; + } + + return false; } Index: trunk/i386/libsaio/acpi.h =================================================================== --- trunk/i386/libsaio/acpi.h (revision 191) +++ trunk/i386/libsaio/acpi.h (revision 192) @@ -59,6 +59,32 @@ } __attribute__((packed)); // TODO Migrate +struct acpi_2_ssdt { + char Signature[4]; + uint32_t Length; + uint8_t Revision; + uint8_t Checksum; + char OEMID[6]; + char OEMTableId[8]; + uint32_t OEMRevision; + uint32_t CreatorId; + uint32_t CreatorRevision; +} __attribute__((packed)); + +// TODO Migrate +struct acpi_2_dsdt { + char Signature[4]; + uint32_t Length; + uint8_t Revision; + uint8_t Checksum; + char OEMID[6]; + char OEMTableId[8]; + uint32_t OEMRevision; + uint32_t CreatorId; + uint32_t CreatorRevision; +} __attribute__((packed)); + +// TODO Migrate struct acpi_2_fadt { char Signature[4]; uint32_t Length; @@ -73,8 +99,39 @@ uint32_t DSDT; uint8_t Model; // JrCs uint8_t PM_Profile; // JrCs - /*We absolutely don't care about theese fields*/ - uint8_t notimp1[66]; + uint16_t SCI_Interrupt; + uint32_t SMI_Command_Port; + uint8_t ACPI_Enable; + uint8_t ACPI_Disable; + uint8_t S4BIOS_Command; + uint8_t PState_Control; + uint32_t PM1A_Event_Block_Address; + uint32_t PM1B_Event_Block_Address; + uint32_t PM1A_Control_Block_Address; + uint32_t PM1B_Control_Block_Address; + uint32_t PM2_Control_Block_Address; + uint32_t PM_Timer_Block_Address; + uint32_t GPE0_Block_Address; + uint32_t GPE1_Block_Address; + uint8_t PM1_Event_Block_Length; + uint8_t PM1_Control_Block_Length; + uint8_t PM2_Control_Block_Length; + uint8_t PM_Timer_Block_Length; + uint8_t GPE0_Block_Length; + uint8_t GPE1_Block_Length; + uint8_t GPE1_Base_Offset; + uint8_t CST_Support; + uint16_t C2_Latency; + uint16_t C3_Latency; + uint16_t CPU_Cache_Size; + uint16_t Cache_Flush_Stride; + uint8_t Duty_Cycle_Offset; + uint8_t Duty_Cycle_Width; + uint8_t RTC_Day_Alarm_Index; + uint8_t RTC_Month_Alarm_Index; + uint8_t RTC_Century_Index; + uint16_t Boot_Flags; + uint8_t Reserved0; /* Begin Asere */ //Reset Fix uint32_t Flags; Index: trunk/i386/libsaio/platform.c =================================================================== --- trunk/i386/libsaio/platform.c (revision 191) +++ trunk/i386/libsaio/platform.c (revision 192) @@ -52,11 +52,9 @@ */ void scan_platform(void) { - memset(&Platform, 0, sizeof(Platform)); build_pci_dt(); scan_cpu(&Platform); - // disabled for now as options can't be read yet here: - // scan_mem(); - + // It's working after some changes in strdup + scan_mem(); } Index: trunk/i386/libsaio/cpu.c =================================================================== --- trunk/i386/libsaio/cpu.c (revision 191) +++ trunk/i386/libsaio/cpu.c (revision 192) @@ -17,105 +17,7 @@ #define DBG(x...) #endif - -static inline uint64_t rdtsc64(void) -{ - uint64_t ret; - __asm__ volatile("rdtsc" : "=A" (ret)); - return ret; -} - -static inline uint64_t rdmsr64(uint32_t msr) -{ - uint64_t ret; - __asm__ volatile("rdmsr" : "=A" (ret) : "c" (msr)); - return ret; -} - -static inline void do_cpuid(uint32_t selector, uint32_t *data) -{ - asm volatile ("cpuid" - : "=a" (data[0]), - "=b" (data[1]), - "=c" (data[2]), - "=d" (data[3]) - : "a" (selector)); -} - -static inline void do_cpuid2(uint32_t selector, uint32_t selector2, uint32_t *data) -{ - asm volatile ("cpuid" - : "=a" (data[0]), - "=b" (data[1]), - "=c" (data[2]), - "=d" (data[3]) - : "a" (selector), "c" (selector2)); -} - -// DFE: enable_PIT2 and disable_PIT2 come from older xnu - /* - * Enable or disable timer 2. - * Port 0x61 controls timer 2: - * bit 0 gates the clock, - * bit 1 gates output to speaker. - */ -static inline void enable_PIT2(void) -{ - /* Enable gate, disable speaker */ - __asm__ volatile( - " inb $0x61,%%al \n\t" - " and $0xFC,%%al \n\t" /* & ~0x03 */ - " or $1,%%al \n\t" - " outb %%al,$0x61 \n\t" - : : : "%al" ); -} - -static inline void disable_PIT2(void) -{ - /* Disable gate and output to speaker */ - __asm__ volatile( - " inb $0x61,%%al \n\t" - " and $0xFC,%%al \n\t" /* & ~0x03 */ - " outb %%al,$0x61 \n\t" - : : : "%al" ); -} - -// DFE: set_PIT2_mode0, poll_PIT2_gate, and measure_tsc_frequency are -// roughly based on Linux code - -/* Set the 8254 channel 2 to mode 0 with the specified value. - In mode 0, the counter will initially set its gate low when the - timer expires. For this to be useful, you ought to set it high - before calling this function. The enable_PIT2 function does this. - */ -static inline void set_PIT2_mode0(uint16_t value) -{ - __asm__ volatile( - " movb $0xB0,%%al \n\t" - " outb %%al,$0x43 \n\t" - " movb %%dl,%%al \n\t" - " outb %%al,$0x42 \n\t" - " movb %%dh,%%al \n\t" - " outb %%al,$0x42" - : : "d"(value) /*: no clobber */ ); -} - -/* Returns the number of times the loop ran before the PIT2 signaled */ -static inline unsigned long poll_PIT2_gate(void) -{ - unsigned long count = 0; - unsigned char nmi_sc_val; - do { - ++count; - __asm__ volatile( - "inb $0x61,%0" - : "=q"(nmi_sc_val) /*:*/ /* no input */ /*:*/ /* no clobber */); - } while( (nmi_sc_val & 0x20) == 0); - return count; -} - -/* * DFE: Measures the TSC frequency in Hz (64-bit) using the ACPI PM timer */ static uint64_t measure_tsc_frequency(void) @@ -249,6 +151,9 @@ if ((bit(29) & p->CPU.CPUID[CPUID_81][3]) != 0) { p->CPU.Features |= CPU_FEATURE_EM64T; } + if ((bit(5) & p->CPU.CPUID[CPUID_1][3]) != 0) { + p->CPU.Features |= CPU_FEATURE_MSR; + } //if ((bit(28) & p->CPU.CPUID[CPUID_1][3]) != 0) { if (p->CPU.NoThreads > p->CPU.NoCores) { p->CPU.Features |= CPU_FEATURE_HTT; @@ -279,7 +184,7 @@ } cpuFrequency = tscFrequency; } else { - msr = rdmsr64(IA32_PERF_STATUS); + msr = rdmsr64(MSR_IA32_PERF_STATUS); DBG("msr(%d): ia32_perf_stat 0x%08x\n", __LINE__, msr & 0xffffffff); currcoef = (msr >> 8) & 0x1f; /* Non-integer bus ratio for the max-multi*/ Index: trunk/i386/libsaio/platform.h =================================================================== --- trunk/i386/libsaio/platform.h (revision 191) +++ trunk/i386/libsaio/platform.h (revision 192) @@ -33,6 +33,7 @@ #define CPU_FEATURE_EM64T 0x00000040 // 64Bit Support #define CPU_FEATURE_HTT 0x00000080 // HyperThreading #define CPU_FEATURE_MOBILE 0x00000100 // Mobile CPU +#define CPU_FEATURE_MSR 0x00000200 // MSR Support /* SMBIOS Memory Types */ #define SMB_MEM_TYPE_UNDEFINED 0 @@ -75,16 +76,16 @@ #define UUID_LEN 16 typedef struct _RamSlotInfo_t { - uint32_t ModuleSize; // Size of Module in MB - uint32_t Frequency; // in Mhz + uint32_t ModuleSize; // Size of Module in MB + uint32_t Frequency; // in Mhz const char* Vendor; const char* PartNo; const char* SerialNo; - char* spd; // SPD Dump - bool InUse; - uint8_t Type; - uint8_t BankConnections; // table type 6, see (3.3.7) - uint8_t BankConnCnt; + char* spd; // SPD Dump + bool InUse; + uint8_t Type; + uint8_t BankConnections; // table type 6, see (3.3.7) + uint8_t BankConnCnt; } RamSlotInfo_t; Index: trunk/i386/libsaio/cpu.h =================================================================== --- trunk/i386/libsaio/cpu.h (revision 191) +++ trunk/i386/libsaio/cpu.h (revision 192) @@ -14,11 +14,13 @@ #define bitmask(h,l) ((bit(h)|(bit(h)-1)) & ~(bit(l)-1)) #define bitfield(x,h,l) (((x) & bitmask(h,l)) >> l) -#define IA32_PERF_STATUS 0x198 -#define MSR_FLEX_RATIO 0x194 -#define MSR_PLATFORM_INFO 0xCE -#define K8_FIDVID_STATUS 0xC0010042 -#define K10_COFVID_STATUS 0xC0010071 +#define MSR_IA32_PERF_STATUS 0x198 +#define MSR_IA32_PERF_CONTROL 0x199 +#define MSR_IA32_EXT_CONFIG 0x00EE +#define MSR_FLEX_RATIO 0x194 +#define MSR_PLATFORM_INFO 0xCE +#define K8_FIDVID_STATUS 0xC0010042 +#define K10_COFVID_STATUS 0xC0010071 #define DEFAULT_FSB 100000 /* for now, hardcoding 100MHz for old CPUs */ @@ -29,4 +31,111 @@ #define CALIBRATE_TIME_MSEC 30 /* 30 msecs */ #define CALIBRATE_LATCH ((CLKNUM * CALIBRATE_TIME_MSEC + 1000/2)/1000) +static inline uint64_t rdtsc64(void) +{ + uint64_t ret; + __asm__ volatile("rdtsc" : "=A" (ret)); + return ret; +} + +static inline uint64_t rdmsr64(uint32_t msr) +{ + uint64_t ret; + __asm__ volatile("rdmsr" : "=A" (ret) : "c" (msr)); + return ret; +} + +static inline void wrmsr64(uint32_t msr, uint64_t val) +{ + __asm__ volatile("wrmsr" : : "c" (msr), "A" (val)); +} + +static inline void intel_waitforsts(void) { + uint32_t inline_timeout = 100000; + while (rdmsr64(MSR_IA32_PERF_STATUS) & (1 << 21)) { if (!inline_timeout--) break; } +} + +static inline void do_cpuid(uint32_t selector, uint32_t *data) +{ + asm volatile ("cpuid" + : "=a" (data[0]), + "=b" (data[1]), + "=c" (data[2]), + "=d" (data[3]) + : "a" (selector)); +} + +static inline void do_cpuid2(uint32_t selector, uint32_t selector2, uint32_t *data) +{ + asm volatile ("cpuid" + : "=a" (data[0]), + "=b" (data[1]), + "=c" (data[2]), + "=d" (data[3]) + : "a" (selector), "c" (selector2)); +} + +// DFE: enable_PIT2 and disable_PIT2 come from older xnu + +/* + * Enable or disable timer 2. + * Port 0x61 controls timer 2: + * bit 0 gates the clock, + * bit 1 gates output to speaker. + */ +static inline void enable_PIT2(void) +{ + /* Enable gate, disable speaker */ + __asm__ volatile( + " inb $0x61,%%al \n\t" + " and $0xFC,%%al \n\t" /* & ~0x03 */ + " or $1,%%al \n\t" + " outb %%al,$0x61 \n\t" + : : : "%al" ); +} + +static inline void disable_PIT2(void) +{ + /* Disable gate and output to speaker */ + __asm__ volatile( + " inb $0x61,%%al \n\t" + " and $0xFC,%%al \n\t" /* & ~0x03 */ + " outb %%al,$0x61 \n\t" + : : : "%al" ); +} + +// DFE: set_PIT2_mode0, poll_PIT2_gate, and measure_tsc_frequency are +// roughly based on Linux code + +/* Set the 8254 channel 2 to mode 0 with the specified value. + In mode 0, the counter will initially set its gate low when the + timer expires. For this to be useful, you ought to set it high + before calling this function. The enable_PIT2 function does this. + */ +static inline void set_PIT2_mode0(uint16_t value) +{ + __asm__ volatile( + " movb $0xB0,%%al \n\t" + " outb %%al,$0x43 \n\t" + " movb %%dl,%%al \n\t" + " outb %%al,$0x42 \n\t" + " movb %%dh,%%al \n\t" + " outb %%al,$0x42" + : : "d"(value) /*: no clobber */ ); +} + +/* Returns the number of times the loop ran before the PIT2 signaled */ +static inline unsigned long poll_PIT2_gate(void) +{ + unsigned long count = 0; + unsigned char nmi_sc_val; + do { + ++count; + __asm__ volatile( + "inb $0x61,%0" + : "=q"(nmi_sc_val) /*:*/ /* no input */ /*:*/ /* no clobber */); + } while( (nmi_sc_val & 0x20) == 0); + return count; +} + #endif /* !__LIBSAIO_CPU_H */ Index: trunk/i386/libsaio/fake_efi.c =================================================================== --- trunk/i386/libsaio/fake_efi.c (revision 191) +++ trunk/i386/libsaio/fake_efi.c (revision 192) @@ -11,7 +11,7 @@ #include "fake_efi.h" #include "efi_tables.h" #include "platform.h" -#include "dsdt_patcher.h" +#include "acpi_patcher.h" #include "smbios_patcher.h" #include "device_inject.h" #include "convert.h" Index: trunk/i386/libsaio/saio_internal.h =================================================================== --- trunk/i386/libsaio/saio_internal.h (revision 191) +++ trunk/i386/libsaio/saio_internal.h (revision 192) @@ -183,6 +183,7 @@ extern int close(int fdesc); extern int file_size(int fdesc); extern int read(int fdesc, char *buf, int count); +extern int write(int fdesc, const char *buf, int count); extern int b_lseek(int fdesc, int addr, int ptr); extern int tell(int fdesc); extern const char * systemConfigDir(void); Index: trunk/i386/boot2/boot.h =================================================================== --- trunk/i386/boot2/boot.h (revision 191) +++ trunk/i386/boot2/boot.h (revision 192) @@ -42,52 +42,54 @@ #define kKernelNameKey "Kernel" #define kKernelCacheKey "Kernel Cache" #define kBootDeviceKey "Boot Device" -#define kTimeoutKey "Timeout" +#define kTimeoutKey "Timeout" #define kRootDeviceKey "rd" #define kBootUUIDKey "boot-uuid" #define kHelperRootUUIDKey "Root UUID" #define kPlatformKey "platform" -#define kACPIKey "acpi" +#define kACPIKey "acpi" #define kCDROMPromptKey "CD-ROM Prompt" #define kCDROMOptionKey "CD-ROM Option Key" #define kRescanPromptKey "Rescan Prompt" -#define kRescanKey "Rescan" +#define kRescanKey "Rescan" #define kScanSingleDriveKey "Scan Single Drive" #define kInsantMenuKey "Instant Menu" #define kDefaultKernel "mach_kernel" -#define kGUIKey "GUI" +#define kGUIKey "GUI" #define kBootBannerKey "Boot Banner" #define kWaitForKeypressKey "Wait" /* AsereBLN: added the other keys */ -#define kUseAtiROM "UseAtiROM" /* ati.c */ -#define kWake "Wake" /* boot.c */ -#define kForceWake "ForceWake" /* boot.c */ -#define kWakeImage "WakeImage" /* boot.c */ +#define kUseAtiROM "UseAtiROM" /* ati.c */ +#define kWake "Wake" /* boot.c */ +#define kForceWake "ForceWake" /* boot.c */ +#define kWakeImage "WakeImage" /* boot.c */ #define kProductVersion "ProductVersion" /* boot.c */ -#define karch "arch" /* boot.c */ -#define kDSDT "DSDT" /* dsdt_patcher.c */ -#define kDropSSDT "DropSSDT" /* dsdt_patcher.c */ -#define kRestartFix "RestartFix" /* dsdt_patcher.c */ -#define kSMBIOS "SMBIOS" /* fake_efi.c */ -#define kSystemID "SystemId" /* fake_efi.c */ -#define kSystemType "SystemType" /* fake_efi.c */ +#define karch "arch" /* boot.c */ +#define kDSDT "DSDT" /* acpi_patcher.c */ +#define kDropSSDT "DropSSDT" /* acpi_patcher.c */ +#define kRestartFix "RestartFix" /* acpi_patcher.c */ +#define kSMBIOS "SMBIOS" /* fake_efi.c */ +#define kSystemID "SystemId" /* fake_efi.c */ +#define kSystemType "SystemType" /* fake_efi.c */ #define kUseNvidiaROM "UseNvidiaROM" /* nvidia.c */ -#define kVBIOS "VBIOS" /* nvidia.c */ -#define kPCIRootUID "PCIRootUID" /* pci_root.c */ +#define kVBIOS "VBIOS" /* nvidia.c */ +#define kPCIRootUID "PCIRootUID" /* pci_root.c */ #define kEthernetBuiltIn "EthernetBuiltIn" /* pci_setup.c */ #define kGraphicsEnabler "GraphicsEnabler" /* pci_setup.c */ -#define kUSBBusFix "USBBusFix" /* pci_setup.c */ +#define kUSBBusFix "USBBusFix" /* pci_setup.c */ #define kEHCIacquire "EHCIacquire" /* pci_setup.c */ -#define kUHCIreset "UHCIreset" /* pci_setup.c */ -#define kForceHPET "ForceHPET" /* pci_setup.c */ +#define kUHCIreset "UHCIreset" /* pci_setup.c */ +#define kForceHPET "ForceHPET" /* pci_setup.c */ #define kSMBIOSdefaults "SMBIOSdefaults" /* smbios_patcher.c */ -#define kEHCIhard "EHCIhard" /* usb.c */ +#define kEHCIhard "EHCIhard" /* usb.c */ #define kDefaultPartition "Default Partition" /* sys.c */ #define kDeviceProperties "device-properties" /* device_inject.c */ #define kHidePartition "Hide Partition" /* disk.c */ #define kRenamePartition "Rename Partition" /* disk.c */ -#define kUseMemDetect "UseMemDetect" /* platform.c */ -#define kRestartFix "RestartFix" /* dsdt_patcher.c */ +#define kUseMemDetect "UseMemDetect" /* platform.c */ +#define kRestartFix "RestartFix" /* acpi_patcher.c */ +#define kGeneratePStates "GeneratePStates" /* acpi_patcher.c */ +#define kGenerateCStates "GenerateCStates" /* acpi_patcher.c */ /* * Flags to the booter or kernel