Chameleon

Chameleon Commit Details

Date:2010-08-20 19:44:49 (13 years 8 months ago)
Author:Tamás Kosárszky
Commit:394
Parents: 393
Message:Added back -f (ignore caches) option. Eliminated hard coded command line manipulation.
Changes:
M/trunk/doc/BootHelp.txt
M/trunk/i386/libsaio/disk.c
M/trunk/i386/boot2/boot.h
M/trunk/i386/boot2/options.c

File differences

trunk/doc/BootHelp.txt
1414
1515
1616
17
17
18
1819
1920
2021
kernel: kernel name (e.g. "mach_kernel" - must be in "/" )
flags: -v (verbose) -s (single user mode) -x (safe mode)
flags: -v (verbose) -s (single user mode)
-x (safe mode) -f (ignore caches)
-F (ignore "Kernel Flags" specified in boot configuration file)
"Graphics Mode"="WIDTHxHEIGHTxDEPTH" (e.g. "1024x768x32")
trunk/i386/libsaio/disk.c
14441444
14451445
14461446
1447
1448
1449
1450
1451
1452
1447
1448
1449
1450
1451
14531452
14541453
14551454
void rescanBIOSDevice(int biosdev)
{
struct DiskBVMap *oldMap = diskResetBootVolumes(biosdev);
CacheReset();
diskFreeMap(oldMap);
oldMap = NULL;
scanBootVolumes(biosdev, 0);
struct DiskBVMap *oldMap = diskResetBootVolumes(biosdev);
CacheReset();
diskFreeMap(oldMap);
oldMap = NULL;
scanBootVolumes(biosdev, 0);
}
struct DiskBVMap* diskResetBootVolumes(int biosdev)
trunk/i386/boot2/boot.h
9999
100100
101101
102
102103
103104
104105
*/
#define kVerboseModeFlag"-v"
#define kSafeModeFlag"-x"
#define kIgnoreCachesFlag"-f"
#define kIgnoreBootFileFlag"-F"
#define kSingleUserModeFlag"-s"
trunk/i386/boot2/options.c
182182
183183
184184
185
185
186186
187187
188188
189189
190190
191
192
193
194
195
196
197
198
199
200
191201
192202
193203
......
434444
435445
436446
437
438
447
439448
440449
441450
442451
443452
444
445
453
446454
447455
448456
449457
450458
451
452
459
453460
454461
455462
......
689696
690697
691698
692
693
694
695
699
700
701
696702
697703
704
705
706
698707
699708
700709
......
724733
725734
726735
736
737
738
739
740
741
742
743
744
727745
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
746
747
748
751749
752
750
751
752
753
754
755
756
757
753758
754759
755760
......
13121317
13131318
13141319
1320
1321
1322
1323
13151324
13161325
13171326
{
gBootArgsPtr = gBootArgs;
memset(gBootArgs, '\0', BOOT_STRING_LEN);
if (bootArgs->Video.v_display == GRAPHICS_MODE) {
clearGraphicBootPrompt();
}
}
static void addBootArg(const char * argStr)
{
if ( (gBootArgsPtr + strlen(argStr) + 1) < gBootArgsEnd)
{
*gBootArgsPtr++ = ' ';
strcat(gBootArgs, argStr);
gBootArgsPtr += strlen(argStr);
}
}
//==========================================================================
static void showBootPrompt(int row, bool visible)
case BOOT_VERBOSE:
gVerboseMode = true;
gBootMode = kBootModeNormal;
*gBootArgsPtr++ = '-';
*gBootArgsPtr++ = 'v';
addBootArg(kVerboseModeFlag);
break;
case BOOT_IGNORECACHE:
gVerboseMode = false;
gBootMode = kBootModeNormal;
*gBootArgsPtr++ = '-';
*gBootArgsPtr++ = 'x';
addBootArg(kIgnoreCachesFlag);
break;
case BOOT_SINGLEUSER:
gVerboseMode = true;
gBootMode = kBootModeNormal;
*gBootArgsPtr++ = '-';
*gBootArgsPtr++ = 's';
addBootArg(kSingleUserModeFlag);
break;
}
}
// ensure we're in graphics mode if gui is setup
if (gui.initialised) {
if (bootArgs->Video.v_display == VGA_TEXT_MODE) {
setVideoMode(GRAPHICS_MODE, 0);
}
if (gui.initialised && bootArgs->Video.v_display == VGA_TEXT_MODE)
{
setVideoMode(GRAPHICS_MODE, 0);
}
// Clear command line boot arguments
clearBootArgs();
// Allow user to override default timeout.
if (multiboot_timeout_set) {
timeout = multiboot_timeout;
gBootMode |= kBootModeSafe;
}
// Checking user pressed keys
bool f8press = false, spress = false, vpress = false;
int key;
while (readKeyboardStatus()) {
key = bgetc ();
if (key == 0x4200) f8press = true;
if ((key & 0xff) == 's' || (key & 0xff) == 'S') spress = true;
if ((key & 0xff) == 'v' || (key & 0xff) == 'V') vpress = true;
}
// If user typed F8, abort quiet mode, and display the menu.
{
bool f8press = false, spress = false, vpress = false;
int key;
while (readKeyboardStatus()) {
key = bgetc ();
if (key == 0x4200) f8press = true;
if ((key & 0xff) == 's' || (key & 0xff) == 'S') spress = true;
if ((key & 0xff) == 'v' || (key & 0xff) == 'V') vpress = true;
}
if (f8press) {
gBootMode &= ~kBootModeQuiet;
timeout = 0;
}
if ((gBootMode & kBootModeQuiet) && firstRun && vpress && (gBootArgsPtr + 3 < gBootArgsEnd)) {
*(gBootArgsPtr++) = ' ';
*(gBootArgsPtr++) = '-';
*(gBootArgsPtr++) = 'v';
}
if ((gBootMode & kBootModeQuiet) && firstRun && spress && (gBootArgsPtr + 3 < gBootArgsEnd)) {
*(gBootArgsPtr++) = ' ';
*(gBootArgsPtr++) = '-';
*(gBootArgsPtr++) = 's';
}
if (f8press) {
gBootMode &= ~kBootModeQuiet;
timeout = 0;
}
clearBootArgs();
// If user typed 'v' or 'V', boot in verbose mode.
if ((gBootMode & kBootModeQuiet) && firstRun && vpress) {
addBootArg(kVerboseModeFlag);
}
// If user typed 's' or 'S', boot in single user mode.
if ((gBootMode & kBootModeQuiet) && firstRun && spress) {
addBootArg(kSingleUserModeFlag);
}
if (bootArgs->Video.v_display == VGA_TEXT_MODE) {
setCursorPosition(0, 0, 0);
gBootMode = ( getValueForKey( kSafeModeFlag, &val, &cnt, &bootInfo->bootConfig ) ) ?
kBootModeSafe : kBootModeNormal;
if ( getValueForKey( kIgnoreCachesFlag, &val, &cnt, &bootInfo->bootConfig ) ) {
gBootMode = kBootModeSafe;
}
}
if ( getValueForKey( kMKextCacheKey, &val, &cnt, &bootInfo->bootConfig ) )

Archive Download the corresponding diff file

Revision: 394