Chameleon

Chameleon Commit Details

Date:2010-01-31 04:15:52 (14 years 2 months ago)
Author:Pradeesh
Commit:52
Parents: 51
Message:Imported _18seven's patch of new boot argus and modified it. For instance now alt+v , gives you verbose , alt+x , gives you safe mode. Going to make it more mac like by including 32 and 64 keys to bring chameleon one step closer
Changes:
M/branches/prasys/i386/boot2/options.c

File differences

branches/prasys/i386/boot2/options.c
711711
712712
713713
714
715
714
715
716
717
718
719
720
721
722
723
724
725
726
727
716728
717
718
729
730
731
719732
720
721
722
723
724
725
733
734
735
736
737
738
739
740
741
726742
727743
728744
729
730
745
731746
732747
733
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
734764
735
736
765
737766
738767
739
740
741
768
769
770
771
772
773
774
775
776
777
742778
743779
744
745
746780
747781
748782
firstRun = NO;
}
// If user typed F8, abort quiet mode,
// and display the menu.
/*
Patch from 18seven & modified by me to make it even more mac like and to include couple of commands
* Bootargs keyboard shortcut
* Keys were obtaiend from ApplePS2ToADBMap.h
* F8 abort quiet mode, and display the menu.
* alt+f old safe mode
* shift+f ignore boot configuration file
* alt+s single user mode
* alt+v verbose (in mac its command +v)
* alt+x safe mode (aka boot args with -x , in macs its command +x)
* alt+l legacy mode (not sure why you need this)
*/
{
int f8press = FALSE, spress = FALSE, vpress = FALSE, key;
while ( readKeyboardStatus() ) {
bool f8 = false, altf = false, shiftf = false, alts = false, altv = false, altl = false, altx = 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)
{
if (key == 0x4200) f8 = true;
if (key == 0x2100) altf = true;
if (key == 0x2146) shiftf = true;
if (key == 0x1F00) alts = true;
if (key == 0x2F00) altv = true;
if (key == 0x2D00) altx = true;
if (key == 0x2600) altl = true;
}
if (f8) {
gBootMode &= ~kBootModeQuiet;
timeout = 0;
}
if ((gBootMode & kBootModeQuiet) && firstRun && vpress && (gBootArgsPtr + 3 < gBootArgsEnd))
{
if ((altf) && (gBootArgsPtr + 3 < gBootArgsEnd)) {
*(gBootArgsPtr++) = ' ';
*(gBootArgsPtr++) = '-';
*(gBootArgsPtr++) = 'v';
*(gBootArgsPtr++) = 'f';
}
if ((shiftf) && (gBootArgsPtr + 3 < gBootArgsEnd)) {
*(gBootArgsPtr++) = ' ';
*(gBootArgsPtr++) = '-';
*(gBootArgsPtr++) = 'F';
}
if ((alts) && (gBootArgsPtr + 3 < gBootArgsEnd)) {
*(gBootArgsPtr++) = ' ';
*(gBootArgsPtr++) = '-';
*(gBootArgsPtr++) = 's';
}
if ((altv) && (gBootArgsPtr + 3 < gBootArgsEnd)) {
*(gBootArgsPtr++) = ' ';
*(gBootArgsPtr++) = '-';
*(gBootArgsPtr++) = 'v';
}
if ((gBootMode & kBootModeQuiet) && firstRun && spress && (gBootArgsPtr + 3 < gBootArgsEnd))
{
if ((altx) && (gBootArgsPtr + 5 < gBootArgsEnd)) {
*(gBootArgsPtr++) = ' ';
*(gBootArgsPtr++) = '-';
*(gBootArgsPtr++) = 's';
}
*(gBootArgsPtr++) = 'x';
//*(gBootArgsPtr++) = '';
//*(gBootArgsPtr++) = '';
}
if ((altl) && (gBootArgsPtr + 3 < gBootArgsEnd)) {
*(gBootArgsPtr++) = ' ';
*(gBootArgsPtr++) = '-';
*(gBootArgsPtr++) = 'legacy';
}
}
clearBootArgs();
if( bootArgs->Video.v_display == VGA_TEXT_MODE )
{
setCursorPosition( 0, 0, 0 );

Archive Download the corresponding diff file

Revision: 52