Chameleon

Chameleon Commit Details

Date:2010-10-28 05:26:25 (8 years 8 months ago)
Author:Azimutz
Commit:618
Parents: 617
Message:"Wrap up" some leftovers: TRUE/FALSE --> true/false; reenabled search for override config on bt(0,0)/Extra; small clean up's; comments, mostly reminders.
Changes:
M/branches/azimutz/Chazi/i386/boot2/options.c
M/branches/azimutz/Chazi/i386/libsaio/stringTable.c
M/branches/azimutz/Chazi/i386/libsaio/sys.c
M/branches/azimutz/Chazi/i386/libsaio/aml_generator.c
M/branches/azimutz/Chazi/i386/libsaio/vbe.h
M/branches/azimutz/Chazi/i386/libsaio/edid.c
M/branches/azimutz/Chazi/i386/libsaio/fdisk.h
M/branches/azimutz/Chazi/i386/boot2/gui.c
M/branches/azimutz/Chazi/i386/libsaio/disk.c
M/branches/azimutz/Chazi/i386/boot2/modules.c
M/branches/azimutz/Chazi/i386/boot2/ramdisk.c

File differences

branches/azimutz/Chazi/i386/libsaio/vbe.h
3737
3838
3939
40
4041
4142
4243
//#include "edid.h"//Azi:autoresolution <-- included in
#include "autoresolution.h"
//#include "../modules/AutoResolution/autoresolution.h" //Azi: reminder
#define MIN_VESA_VERSION 0x200
branches/azimutz/Chazi/i386/libsaio/aml_generator.c
2222
2323
2424
25
25
2626
2727
2828
2929
30
30
3131
3232
3333
......
4343
4444
4545
46
46
4747
4848
49
49
5050
5151
5252
case AML_CHUNK_QWORD:
case AML_CHUNK_ALIAS:
verbose("aml_add_to_parent: Node isn't supports child nodes!");
return FALSE;
return false;
case AML_CHUNK_NAME:
if (parent->First)
{
verbose("aml_add_to_parent: Name node could have only one child node!");
return FALSE;
return false;
}
break;
parent->Last = node;
return TRUE;
return true;
}
return FALSE;
return false;
}
struct aml_chunk* aml_create_node(struct aml_chunk* parent)
branches/azimutz/Chazi/i386/libsaio/fdisk.h
5353
5454
5555
56
56
5757
5858
5959
#define FDISK_LINUX0x83
#define FDISK_UFS 0xa8 /* Apple UFS partition */
#define FDISK_HFS 0xaf /* Apple HFS partition */
#define FDISK_BOOTER 0xab /* Apple booter partition */
#define FDISK_BOOTER 0xab /* Apple booter partition - Azi: reminder */
/*
* Format of fdisk partion entry (if present).
branches/azimutz/Chazi/i386/libsaio/sys.c
754754
755755
756756
757
758
757
758
759759
760760
761
761
762
762763
763764
764
765
765766
766767
767768
......
789790
790791
791792
792
793
794
795
796
797
793
794
795
796
797
798
798799
799
800
801
800
801
802
802803
803
804
804
805
805806
806807
807
808
808
809
809810
810811
811812
812813
813814
814
815
815816
816817
817818
......
913914
914915
915916
916
917
917918
918919
919920
}
//==========================================================================
const char * systemConfigDir()
/*
const char * systemConfigDir() //Azi: boot 132 loadSystemConfig remains.
{
if (gBootFileType == kNetworkDeviceType)
return "";
return "";
return "/Library/Preferences/SystemConfiguration";
}
*/
//==========================================================================
int gBootFileType;
void scanDisks(int biosdev, int *count)
{
#define MAX_HDD_COUNT 32
int bvCount;
int hd = 0;
// Testing up to MAX_HDD_COUNT hard drives.
while(!testBiosread(0x80 + hd, 0) && hd < MAX_HDD_COUNT)
#define MAX_HDD_COUNT 32
int bvCount;
int hd = 0;
// Testing up to MAX_HDD_COUNT hard drives.
while (!testBiosread(0x80 + hd, 0) && hd < MAX_HDD_COUNT)
{
bvCount = 0;
scanBootVolumes(0x80 + hd, &bvCount);
hd++;
bvCount = 0;
scanBootVolumes(0x80 + hd, &bvCount);
hd++;
}
// Also scanning CD/DVD drive.
// Also scanning CD/DVD drive.
if (biosDevIsCDROM(gBIOSDev))
{
bvCount = 0;
scanBootVolumes(gBIOSDev, &bvCount);
bvCount = 0;
scanBootVolumes(gBIOSDev, &bvCount);
}
}
//==========================================================================
BVRef selectBootVolume( BVRef chain )
BVRef selectBootVolume( BVRef chain ) //Azi: return default boot volume.
{
bool filteredChain = false;
bool foundPrimary = false;
// turbo - Save the ORIGINAL boot volume too for loading our mkext
if (!gBIOSBootVolume) gBIOSBootVolume = gBootVolume;
setRootVolume(gBootVolume);
setRootVolume(gBootVolume);
}
/*!
branches/azimutz/Chazi/i386/libsaio/disk.c
19991999
20002000
20012001
2002
2002
20032003
20042004
20052005
return 0;
}
//Azi: for device drawing purposes (gui.c)
int diskIsCDROM(BVRef bvr)
{
struct driveInfo di;
branches/azimutz/Chazi/i386/libsaio/edid.c
1414
1515
1616
17
17
1818
1919
2020
......
5454
5555
5656
57
5857
5958
6059
#include "graphics.h"
//static biosBuf_t bb;
//static biosBuf_t bb; // reminder
UInt32 xResolution = 0;
UInt32 yResolution = 0;
}
}
unsigned char* readEDID()
{
SInt16 last_reported = -1;
branches/azimutz/Chazi/i386/libsaio/stringTable.c
608608
609609
610610
611
611
612
612613
613614
614615
......
672673
673674
674675
675
676
676677
677
678
679
680
678
679
680
681
681682
682683
683684
int loadSystemConfig(config_file_t *config)
{
char *dirspec[] = {
//"/Extra/com.apple.Boot.plist", removed in favor of bt(0,0)
//"/Extra/com.apple.Boot.plist", removed in favor of bt(0,0)... BS!
//Azi: review; at this point /Extra/modules/ = bt(0,0)/Extra/modules/.
"bt(0,0)/Extra/com.apple.Boot.plist",
"/Library/Preferences/SystemConfiguration/com.apple.Boot.plist",
"/com.apple.boot.P/Library/Preferences/SystemConfiguration/com.apple.Boot.plist",
// Check specific OS folders.
sprintf(dirSpecBplist, "bt(0,0)/Extra/%s/%s", &gMacOSVersion, filename);
fd = open(dirSpecBplist, 0);
//if (fd >= 0) goto success_fd;
if (fd >= 0) goto success_fd;
//restore?? can be useful with ramdisks...
//sprintf(dirSpecBplist, "bt(0,0)/Extra/%s", filename);
//fd = open(dirSpecBplist, 0);
//if (fd >= 0) goto success_fd;
//can be useful with ramdisks...
sprintf(dirSpecBplist, "bt(0,0)/Extra/%s", filename);
fd = open(dirSpecBplist, 0);
if (fd >= 0) goto success_fd;
//Azi: i really don't like these two!
// "/Extra/com.apple.Boot.plist"
branches/azimutz/Chazi/i386/boot2/modules.c
8282
8383
8484
85
85
86
87
8688
8789
8890
char* name;
long flags;
long time;
//Azi: Modules.txt-->Issues
//Azi: review; at this point /Extra/modules/ = bt(0,0)/Extra/modules/;
// same thing with all other files that load before the prompt.
struct dirstuff* moduleDir = opendir("bt(0,0)/Extra/modules/");
while(readdir(moduleDir, (const char**)&name, &flags, &time) >= 0)
{
branches/azimutz/Chazi/i386/boot2/gui.c
2323
2424
2525
26
2726
2827
2928
......
129128
130129
131130
132
133
131
132
134133
135134
136135
......
725724
726725
727726
727
728728
729729
730730
#endif
int lasttime = 0; // we need this for animating maybe
extern int gDeviceCount; // dup, line 132
static const char *theme_name = kDefaultThemeName; // #define'ed on boot.h
/*
int imageCnt = 0;
//extern intgDeviceCount; - dup, line 25
extern intselectIndex;
extern intgDeviceCount;
//extern intselectIndex; Azi: not in use
extern MenuItem *menuItems;
gui.screen.width = screen_params[0];
gui.screen.height = screen_params[1];
PRINT("Found mode %dx%d in VESA Table\n", gui.screen.width, gui.screen.height);
//Azi: check why is this printing... (reloadAutoRes/debug)
// load graphics otherwise fail and return
if (loadGraphics() == 0) {
branches/azimutz/Chazi/i386/boot2/ramdisk.c
117117
118118
119119
120
120
121121
122122
123123
fh = open(param, 0);
if (fh != -1)
{
printf("\nreading ramdisk image: %s", param);
printf("\nreading ramdisk image: %s", param); //Azi: check this later...
ramDiskSize = file_size(fh);
if (ramDiskSize > 0)
branches/azimutz/Chazi/i386/boot2/options.c
670670
671671
672672
673
673674
674675
675676
676677
678
677679
678680
679681
......
686688
687689
688690
689
690691
691692
692693
......
10371038
10381039
10391040
1040
1041
1042
1043
1041
1042
10441043
10451044
10461045
......
10561055
10571056
10581057
1059
1060
1058
10611059
10621060
10631061
......
10661064
10671065
10681066
1069
1070
1071
1072
1073
1074
1075
1076
1067
10771068
10781069
10791070
}
//==========================================================================
//Azi: autoresolution
int key;
int nextRow;
BVRef menuBVR;
bool showPrompt;
extern void reloadAutoRes();
int getBootOptions(bool firstRun)
{
//BVRef menuBVR;
//bool showPrompt;
bool newShowPrompt, isCDROM;
extern void reloadAutoRes(); //Azi: autoresolution
// Initialize default menu selection entry.
gBootVolume = menuBVR = selectBootVolume(bvChain);
// New behavior:
// Switch between text & graphic interfaces
// Only Permitted if started in graphics interface
if (useGUI)
{
if (bootArgs->Video.v_display == GRAPHICS_MODE)
{
if (useGUI) {
if (bootArgs->Video.v_display == GRAPHICS_MODE) {
setVideoMode(VGA_TEXT_MODE, 0);
setCursorPosition(0, 0, 0);
nextRow = kMenuTopRow;
showPrompt = true;
if (gDeviceCount)
{
if (gDeviceCount) {
printf("Use \30\31 keys to select the startup volume.");
showMenu(menuItems, gDeviceCount, selectIndex, kMenuTopRow + 2, kMenuMaxItems);
nextRow += min(gDeviceCount, kMenuMaxItems) + 3;
showPrompt = (gDeviceCount == 0) || (menuBVR->flags & kBVFlagNativeBoot);
showBootPrompt(nextRow, showPrompt);
//changeCursor( 0, kMenuTopRow, kCursorTypeUnderline, 0 );
// need to disable F2 here but can't do useGUI = false...
// not a big deal but since i disabled it when in TEXT MODE,
// were it makes no sense and it just hangs the prompt.. not fatal, though...
// back later...
}
else
{
} else {
gui.redraw = true;
setVideoMode(GRAPHICS_MODE, 0);
updateVRAM();

Archive Download the corresponding diff file

Revision: 618