Index: branches/Chimera/version =================================================================== --- branches/Chimera/version (revision 1731) +++ branches/Chimera/version (revision 1732) @@ -1 +1 @@ -1.6.0 +1.7.0 Index: branches/Chimera/i386/libsaio/nvidia.c =================================================================== --- branches/Chimera/i386/libsaio/nvidia.c (revision 1731) +++ branches/Chimera/i386/libsaio/nvidia.c (revision 1732) @@ -99,9 +99,6 @@ static struct nv_chipsets_t NVKnownChipsets[] = { { 0x00000000, "Unknown" }, -// temporary placement - { 0x10DE0DF4, "GeForce GT 450M" }, //Azi + issue #99 - { 0x10DE1251, "GeForce GTX 560M" }, // Asus G74SX //======================================== // 0040 - 004F { 0x10DE0040, "GeForce 6800 Ultra" }, @@ -507,6 +504,7 @@ { 0x10DE06DD, "Quadro 4000" }, { 0x10DE06DE, "Tesla M2050" }, // TODO: sub-device id: 0x0846 { 0x10DE06DE, "Tesla M2070" }, // TODO: sub-device id: ? + { 0x10DE06DF, "Tesla M2070-Q" }, // 0x10DE06DE also applies to misc S2050, X2070, M2050, M2070 // 06E0 - 06EF { 0x10DE06E0, "GeForce 9300 GE" }, @@ -730,11 +728,15 @@ { 0x10DE0DC5, "GeForce GTS 450" }, { 0x10DE0DC6, "GeForce GTS 450" }, { 0x10DE0DCA, "GF10x" }, + { 0x10DE0DCD, "GeForce GT 555M" }, + { 0x10DE0DCE, "GeForce GT 555M" }, // 0DD0 - 0DDF { 0x10DE0DD1, "GeForce GTX 460M" }, { 0x10DE0DD2, "GeForce GT 445M" }, { 0x10DE0DD3, "GeForce GT 435M" }, + { 0x10DE0DD6, "GeForce GT 550M" }, { 0x10DE0DD8, "Quadro 2000" }, + { 0x10DE0DDA, "Quadro 2000M" }, { 0x10DE0DDE, "GF106-ES" }, { 0x10DE0DDF, "GF106-INT" }, // 0DE0 - 0DEF @@ -743,13 +745,20 @@ { 0x10DE0DE2, "GeForce GT 420" }, { 0x10DE0DE5, "GeForce GT 530" }, { 0x10DE0DEB, "GeForce GT 555M" }, + { 0x10DE0DEC, "GeForce GT 525M" }, + { 0x10DE0DED, "GeForce GT 520M" }, { 0x10DE0DEE, "GeForce GT 415M" }, // 0DF0 - 0DFF { 0x10DE0DF0, "GeForce GT 425M" }, { 0x10DE0DF1, "GeForce GT 420M" }, { 0x10DE0DF2, "GeForce GT 435M" }, { 0x10DE0DF3, "GeForce GT 420M" }, + { 0x10DE0DF4, "GeForce GT 450M" }, + { 0x10DE0DF5, "GeForce GT 525M" }, + { 0x10DE0DF6, "GeForce GT 550M" }, + { 0x10DE0DF7, "GeForce GT 520M" }, { 0x10DE0DF8, "Quadro 600" }, + { 0x10DE0DFA, "Quadro 1000M" }, { 0x10DE0DFE, "GF108 ES" }, { 0x10DE0DFF, "GF108 INT" }, // 0E00 - 0E0F @@ -762,7 +771,10 @@ { 0x10DE0E25, "D12U-50" }, // 0E30 - 0E3F { 0x10DE0E30, "GeForce GTX 470M" }, + { 0x10DE0E31, "GeForce GTX 485M" }, { 0x10DE0E38, "GF104GL" }, + { 0x10DE0E3A, "Quadro 3000M" }, + { 0x10DE0E3B, "Quadro 4000M" }, { 0x10DE0E3E, "GF104-ES" }, { 0x10DE0E3F, "GF104-INT" }, // 0E40 - 0E4F @@ -801,9 +813,12 @@ { 0x10DE1040, "GeForce GT 520" }, // 1050 - 105F { 0x10DE1050, "GeForce GT 520M" }, + { 0x10DE1054, "GeForce GT 410M" }, { 0x10DE1056, "Quadro NVS 4200M" }, + { 0x10DE1057, "Quadro NVS 4200M" }, // 1060 - 106F // 1070 - 107F + { 0x10DE107F, "NVIDIA GF119-ES" }, // 1080 - 108F { 0x10DE1080, "GeForce GTX 580" }, { 0x10DE1081, "GeForce GTX 570" }, @@ -818,10 +833,13 @@ // 10B0 - 10BF // 10C0 - 10CF { 0x10DE10C3, "GeForce 8400 GS" }, + { 0x10DE10C5, "GeForce 405" }, // 1200 - { 0x10DE1200, "GeForce GTX 560 Ti" }, + { 0x10DE1201, "GeForce GTX 560" }, { 0x10DE1244, "GeForce GTX 550 Ti" }, - { 0x10DE1245, "GeForce GTS 450" }, + { 0x10DE1245, "GeForce GTS 450" }, + { 0x10DE1251, "GeForce GTX 560M" }, }; static uint16_t swap16(uint16_t x) @@ -1203,12 +1221,14 @@ vram_size *= REG32(NVC0_MEM_CTRLR_COUNT); } - // Workaround for GT 420/430 & 9600M GT + // Workaround for 9600M GT, GT 420/430/440 & GT 525M switch (nvda_dev->device_id) { + case 0x0649: vram_size = 512*1024*1024; break; // 9600M GT + case 0x0DE0: vram_size = 1024*1024*1024; break; // GT 440 case 0x0DE1: vram_size = 1024*1024*1024; break; // GT 430 case 0x0DE2: vram_size = 1024*1024*1024; break; // GT 420 - case 0x0649: vram_size = 512*1024*1024; break; // 9600M GT + case 0x0DEC: vram_size = 1024*1024*1024; break; // GT 525M default: break; } Index: branches/Chimera/i386/libsaio/ati.c =================================================================== --- branches/Chimera/i386/libsaio/ati.c (revision 1731) +++ branches/Chimera/i386/libsaio/ati.c (revision 1732) @@ -220,6 +220,8 @@ { 0x9440, 0x24441682, CHIP_FAMILY_RV770, "ATI Radeon HD 4870", kMotmot }, { 0x9440, 0x24451682, CHIP_FAMILY_RV770, "ATI Radeon HD 4870", kMotmot }, + { 0x9440, 0x114A174B, CHIP_FAMILY_RV770, "Sapphire Radeon HD4870 Vapor-X", kCardinal }, + { 0x9441, 0x24401682, CHIP_FAMILY_RV770, "ATI Radeon HD 4870 X2", kMotmot }, { 0x9442, 0x080110B0, CHIP_FAMILY_RV770, "ATI Radeon HD 4850", kMotmot }, @@ -359,18 +361,21 @@ { 0x9540, 0x30501787, CHIP_FAMILY_RV710, "ATI Radeon HD 4590", kNull }, + { 0x954F, 0x16131462, CHIP_FAMILY_RV710, "ATI Radeon HD 4550", kNull }, + { 0x954F, 0x29201682, CHIP_FAMILY_RV710, "ATI Radeon HD 4550", kNull }, { 0x954F, 0x29211682, CHIP_FAMILY_RV710, "ATI Radeon HD 4550", kNull }, { 0x954F, 0x30901682, CHIP_FAMILY_RV710, "XFX Radeon HD 4570", kNull }, - - { 0x954F, 0x30501787, CHIP_FAMILY_RV710, "ATI Radeon HD 4450", kNull }, - { 0x954F, 0x31001787, CHIP_FAMILY_RV710, "ATI Radeon HD 4520", kNull }, - + { 0x954F, 0x3000174B, CHIP_FAMILY_RV710, "ATI Radeon HD 4520", kNull }, { 0x954F, 0x4450174B, CHIP_FAMILY_RV710, "ATI Radeon HD 4450", kNull }, { 0x954F, 0x4570174B, CHIP_FAMILY_RV710, "Sapphire Radeon HD 4570", kNull }, { 0x954F, 0xE990174B, CHIP_FAMILY_RV710, "Sapphire Radeon HD 4350", kNull }, + { 0x954F, 0x20081787, CHIP_FAMILY_RV710, "ATI Radeon HD 4350", kNull }, + { 0x954F, 0x30501787, CHIP_FAMILY_RV710, "ATI Radeon HD 4450", kNull }, + { 0x954F, 0x31001787, CHIP_FAMILY_RV710, "ATI Radeon HD 4520", kNull }, + { 0x954F, 0x301017AF, CHIP_FAMILY_RV710, "ATI Radeon HD 4450", kNull }, { 0x9552, 0x04341028, CHIP_FAMILY_RV710, "ATI Mobility Radeon 4330", kShrike }, @@ -469,6 +474,7 @@ { 0x6899, 0x21E41458, CHIP_FAMILY_CYPRESS, "ATI Radeon HD 5850", kUakari }, { 0x6899, 0xE140174B, CHIP_FAMILY_CYPRESS, "ATI Radeon HD 5850", kUakari }, + { 0x6899, 0xE174174B, CHIP_FAMILY_CYPRESS, "ATI Radeon HD 5850", kUakari }, { 0x6899, 0x200A1787, CHIP_FAMILY_CYPRESS, "ATI Radeon HD 5850", kUakari }, { 0x6899, 0x22901787, CHIP_FAMILY_CYPRESS, "ATI Radeon HD 5850", kUakari }, @@ -477,6 +483,8 @@ { 0x689C, 0x039E1043, CHIP_FAMILY_HEMLOCK, "ASUS EAH5870 Series", kUakari }, { 0x689C, 0x30201682, CHIP_FAMILY_HEMLOCK, "ATI Radeon HD 5970", kUakari }, + + { 0x68A0, 0x043A1028, CHIP_FAMILY_CYPRESS, "ATI Mobility Radeon HD 5870", kNomascus }, { 0x68A1, 0x144D103C, CHIP_FAMILY_CYPRESS, "ATI Mobility Radeon HD 5850", kNomascus }, { 0x68A1, 0x1522103C, CHIP_FAMILY_CYPRESS, "ATI Mobility Radeon HD 5850", kHoolock }, @@ -485,6 +493,9 @@ { 0x68B8, 0x00CF106B, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5770", kHoolock }, + { 0x68B8, 0x21D71458, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5770", kVervet }, + { 0x68B8, 0x21F61458, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5770", kVervet }, + { 0x68B8, 0x29901682, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5770", kVervet }, { 0x68B8, 0x29911682, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5770", kVervet }, @@ -492,11 +503,12 @@ { 0x68B8, 0xE144174B, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5770", kHoolock }, { 0x68B8, 0xE147174B, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5770", kVervet }, - { 0x68B8, 0x21D71458, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5770", kVervet }, - + { 0x68B8, 0x200A1787, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5770", kVervet }, { 0x68B8, 0x200B1787, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5770", kVervet }, { 0x68B8, 0x22881787, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5770", kVervet }, + { 0x68BE, 0x22881787, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5750", kVervet }, + { 0x68BF, 0x220E1458, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 6750", kVervet }, { 0x68C0, 0x1594103C, CHIP_FAMILY_REDWOOD, "AMD Radeon HD 6570M", kNull }, @@ -536,9 +548,17 @@ { 0x68E1, 0x1426103C, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5430M", kEulemur }, + { 0x68F9, 0x010E1002, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + + { 0x68F9, 0x03741043, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + + { 0x68F9, 0x23401462, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + { 0x68F9, 0x5470174B, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470", kNull }, { 0x68F9, 0x5490174B, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5490", kNull }, { 0x68F9, 0x5530174B, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5530", kNull }, + { 0x68F9, 0xE145174B, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + { 0x68F9, 0xE153174B, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, { 0x68F9, 0x20091787, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, { 0x68F9, 0x22911787, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, @@ -555,7 +575,13 @@ { 0x6718, 0x67181002, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6970", kNull }, { 0x6718, 0x31301682, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6970", kNull }, + + { 0x6719, 0x0B001002, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6950", kGibba }, + { 0x6719, 0x20101787, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6950", kGibba }, + + { 0x6720, 0x04BA1028, CHIP_FAMILY_BARTS, "AMD Radeon HD 6970M", kElodea }, + { 0x6738, 0x00D01002, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, { 0x6738, 0x21FA1002, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, { 0x6738, 0x67381002, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, @@ -564,13 +590,17 @@ { 0x6738, 0x31031682, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, { 0x6738, 0x31041682, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, + { 0x6738, 0x31071682, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, + { 0x6738, 0x31081682, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, { 0x6738, 0xE178174B, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, + { 0x6738, 0x174B174B, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kBulrushes }, { 0x6738, 0x20101787, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, { 0x6738, 0x23051787, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, { 0x6739, 0x67391002, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850", kDuckweed }, + { 0x6739, 0xAA881002, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850", kDuckweed }, { 0x6739, 0x21F81458, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850", kDuckweed }, @@ -583,6 +613,8 @@ { 0x6740, 0x1657103C, CHIP_FAMILY_TURKS, "AMD Radeon HD 6770M", kNull }, { 0x6740, 0x165A103C, CHIP_FAMILY_TURKS, "AMD Radeon HD 6770M", kNull }, + { 0x6740, 0x1D121043, CHIP_FAMILY_TURKS, "AMD Radeon HD 6730M", kNull }, + { 0x6741, 0x050E1025, CHIP_FAMILY_TURKS, "AMD Radeon HD 6650M", kNull }, { 0x6741, 0x05131025, CHIP_FAMILY_TURKS, "AMD Radeon HD 6650M", kNull }, @@ -607,6 +639,9 @@ { 0x6760, 0x1CB21043, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6470M", kNull }, + { 0x6760, 0x165A103C, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6470M", kNull }, + { 0x6760, 0x167D103C, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6470M", kNull }, + { 0x6779, 0x64501092, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450", kBulrushes }, { 0x6779, 0xE164174B, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450", kBulrushes }, @@ -679,9 +714,12 @@ { 0x6899, 0x00000000, CHIP_FAMILY_CYPRESS, "ATI Radeon HD 5800 Series", kUakari }, { 0x689C, 0x00000000, CHIP_FAMILY_HEMLOCK, "ATI Radeon HD 5900 Series", kUakari }, { 0x689E, 0x00000000, CHIP_FAMILY_CYPRESS, "ATI Radeon HD 5800 Series", kUakari }, - + + { 0x68A0, 0x00000000, CHIP_FAMILY_CYPRESS, "ATI Radeon HD 5800M Series", kNomascus }, + { 0x68B8, 0x00000000, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5700 Series", kVervet }, - { 0x68B9, 0x00000000, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5600 Series", kVervet }, + { 0x68B9, 0x00000000, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5600 Series", kVervet }, + { 0x68BA, 0x00000000, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 6770 Series", kVervet }, { 0x68BE, 0x00000000, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5700 Series", kVervet }, { 0x68D8, 0x00000000, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5600 Series", kBaboon }, @@ -692,7 +730,7 @@ /* Northen Islands */ { 0x6718, 0x00000000, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6970 Series", kNull }, - { 0x6719, 0x00000000, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6950 Series", kNull }, + { 0x6719, 0x00000000, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6950 Series", kGibba }, { 0x6720, 0x00000000, CHIP_FAMILY_BARTS, "AMD Radeon HD 6900M Series", kNull }, @@ -1319,7 +1357,8 @@ } } - if (!card->info->device_id || !card->info->cfg_name) +// if (!card->info->device_id || !card->info->cfg_name) + if (!card->info->device_id) { verbose("Unsupported ATI card! Device ID: [%04x:%04x] Subsystem ID: [%08x] \n", pci_dev->vendor_id, pci_dev->device_id, pci_dev->subsys_id); Index: branches/Chimera/i386/libsaio/stringTable.c =================================================================== --- branches/Chimera/i386/libsaio/stringTable.c (revision 1731) +++ branches/Chimera/i386/libsaio/stringTable.c (revision 1732) @@ -498,7 +498,7 @@ ret = getValueForConfigTableKey(config, key, val, size); - // Try to find alternate keys in bootInfo->overrideConfig + // Try to find alternate keys in bootInfo->chameleonConfig (if config can be overriden) // and prefer its values with the exceptions for // "Kernel"="mach_kernel" and "Kernel Flags"="". @@ -635,13 +635,15 @@ sysConfigValid = true; ret=0; - // enable canOverride flag - config->canOverride = true; - break; } } + if(ret == -1) ret = loadHelperConfig(config); + + // Always enable canOverride flag (for SystemConfig) + config->canOverride = true; + return ret; } Index: branches/Chimera/i386/boot0/boot0md.s =================================================================== --- branches/Chimera/i386/boot0/boot0md.s (revision 1731) +++ branches/Chimera/i386/boot0/boot0md.s (revision 1732) @@ -54,16 +54,67 @@ ; - if not found, itarates over drives again and searches for active partition and ; loads from it ; +; dmazar: 19/7/2011 +; Searching for bootable partition works in 3 passes now: +; +; - Pass1: +; - for the boot drive only: +; - searches MBR partition table for an active HSF+ bootable partition and boots it +; - if not found and disk is actually GPT, then searches for the first HFS+ bootable +; partition (or EFI with boot1f32) in the GPT array and boots it +; - if still not found, then continues with Pass2 +; +; - Pass2: +; - iterates over all drives and for each drive: +; - searches MBR partition table for the first HSF+ bootable partition and boots it +; - if not found and disk is actually GPT, then searches for the first HFS+ bootable +; partition (or EFI with boot1f32) in the GPT array and boots it +; - if still not found, then continues with the next drive +; - if all drives are searched and nothing found, then continues with Pass3 +; - Pass3: +; - iterates over all drives and for each drive: +; - searches MBR partition table for the first active bootable partition and boots it +; - if not found and disk is actually GPT, then searches for the first HFS+ bootable +; partition (or EFI with boot1f32) in the GPT and boots it +; - if still not found, then continues with the next drive +; - if all drives are searched and nothing found, finishes with "boot0: error" ; +; Bootable partition above means a partition with the boot sector signature (0xAA55) +; at the end of the partition boot sector. +; Booting partition means loading partition boot sector and passing control to partition +; boot loader (for example boot1h). +; Drives are searched in the order defined in the BIOS. Drive which is selected as the boot drive +; is searched first. +; +; If compiled with DEBUG=1 gives debug output: +; P - starting new pass +; D - starting disk scanning: MBR and then GPT +; p - checking MBR partition entry +; t - testing MBR partition +; l - MBR or GPT partition satisfies conditions - loading partition boot sector +; G - found GPT +; + - stage 1 booter loaded, press a key to continue +; E - error +; + +; ; Set to 1 to enable obscure debug messages. ; -DEBUG EQU CONFIG_BOOT0_DEBUG +;DEBUG EQU CONFIG_BOOT0_DEBUG +DEBUG EQU 0 +NOT_USED EQU 0 ; exclude print_hex - no space for it ; -; Set to 1 to enable verbose mode +; Verbose - write boot0 messages +; No space for verbose and debug in the same time ; -VERBOSE EQU CONFIG_BOOT0_VERBOSE +;VERBOSE EQU CONFIG_BOOT0_VERBOSE +%if DEBUG +VERBOSE EQU 0 +%else +VERBOSE EQU 1 +%endif ; ; Various constants. @@ -116,6 +167,10 @@ kDriveNumber EQU 0x80 %endif +kPass1 EQU 3 ; Pass1 +kPass2 EQU 2 ; Pass2 +kPass3 EQU 1 ; Pass3 + ; ; Format of fdisk partition entry. ; @@ -175,17 +230,29 @@ call print_char %endmacro -%macro LogString 1 +%macro DebugPauseMacro 0 + call getc +%endmacro + +%macro LogStringMacro 1 mov di, %1 call log_string %endmacro %if DEBUG %define DebugChar(x) DebugCharMacro x +%define DebugPause DebugPauseMacro %else %define DebugChar(x) +%define DebugPause %endif +%if VERBOSE +%define LogString(x) LogStringMacro x +%else +%define LogString(x) +%endif + ;-------------------------------------------------------------------------- ; Start of text segment. @@ -229,21 +296,20 @@ ; start_reloc: - push dx ; save dl (boot drive) for second pass. - ; will stay on stack if booter loaded in first pass. - ; this should not be a problem - mov bh, 1 ; BH = 1. two pass scanning (active or hfs partition). - ; actuall use of it (scanning) is in find_boot + ; + ; BH is pass counter + ; Pass1 BH=3, Pass2 BH=2, Pass3 BH=1 + ; + mov bh, kPass1 ; BH = 3. Pass1 -scan_drives: +pass_loop: - DebugChar('>') + DebugChar('P') ; starting new pass + push dx ; save dl (boot drive) for next pass + + +.scan_drive: -%if DEBUG - mov al, dl - call print_hex -%endif - ; ; Since this code may not always reside in the MBR, always start by ; loading the MBR to kMBRBuffer and LBA1 to kGPTBuffer. @@ -256,8 +322,10 @@ mov bx, kMBRBuffer ; MBR load address call load pop bx ; restore BH - jc .mbr_load_error ; MBR load error - normally because we scanned all drives + jc .next_pass ; MBR load error - normally because we scanned all drives + DebugChar('D') ; starting disk scanning + ; ; Look for the booter partition in the MBR partition table, ; which is at offset kMBRPartTable. @@ -265,27 +333,34 @@ mov si, kMBRPartTable ; pointer to partition table call find_boot ; will not return on success - ; if returns - booter partition not found + ; if returns - booter partition is not found + + ; skip scanning of all drives in Pass1 + cmp bh, kPass1 + je .next_pass + ; try next drive - ; if next drive does not exists - will break on above MBR load error + ; if next drive does not exists - will break on the MBR load error above inc dl - jmp scan_drives + jmp short .scan_drive -.mbr_load_error: - ; all drives scanned - see if we need to run second pass +.next_pass: + ; all drives scanned - move to next pass pop dx ; restore orig boot drive dec bh ; decrement scan pass counter - jz scan_drives ; if zero - run seccond pass + jnz pass_loop ; if not zero - exec next pass - ; we ran two passes - nothing found - error + ; we ran all passes - nothing found - error error: + DebugChar('E') + DebugPause LogString(boot_error_str) hang: hlt - jmp hang + jmp short hang ;-------------------------------------------------------------------------- @@ -294,7 +369,7 @@ ; Arguments: ; DL = drive number (0x80 + unit number) ; SI = pointer to fdisk partition table. -; BH = pass counter (1=first pass, 0=second pass) +; BH = pass counter ; ; Clobber list: ; EAX, BX, EBP @@ -316,15 +391,7 @@ .loop: - ; - ; First scan through the partition table looking for the active - ; partition. - ; -%if DEBUG - mov al, [si + part.type] ; print partition type - call print_hex -%endif - + DebugChar('p') ; checking partition entry mov eax, [si + part.lba] ; save starting LBA of current mov [my_lba], eax ; MBR partition entry for read_lba function cmp BYTE [si + part.type], 0 ; unused partition? @@ -338,27 +405,42 @@ mov bl, 1 ; Assume we can deal with GPT but try to scan ; later if not found any other bootable partitions. + ; + ; The following code between .testPass and .tryToBoot performs checking for 3 passes: + ; Pass1 (BH=3) if (partition is HFS+ and active) then { DH=1; call loadBootSector} + ; Pass2 (BH=2) if (partition is HFS+) then { DH=1; call loadBootSector} + ; Pass3 (BH=1) if (partition is active) then { DH=0; call loadBootSector} + ; + ; BH is Pass counter + ; DH is argument to loadBootSector + ; = 0 - skip HFS+ partition signature check + ; = 1 - check for HFS+ partition signature + ; + ; Code may be harder to read because I tried to optimized it for minimum size. + ; + .testPass: - cmp bh, 1 - jne .Pass2 + DebugChar('t') ; testing partition + xor dh, dh ; DH=0 This will be used in Pass3 (partition is active, not HFS+). + + cmp bh, kPass3 ; If this is Pass3 (BH=1) + je .checkActive ; check for active flag only. -.Pass1: - cmp BYTE [si + part.type], kPartTypeHFS ; In pass 1 we're going to find a HFS+ partition - ; equipped with boot1h in its boot record - ; regardless if it's active or not. +.checkHFS: + ; We are in Pass1 (BH=3) or Pass2 (BH=2). + inc dh ; DH=1 + cmp BYTE [si + part.type], kPartTypeHFS ; Check for a HFS+ partition. jne .continue - mov dh, 1 ; Argument for loadBootSector to check HFS+ partition signature. - jmp .tryToBoot + cmp bh, kPass2 ; It's HFS+. That's enough checking for Pass2, + je .tryToBoot ; so try to boot (with DH=1) + ; Pass1 needs active flag check also ... -.Pass2: - cmp BYTE [si + part.bootid], kPartActive ; In pass 2 we are walking on the standard path - ; by trying to hop on the active partition. +.checkActive: + ; We are in Pass1 or Pass3 + cmp BYTE [si + part.bootid], kPartActive ; Check if partition is Active jne .continue - xor dh, dh ; Argument for loadBootSector to skip HFS+ partition - ; signature check. - DebugChar('*') ; ; Found boot partition, read boot sector to memory. @@ -393,11 +475,10 @@ ; initBootLoader: -DebugChar('J') + DebugChar('+') + DebugPause -%if VERBOSE LogString(done_str) -%endif jmp kBoot0LoadAddr @@ -415,8 +496,10 @@ jne .exit ; not found. Giving up. cmp DWORD [di + 4], kGPTSignatureHigh ; looking for 'PART' jne .exit ; not found. Giving up indeed. + + DebugChar('G') ; found GPT mov si, di - + ; ; Loading GUID Partition Table Array ; @@ -447,7 +530,8 @@ call load ; read GPT Array pop si ; SI = address of GPT Array pop bx ; BX = size of GUID Partition Array entry - jc error + ;jc error + jc .exit ; dmazar's change to continue disk scanning if encountering invalid LBA. ; ; Walk through GUID Partition Table Array @@ -457,9 +541,7 @@ ; otherwise skip to next partition. ; -%if VERBOSE LogString(gpt_str) -%endif .gpt_loop: @@ -517,19 +599,21 @@ loadBootSector: pusha + DebugChar('l') ; loading partition boot sector + mov al, 3 mov bx, kBoot0LoadAddr call load - jc error + ;jc error + or dl, dl ; to set flag Z=0 ; dmazar's change to continue disk scanning if encountering invalid LBA. + jc .exit ; dmazar's change to continue disk scanning if encountering invalid LBA. or dh, dh jz .checkBootSignature .checkHFSSignature: -%if VERBOSE ;LogString(test_str) ; dmazar: removed to get space -%endif ; ; Looking for HFSPlus ('H+') or HFSPlus case-sensitive ('HX') signature. @@ -588,7 +672,6 @@ pop cx ret - ;-------------------------------------------------------------------------- ; read_lba - Read sectors from a partition using LBA addressing. ; @@ -624,12 +707,6 @@ ; It pushes 2 bytes with a smaller opcode than if WORD was used push BYTE 16 ; offset 0-1, packet size - DebugChar('<') -%if DEBUG - mov eax, ecx - call print_hex -%endif - ; ; INT13 Func 42 - Extended Read Sectors ; @@ -652,8 +729,6 @@ jnc .exit - DebugChar('R') ; indicate INT13/F42 error - ; ; Issue a disk reset on error. ; Should this be changed to Func 0xD to skip the diskette controller @@ -668,7 +743,9 @@ popad ret - + +%if VERBOSE + ;-------------------------------------------------------------------------- ; Write a string with 'boot0: ' prefix to the console. ; @@ -715,7 +792,9 @@ .exit: ret +%endif ;VERBOSE + %if DEBUG ;-------------------------------------------------------------------------- @@ -732,6 +811,15 @@ popa ret +getc: + pusha + mov ah, 0 + int 0x16 + popa + ret +%endif ;DEBUG + +%if NOT_USED ;-------------------------------------------------------------------------- ; Write the 4-byte value to the console in hex. @@ -770,25 +858,22 @@ call print_char ret -getc: - pusha - mov ah, 0 - int 0x16 - popa - ret -%endif ;DEBUG - +%endif ; NOT_USED + + +%if VERBOSE + ;-------------------------------------------------------------------------- ; NULL terminated strings. ; -log_title_str db 10, 13, 'boot0: ', 0 +log_title_str db 10, 13, 'boot0:', 0 boot_error_str db 'error', 0 -%if VERBOSE gpt_str db 'GPT', 0 ;test_str db 'test', 0 done_str db 'done', 0 + %endif ;-------------------------------------------------------------------------- Index: branches/Chimera/i386/boot0/Makefile =================================================================== --- branches/Chimera/i386/boot0/Makefile (revision 1731) +++ branches/Chimera/i386/boot0/Makefile (revision 1732) @@ -1,4 +1,4 @@ -SRCROOT = $(shell pwd)/../../ +SRCROOT = $(abspath $(CURDIR)/../..) OBJROOT = $(SRCROOT)/obj/i386/boot0 SYMROOT = $(SRCROOT)/sym/i386 DSTROOT = $(SRCROOT)/dst/i386 @@ -12,15 +12,15 @@ DIRS_NEEDED = $(SYMROOT) +OBJS = boot0 boot0hfs boot0md chain0 +OBJS := $(addprefix $(SYMROOT)/, $(OBJS)) -OBJECTS = boot0 boot0hfs boot0md chain0 -OBJECTS := $(addprefix $(SYMROOT)/, $(OBJECTS)) +all: $(DIRS_NEEDED) $(OBJS) -all: $(DIRS_NEEDED) $(OBJECTS) - -$(OBJECTS): $(SRCROOT)/autoconf.inc +$(OBJS): $(SRCROOT)/autoconf.inc @echo "\t[NASM] $(@F)" @$(NASM) $(@F).s -o $@ -#dependencies - +clean-local: + @for o in $(OBJS); do if [ -f "$${o}" ];then echo "\t[RM] $${o}"; fi; done + @rm -f $(OBJS) Index: branches/Chimera/i386/boot2/boot.c =================================================================== --- branches/Chimera/i386/boot2/boot.c (revision 1731) +++ branches/Chimera/i386/boot2/boot.c (revision 1732) @@ -159,8 +159,9 @@ } md0Ramdisk(); - + verbose("Starting Darwin %s\n",( archCpuType == CPU_TYPE_I386 ) ? "x86" : "x86_64"); + verbose("Boot Args: %s\n", bootArgs->CommandLine); // Cleanup the PXE base code. Index: branches/Chimera/CREDITS =================================================================== --- branches/Chimera/CREDITS (revision 1731) +++ branches/Chimera/CREDITS (revision 1732) @@ -3,9 +3,12 @@ Developers: ---------- -zef, Turbo, dfe, netkas, mackerintel, fassl, Kabyl, kaitek, iNDi, asereBLN, mozodojo, meklort, AzimutZ, Slice, cosmo1t, cparm +zef, Turbo, dfe, netkas, mackerintel, mercurysquad, fassl, Kabyl, Crazor, Dense, Turbo, kaitek, iNDi, munky, JrCs, asereBLN, rekursor, mozodojo, meklort, AnV, valv, AzimutZ, Slice, cosmo1t, cparm Thanks to: --------- -JrCs, mercurysquad, munky, rekursor, kalyway, Krazubu, XyZ, blackosx, DHP +bumby, kalyway, Krazubu, XyZ, Galaxy, sckevyn, MasterChief, smith@@, blackosx, DHP, nawcom, scorpius, macman, dmazar +Package: +--------- +kalyway, AzimutZ, blackosx, ErmaC, scrax \ No newline at end of file Index: branches/Chimera/doc/BootHelp.txt =================================================================== --- branches/Chimera/doc/BootHelp.txt (revision 1731) +++ branches/Chimera/doc/BootHelp.txt (revision 1732) @@ -106,6 +106,8 @@ (C-States). GeneratePStates=Yes Enable auto generation of processor power performance states (P-States). + CSTUsingSystemIO=Yes New C-State _CST generation method using SystemIO + registers instead of FixedHW. EnableC2State=Yes Enable specific Processor power state, C2. EnableC3State=Yes Enable specific Processor power state, C3.