Chameleon

Chameleon Commit Details

Date:2011-01-21 21:22:37 (13 years 2 months ago)
Author:valv
Commit:709
Parents: 708
Message:defaulting kernel_patcher to disabled, autoresolution rework (Thanks Azi), NoCores & minor fixes
Changes:
M/branches/valv/i386/libsaio/nvidia.c
M/branches/valv/i386/boot2/boot.h
M/branches/valv/i386/libsaio/device_tree.c
M/branches/valv/i386/libsaio/aml_generator.c
M/branches/valv/i386/libsaio/acpi.h
M/branches/valv/i386/boot2/drivers.c
M/branches/valv/i386/libsaio/vbe.h
M/branches/valv/i386/libsaio/gma_resolution.c
M/branches/valv/i386/boot2/gui.c
M/branches/valv/i386/libsaio/cpu.c
M/branches/valv/version
M/branches/valv/i386/boot2/kernel_patcher.c
M/branches/valv/i386/libsaio/disk.c
M/branches/valv/artwork/themes/embed/theme.plist
M/branches/valv/i386/boot2/gui.h
M/branches/valv/i386/libsaio/autoresolution.c
M/branches/valv/i386/libsaio/nvidia_resolution.c
M/branches/valv/i386/boot2/kernel_patcher.h
M/branches/valv/i386/boot2/options.c
M/branches/valv/i386/libsaio/hpet.c
M/branches/valv/i386/libsaio/ati_resolution.c
M/branches/valv/i386/libsaio/autoresolution.h
M/branches/valv/revision
M/branches/valv/i386/boot2/graphics.c
M/branches/valv/i386/libsaio/gma.c
M/branches/valv/i386/libsaio/edid.c
M/branches/valv/i386/boot2/boot.c

File differences

