Chameleon

Chameleon Commit Details

Date:2010-09-09 08:05:12 (13 years 7 months ago)
Author:Azimutz
Commit:510
Parents: 509
Message:Making a mess out of boot.h; the intention is to "update" BootHelp.txt with all the "useful at boot prompt" flags/keys, and only the "useful at boot prompt" ones. This helps me to get a better overall notion of the "mess". Also testing the usefulness of adding the remaining flags/keys (or any other useful info) to a new file, called by the unused ?more/showTextFile() flag/function.
Changes:
M/branches/azimutz/Chazi/i386/boot2/options.c
M/branches/azimutz/Chazi/i386/boot2/boot.h

File differences

branches/azimutz/Chazi/i386/boot2/boot.h
3232
3333
3434
35
35
3636
3737
3838
39
39
4040
41
41
42
43
44
45
46
47
48
4249
4350
44
51
4552
46
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
4785
86
87
88
89
90
4891
49
50
51
52
53
5492
55
56
57
93
94
95
96
5897
5998
6099
61100
62101
63
64
65
66
102
103
104
105
106
107
108
109
110
67111
112
113
114
115
116
117
118
119
120
121
68122
69
123
124
70125
71126
72127
73
128
129
130
131
132
133
134
74135
75136
76137
77138
78139
79140
80
81
82
141
142
83143
84144
85145
86
87
88146
89147
90
91148
92
93
94149
95150
151
96152
97153
98
99
100
101
102
103
104
105154
106155
107156
......
111160
112161
113162
114
115163
116
164
165
117166
118167
119168
//Azi: keep it minimal for now.
// Todo: check bootstruct.h, sl.h, platform.h, next; include bootstruct here??
// don't include headers like libsaio.h on other headers?!
// move keys to the headers of the files they're in, if they have it!?
#include "saio_internal.h" // the only one needed by boot.h it self, afaics.
/*
* Default names
* Default names - these end with "Name" (easier to sort them).
*/
#define kDefaultKernel"mach_kernel"
#define kDefaultKernelName"mach_kernel"
#define kDefaultThemeName"Default"
/*
#define kDefaultBootPlistName"com.apple.Boot.plist"
#define kDefaultDSDTName"dsdt.aml"
#define kDefaultSMBIOSName"smbios.plist"
#define kDefaultRamdiskName"Preboot.dmg"
???*/
/*
* Keys used in system Boot.plist
* Default paths?????
*/
#define kGraphicsModeKey"Graphics Mode"// graphics.c
/*
* Undeclared (or undeclared here) keys.
*/
/*
"-checkers" gui.c, getValFK;
"biosdev" mboot.c, getValFBK
"timeout" mboot.c, getValFBK
"partno" mboot.c, getValFBK
"DumpSPD" spd.c, getBollFK
kNVCAP nvidia.c, getValFK - key is declared as a "variable", char kNVCAP[12], on setup_nvidia_devprop().
Check: http://efixusers.com/showthread.php?t=644, Update Version 1.1.9 (Asere's booter).
"If you want to override the NVCAP value, you must determine the PCI DeviceID of your graphic card.
For instance: my new GTX260 has the DeviceID 0×05e2. Knowing the DeviceID add this to your com.apple.Boot.plist:
<key>NVCAP_05e2</key>
<string>0000000000000000000000000000000000000000</string>
The NVCAP value is exactly 20 bytes long. You have to specify it using ASCII-HEX (0-9,a-f)."
ramdisk specific:
"Info" // ramdisk.c, getValFK
"BTAlias" // ramdisk.c, getBollFK
*/
/*
* Internal or Boot.plist only keys (firstrun) - these end with "Key" (key/value pair).??
*
* keys that make no sense on "override" Boot.plist or at boot prompt;
* like so, they won't be present on BootHelp.txt.
*
*/
//identifierstringlocation
#define kTextModeKey"Text Mode"// graphics.c
#define kProductVersion"ProductVersion"// boot.c
#define kDefaultPartition"Default Partition"// sys.c
#define kHidePartition"Hide Partition"// disk.c
#define kRenamePartition"Rename Partition"// disk.c
#define kInstantMenuKey"Instant Menu"// boot.c
#define kQuietBootKey"Quiet Boot"// boot.c
#define kKernelFlagsKey"Kernel Flags"// options.c
#define kMKextCacheKey"MKext Cache"// options.c
#define kKernelNameKey"Kernel"// options.c
#define kKernelCacheKey"Kernel Cache"// boot.c
#define kBootDeviceKey"Boot Device"// options.c
#define kTimeoutKey"Timeout"// options.c
#define kRootDeviceKey"rd"// options.c
#define kBootUUIDKey"boot-uuid"// options.c
#define kHelperRootUUIDKey"Root UUID"// options.c
#define kThemeNameKey"Theme"// gui.cgetValFK??
#define kGUIKey"GUI"// boot.c
#define kBootBannerKey"Boot Banner"// options.c
#define kDebugInfoKey"DebugInfo"// gui.c, graphics.c
#define kCDROMPromptKey"CD-ROM Prompt"// options.c
#define kCDROMOptionKey"CD-ROM Option Key"// options.c
#define kRescanPromptKey"Rescan Prompt"// boot.c
#define kRescanKey "Rescan"// boot.c
#define kScanSingleDriveKey"Scan Single Drive"// boot.c
#define kInstantMenuKey"Instant Menu"// boot.c
#define kGUIKey"GUI"// boot.c
#define kBootBannerKey"Boot Banner"// options.c
#define kDebugInfoKey"DebugInfo"// gui.c, graphics.c
#define kDeviceProperties"device-properties"// device_inject.c
/*
* Prompt or Boot.plist keys (secondrun) - these end with "Key"??
*
* Keys that make some or all sense at boot prompt.
*
*/
#define kWaitForKeypressKey"Wait"// boot.c
#define kTestConfigKey"config"// stringTable.c
#define kCanOverrideKey"CanOverride"// stringTable.c
#define kRootDeviceKey"rd"// options.c
#define kBootDeviceKey"Boot Device"// options.c - ????? internal
#define kBootUUIDKey"boot-uuid"// options.c
#define kHelperRootUUIDKey"Root UUID"// options.c
#define kKernelNameKey"Kernel"// options.c
#define kKernelCacheKey"Kernel Cache"// boot.c
#define kKernelFlagsKey"Kernel Flags"// options.c
#define kKPatcherKey"PatchKernel"// kernel_patcher.c
#define kExtensionsKey"kext"// drivers.c
#define kUseAtiROM"UseAtiROM"// ati.c
#define kMKextCacheKey"MKext Cache"// options.c
#define kMD0Image"md0"// ramdisk.h
#define kWake"Wake"// boot.c
#define kForceWake"ForceWake"// boot.c
#define kWakeImage"WakeImage"// boot.c
#define kProductVersion"ProductVersion"// boot.c
#define kUseAtiROM"UseAtiROM"// ati.c
#define kUseNvidiaROM"UseNvidiaROM"// nvidia.c
#define kVBIOS"VBIOS"// nvidia.c
#define kGraphicsModeKey"Graphics Mode"// graphics.c - here because of AutoResolution patch, which uses it + F2!!
#define kAutoResolutionKey"AutoResolution"// boot.c
#define kGraphicsEnabler"GraphicsEnabler"// pci_setup.c
#define kLegacyLogoKey"Legacy Logo"// gui.c
#define kDSDTKey"DSDT"// acpi_patcher.c
#define kDropSSDT"DropSSDT"// acpi_patcher.c
#define kRestartFix"RestartFix" // acpi_patcher.c
#define kGeneratePStates"GeneratePStates"// acpi_patcher.c
#define kGenerateCStates"GenerateCStates"// acpi_patcher.c
#define kEnableC4States"EnableC4State"// acpi_patcher.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 - change name-->memDetect?
#define kSMBIOSdefaults"SMBIOSdefaults"// smbios_patcher.c
#define kSMBIOSKey"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"PciRoot"// pci_root.c
#define kEthernetBuiltIn"EthernetBuiltIn"// pci_setup.c
#define kGraphicsEnabler"GraphicsEnabler"// pci_setup.c
#define kForceHPET"ForceHPET"// pci_setup.c
#define kUseMemDetect"UseMemDetect" // platform.c
#define kSMBIOSdefaults"SMBIOSdefaults"// smbios_patcher.c
#define kUSBBusFix"USBBusFix"// usb.c
#define kEHCIacquire"EHCIacquire"// usb.c
#define kEHCIhard"EHCIhard"// usb.c - ????? internal
#define kUHCIreset"UHCIreset"// usb.c
#define kLegacyOff"USBLegacyOff"// usb.c
#define kEHCIhard"EHCIhard"// usb.c
#define kDefaultPartition"Default Partition"// sys.c
#define kMD0Image"md0"// ramdisk.h
#define kTestConfigKey"config"// stringTable.c
#define kCanOverrideKey"CanOverride"// stringTable.c
#define kAutoResolutionKey"AutoResolution"// boot.c
#define kKPatcherKey"PatchKernel"// kernel_patcher.c
/*
* Flags to the booter and/or kernel - these end with "Flag".
#define kIgnoreCachesFlag"-f"// options.c
#define kIgnoreBootFileFlag"-F"// options.c
#define kSingleUserModeFlag"-s"// options.c
#define kArchI386Flag"32"// boot.c
#define kLegacyModeFlag"-legacy"// boot.c
#define kArchX86_64Flag"64"// boot.c
#define kArchI386Flag"32"// boot.c - to be reverted!?
#define kArchX86_64Flag"64"// boot.c - to be reverted!?
/*
* Booter behavior control
branches/azimutz/Chazi/i386/boot2/options.c
941941
942942
943943
944
945
944
945
946
947
946948
947
949
950
951
948952
949953
950
951
954
955
956
957
958
952959
953
960
961
962
954963
955964
956
965
966
967
957968
958
959
960
969
970
971
972
973
974
975
976
961977
962
963
978
979
980
981
982
964983
965984
966985
967
986
987
988
968989
969990
970991
......
13571378
13581379
13591380
1360
1361
1362
1363
1364
1365
1366
1367
1368
13691381
13701382
13711383
......
15291541
15301542
15311543
1532
1544
15331545
15341546
1535
1536
1537
1547
1548
1549
15381550
1539
1551
1552
15401553
15411554
15421555
15431556
15441557
1545
1546
1558
1559
1560
1561
15471562
15481563
1549
1550
1551
1564
1565
1566
1567
1568
15521569
15531570
15541571
/*
* TODO: this needs to be refactored.
*/
if (strcmp( booterCommand, "video" ) == 0) {
if (bootArgs->Video.v_display == GRAPHICS_MODE) {
if (strcmp( booterCommand, "video" ) == 0)
{
if (bootArgs->Video.v_display == GRAPHICS_MODE)
{
showInfoBox(getVBEInfoString(), getVBEModeInfoString());
} else {
}
else
{
printVBEModeInfo();
}
} else if ( strcmp( booterCommand, "memory" ) == 0) {
if (bootArgs->Video.v_display == GRAPHICS_MODE ) {
}
else if ( strcmp( booterCommand, "memory" ) == 0)
{
if (bootArgs->Video.v_display == GRAPHICS_MODE )
{
showInfoBox("Memory Map", getMemoryInfoString());
} else {
}
else
{
printMemoryInfo();
}
} else if (strcmp(booterCommand, "lspci") == 0) {
}
else if (strcmp(booterCommand, "lspci") == 0)
{
lspci();
} else if (strcmp(booterCommand, "more") == 0) {
showTextFile(booterParam);
} else if (strcmp(booterCommand, "rd") == 0) {
}
else if (strcmp(booterCommand, "more") == 0) //Azi:?more
{
//showTextFile(booterParam);
showTextFile("bt(0,0)/Extra/BootExtra.txt");
}
else if (strcmp(booterCommand, "rd") == 0)
{
processRAMDiskCommand(&argPtr, booterParam);
} else if (strcmp(booterCommand, "norescan") == 0) {
if (gEnableCDROMRescan) {
}
else if (strcmp(booterCommand, "norescan") == 0)
{
if (gEnableCDROMRescan)
{
gEnableCDROMRescan = false;
break;
}
} else {
}
else
{
showHelp();
}
key = 0;
strlcpy( gRootDevice, val, (cnt + 1));
}
/*
* Removed. We don't need this anymore.
*
if (!processBootArgument(kPlatformKey, cp, configKernelFlags, bootInfo->config, &argP, &cntRemaining, gPlatformName)) {
getPlatformName(gPlatformName);
copyArgument(kPlatformKey, gPlatformName, strlen(gPlatformName), &argP, &cntRemaining);
}
*/
if (!getValueForBootKey(cp, kSafeModeFlag, &val, &cnt) &&
!getValueForBootKey(configKernelFlags, kSafeModeFlag, &val, &cnt)) {
if (gBootMode & kBootModeSafe) {
}
}
void showTextFile(const char * filename)
void showTextFile(const char * filename) //Azi:?more
{
#define MAX_TEXT_FILE_SIZE 65536
char*buf;
intfd;
intsize;
char *buf;
int fd;
int size;
if ((fd = open_bvdev("bt(0,0)", filename, 0)) < 0) {
if ((fd = open_bvdev("bt(0,0)", filename, 0)) < 0)
{
printf("\nFile not found: %s\n", filename);
sleep(2);
return;
}
size = file_size(fd);
if (size > MAX_TEXT_FILE_SIZE) {
size = file_size(fd);
if (size > MAX_TEXT_FILE_SIZE)
{
size = MAX_TEXT_FILE_SIZE;
}
buf = malloc(size);
read(fd, buf, size);
close(fd);
buf = malloc(size);
read(fd, buf, size);
close(fd);
showTextBuffer(buf, size);
free(buf);
}

Archive Download the corresponding diff file

Revision: 510