branches/valv/version
1
1
5.1.3
5.1.4
branches/valv/artwork/themes/embed/theme.plist
44
55
66
7
8
9
710
811
9
10
12
13
14
15
16
17
18
19
20
21
22
23
1124
1225
1326
1427
15
16
17
18
19
20
21
22
23
24
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
2553
2654
2755
2856
57
58
59
60
2961
3062
3163
3264
65
66
3367
3468
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
69
5970
6071
6172
6273
74
75
76
77
6378
6479
6580
6681
82
83
6784
6885
69
70
71
72
73
74
75
76
77
78
79
80
86
8187
8288
8389
......
8692
8793
8894
95
96
8997
9098
91
92
99
93100
94101
95102
96103
97104
98105
99
100
101
102
103
104
105
106
107
108
106
107
108
109
110
111
112
113
114
115
116
117
118
119
109120
110121
<dict>
<key>Author</key>
<string>Blackosx</string>
<key>Version</key>
<string>1.0</string>
<key>Enabled</key>
<string>no</string>
<key>Version</key>
<string>1.0</string>
<key>screen_width</key>
<string>1024</string>
<key>screen_height</key>
<string>768</string>
<key>screen_textmargin_h</key>
<string>10</string>
<key>screen_textmargin_v</key>
<string>10</string>
<key>screen_bgcolor</key>
<string>#767f73</string>
<key>background_pos_x</key>
<string>50%</string>
<key>background_pos_y</key>
<string>0</string>
<key>boot_bgcolor</key>
<string>#AAAAAA</string>
<key>boot_height</key>
<string>1080</string>
<key>boot_width</key>
<string>1920</string>
<key>bootprompt_bgcolor</key>
<string>#3e3e3e</string>
<key>bootprompt_height</key>
<string>20</string>
<key>logo_pos_x</key>
<string></string>
<key>logo_pos_y</key>
<string>5%</string>
<key>logo_bgcolor</key>
<string>#000000</string>
<key>logo_transparency</key>
<string>255</string>
<key>devices_pos_x</key>
<string></string>
<key>devices_pos_y</key>
<string></string>
<key>devices_bgcolor</key>
<string>#767f73</string>
<key>devices_transparency</key>
<string>0</string>
<key>devices_max_visible</key>
<string>5</string>
<key>devices_iconspacing</key>
<string>35</string>
<key>devices_layout</key>
<string>horizontal</string>
<key>bootprompt_pos_x</key>
<string></string>
<key>bootprompt_pos_y</key>
<string>-6</string>
<key>bootprompt_width</key>
<string>40%</string>
<key>bootprompt_height</key>
<string>20</string>
<key>bootprompt_textmargin_h</key>
<string>10</string>
<key>bootprompt_textmargin_v</key>
<string>5</string>
<key>bootprompt_bgcolor</key>
<string>#3e3e3e</string>
<key>bootprompt_transparency</key>
<string>1</string>
<key>bootprompt_width</key>
<string>40%</string>
<key>countdown_pos_x</key>
<string></string>
<key>countdown_pos_y</key>
<string>-20%</string>
<key>devices_bgcolor</key>
<string>#767f73</string>
<key>devices_iconspacing</key>
<string>35</string>
<key>devices_layout</key>
<string>horizontal</string>
<key>devices_max_visible</key>
<string>5</string>
<key>devices_pos_x</key>
<string></string>
<key>devices_pos_y</key>
<string></string>
<key>devices_transparency</key>
<string>0</string>
<key>infobox_bgcolor</key>
<string>#3e3e3e</string>
<key>infobox_height</key>
<string>320</string>
<key>infobox_pos_x</key>
<string></string>
<key>infobox_pos_y</key>
<string>30%</string>
<key>infobox_width</key>
<string>660</string>
<key>infobox_height</key>
<string>320</string>
<key>infobox_textmargin_h</key>
<string>10</string>
<key>infobox_textmargin_v</key>
<string>10</string>
<key>infobox_bgcolor</key>
<string>#3e3e3e</string>
<key>infobox_transparency</key>
<string>35</string>
<key>infobox_width</key>
<string>660</string>
<key>logo_bgcolor</key>
<string>#000000</string>
<key>logo_pos_x</key>
<string></string>
<key>logo_pos_y</key>
<string>5%</string>
<key>logo_transparency</key>
<string>255</string>
<key>menu_bgcolor</key>
<string>#3e3e3e</string>
<key>menu_pos_x</key>
<string></string>
<key>menu_pos_y</key>
<string>10</string>
<key>menu_textmargin_v</key>
<string>5</string>
<key>menu_bgcolor</key>
<string>#3e3e3e</string>
<key>menu_transparency</key>
<string>1</string>
<key>progressbar_height</key>
<string>40</string>
<key>progressbar_pos_x</key>
<string></string>
<key>progressbar_pos_y</key>
<string>-30%</string>
<key>progressbar_width</key>
<string>100</string>
<key>screen_bgcolor</key>
<string>#767f73</string>
<key>screen_height</key>
<string>1080</string>
<key>screen_textmargin_h</key>
<string>10</string>
<key>screen_textmargin_v</key>
<string>10</string>
<key>screen_width</key>
<string>1920</string>
<key>progressbar_height</key>
<string>40</string>
<key>countdown_pos_x</key>
<string></string>
<key>countdown_pos_y</key>
<string>-20%</string>
<key>boot_width</key>
<string>1024</string>
<key>boot_height</key>
<string>768</string>
<key>boot_bgcolor</key>
<string>#AAAAAA</string>
</dict>
</plist>
branches/valv/i386/libsaio/ati_resolution.c
7878
7979
8080
81
81
8282
8383
8484
......
100100
101101
102102
103
103
104104
*x = modeTiming[idx + 1].hActive;
*y = modeTiming[idx + 1].vActive;
return TRUE;
return true;
}
bool atiSetMode_2(sModeTable * table, uint8_t idx, uint32_t* x, uint32_t* y)
*x = modeTiming[idx + 1].hActive;
*y = modeTiming[idx + 1].hActive;
return TRUE;
return true;
}
branches/valv/i386/libsaio/device_tree.c
397397
398398
399399
400
400
401401
402402
403403
......
536536
537537
538538
539
539540
540
541541
_PrintTree(node, 0);
}
#if 0
//#if 0
void
DT__PrintFlattenedNode(DTEntry entry, int level)
{
return 0;
}
//#endif
#endif
#endif
branches/valv/i386/libsaio/vbe.h
271271
272272
273273
274
274
275275
276276
277277
typedef unsigned long VBEPalette[256];
extern int getVBEInfo(void *vinfo_p);
extern int getEDID(void * edidBlock, UInt8 blocks_left);
//extern int getEDID(void * edidBlock, UInt8 blocks_left);
extern int getVBEModeInfo(int mode, void *minfo_p);
extern int getVBEDACFormat(unsigned char *format);
extern int setVBEDACFormat(unsigned char format);
branches/valv/i386/libsaio/gma.c
108108
109109
110110
111
112
111
112
113113
114114
115115
116116
117117
118
119
118
119
120120
121121
122122
devprop_add_value(device, "model", (uint8_t*)model, (strlen(model) + 1));
devprop_add_value(device, "device_type", (uint8_t*)"display", 8);
if ((model == (char *)"Mobile GMA950") ||
(model == (char *)"Mobile GMA3150"))
if ((model == (char *)"Mobile GMA950")
|| (model == (char *)"Mobile GMA3150"))
{
devprop_add_value(device, "AAPL,HasPanel", reg_TRUE, 4);
devprop_add_value(device, "built-in", &BuiltIn, 1);
devprop_add_value(device, "class-code", ClassFix, 4);
}
else if ((model == (char *)"Desktop GMA950") ||
(model == (char *)"Desktop GMA3150"))
else if ((model == (char *)"Desktop GMA950")
|| (model == (char *)"Desktop GMA3150"))
{
BuiltIn = 0x01;
devprop_add_value(device, "built-in", &BuiltIn, 1);
branches/valv/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
......
173173
174174
175175
176
176
177177
178178
179179
......
190190
191191
192192
193
193
194194
195195
196196
case AML_CHUNK_QWORD:
case AML_CHUNK_ALIAS:
verbose("aml_add_to_parent: Node doesn't support child nodes!");
return FALSE;
return false;
case AML_CHUNK_NAME:
if (parent->First)
{
verbose("aml_add_to_parent: Name node could have one child only!");
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)
{
if (strlen(name) < 4)
{
verbose("aml_fill_simple_name: simple name %s has incorrect lengh! Must be 4", name);
verbose("aml_fill_simple_name: simple name %s has incorrect lengh! Must be 4\n", name);
return 0;
}
if ((len % 4) > 1 || count == 0)
{
verbose("aml_fill_name: pathname %s has incorrect length! Must be 4, 8, 12, 16 etc.", name);
verbose("aml_fill_name: pathname %s has incorrect length! Must be 4, 8, 12, 16 etc\n", name);
return 0;
}
branches/valv/i386/libsaio/autoresolution.c
1414
1515
1616
17
17
1818
1919
2020
......
216216
217217
218218
219
219
220220
221221
222222
......
240240
241241
242242
243
243
244244
245245
246246
......
369369
370370
371371
372
373
372
373
374374
375375
376376
......
386386
387387
388388
389
389
390390
391391
392392
393393
394394
395395
396
396
397397
398398
399399
......
412412
413413
414414
415
415
416416
417417
418418
......
472472
473473
474474
475
475
476476
477477
478478
......
610610
611611
612612
613
613
614614
615615
616616
617
617
618618
619619
620620
......
622622
623623
624624
625
625
*/
#include "libsaio.h"
#include "autoresolution.h"
//#include "autoresolution.h"
#include "nvidia_resolution.h"
#include "ati_resolution.h"
#include "gma_resolution.h"
while ( i != 0 )
{
table->id = tablesCount - i;
PRINT("New table with id : %d\n", table->id);
PRINT("New table with id: %d\n", table->id);
// opening the chain if it's the first table
if (i == tablesCount)
}
void closeVbios(vBiosMap * map);
//void closeVbios(vBiosMap * map); azi: dup - declared on header
vBiosMap * openVbios(chipsetType forcedChipset)
{
{
PRINT("Closing VBios\n");
//make sure to turn autoResolution off
if (gAutoResolution == TRUE)
gAutoResolution = FALSE;
if (gAutoResolution == true)
gAutoResolution = false;
// if we saved the vBios, free the copy
if (map->biosBackupPtr != NULL)
{
if (table->backup != NULL)
{
PRINT("Table #%d : Freeing backup\t", table->id);
PRINT("Table #%d: Freeing backup\t", table->id);
FREE(table->backup);
PRINT("[OK]\n");
}
if (table != NULL)
{
PRINT("Table #%d : Freeing\t\t", table->id);
PRINT("Table #%d: Freeing\t\t", table->id);
FREE(table);
PRINT("[OK]\n");
}
void unlockVbios(vBiosMap * map)
{
map->unlocked = TRUE;
map->unlocked = true;
switch (map->chipset)
{
void relockVbios(vBiosMap * map)
{
map->unlocked = FALSE;
map->unlocked = false;
switch (map->chipset)
{
x = map->currentX;
y = map->currentY;
PRINT("Patching Table #%d : \n", table->id);
PRINT("Patching Table #%d: \n", table->id);
map->setMode(table, i, &x, &y);
#ifdef AUTORES_DEBUG
getc();
pause();
#endif
table = table->next;
relockVbios(map);
return;
}
}
branches/valv/i386/libsaio/autoresolution.h
1
21
32
43
......
1312
1413
1514
15
1616
1717
1818
......
3838
3939
4040
41
42
41
42
4343
4444
4545
46
4647
47
4848
4949
5050
/* Copied from 915 resolution created by steve tomljenovic
*
* This code is based on the techniques used in :
*
* This source code is into the public domain.
*/
#ifndef __915_RESOLUTION_H
#define __915_RESOLUTION_H
#define VBIOS_START 0xc0000
#define VBIOS_SIZE 0x10000
#define FALSE 0
#define TRUE 1
#define false 0
#define true 1
bool gAutoResolution;
UInt32 params[4];
typedef struct
{
uint8_t width;
branches/valv/i386/libsaio/nvidia.c
8181
8282
8383
84
85
84
85
8686
8787
8888
......
391391
392392
393393
394
394395
395396
396397
397398
398399
400
401
402
403
399404
400405
401406
......
452457
453458
454459
455
460
456461
457462
458463
......
503508
504509
505510
511
512
513
506514
515
516
517
518
519
520
521
522
523
507524
525
526
527
508528
529
530
531
532
533
534
535
509536
537
510538
539
540
541
542
543
511544
545
546
547
548
549
512550
513551
514552
......
593631
594632
595633
634
596635
597636
598637
......
817856
818857
819858
820
859
821860
822
823861
824
862
863
825864
826865
827866
......
863902
864903
865904
866
867
868
905
869906
870907
871908
......
10071044
10081045
10091046
1010
1047
10111048
10121049
10131050
10141051
10151052
10161053
1017
1054
10181055
1019
1056
1057
10201058
1021
1022
1059
1060
1061
10231062
10241063
10251064
......
10301069
10311070
10321071
1033
1072
1073
10341074
1035
1036
1075
1076
1077
10371078
10381079
10391080
......
10521093
10531094
10541095
1055
1096
10561097
1057
10581098
10591099
10601100
const char *nvidia_device_type_0[]={ "@0,device_type","display" };
const char *nvidia_device_type_1[]={ "@1,device_type","display" };
const char *nvidia_device_type[]={ "device_type","NVDA,Parent" };
const char *nvidia_name_0[]={ "@0,name","NVDA,Display-A" };
const char *nvidia_name_1[]={ "@1,name","NVDA,Display-B" };
const char *nvidia_name_0[]={ "@0,name","NVDA,Display-A" };
const char *nvidia_name_1[]={ "@1,name","NVDA,Display-B" };
const char *nvidia_slot_name[]={ "AAPL,slot-name","Slot-1" };
static uint8_t default_dcfg_0[]={0xff, 0xff, 0xff, 0xff};
{ 0x10DE065C, "Quadro FX 770M" },
{ 0x10DE065F, "GeForce G210" },
{ 0x10DE06C0, "GeForce GTX 480" },
{ 0x10DE06C3, "GeForce GTX D12U" },
{ 0x10DE06C4, "GeForce GTX 465" },
{ 0x10DE06CA, "GeForce GTX 480M" },
{ 0x10DE06CD, "GeForce GTX 470" },
{ 0x10DE06D1, "Tesla C2050" },// TODO: sub-device id: 0x0771
{ 0x10DE06D1, "Tesla C2070" },// TODO: sub-device id: 0x0772
{ 0x10DE06D8, "Quadro 6000" },
{ 0x10DE06D9, "Quadro 5000" },
{ 0x10DE06DA, "Quadro 5000M" },
{ 0x10DE06DC, "Quadro 6000" },
{ 0x10DE06DD, "Quadro 4000" },
{ 0x10DE06DE, "Tesla M2050" },// TODO: sub-device id: 0x0846
{ 0x10DE06DE, "Tesla M2070" },// TODO: sub-device id: ?
{ 0x10DE0871, "GeForce 9200" },
{ 0x10DE0872, "GeForce G102M" },
{ 0x10DE0873, "GeForce G102M" },
{ 0x10DE0874, "ION" },
{ 0x10DE0874, "ION 9300M" },
{ 0x10DE0876, "ION" },
{ 0x10DE087A, "GeForce 9400" },
{ 0x10DE087D, "ION 9400M" },
{ 0x10DE0CB0, "GeForce GTS 350M" },
{ 0x10DE0CB1, "GeForce GT 360M" },
{ 0x10DE0CBC, "Quadro FX 1800M" },
{ 0x10DE0DC0, "GeForce GT 440" },
{ 0x10DE0DC1, "D12-P1-35" },
{ 0x10DE0DC2, "D12-P1-35" },
{ 0x10DE0DC4, "GeForce GTS 450" },
{ 0x10DE0DC5, "GeForce GTS 450" },
{ 0x10DE0DC6, "GeForce GTS 450" },
{ 0x10DE0DCA, "GF10x" },
{ 0x10DE0DD1, "GeForce GTX 460M" },
{ 0x10DE0DD2, "GeForce GT 445M" },
{ 0x10DE0DD3, "GeForce GT 435M" },
{ 0x10DE0DD8, "Quadro 2000" },
{ 0x10DE0DDE, "GF106-ES" },
{ 0x10DE0DDF, "GF106-INT" },
{ 0x10DE0DE1, "GeForce GT 430" },
{ 0x10DE0DE2, "GeForce GT 420" },
{ 0x10DE0DEB, "GeForce GT 555M" },
{ 0x10DE0DEE, "GeForce GT 415M" },
{ 0x10DE0DF0, "GeForce GT 425M" },
{ 0x10DE0DF1, "GeForce GT 420M" },
{ 0x10DE0DF2, "GeForce GT 435M" },
{ 0x10DE0DF3, "GeForce GT 420M" },
{ 0x10DE0DF8, "Quadro 600" },
{ 0x10DE0DFE, "GF108 ES" },
{ 0x10DE0DFF, "GF108 INT" },
{ 0x10DE0E21, "D12U-25" },
{ 0x10DE0E22, "GeForce GTX 460" },
{ 0x10DE0E23, "GeForce GTX 460 SE" },
{ 0x10DE0E24, "GeForce GTX 460" },
{ 0x10DE0E25, "D12U-50" },
{ 0x10DE0E30, "GeForce GTX 470M" },
{ 0x10DE0E38, "GF104GL" },
{ 0x10DE0E3E, "GF104-ES" },
{ 0x10DE0E3F, "GF104-INT" },
{ 0x10DE1080, "GeForce GTX 580" },
{ 0x10DE1081, "D13U" },
{ 0x10DE1082, "D13U" },
{ 0x10DE1083, "D13U" },
{ 0x10DE1098, "D13U" },
{ 0x10DE109A, "N12E-Q5" },
{ 0x10DE10C3, "GeForce 8400 GS" }
};
return PATCH_ROM_FAILED;
}
} else {
printf("ERROR: dcbtable_version is 0x%X\n", dcbtable_version);
return PATCH_ROM_FAILED;
}
vram_size &= NV10_PFB_FIFO_DATA_RAM_AMOUNT_MB_MASK;
}
else if (nvCardType >= NV_ARCH_C0) {
vram_size = REG32(NVC0_MEM_CTRLR_COUNT);
vram_size = REG32(NVC0_MEM_CTRLR_COUNT) << 20;
vram_size *= REG32(NVC0_MEM_CTRLR_RAM_AMOUNT);
vram_size <<= 20;
}
else {
else
{
vram_size = REG32(NV04_PFB_FIFO_DATA);
vram_size |= (vram_size & 0xff) << 32;
vram_size &= 0xffffffff00ll;
devicepath = get_pci_dev_path(nvda_dev);
bar[0] = pci_config_read32(nvda_dev->dev.addr, 0x10 );
regs = (uint8_t *) (bar[0] & ~0x0f);
delay(50);
//delay(50);
// get card type
nvCardType = (REG32(0) >> 20) & 0x1ff;
}
}
//#if DEBUG_NVCAP
#if DEBUG_NVCAP
printf("NVCAP: %02x%02x%02x%02x-%02x%02x%02x%02x-%02x%02x%02x%02x-%02x%02x%02x%02x-%02x%02x%02x%02x\n",
default_NVCAP[0], default_NVCAP[1], default_NVCAP[2], default_NVCAP[3],
default_NVCAP[4], default_NVCAP[5], default_NVCAP[6], default_NVCAP[7],
default_NVCAP[8], default_NVCAP[9], default_NVCAP[10], default_NVCAP[11],
default_NVCAP[12], default_NVCAP[13], default_NVCAP[14], default_NVCAP[15],
default_NVCAP[16], default_NVCAP[17], default_NVCAP[18], default_NVCAP[19]);
//#endif
#endif
if (getValueForKey(kdcfg0, &value, &len, &bootInfo->bootConfig) && len == DCFG0_LEN * 2) {
if (getValueForKey(kdcfg0, &value, &len, &bootInfo->bootConfig) && len == DCFG0_LEN * 2)
{
uint8_tnew_dcfg0[DCFG0_LEN];
if (hex2bin(value, new_dcfg0, DCFG0_LEN) == 0) {
if (hex2bin(value, new_dcfg0, DCFG0_LEN) == 0)
{
verbose("Using user supplied @0,display-cfg\n");
memcpy(default_dcfg_0, new_dcfg0, DCFG0_LEN);
}
default_dcfg_0[0], default_dcfg_0[1], default_dcfg_0[2], default_dcfg_0[3], default_dcfg_0[4]);
//#endif
if (getValueForKey(kdcfg1, &value, &len, &bootInfo->bootConfig) && len == DCFG1_LEN * 2) {
if (getValueForKey(kdcfg1, &value, &len, &bootInfo->bootConfig) && len == DCFG1_LEN * 2)
{
uint8_tnew_dcfg1[DCFG1_LEN];
if (hex2bin(value, new_dcfg1, DCFG1_LEN) == 0) {
if (hex2bin(value, new_dcfg1, DCFG1_LEN) == 0)
{
verbose("Using user supplied @1,display-cfg\n");
memcpy(default_dcfg_1, new_dcfg1, DCFG1_LEN);
}
devprop_add_value(device, "@0,display-cfg", default_dcfg_0, DCFG0_LEN);
devprop_add_value(device, "@1,display-cfg", default_dcfg_1, DCFG1_LEN);
devprop_add_value(device, "NVPM", default_NVPM, 28);
if (getBoolForKey(kVBIOS, &doit, &bootInfo->bootConfig) && doit) {
if (getBoolForKey(kVBIOS, &doit, &bootInfo->bootConfig) && doit)
devprop_add_value(device, "vbios", rom, (nvBiosOveride > 0) ? nvBiosOveride : (rom[2] * 512));
}
stringdata = malloc(sizeof(uint8_t) * string->length);
memcpy(stringdata, (uint8_t*)devprop_generate_string(string), string->length);
branches/valv/i386/libsaio/acpi.h
2121
2222
2323
24
25
26
27
28
29
30
31
32
24
25
26
27
28
29
30
31
32
3333
3434
3535
3636
37
38
39
40
41
42
43
44
45
37
38
39
40
41
42
43
44
45
4646
4747
4848
4949
50
51
52
53
54
55
56
57
58
50
51
52
53
54
55
56
57
58
5959
6060
6161
6262
63
64
65
66
67
63
64
65
66
67
6868
6969
7070
7171
72
73
74
75
76
77
78
79
80
72
73
74
75
76
77
78
79
80
8181
8282
8383
8484
85
86
87
88
89
90
91
92
93
85
86
87
88
89
90
91
92
93
9494
9595
9696
9797
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145145
146
147
148
149
146
147
148
149
150150
151151
152152
// TODO Migrate
struct acpi_2_rsdp {
char Signature[8];
uint8_t Checksum;
char OEMID[6];
uint8_t Revision;
uint32_t RsdtAddress;
uint32_t Length;
uint64_t XsdtAddress;
uint8_t ExtendedChecksum;
char Reserved[3];
charSignature[8];
uint8_tChecksum;
charOEMID[6];
uint8_tRevision;
uint32_tRsdtAddress;
uint32_tLength;
uint64_tXsdtAddress;
uint8_tExtendedChecksum;
charReserved[3];
} __attribute__((packed));
// TODO Migrate
struct acpi_2_rsdt {
char Signature[4];
uint32_t Length;
uint8_t Revision;
uint8_t Checksum;
char OEMID[6];
char OEMTableId[8];
uint32_t OEMRevision;
uint32_t CreatorId;
uint32_t CreatorRevision;
charSignature[4];
uint32_tLength;
uint8_tRevision;
uint8_tChecksum;
charOEMID[6];
charOEMTableId[8];
uint32_tOEMRevision;
uint32_tCreatorId;
uint32_tCreatorRevision;
} __attribute__((packed));
// TODO Migrate
struct acpi_2_xsdt {
char Signature[4];
uint32_t Length;
uint8_t Revision;
uint8_t Checksum;
char OEMID[6];
char OEMTableId[8];
uint32_t OEMRevision;
uint32_t CreatorId;
uint32_t CreatorRevision;
charSignature[4];
uint32_tLength;
uint8_tRevision;
uint8_tChecksum;
charOEMID[6];
charOEMTableId[8];
uint32_tOEMRevision;
uint32_tCreatorId;
uint32_tCreatorRevision;
} __attribute__((packed));
// TODO Migrate
struct acpi_2_gas {
uint8_tAddress_Space_ID;
uint8_tRegister_Bit_Width;
uint8_tRegister_Bit_Offset;
uint8_tAccess_Size;
uint64_tAddress;
uint8_tAddress_Space_ID;
uint8_tRegister_Bit_Width;
uint8_tRegister_Bit_Offset;
uint8_tAccess_Size;
uint64_tAddress;
} __attribute__((packed));
// TODO Migrate
struct acpi_2_ssdt {
charSignature[4];
uint32_tLength;
uint8_tRevision;
uint8_tChecksum;
charOEMID[6];
charOEMTableId[8];
uint32_tOEMRevision;
uint32_tCreatorId;
uint32_tCreatorRevision;
charSignature[4];
uint32_tLength;
uint8_tRevision;
uint8_tChecksum;
charOEMID[6];
charOEMTableId[8];
uint32_tOEMRevision;
uint32_tCreatorId;
uint32_tCreatorRevision;
} __attribute__((packed));
// TODO Migrate
struct acpi_2_dsdt {
charSignature[4];
uint32_tLength;
uint8_tRevision;
uint8_tChecksum;
charOEMID[6];
charOEMTableId[8];
uint32_tOEMRevision;
uint32_tCreatorId;
uint32_tCreatorRevision;
charSignature[4];
uint32_tLength;
uint8_tRevision;
uint8_tChecksum;
charOEMID[6];
charOEMTableId[8];
uint32_tOEMRevision;
uint32_tCreatorId;
uint32_tCreatorRevision;
} __attribute__((packed));
// TODO Migrate
struct acpi_2_fadt {
charSignature[4];
uint32_tLength;
uint8_tRevision;
uint8_tChecksum;
charOEMID[6];
charOEMTableId[8];
uint32_tOEMRevision;
uint32_tCreatorId;
uint32_tCreatorRevision;
uint32_tFIRMWARE_CTRL;
uint32_tDSDT;
uint8_tINT_MODEL; // JrCs
uint8_tPreferred_PM_Profile; // JrCs
uint16_tSCI_INT;
uint32_tSMI_CMD;
uint8_tACPI_ENABLE;
uint8_tACPI_DISABLE;
uint8_tS4BIOS_REQ;
uint8_tPSTATE_CNT;
uint32_tPM1a_EVT_BLK;
uint32_tPM1b_EVT_BLK;
uint32_tPM1a_CNT_BLK;
uint32_tPM1b_CNT_BLK;
uint32_tPM2_CNT_BLK;
uint32_tPM_TMR_BLK;
uint32_tGPE0_BLK;
uint32_tGPE1_BLK;
uint8_tPM1_EVT_LEN;
uint8_tPM1_CNT_LEN;
uint8_tPM2_CNT_LEN;
uint8_tPM_TMR_LEN;
uint8_tGPE0_BLK_LEN;
uint8_tGPE1_BLK_LEN;
uint8_tGPE1_BASE;
uint8_tCST_CNT;
uint16_tP_LVL2_LAT;
uint16_tP_LVL3_LAT;
uint16_tFLUSH_SIZE;
uint16_tFLUSH_STRIDE;
uint8_tDUTY_OFFSET;
uint8_tDUTY_WIDTH;
uint8_tDAY_ALRM;
uint8_tMON_ALRM;
uint8_tCENTURY;
uint16_tIAPC_BOOT_ARCH;
uint8_tReserved1;
uint32_tFlags;
charSignature[4];
uint32_tLength;
uint8_tRevision;
uint8_tChecksum;
charOEMID[6];
charOEMTableId[8];
uint32_tOEMRevision;
uint32_tCreatorId;
uint32_tCreatorRevision;
uint32_tFIRMWARE_CTRL;
uint32_tDSDT;
uint8_tINT_MODEL; // JrCs
uint8_tPreferred_PM_Profile; // JrCs
uint16_tSCI_INT;
uint32_tSMI_CMD;
uint8_tACPI_ENABLE;
uint8_tACPI_DISABLE;
uint8_tS4BIOS_REQ;
uint8_tPSTATE_CNT;
uint32_tPM1a_EVT_BLK;
uint32_tPM1b_EVT_BLK;
uint32_tPM1a_CNT_BLK;
uint32_tPM1b_CNT_BLK;
uint32_tPM2_CNT_BLK;
uint32_tPM_TMR_BLK;
uint32_tGPE0_BLK;
uint32_tGPE1_BLK;
uint8_tPM1_EVT_LEN;
uint8_tPM1_CNT_LEN;
uint8_tPM2_CNT_LEN;
uint8_tPM_TMR_LEN;
uint8_tGPE0_BLK_LEN;
uint8_tGPE1_BLK_LEN;
uint8_tGPE1_BASE;
uint8_tCST_CNT;
uint16_tP_LVL2_LAT;
uint16_tP_LVL3_LAT;
uint16_tFLUSH_SIZE;
uint16_tFLUSH_STRIDE;
uint8_tDUTY_OFFSET;
uint8_tDUTY_WIDTH;
uint8_tDAY_ALRM;
uint8_tMON_ALRM;
uint8_tCENTURY;
uint16_tIAPC_BOOT_ARCH;
uint8_tReserved1;
uint32_tFlags;
struct acpi_2_gasRESET_REG;
uint8_tRESET_VALUE;
uint8_tReserved2[3];
uint64_tX_FIRMWARE_CTRL;
uint64_tX_DSDT;
uint8_tRESET_VALUE;
uint8_tReserved2[3];
uint64_tX_FIRMWARE_CTRL;
uint64_tX_DSDT;
struct acpi_2_gasX_PM1a_EVT_BLK;
struct acpi_2_gasX_PM1b_EVT_BLK;
struct acpi_2_gasX_PM1a_CNT_BLK;
branches/valv/i386/libsaio/cpu.c
137137
138138
139139
140
140
141
142
143
144
145
146
141147
142148
143149
......
211217
212218
213219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
214236
215237
216238
217239
218240
219241
242
243
244
245
246
247
248
249
250
251
220252
221253
222254
223255
224256
225257
226
227258
228259
229260
......
392423
393424
394425
395
396
397
426
398427
399428
400429
p->CPU.ExtModel= bitfield(p->CPU.CPUID[CPUID_1][0], 19, 16);
p->CPU.ExtFamily= bitfield(p->CPU.CPUID[CPUID_1][0], 27, 20);
p->CPU.NoThreads= bitfield(p->CPU.CPUID[CPUID_1][1], 23, 16);
p->CPU.NoCores= bitfield(p->CPU.CPUID[CPUID_4][0], 31, 26) + 1;
if(p->CPU.Vendor == 0x68747541)
{
do_cpuid(0x80000008, p->CPU.CPUID[8]);
p->CPU.NoCores= bitfield(p->CPU.CPUID[8][2], 7, 0) + 1;
}
else
p->CPU.NoCores= bitfield(p->CPU.CPUID[CPUID_4][0], 31, 26) + 1;
p->CPU.Model += (p->CPU.ExtModel << 4);
{
if (p->CPU.Family == 0x06)
{
// valv: to be moved!
/*if(p->CPU.CPUID[CPUID_0][0] >= 11)
{
if((p->CPU.CPUID[0xB][1] != 0) && (bitfield(p->CPU.CPUID[CPUID_1][3], 28, 28)))
}*/
/*int CoreOk = 0;
int ThreadOk = 0;
int lvlType, lvlShift;
do
{
if(p->CPU.CPUID[0xB][1] == 0) break;
lvlType = bitfield(p->CPU.CPUID[0xB][2], 15, 8);
lvlShift = bitfield(p->CPU.CPUID[0xB][0], 4, 0);
switch(lvlType)
}*/
int intelCPU = p->CPU.Model;
int Stepp = p->CPU.Stepping;
int bus;
switch (intelCPU)
{
// valv: hoardcoded to BrandString for now, till the code above is ready!
case 0x2a:// Sandy Bridge, 32nm
if((strstr(p->CPU.BrandString, "i3"))
|| (strstr(p->CPU.BrandString, "i5-2390T"))
|| (strstr(p->CPU.BrandString, "i5-2100S")))
p->CPU.NoCores = 2;
else p->CPU.NoCores = 4;
if(strstr(p->CPU.BrandString, "i7"))
p->CPU.NoThreads = 8;
else p->CPU.NoThreads = 4;
case 0xc:// Core i7 & Atom
if (strstr(p->CPU.BrandString, "Atom")) goto teleport1;
case 0x1a:// Core i7 LGA1366, Xeon 5500, "Bloomfield", "Gainstown", 45nm
case 0x1e:// Core i7, i5 LGA1156, "Clarksfield", "Lynnfield", "Jasper", 45nm
case 0x1f:// Core i7, i5, Nehalem
case 0x25:// Core i7, i5, i3 LGA1156, "Westmere", "Clarkdale", "Arrandale", 32nm
case 0x2a:// Sandy Bridge, 32nm
case 0x2c:// Core i7 LGA1366, Six-core, "Westmere", "Gulftown", 32nm
case 0x2e:// Core i7, Nehalem-Ex Xeon, "Beckton"
case 0x2f:// Core i7, Nehalem-Ex Xeon, "Eagleton"
{
msr32.hi |= (1 << (36 - 32)); // EMTTM
wrmsr(MSR_IA32_MISC_ENABLE, msr32);
}
if(tmfix)
{
msr32 = rdmsr(PIC_SENS_CFG);
msr32.lo |= (1 << 21);
wrmsr(PIC_SENS_CFG, msr32);
branches/valv/i386/libsaio/disk.c
17031703
17041704
17051705
1706
1706
17071707
17081708
17091709
17101710
17111711
17121712
1713
1714
1715
1716
1717
1718
1719
1720
1713
1714
1715
1716
1717
1718
1719
1720
17211721
17221722
17231723
static const struct NamedValue fdiskTypes[] =
{
{ FDISK_NTFS, "Windows NTFS" },
{ FDISK_NTFS, "Windows NTFS" },
{ FDISK_DOS12, "Windows FAT12" },
{ FDISK_DOS16B, "Windows FAT16" },
{ FDISK_DOS16S, "Windows FAT16" },
{ FDISK_DOS16SLBA, "Windows FAT16" },
{ FDISK_SMALLFAT32, "Windows FAT32" },
{ FDISK_FAT32, "Windows FAT32" },
{ FDISK_FREEBSD, "FreeBSD" },
{ FDISK_OPENBSD, "OpenBSD" },
{ FDISK_LINUX, "Linux" },
{ FDISK_UFS, "Apple UFS" },
{ FDISK_HFS, "Apple HFS" },
{ FDISK_BOOTER, "Apple Boot/UFS" },
{ 0xCD, "CD-ROM" },
{ 0x00, 0 } /* must be last */
{ FDISK_FREEBSD, "FreeBSD" },
{ FDISK_OPENBSD, "OpenBSD" },
{ FDISK_LINUX, "Linux" },
{ FDISK_UFS, "Apple UFS" },
{ FDISK_HFS, "Apple HFS" },
{ FDISK_BOOTER, "Apple Boot/UFS" },
{ 0xCD, "CD-ROM" },
{ 0x00, 0 } /* must be last */
};
//==========================================================================
branches/valv/i386/libsaio/nvidia_resolution.c
121121
122122
123123
124
124
125125
126126
127127
......
214214
215215
216216
217
217
218218
saveTables(map->modeTables);
#ifdef AUTORES_DEBUG
getc();
pause();
#endif
return map;
idx++;
}
}
return TRUE;
return true;
}
branches/valv/i386/libsaio/hpet.c
174174
175175
176176
177
178177
179178
180179
printf(" Failed to force enable HPET\n");
}
break;
}
}
}
branches/valv/i386/libsaio/edid.c
1313
1414
1515
16
16
1717
1818
1919
......
3434
3535
3636
37
37
3838
3939
4040
......
5555
5656
5757
58
5958
6059
6160
......
7170
7271
7372
74
73
7574
7675
7776
#include "vbe.h"
#include "bootstruct.h"
#include "graphics.h"
#include "boot.h"
//#include "boot.h"
//static biosBuf_t bb;
free( edidInfo );
} else {
// TODO: check *all* resolutions reported and eithe ruse the highest, or the native resolution (if there is a flag for that)
// TODO: check all reported resolutions and either use highest or native (if there is a flag for that)
xResolution = edidInfo[56] | ((edidInfo[58] & 0xF0) << 4);
yResolution = edidInfo[59] | ((edidInfo[61] & 0xF0) << 4);
}
}
unsigned char* readEDID()
{
SInt16 last_reported = -1;
do
{
// TODO: This currently only retrieves the *last* block, make the block buffer expand as needed / calculated from the first block
// TODO: This currently retrieves the last block only. Expand the block buffer as needed / calculated from first block
bzero( edidInfo, EDID_BLOCK_SIZE);
branches/valv/i386/libsaio/gma_resolution.c
8686
8787
8888
89
89
9090
9191
9292
......
101101
102102
103103
104
104
105105
106106
107107
108108
109109
110110
111
111
112112
113113
114114
115
115
116116
117
117
118118
119119
120120
121
121
122122
123
123
124124
125125
126126
127
127
128128
129129
130130
......
277277
278278
279279
280
280
return 0;
}
PRINT("Mode Table at offset : 0x%x\n", (table->pointer) - map->biosPtr);
PRINT("Mode Table at offset: 0x%x\n", (table->pointer) - map->biosPtr);
/*
* Determine size of mode table
}
table->modeCount = table->size;
PRINT("Mode Table size : %d\n", table->modeCount);
PRINT("Mode Table size: %d\n", table->modeCount);
/*
* Figure out what type of bios we have
* order of detection is important
*/
if (detectBiosType(map, TRUE, sizeof(vbiosModelineType3)))
if (detectBiosType(map, true, sizeof(vbiosModelineType3)))
{
map->bios = BT_3;
map->setMode = intelSetMode_3;
PRINT("Bios Type : BT_3\n");
PRINT("Bios Type: BT_3\n");
}
else if (detectBiosType(map, TRUE, sizeof(vbiosModelineType2)))
else if (detectBiosType(map, true, sizeof(vbiosModelineType2)))
{
map->bios = BT_2;
map->setMode = intelSetMode_2;
PRINT("Bios Type : BT_2\n");
PRINT("Bios Type: BT_2\n");
}
else if (detectBiosType(map, FALSE, sizeof(vbiosResolutionType1)))
else if (detectBiosType(map, false, sizeof(vbiosResolutionType1)))
{
map->bios = BT_1;
map->setMode = intelSetMode_1;
PRINT("Bios Type : BT_1\n");
PRINT("Bios Type: BT_1\n");
}
else
{
*y = res->modelines[0].vActive1 + 1;
return true;
}
}
branches/valv/i386/boot2/graphics.c
429429
430430
431431
432
432433
433
434
434435
435
436
437
436
437
438438
439
440
441
439
440
441
442442
443
443
444
444445
445
446
446447
447
448
449
450
451
452
453
454
455
448
449
450
451
452
453
454
456455
457
458
456
457
458
459459
460
461
462
460
461
463462
464
465
466
467
468
469
470
471
472
463
464
465
466
467
468
473469
474470
475471
......
10421038
10431039
10441040
1045
1046
1041
10471042
10481043
10491044
// Set the mode with default refresh rate.
#ifdef AUTORES_DEBUG
printf("Is about to set mode #%d with resolution %dx%d\n", mode, minfo.XResolution, minfo.YResolution);
sleep(2);
#endif
err = setVBEMode( mode | kLinearFrameBufferBit, NULL );
err = setVBEMode( mode | kLinearFrameBufferBit, NULL );
if ( err != errSuccess )
{
break;
if ( err != errSuccess )
{
#ifdef AUTORES_DEBUG
printf("setVBEMode failed to set mode %d (%dx%d) with error #%d\n",
mode, minfo.XResolution, minfo.YResolution, err);
getc();
printf("setVBEMode failed to set mode %d (%dx%d) with error #%d\n",
mode, minfo.XResolution, minfo.YResolution, err);
sleep(2);
#endif
}
break;
}
// Set 8-bit color palette.
// Set 8-bit color palette.
if ( minfo.BitsPerPixel == 8 )
{
VBEPalette palette;
setupPalette( &palette, appleClut8 );
if ((err = setVBEPalette(palette)) != errSuccess)
{
break;
}
}
if ( minfo.BitsPerPixel == 8 )
{
VBEPalette palette;
setupPalette( &palette, appleClut8 );
if((err = setVBEPalette(palette)) != errSuccess)
break;
}
// Is this required for buggy Video BIOS implementations?
// On which adapter?
// Is this required for buggy Video BIOS implementations? On which adapter?
if ( minfo.BytesPerScanline == 0 )
minfo.BytesPerScanline = ( minfo.XResolution * minfo.BitsPerPixel ) >> 3;
if ( minfo.BytesPerScanline == 0 )
minfo.BytesPerScanline = ( minfo.XResolution *
minfo.BitsPerPixel ) >> 3;
// Update KernBootStruct using info provided by the selected
// VESA mode.
// Update KernBootStruct using info provided by the selected
// VESA mode.
bootArgs->Video.v_display = GRAPHICS_MODE;
bootArgs->Video.v_width = minfo.XResolution;
bootArgs->Video.v_height = minfo.YResolution;
bootArgs->Video.v_depth = minfo.BitsPerPixel;
bootArgs->Video.v_rowBytes = minfo.BytesPerScanline;
bootArgs->Video.v_baseAddr = VBEMakeUInt32(minfo.PhysBasePtr);
bootArgs->Video.v_display = GRAPHICS_MODE;
bootArgs->Video.v_width = minfo.XResolution;
bootArgs->Video.v_height = minfo.YResolution;
bootArgs->Video.v_depth = minfo.BitsPerPixel;
bootArgs->Video.v_rowBytes = minfo.BytesPerScanline;
bootArgs->Video.v_baseAddr = VBEMakeUInt32(minfo.PhysBasePtr);
#if AUTORES_DEBUG
gui.screen.mm= minfo.MemoryModel;
gui.screen.attr= minfo.ModeAttributes;
//==========================================================================
// getNumberArrayFromProperty
int
getNumberArrayFromProperty( const char * propKey,
int getNumberArrayFromProperty( const char * propKey,
unsigned long numbers[],
unsigned long maxArrayCount )
{
branches/valv/i386/boot2/boot.c
8080
8181
8282
83
83
8484
8585
8686
......
186186
187187
188188
189
190
191
192
193
194
189195
196
197
198
199
200
190201
191202
192203
......
327338
328339
329340
330
341
331342
332343
333344
334345
335346
336
337
338347
339348
340
349
341350
342351
343352
344
345
353
346354
347
355
348356
349
357
358
359
360
350361
351362
352363
......
360371
361372
362373
363
374
364375
365376
377
378
379
380
381
382
366383
367
368
369
370
371
384
385
386
372387
373388
374389
......
434449
435450
436451
437
438
439
440
441
452
453
454
455
456
442457
443458
444
459
445460
446
447
461
462
448463
449464
450465
......
476491
477492
478493
479
494
480495
481496
482497
483
484
485
498
499
486500
487
488
489
490
491
492
493
494
495
496
497
498
501
499502
500503
501504
BVRef menuBVR;
BVRef bvChain;
bool useGUI;
boolautoResolution;
//boolautoResolution;
//static void selectBiosDevice(void);
static unsigned long Adler32(unsigned char *buffer, long length);
}
usb_loop();
//Azi:autoresolution - while testing, i didn't got any problems when booting without
// closing Vbios... closing it just in case. (check again later!)
if ((gAutoResolution == true) && map)
{
closeVbios(map);
// gAutoResolution was just set to false on closeVbios();
// we need it to be "true" for drawBootGraphics().
gAutoResolution = true;
}
// If we were in text mode, switch to graphics mode.
// This will draw the boot graphics unless we are in
// verbose mode.
getc();
#endif
useGUI = TRUE;
useGUI = true;
// Override useGUI default
getBoolForKey(kGUIKey, &useGUI, &bootInfo->bootConfig);
// Before initGui, patch the video bios with the correct resolution
UInt32 params[4];
params[3] = 0;
gAutoResolution = TRUE;
gAutoResolution = false;
// Override AutoResolution default
getBoolForKey(kAutoResolutionKey, &gAutoResolution, &bootInfo->bootConfig);
//Open the VBios and store VBios or Tables
map = openVbios(CT_UNKWN);
if (gAutoResolution == TRUE)
if (gAutoResolution == true)
{
//Get Resolution from Graphics Mode key or EDID
params[3] = 0;
//Open the VBios and store VBios or Tables
map = openVbios(CT_UNKWN);
//Get resolution from Graphics Mode key or EDID
int count = getNumberArrayFromProperty(kGraphicsModeKey, params, 4);
if (count < 3)
getResolution(params);
#ifdef AUTORES_DEBUG
printf("Resolution: %dx%d\n",params[0], params[1]);
#endif
//perfom the actual VBIOS patching
//perfom the actual VBIOS patching
if (params[0] != 0 && params[1] != 0)
patchVbios(map, params[0], params[1], params[2], 0, 0);
if (bootArgs->Video.v_display == VGA_TEXT_MODE)
{
gui.screen.width = params[0];
gui.screen.height = params[1];
}
}
if (useGUI) {
/* XXX AsereBLN handle error */
initGUI();
}
if (useGUI && initGUI())
useGUI = false;
setBootGlobals(bvChain);
/*
* AutoResolution - Reapply the patch or cancel if Graphics Mode was incorrect
* or EDID Info was insane
*/
getBoolForKey(kAutoResolutionKey, &gAutoResolution, &bootInfo->bootConfig);
//Restore the vbios for Cancelation
if ((gAutoResolution == FALSE) && map)
*/
getBoolForKey(kAutoResolutionKey, &gAutoResolution, &bootInfo->bootConfig);
// Restore and close the vbios for cancelation
if ((gAutoResolution == false) && map)
{
restoreVbios(map);
closeVbios(map);
closeVbios(map);
}
if ((gAutoResolution == TRUE) && map)
if ((gAutoResolution == true) && map)
{
// If mode has been switched during boot menu
// use the new resolution
closeVbios(map);
}
// Find out which mac os version we're booting.
getOSVersion(gMacOSVersion);
if (platformCPUFeature(CPU_FEATURE_EM64T)) {
archCpuType = CPU_TYPE_X86_64;
} else {
if(((getValueForKey(karch, &val, &len, &bootInfo->bootConfig)) && (strncmp(val, "i386", 4) == 0))
|| (!platformCPUFeature(CPU_FEATURE_EM64T)))
archCpuType = CPU_TYPE_I386;
}
if (getValueForKey(karch, &val, &len, &bootInfo->bootConfig)) {
if (strncmp(val, "i386", 4) == 0) {
archCpuType = CPU_TYPE_I386;
}
}
if (getValueForKey(k32BitModeFlag, &val, &len, &bootInfo->bootConfig)) {
archCpuType = CPU_TYPE_I386;
}
if (getValueForKey(k64BitModeFlag, &val, &len, &bootInfo->bootConfig)) {
archCpuType = CPU_TYPE_X86_64;
}
else archCpuType = CPU_TYPE_X86_64;
if (!getBoolForKey (kWake, &tryresume, &bootInfo->bootConfig)) {
tryresume = true;
branches/valv/i386/boot2/boot.h
3131
3232
3333
34
34
3535
3636
3737
......
142142
143143
144144
145
146
147
148
149
145
146
147
148
149
150150
151
152
153
154
155
156
157
151
152
153
154
155
156
157
158158
159159
160
161
162
160
161
162
163
163164
164165
165166
......
169170
170171
171172
172
173
174173
175174
176175
#include "libsaio.h"
#include "autoresolution.h"
#if DEBUG
#ifndef AUTORES_DEBUG
#define AUTORES_DEBUG
#define kEnableC4State"EnableC4State"/* acpi_patcher.c */
/* valv: added these keys */
#define kFixFSB"FixFSB"/* cpu.c */
#define kbusratio"busratio"/* cpu.c */
#define kForceFSB"ForceFSB"/* cpu.c */
#define kC2EEnable"C2E"/* cpu.c */
#define kC4EEnable"C4E"/* cpu.c */
#define kFixFSB"FixFSB"/* cpu.c */
#define kbusratio"busratio"/* cpu.c */
#define kForceFSB"ForceFSB"/* cpu.c */
#define kC2EEnable"C2E"/* cpu.c */
#define kC4EEnable"C4E"/* cpu.c */
#define kHardC4EEnable"HC4E"/* cpu.c */
#define kFixTM"FixTM"/* cpu.c */
#define kdcfg0"display_0"/* nvidia.c */
#define kdcfg1"display_1"/* nvidia.c */
#define kpstates"PStates"/* acpi_patcher.c */
#define kEnableC6State"EnableC6State"/* acpi_patcher.c */
#define kmaxVoltage"maxVolt"/* acpi_patcher.c */
#define kminVoltage"minVolt"/* acpi_patcher.c */
#define kFixTM"FixTM"/* cpu.c */
#define kdcfg0"display_0"/* nvidia.c */
#define kdcfg1"display_1"/* nvidia.c */
#define kpstates"PStates"/* acpi_patcher.c */
#define kEnableC6State"EnableC6State"/* acpi_patcher.c */
#define kmaxVoltage"maxVolt"/* acpi_patcher.c */
#define kminVoltage"minVolt"/* acpi_patcher.c */
#define kmoreVoltage"moreVolt"/* acpi_patcher.c */
#define klessVoltage"lessVolt"/* acpi_patcher.c */
#define kTjmax"Tjmax"/* acpi_patcher.c */
#define kpstart"PStart"/* acpi_patcher.c */
#define kGenerateTStates"GenerateTStates"/* apci_patcher.c */
#define kTjmax"Tjmax"/* acpi_patcher.c */
#define kpstart"PStart"/* acpi_patcher.c */
#define kGenerateTStates"GenerateTStates"/* apci_patcher.c */
#define kPatchKrn"PatchKernel"/* drivers.c */
/*
* Flags to the booter or kernel
#define kIgnoreCachesFlag"-f"
#define kIgnoreBootFileFlag"-F"
#define kSingleUserModeFlag"-s"
#define k32BitModeFlag"-x32"
#define k64BitModeFlag"-x64"
/*
* Booter behavior control
branches/valv/i386/boot2/drivers.c
816816
817817
818818
819
819
820
821
820822
821823
822824
ret = ThinFatFile(&binary, &len);
}
patch_kernel(binary);
bool patchkrn = false;
getBoolForKey(kPatchKrn, &patchkrn, &bootInfo->bootConfig);
if(patchkrn) patch_kernel(binary);
ret = DecodeMachO(binary, rentry, raddr, rsize);
branches/valv/i386/boot2/gui.c
718718
719719
720720
721
721
722722
723
723724
725
724726
725727
726
727728
728729
729
730
731
730
731
732
732733
733734
734735
735
736
736737
737738
738739
739740
740
741
741742
742743
743744
......
896897
897898
898899
899
900
900901
901902
902
903
904
905
906
907
908
909
910
911
912
903
904
905
906
907
908
909
910
911
913912
914913
915914
916915
917916
918917
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
935934
936935
937936
......
962961
963962
964963
965
966964
967
965
968966
969967
970968
971969
972970
973
974971
975
972
976973
977974
978975
979976
980977
981978
982
983979
984980
985981
......
18891885
18901886
18911887
1892
1888
18931889
18941890
18951891
1892
1893
18961894
1897
18981895
18991896
19001897
19011898
19021899
1903
1900
19041901
19051902
19061903
19071904
1908
1905
19091906
19101907
19111908
19121909
19131910
1914
1911
19151912
19161913
19171914
/*
* AutoResolution
*/
if (gAutoResolution == TRUE) //Get Resolution from Graphics Mode key
if (gAutoResolution == true)
{
//Get Resolution from Graphics Mode key
count = getNumberArrayFromProperty(kGraphicsModeKey, screen_params, 4);
//If no Graphics Mode key, get it from EDID
if ( count < 3 )
{
//If no Graphics Mode key, get it from EDID
getResolution(screen_params);
PRINT("Resolution : %dx%d (EDID)\n",screen_params[0], screen_params[1]);
} else
PRINT("Resolution : %dx%d (Graphics Mode key)\n",screen_params[0], screen_params[1]);
}
}
else PRINT("Resolution : %dx%d (Graphics Mode key)\n",screen_params[0], screen_params[1]);
}
else
{
// parse screen size parameters
if(getIntForKey("screen_width", &val, &bootInfo->themeConfig))
if(getIntForKey("screen_width", &val, &bootInfo->themeConfig) && val > 0)
screen_params[0] = val;
else
screen_params[0] = DEFAULT_SCREEN_WIDTH;
if(getIntForKey("screen_height", &val, &bootInfo->themeConfig))
if(getIntForKey("screen_height", &val, &bootInfo->themeConfig) && val > 0)
screen_params[1] = val;
else
screen_params[1] = DEFAULT_SCREEN_HEIGHT;
{
BVRef param = menuItems[start + i].param;
bool isSelected = ((start + i) == selection) ? true : false;
bool isSelected = ((start + i) == selection) ? true : false;
if (isSelected)
{
if (param->flags & kBVFlagNativeBoot)
{
infoMenuNativeBoot = true;
}
else
{
infoMenuNativeBoot = false;
if(infoMenuSelection >= INFOMENU_NATIVEBOOT_START && infoMenuSelection <= INFOMENU_NATIVEBOOT_END)
infoMenuSelection = 0;
}
if (param->flags & kBVFlagNativeBoot)
infoMenuNativeBoot = true;
else
{
infoMenuNativeBoot = false;
if(infoMenuSelection >= INFOMENU_NATIVEBOOT_START && infoMenuSelection <= INFOMENU_NATIVEBOOT_END)
infoMenuSelection = 0;
}
if(gui.menu.draw)
drawInfoMenuItems();
#ifdef AUTORES_DEBUG
#define DEBUG
#endif
#ifdef DEBUG
gui.debug.cursor = pos( 10, 100);
dprintf( &gui.screen, "label %s\n", param->label );
dprintf( &gui.screen, "biosdev 0x%x\n", param->biosdev );
dprintf( &gui.screen, "type 0x%x\n", param->type );
dprintf( &gui.screen, "flags 0x%x\n", param->flags );
dprintf( &gui.screen, "part_no %d\n", param->part_no );
dprintf( &gui.screen, "part_boff 0x%x\n", param->part_boff );
dprintf( &gui.screen, "part_type 0x%x\n", param->part_type );
dprintf( &gui.screen, "bps 0x%x\n", param->bps );
dprintf( &gui.screen, "name %s\n", param->name );
dprintf( &gui.screen, "type_name %s\n", param->type_name );
dprintf( &gui.screen, "modtime %d\n", param->modTime );
dprintf( &gui.screen, "width %d\n", gui.screen.width);
dprintf( &gui.screen, "height %d\n", gui.screen.height);
dprintf( &gui.screen, "attr: 0x%x\n", gui.screen.attr);
dprintf( &gui.screen, "mm: %d\n", gui.screen.mm);
gui.debug.cursor = pos( 10, 100);
dprintf( &gui.screen, "label %s\n", param->label );
dprintf( &gui.screen, "biosdev 0x%x\n", param->biosdev );
dprintf( &gui.screen, "type 0x%x\n", param->type );
dprintf( &gui.screen, "flags 0x%x\n", param->flags );
dprintf( &gui.screen, "part_no %d\n", param->part_no );
dprintf( &gui.screen, "part_boff 0x%x\n", param->part_boff );
dprintf( &gui.screen, "part_type 0x%x\n", param->part_type );
dprintf( &gui.screen, "bps 0x%x\n", param->bps );
dprintf( &gui.screen, "name %s\n", param->name );
dprintf( &gui.screen, "type_name %s\n", param->type_name );
dprintf( &gui.screen, "modtime %d\n", param->modTime );
dprintf( &gui.screen, "width %d\n", gui.screen.width);
dprintf( &gui.screen, "height %d\n", gui.screen.height);
dprintf( &gui.screen, "attr: 0x%x\n", gui.screen.attr);
dprintf( &gui.screen, "mm: %d\n", gui.screen.mm);
#endif
#ifdef AUTORES_DEBUG
gui.redraw = true;
updateVRAM();
}
void clearGraphicBootPrompt()
{
// clear text buffer
prompt[0] = '\0';
prompt_pos=0;
if(gui.bootprompt.draw == true )
if(gui.bootprompt.draw == true)
{
gui.bootprompt.draw = false;
gui.redraw = true;
// this causes extra frames to be drawn
//updateVRAM();
}
return;
}
/*
* AutoResolution
*/
if (gAutoResolution == TRUE)
if (gAutoResolution == true)
{
//Get Resolution from Graphics Mode key
count = getNumberArrayFromProperty(kGraphicsModeKey, screen_params, 4);
//If no Graphics Mode key, get resolution from EDID
if ( count < 3 )
//If no Graphics Mode key, get resolution from EDID
getResolution(screen_params);
}
else
{
// parse screen size parameters
if(getIntForKey("boot_width", &pos, &bootInfo->themeConfig))
if(getIntForKey("boot_width", &pos, &bootInfo->themeConfig) && pos > 0)
screen_params[0] = pos;
else
screen_params[0] = DEFAULT_SCREEN_WIDTH;
if(getIntForKey("boot_height", &pos, &bootInfo->themeConfig))
if(getIntForKey("boot_height", &pos, &bootInfo->themeConfig) && pos > 0)
screen_params[1] = pos;
else
screen_params[1] = DEFAULT_SCREEN_HEIGHT;
}
// Save current screen resolution.
// Save current screen resolution.
oldScreenWidth = gui.screen.width;
oldScreenHeight = gui.screen.height;
branches/valv/i386/boot2/kernel_patcher.c
9090
9191
9292
93
94
95
96
97
98
99
100
93
94
95
96
97
98
99
100
101
102
101103
102104
103105
104
106
107
108
105109
106
110
107111
108112
109113
switch(Platform.CPU.Model)
{
// Known good CPU's, no reason to patch kernel
case 13:
case CPUID_MODEL_YONAH:
case CPUID_MODEL_MEROM:
case CPUID_MODEL_PENRYN:
case CPUID_MODEL_NEHALEM:
case CPUID_MODEL_FIELDS:
case CPUID_MODEL_DALES:
case CPUID_MODEL_NEHALEM_EX:
case 0x0C:
if (strstr(Platform.CPU.BrandString, "Atom")) goto atom;
case 0x0D:
case 0x0E:
case 0x0F:
case 0x17:
case 0x1A:
case 0x1E:
case 0x1F:
case 0x2E:
break;
// Known unsuported CPU's
case CPUID_MODEL_ATOM:
case 0x1C:
case 0x27:
atom:
// TODO: Impersonate CPU based on user selection
patch_cpuid_set_info(kernelData, CPUFAMILY_INTEL_PENRYN, CPUID_MODEL_PENRYN);// Impersonate Penryn CPU
patch_cpuid_set_info(kernelData, CPUFAMILY_INTEL_PENRYN, 0x17);// Impersonate Penryn CPU
break;
// Unknown CPU's
branches/valv/i386/boot2/gui.h
9898
9999
100100
101
102
103
104
105
106
107
108
101
102
103
104
105
106
107
108
109109
110110
111111
uint32_tfont_console_color;// Color for consle font AARRGGBB
booldraw;// Draw flag
//resolution specifics
uint16_thtotal;
uint16_tvtotal;
uint16_thsyncstart;
uint16_thsyncend;
uint16_tvsyncstart;
uint16_tvsyncend;
uint8_tmm;
uint16_tattr;
uint16_thtotal;
uint16_tvtotal;
uint16_thsyncstart;
uint16_thsyncend;
uint16_tvsyncstart;
uint16_tvsyncend;
uint8_tmm;
uint16_tattr;
} window_t;
/*
branches/valv/i386/boot2/kernel_patcher.h
99
1010
1111
12
13
14
15
16
17
18
19
20
21
22
2312
2413
2514
#ifndef __BOOT2_KERNEL_PATCHER_H
#define __BOOT2_KERNEL_PATCHER_H
#define CPUID_MODEL_YONAH14
#define CPUID_MODEL_MEROM15
#define CPUID_MODEL_PENRYN23
#define CPUID_MODEL_NEHALEM26
#define CPUID_MODEL_ATOM28
#define CPUID_MODEL_FIELDS30/* Lynnfield, Clarksfield, Jasper */
#define CPUID_MODEL_DALES31/* Havendale, Auburndale */
#define CPUID_MODEL_NEHALEM_EX46
void patch_kernel(void* kernelData);
#define KERNEL_641
branches/valv/i386/boot2/options.c
736736
737737
738738
739
740
739
740
741
741742
742743
743744
......
745746
746747
747748
748
749
749750
750
751
751752
752753
753754
......
776777
777778
778779
779
780
780781
781782
782783
......
784785
785786
786787
787
788
788789
789790
790791
......
10091010
10101011
10111012
1012
1013
10131014
1014
1015
1016
1017
1018
1015
1016
1017
1018
1019
1020
1021
1022
1023
10191024
1020
1021
1022
1025
1026
1027
1028
1029
1030
1031
1032
1033
10231034
1024
1025
1026
1027
1028
1029
1030
1031
1032
1035
1036
1037
10331038
1039
10341040
1035
1036
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
10371065
1038
1066
10391067
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1068
1069
1070
1071
1072
10661073
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1074
1075
10921076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
10931093
1094
1095
10961094
1095
1096
1097
10971098
10981099
10991100
......
11181119
11191120
11201121
1121
1122
1122
1123
1124
11231125
1124
1125
1126
1127
11261128
1127
1128
1129
1129
1130
1131
11301132
1131
1132
1133
1134
11331135
1134
1135
1136
1137
11361138
1137
1138
1139
1140
1141
1139
1140
1141
1142
1143
1144
11421145
1143
1144
1145
1146
1147
1148
11461149
11471150
11481151
......
11501153
11511154
11521155
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
11651170
11661171
11671172
// 18seven's Quick-args macro
bool f8 = false, altf = false, shiftf = false, alts = false,
altv = false, x32 = false, x64 = false, altx = false;
while (readKeyboardStatus()) {
altv = false, altx = false; // x32 = false, x64 = false;
while (readKeyboardStatus())
{
key = bgetc ();
if (key == 0x4200) f8 = true;
if (key == 0x2100) altf = true;
if (key == 0x1F00) alts = true;
if (key == 0x2F00) altv = true;
if (key == 0x2D00) altx = true;
if (key == 0x0004) x32 = true;
/*if (key == 0x0004) x32 = true;
if (key == 0x0007) x64 = true;
}
*/}
// If user typed F8, abort quiet mode, and display the menu.
if (f8) {
if ((gBootMode & kBootModeQuiet) && firstRun && altx) {
addBootArg(kSafeModeFlag);
}
/*
if ((gBootMode & kBootModeQuiet) && firstRun && x32) {
addBootArg(k32BitModeFlag);
}
if ((gBootMode & kBootModeQuiet) && firstRun && x64) {
addBootArg(k64BitModeFlag);
}
*/
if (bootArgs->Video.v_display == VGA_TEXT_MODE) {
setCursorPosition(0, 0, 0);
clearScreenRows(0, kScreenLastRow);
case kEscapeKey:
clearBootArgs();
break;
case kF2Key:
/*
* AutoResolution - Reapply the patch if Graphics Mode was incorrect
* or EDID Info was insane
*/
/*
* AutoResolution - Reapply the patch if Graphics Mode was incorrect or EDID Info was insane
*/
if ((gAutoResolution == TRUE) && map)
{
// get the new Graphics Mode key
processBootOptions();
//get the new Graphics Mode key
processBootOptions();
if ((gAutoResolution == TRUE) && map)
UInt32 params[4];
params[3] = 0;
//Has the target Resolution Changed ?
int count = getNumberArrayFromProperty(kGraphicsModeKey, params, 4);
if ( count < 3 )
getResolution(params);
if ((params[0] != 0) && (params[1] != 0)
&& (params[0] != map->currentX) && (params[1] != map->currentY))
{
UInt32 params[4];
params[3] = 0;
//Has the target Resolution Changed ?
int count = getNumberArrayFromProperty(kGraphicsModeKey, params, 4);
if ( count < 3 )
getResolution(params);
if ((params[0] != 0) && (params[1] != 0)
&&(params[0] != map->currentX) && (params[1] != map->currentY))
//Go back to TEXT mode while we change the mode
if (bootArgs->Video.v_display == GRAPHICS_MODE)
{
CursorState cursorState;
//Go back to TEXT mode while we change the mode
if (bootArgs->Video.v_display == GRAPHICS_MODE)
setVideoMode(VGA_TEXT_MODE, 0);
setCursorPosition(0, 0, 0);
clearScreenRows(0, kScreenLastRow);
changeCursor( 0, 0, kCursorTypeHidden, &cursorState );
//Reapply patch in case resolution have changed
patchVbios(map, params[0], params[1], params[2], 0, 0);
if (useGUI && (gui.initialised == true))
initGUI();
// Make sure all values are set
if (bootArgs->Video.v_display != GRAPHICS_MODE)
bootArgs->Video.v_display = GRAPHICS_MODE;
if (!useGUI)
useGUI = true;
// redraw the background buffer
drawBackground();
gui.devicelist.draw = true;
gui.redraw = true;
if (!(gBootMode & kBootModeQuiet))
{
CursorState cursorState;
bool showBootBanner = true;
setVideoMode(VGA_TEXT_MODE, 0);
setCursorPosition(0, 0, 0);
clearScreenRows(0, kScreenLastRow);
changeCursor( 0, 0, kCursorTypeHidden, &cursorState );
//Reapply patch in case resolution have changed
patchVbios(map, params[0], params[1], params[2], 0, 0);
if (useGUI && (gui.initialised == true))
initGUI();
// Make sure all values are set
if (bootArgs->Video.v_display != GRAPHICS_MODE)
bootArgs->Video.v_display = GRAPHICS_MODE;
if (!useGUI)
useGUI = true;
// redraw the background buffer
drawBackground();
gui.devicelist.draw = true;
gui.redraw = true;
if (!(gBootMode & kBootModeQuiet))
{
bool showBootBanner = true;
// Check config file.
getBoolForKey(kBootBannerKey, &showBootBanner, &bootInfo->bootConfig);
if (showBootBanner)
// Display banner and show hardware info.
gprintf(&gui.screen, bootBanner + 1, (bootInfo->convmem + bootInfo->extmem) / 1024);
// Check if "Boot Banner"=N switch is present in config file.
getBoolForKey(kBootBannerKey, &showBootBanner, &bootInfo->bootConfig);
if (showBootBanner)
// Display banner and show hardware info.
gprintf(&gui.screen, bootBanner + 1, (bootInfo->convmem + bootInfo->extmem) / 1024);
// redraw background
memcpy(gui.backbuffer->pixels, gui.screen.pixmap->pixels, gui.backbuffer->width * gui.backbuffer->height * 4);
}
nextRow = kMenuTopRow;
showPrompt = true;
if (gDeviceCount)
{
showMenu( menuItems, gDeviceCount, selectIndex, kMenuTopRow + 2, kMenuMaxItems );
nextRow += min( gDeviceCount, kMenuMaxItems ) + 3;
}
// Show the boot prompt.
showPrompt = (gDeviceCount == 0) || (menuBVR->flags & kBVFlagNativeBoot);
showBootPrompt( nextRow, showPrompt );
//this is used to avoid resetting the incorrect mode while quiting the boot menu
map->hasSwitched = true;
// redraw background
memcpy(gui.backbuffer->pixels, gui.screen.pixmap->pixels, gui.backbuffer->width * gui.backbuffer->height * 4);
}
nextRow = kMenuTopRow;
showPrompt = true;
if (gDeviceCount)
{
showMenu( menuItems, gDeviceCount, selectIndex, kMenuTopRow + 2, kMenuMaxItems );
nextRow += min( gDeviceCount, kMenuMaxItems ) + 3;
}
// Show the boot prompt.
showPrompt = (gDeviceCount == 0) || (menuBVR->flags & kBVFlagNativeBoot);
showBootPrompt( nextRow, showPrompt );
//this is used to avoid resetting the incorrect mode while quiting the boot menu
map->hasSwitched = true;
}
clearBootArgs();
key = 0;
}
clearBootArgs();
key = 0;
}
break;
case kF5Key:
// New behavior:
// Switch between text & graphic interfaces
// Only Permitted if started in graphics interface
if (useGUI) {
setVideoMode(VGA_TEXT_MODE, 0);
if (useGUI)
{
setVideoMode(VGA_TEXT_MODE, 0);
setCursorPosition(0, 0, 0);
clearScreenRows(0, kScreenLastRow);
setCursorPosition(0, 0, 0);
clearScreenRows(0, kScreenLastRow);
// Display banner and show hardware info.
printf(bootBanner, (bootInfo->convmem + bootInfo->extmem) / 1024);
printf(getVBEInfoString());
// Display banner and show hardware info.
printf(bootBanner, (bootInfo->convmem + bootInfo->extmem) / 1024);
printf(getVBEInfoString());
clearScreenRows(kMenuTopRow, kMenuTopRow + 2);
changeCursor(0, kMenuTopRow, kCursorTypeHidden, 0);
clearScreenRows(kMenuTopRow, kMenuTopRow + 2);
changeCursor(0, kMenuTopRow, kCursorTypeHidden, 0);
nextRow = kMenuTopRow;
showPrompt = true;
nextRow = kMenuTopRow;
showPrompt = true;
if (gDeviceCount) {
printf("Use \30\31 keys to select the startup volume.");
showMenu(menuItems, gDeviceCount, selectIndex, kMenuTopRow + 2, kMenuMaxItems);
nextRow += min(gDeviceCount, kMenuMaxItems) + 3;
}
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 );
showPrompt = (gDeviceCount == 0) || (menuBVR->flags & kBVFlagNativeBoot);
showBootPrompt(nextRow, showPrompt);
//changeCursor( 0, kMenuTopRow, kCursorTypeUnderline, 0 );
/*
* AutoResolution - make sure all values are set
bootArgs->Video.v_display = VGA_TEXT_MODE;
useGUI = false;
} else {
gui.redraw = true;
setVideoMode(GRAPHICS_MODE, 0);
/*
* AutoResolution - make sure all values are set
*/
bootArgs->Video.v_display = GRAPHICS_MODE;
useGUI = true;
updateVRAM();
}
}
else
{
gui.redraw = true;
setVideoMode(GRAPHICS_MODE, 0);
/*
* AutoResolution - make sure all values are set
*/
bootArgs->Video.v_display = GRAPHICS_MODE;
useGUI = true;
updateVRAM();
}
key = 0;
break;
branches/valv/revision
1
1
665:706
665:707

Archive Download the corresponding diff file

Revision: 709