Chameleon

Chameleon Commit Details

Date:2011-06-24 02:29:43 (12 years 9 months ago)
Author:Azimutz
Commit:1040
Parents: 1039
Message:Sync with trunk (r1038). Add to ati.c the dev id's from issues #88 --> 91.
Changes:
M/branches/azimutz/trunkGraphicsEnablerModules/i386/boot2/boot.c
M/branches/azimutz/trunkGraphicsEnablerModules/i386/libsa/libsa.h
M/branches/azimutz/trunkGraphicsEnablerModules/i386/modules/GraphicsEnabler/AMDGraphicsEnabler/ati.c
M/branches/azimutz/trunkGraphicsEnablerModules/i386/boot2/modules.c
M/branches/azimutz/trunkGraphicsEnablerModules/CHANGES
M/branches/azimutz/trunkGraphicsEnablerModules/i386/modules/HelloWorld/HelloWorld.cpp
M/branches/azimutz/trunkGraphicsEnablerModules/i386/modules/GraphicsEnabler/NVIDIAGraphicsEnabler/nvidia.c
M/branches/azimutz/trunkGraphicsEnablerModules/i386/libsa/string.c
M/branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/load.c
M/branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/biosfn.c
M/branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/acpi_patcher.c
M/branches/azimutz/trunkGraphicsEnablerModules/package/smbios.plist
M/branches/azimutz/trunkGraphicsEnablerModules/i386/util/fdisk/misc.c
M/branches/azimutz/trunkGraphicsEnablerModules/i386/boot2/gui.c
M/branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/cpu.c
M/branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/disk.c
M/branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/saio_internal.h
M/branches/azimutz/trunkGraphicsEnablerModules/i386/boot2/gui.h
M/branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/cpu.h
M/branches/azimutz/trunkGraphicsEnablerModules/i386/boot2/ramdisk.c
M/branches/azimutz/trunkGraphicsEnablerModules/i386/boot2/options.c
M/branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/xml.c
M/branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/hpet.c
M/branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/console.c
M/branches/azimutz/trunkGraphicsEnablerModules/i386/boot2/resume.c
M/branches/azimutz/trunkGraphicsEnablerModules

File differences

branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/xml.c
355355
356356
357357
358
358
359359
360360
361361
......
380380
381381
382382
383
383
384384
385385
386386
......
423423
424424
425425
426
426
427427
428428
429429
......
448448
449449
450450
451
451
452452
453453
454454
......
669669
670670
671671
672
672
673673
674674
675675
......
710710
711711
712712
713
713
714714
715715
716716
......
731731
732732
733733
734
734
735735
736736
737737
......
771771
772772
773773
774
774
775775
776776
777777
......
803803
804804
805805
806
806
807807
808808
809809
else
{
printf("ParseStringID error (0x%x)\n", *val);
getc(); //Azi: getchar();
getchar();
return -1;
}
}
else
{
printf("ParseStringIDREF error (0x%x)\n", *val);
getc(); //Azi: getchar();
getchar();
return -1;
}
}
else
{
printf("ParseIntegerID error (0x%x)\n", *val);
getc(); //Azi: getchar();
getchar();
return -1;
}
}
else
{
printf("ParseStringIDREF error (0x%x)\n", *val);
getc(); //Azi: getchar();
getchar();
return -1;
}
}
if(buffer[0] == '<')
{
printf("Warning integer is non existant\n");
getc(); //Azi: getchar();
getchar();
tmpTag = NewTag();
tmpTag->type = kTagTypeInteger;
tmpTag->string = 0;
else
{
printf("ParseTagInteger hex error (0x%x) in buffer %s\n", *val, buffer);
getc(); //Azi: getchar();
getchar();
return -1;
}
}
if (*val < '0' || *val > '9')
{
printf("ParseTagInteger decimal error (0x%x) in buffer %s\n", *val, buffer);
getc(); //Azi: getchar();
getchar();
return -1;
}
//printf("ParseTagData unimplimented\n");
//printf("Data: %s\n", buffer);
//getc(); //Azi: getchar();
//getchar();
// TODO: base64 decode
if (tmpTag == 0) return -1;
printf("ParseTagDate unimplimented\n");
getc(); //Azi: getchar();
getchar();
tmpTag->type = kTagTypeDate;
tmpTag->string = 0;
branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/console.c
158158
159159
160160
161
161
162162
163163
164164
165
165
166166
167
167
168168
169169
170170
......
263263
264264
265265
266
267
266
267
268268
// Read and echo a character from console. This doesn't echo backspace
// since that screws up higher level handling
int getchar() //Azi: study!!!
int getchar()
{
register int c = getc();
if ( c == '\r' ) c = '\n'; //Azi: CR/LF ??
//if ( c == '\r' ) c = '\n';
if ( c >= ' ' && c < 0x7f) putchar(c); //Azi: check gui.h - kReturnKey, etc...
//if ( c >= ' ' && c < 0x7f) putchar(c);
return (c);
}
void pause()
{
printf("Press a key to continue...\n");
getc(); //getchar(); //Azi: getc works here because the function is up above.
// replace get/getchar by pause() ??
getchar(); //getc(); //Azi: getc works here because the function is up above; changed for now.
// replace getchar() by pause() ??
}
branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/acpi_patcher.c
10581058
10591059
10601060
1061
1061
10621062
10631063
10641064
}
#if DEBUG_ACPI
printf("Press a key to continue... (DEBUG_ACPI)\n");
getc(); //Azi: getchar();
getchar();
#endif
return 1;
}
branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/load.c
135135
136136
137137
138
138
139139
140140
141141
......
219219
220220
221221
222
222
223223
224224
225225
......
239239
240240
241241
242
242
243243
244244
245245
......
317317
318318
319319
320
320
321321
322322
323323
printf("ncmds: %x\n", (unsigned)mH->ncmds);
printf("sizeofcmds: %x\n", (unsigned)mH->sizeofcmds);
printf("flags: %x\n", (unsigned)mH->flags);
getc(); //Azi: getchar();;
getchar();
#endif
ncmds = mH->ncmds;
printf("segname: %s, vmaddr: %x, vmsize: %x, fileoff: %x, filesize: %x, nsects: %d, flags: %x.\n",
segCmd->segname, (unsigned)vmaddr, (unsigned)vmsize, (unsigned)fileaddr, (unsigned)filesize,
(unsigned) segCmd->nsects, (unsigned)segCmd->flags);
getc(); //Azi: getchar();
getchar();
#endif
}
else
printf("segname: %s, vmaddr: %x, vmsize: %x, fileoff: %x, filesize: %x, nsects: %d, flags: %x.\n",
segCmd->segname, (unsigned)vmaddr, (unsigned)vmsize, (unsigned)fileaddr, (unsigned)filesize,
(unsigned) segCmd->nsects, (unsigned)segCmd->flags);
getc(); //Azi: getchar();
getchar();
#endif
}
#if DEBUG
printf("symoff: %x, nsyms: %x, stroff: %x, strsize: %x\n",
symTab->symoff, symTab->nsyms, symTab->stroff, symTab->strsize);
getc(); //Azi: getchar();
getchar();
#endif
symsSize = symTab->stroff - symTab->symoff;
branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/cpu.c
286286
287287
288288
289
289
290290
291291
292292
/*if(bus_ratio_max > 0) bus_ratio = flex_ratio;*/
p->CPU.MaxRatio = max_ratio;
p->CPU.MinRatio = min_ratio;
myfsb = fsbFrequency / 1000000;
verbose("Sticking with [BCLK: %dMhz, Bus-Ratio: %d]\n", myfsb, max_ratio);
currcoef = bus_ratio_max;
branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/disk.c
16361636
16371637
16381638
1639
1639
16401640
16411641
16421642
printf(" bvr: %d, dev: %d, part: %d, flags: %d, vis: %d\n", bvr, bvr->biosdev, bvr->part_no, bvr->flags, bvr->visible);
}
printf("count: %d\n", bvCount);
getc(); //Azi: getchar();
getchar();
#endif
*count = bvCount;
branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/cpu.h
66
77
88
9
9
1010
1111
1212
#ifndef __LIBSAIO_CPU_H
#define __LIBSAIO_CPU_H
#include "libsaio.h"
//#include "libsaio.h"
extern void scan_cpu(PlatformInfo_t *);
branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/hpet.c
9898
9999
100100
101
101
102102
103103
#if DEBUG_HPET
printf("Press [Enter] to continue...\n");
getc(); //Azi: getchar();
getchar();
#endif
}
branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/biosfn.c
185185
186186
187187
188
188
189189
190190
191191
......
252252
253253
254254
255
255
256256
257257
258
258
259259
260260
261261
......
509509
510510
511511
512
513
512
514513
515514
516515
......
676675
677676
678677
679
680678
681679
682680
// Some BIOSes will simply ignore the value of ECX on entry.
// Probably best to keep its value at 20 to avoid surprises.
//printf("Get memory map 0x%x, %d\n", rangeArray); getc(); //Azi: getchar();
//printf("Get memory map 0x%x, %d\n", rangeArray); getchar();
if (maxRangeCount > (BIOS_LEN / sizeof(MemoryRange))) {
maxRangeCount = (BIOS_LEN / sizeof(MemoryRange));
}
#if DEBUG
{
int i;
printf("%d total ranges\n", count); getc(); //Azi: getchar();
printf("%d total ranges\n", count); getchar();
for (i=0, range = rangeArray; i<count; i++, range++) {
printf("range: type %d, base 0x%x, length 0x%x\n",
range->type, (unsigned int)range->base, (unsigned int)range->length); getc(); //Azi: getchar();
range->type, (unsigned int)range->base, (unsigned int)range->length); getchar();
}
}
#endif
printf("media_type: %x\n", pkt.media_type);
printf("drive_num: %x\n", pkt.drive_num);
printf("device_spec: %x\n", pkt.device_spec);
//printf("press a key->\n"); getc(); //Azi: getchar();
pause();
printf("press a key->\n"); getchar();
#endif
/* Some BIOSes erroneously return cf = 1 */
print_drive_info(di);
printf("uses_ebios = 0x%x\n", dp->uses_ebios);
printf("result %d\n", ret);
//printf("press a key->\n"); getc(); //Azi: getchar();
pause();
#endif
branches/azimutz/trunkGraphicsEnablerModules/i386/libsaio/saio_internal.h
4949
5050
5151
52
53
5452
5553
5654
......
9088
9189
9290
91
9392
9493
9594
96
9795
9896
9997
10098
99
100
101101
102102
103103
extern int ebiosEjectMedia(int biosdev);
extern void bios_putchar(int ch);
extern void putca(int ch, int attr, int repeat);
extern int getc(void); //Azi: getchar();
extern void pause(); //Azi: replace getc/getchar with ? console.c - btw, what is it doing here ?? there's a console.c section below...
extern int readKeyboardStatus(void);
extern int readKeyboardShiftFlags(void);
extern unsigned int time18(void);
extern bool gVerboseMode;
extern bool gErrors;
extern void initBooterLog(void);
extern void msglog(const char * format, ...);
extern void setupBooterLog(void);
extern int putchar(int ch);
extern int getchar(void);
extern void msglog(const char * format, ...);
extern int printf(const char *format, ...);
extern int error(const char *format, ...);
extern int verbose(const char *format, ...);
extern void stop(const char *format, ...);
//Azi: replace getc/getchar with ? console.c
extern void pause();
/* disk.c */
extern void rescanBIOSDevice(int biosdev);
branches/azimutz/trunkGraphicsEnablerModules/i386/boot2/resume.c
119119
120120
121121
122
122
123123
124124
125125
......
143143
144144
145145
146
146
147147
148148
149149
printf ("Resuming from Encrypted image is unsupported.\n"
"Uncheck \"Use secure virtual memory\" in \"Security\" pane on system preferences.\n"
"Press any key to proceed with normal boot.\n");
getc(); //Azi: getchar();
getchar();
return;
}
// depends on NVRAM
if (!((long long)mem_base+allocSize<1024*bootInfo->extmem+0x100000))
{
printf ("Not enough space to restore image. Press any key to proceed with normal boot.\n");
getc(); //Azi: getchar();
getchar();
return;
}
branches/azimutz/trunkGraphicsEnablerModules/i386/boot2/boot.c
185185
186186
187187
188
188
189189
190190
191191
......
350350
351351
352352
353
353
354354
355355
356356
bool dummyVal;
if (getBoolForKey(kWaitForKeypressKey, &dummyVal, &bootInfo->bootConfig) && dummyVal) {
printf("Press any key to continue...");
getc(); //Azi: getchar();
getchar();
}
usb_loop();
#if DEBUG
printf(" Default: %d, ->biosdev: %d, ->part_no: %d ->flags: %d\n", gBootVolume, gBootVolume->biosdev, gBootVolume->part_no, gBootVolume->flags);
printf(" bt(0,0): %d, ->biosdev: %d, ->part_no: %d ->flags: %d\n", gBIOSBootVolume, gBIOSBootVolume->biosdev, gBIOSBootVolume->part_no, gBIOSBootVolume->flags);
getc(); //Azi: getchar();
getchar();
#endif
useGUI = true;
branches/azimutz/trunkGraphicsEnablerModules/i386/boot2/modules.c
1616
1717
1818
19
19
2020
2121
2222
......
8686
8787
8888
89
89
9090
9191
9292
......
185185
186186
187187
188
188
189189
190190
191191
......
304304
305305
306306
307
307
308308
309309
310310
......
370370
371371
372372
373
373
374374
375375
376376
......
379379
380380
381381
382
382
383383
384384
385385
......
891891
892892
893893
894
894
895895
896896
897897
......
910910
911911
912912
913
913
914914
915915
916916
......
928928
929929
930930
931
931
932932
933933
934934
......
953953
954954
955955
956
956
957957
958958
959959
......
10851085
10861086
10871087
1088
1088
10891089
10901090
10911091
......
11331133
11341134
11351135
1136
1136
11371137
11381138
11391139
#if CONFIG_MODULE_DEBUG
#define DBG(x...)printf(x);
#define DBGPAUSE()getc() // getchar();
#define DBGPAUSE()getchar()
#else
#define DBG(x...)
#define DBGPAUSE()
else
{
// The module does not have a valid start function
printf("Unable to start %s\n", SYMBOLS_MODULE); getc(); //Azi: getchar();
printf("Unable to start %s\n", SYMBOLS_MODULE); getchar();
}
}
}
else // The module does not have a valid start function. This may be a library.
{
printf("WARNING: Unable to start %s\n", module);
getc(); //Azi: getchar();
getchar();
}
#else
else msglog("WARNING: Unable to start %s\n", module);
#if CONFIG_MODULE_DEBUG
printf("Unable to locate symbol %s\n", name);
getc(); //Azi: getchar();
getchar();
#endif
if(strcmp(name, VOID_SYMBOL) == 0) return 0xFFFFFFFF;
else
{
verbose("Invalid mach magic 0x%X\n", ((struct mach_header*)binary)->magic);
//getc(); //Azi: getchar();
//getchar();
return NULL;
}
/*if(((struct mach_header*)binary)->filetype != MH_DYLIB)
{
printf("Module is not a dylib. Unable to load.\n");
getc(); //Azi: getchar();
getchar();
return NULL; // Module is in the incorrect format
}*/
else
{
printf("Unable to bind symbol %s\n", symbolName);
getc(); //Azi: getchar();
getchar();
}
segmentAddress += sizeof(void*);
else
{
printf("Unable to bind symbol %s\n", symbolName);
getc(); //Azi: getchar();
getchar();
}
segmentAddress += tmp + sizeof(void*);
else
{
printf("Unable to bind symbol %s\n", symbolName);
getc(); //Azi: getchar();
getchar();
}
segmentAddress += (immediate * sizeof(void*)) + sizeof(void*);
else
{
printf("Unable to bind symbol %s\n", symbolName);
getc(); //Azi: getchar();
getchar();
}
break;
}
#if CONFIG_MODULE_DEBUG
//print_hook_list();
//getc(); //Azi: getchar();
//getchar();
#endif
}
void dyld_stub_binder()
{
printf("ERROR: dyld_stub_binder was called, should have been take care of by the linker.\n");
getc(); //Azi: getchar();
getchar();
}
#else /* CONFIG_MODULES */
branches/azimutz/trunkGraphicsEnablerModules/i386/boot2/gui.c
142142
143143
144144
145
146
145
146
147147
148
149
150148
151149
152150
......
912910
913911
914912
915
916
913
914
917915
918916
919917
......
927925
928926
929927
930
928
931929
932
933
934
935
936
937
938
939
940
941930
942931
943932
......
949938
950939
951940
952
953
954
955941
956
957
958
959
960
961
942
962943
963944
964945
......
15821563
15831564
15841565
1585
1566
15861567
15871568
15881569
extern MenuItem *menuItems;
char prompt[BOOT_STRING_LEN];
//extern char gBootArgs[BOOT_STRING_LEN]; //Azi: getchar/prompt stuff
//char prompt[BOOT_STRING_LEN];
extern char gBootArgs[BOOT_STRING_LEN];
int prompt_pos = 0;
char prompt_text[] = "boot: ";
menuitem_t infoMenuItems[] =
void clearGraphicBootPrompt()
{
// clear text buffer
prompt[0] = '\0'; //Azi: getchar/prompt stuff
prompt_pos=0;
//prompt[0] = '\0';
//prompt_pos=0;
if(gui.bootprompt.draw == true )
return;
}
void updateGraphicBootPrompt(int key)
void updateGraphicBootPrompt()
{
if ( key == kBackspaceKey ) //Azi: getchar/prompt stuff
prompt[--prompt_pos] = '\0';
else
{
prompt[prompt_pos] = key;
prompt_pos++;
prompt[prompt_pos] = '\0';
}
fillPixmapWithColor( gui.bootprompt.pixmap, gui.bootprompt.bgcolor);
makeRoundedCorners( gui.bootprompt.pixmap);
// get the position of the end of the boot prompt text to display user input
position_t p_prompt = pos( p_text.x + ( ( strlen(prompt_text) ) * font_console.chars[0]->width ), p_text.y );
//Azi: getchar/prompt stuff
// calculate the position of the cursor
intoffset = ( prompt_pos - ( ( gui.bootprompt.width / font_console.chars[0]->width ) - strlen(prompt_text) - 2 ) );
if ( offset < 0)
offset = 0;
drawStr( prompt+offset, &font_console, gui.bootprompt.pixmap, p_prompt);
// end
drawStr( prompt + offset, &font_console, gui.bootprompt.pixmap, p_prompt);
drawStr( gBootArgs, &font_console, gui.bootprompt.pixmap, p_prompt);
gui.menu.draw = false;
gui.bootprompt.draw = true;
updateVRAM();
key = getc(); //Azi: getchar();
key = getchar();
if( key == kUpArrowkey )
if( currentline > 0 )
branches/azimutz/trunkGraphicsEnablerModules/i386/boot2/gui.h
11
2
3
2
3
44
5
6
7
5
6
7
88
99
1010
11
12
13
1114
1215
1316
1417
1518
1619
17
18
19
2020
2121
2222
......
4141
4242
4343
44
44
4545
4646
4747
48
48
4949
5050
5151
......
151151
152152
153153
154
154
155155
156156
157157
/*
*gui.h
*
* gui.h
*
*
*Created by Jasmin Fazlic on 18.12.08.
*Copyright 2008/09 Jasmin Fazlic All rights reserved.
*Copyright 2008/09 iNDi All rights reserved.
* Created by Jasmin Fazlic on 18.12.08.
* Copyright 2008/09 Jasmin Fazlic All rights reserved.
* Copyright 2008/09 iNDi All rights reserved.
*
*/
#ifndef __BOOT2_GUI_H
#define __BOOT2_GUI_H
#include "boot.h"
#include "bootstruct.h"
#include "graphics.h"
#include "graphic_utils.h"
#include "picopng.h"
#ifndef __BOOT2_GUI_H
#define __BOOT2_GUI_H
#define CHARACTERS_COUNT223
#define BOOT_NORMAL0
enum {
kBackspaceKey= 0x08,
kTabKey= 0x09,
kReturnKey= 0x0d, // '\n', //Azi: r926
kReturnKey= '\r',
kEscapeKey= 0x1b,
kUpArrowkey= 0x4800,
kDownArrowkey= 0x5000,
kASCIIKeyMask= 0x7f, //Azi: getchar()***
kASCIIKeyMask= 0x7f,
kF5Key= 0x3f00,
kF10Key= 0x4400
};
void showGraphicBootPrompt();
void clearGraphicBootPrompt();
void updateGraphicBootPrompt(int key);
void updateGraphicBootPrompt();
void updateVRAM();
branches/azimutz/trunkGraphicsEnablerModules/i386/boot2/ramdisk.c
290290
291291
292292
293
293
294294
295295
296296
......
303303
304304
305305
306
306
307307
308308
309309
setCursorPosition(0, 0, 1);
showInfoRAMDisk();
printf("\n\nPress any key to continue.\n");
getc(); //Azi: getchar();
getchar();
setActiveDisplayPage(0);
}
else
printf("\n?rd m <filename> - mount ramdisk image\n?rd u - unmount ramdisk image");
printf("\n?rd e - enable bt(0,0) alias\n?rd d - disable bt(0,0) alias");
printf("\n\nPress any key to continue.\n");
getc(); //Azi: getchar();
getchar();
setActiveDisplayPage(0);
}
}
branches/azimutz/trunkGraphicsEnablerModules/i386/boot2/options.c
156156
157157
158158
159
159
160160
161161
162162
......
172172
173173
174174
175
176
175
177176
178177
179178
......
184183
185184
186185
187
186
188187
189188
190189
......
206205
207206
208207
209
210
208
211209
212210
213211
214212
215
213
216214
217215
218216
......
220218
221219
222220
223
221
224222
225223
226224
227
228
229
225
226
230227
231228
232229
......
240237
241238
242239
243
240
244241
245242
246243
244
245
247246
248247
249248
250249
251250
252251
253
254
252
253
255254
256255
257256
258257
259
260
261
262
263
264
265
258
259
260
261
262
263
266264
267265
268266
269267
270268
271
272
273
274
275
276
269
270
271
272
277273
278
274
279275
280276
281277
......
348344
349345
350346
351
347
352348
353349
354350
......
385381
386382
387383
388
384
389385
390386
391387
......
702698
703699
704700
705
701
706702
707703
708704
......
870866
871867
872868
873
869
874870
875871
876872
......
911907
912908
913909
914
910
915911
916912
917913
918914
919915
920
916
921917
922918
923919
......
948944
949945
950946
951
947
952948
953949
954950
955951
956952
957
953
958954
959955
960956
......
10091005
10101006
10111007
1012
1008
10131009
10141010
10151011
......
10381034
10391035
10401036
1037
10411038
10421039
10431040
......
13461343
13471344
13481345
1349
1346
13501347
13511348
13521349
......
13891386
13901387
13911388
1392
1389
13931390
13941391
13951392
......
14091406
14101407
14111408
1412
1409
14131410
14141411
14151412
......
14561453
14571454
14581455
1459
1456
14601457
14611458
14621459
......
15071504
15081505
15091506
1510
1507
15111508
15121509
15131510
}
}
if( bootArgs->Video.v_display == GRAPHICS_MODE )
if( bootArgs->Video.v_display != VGA_TEXT_MODE )
{
drawProgressBar( gui.screen.pixmap, 100, gui.progressbar.pos , ( multi * 100 / multi_buff ) );
gui.redraw = true;
//==========================================================================
//char gBootArgs[BOOT_STRING_LEN];
static char gBootArgs[BOOT_STRING_LEN];
char gBootArgs[BOOT_STRING_LEN];
static char * gBootArgsPtr = gBootArgs;
static char * gBootArgsEnd = gBootArgs + BOOT_STRING_LEN - 1;
static char booterCommand[BOOT_STRING_LEN];
gBootArgsPtr = gBootArgs;
memset(gBootArgs, '\0', BOOT_STRING_LEN);
if (bootArgs->Video.v_display == GRAPHICS_MODE) {
if (bootArgs->Video.v_display != VGA_TEXT_MODE) {
clearGraphicBootPrompt();
}
}
extern char bootPrompt[];
extern char bootRescanPrompt[];
if ( bootArgs->Video.v_display == VGA_TEXT_MODE ) {
//Azi: getchar/prompt stuff
if( bootArgs->Video.v_display == VGA_TEXT_MODE ) {
changeCursor( 0, row, kCursorTypeUnderline, 0 );
clearScreenRows( row, kScreenLastRow );
}
clearBootArgs();
//clearBootArgs();
if (visible) {
if (bootArgs->Video.v_display == VGA_TEXT_MODE) {
printf( bootRescanPrompt );
} else {
printf( bootPrompt );
// printf( gBootArgs );
printf( gBootArgs );
}
}
} else {
if (bootArgs->Video.v_display == GRAPHICS_MODE) {
clearGraphicBootPrompt();
// End
if (bootArgs->Video.v_display != VGA_TEXT_MODE) {
//clearGraphicBootPrompt();
} else {
printf("Press Enter to start up the foreign OS. ");
}
key &= kASCIIKeyMask;
switch ( key )
{
{
case kBackspaceKey:
if ( gBootArgsPtr > gBootArgs )
{
*--gBootArgsPtr = '\0';
int x, y, t;
getCursorPositionAndType( &x, &y, &t );
if ( x == 0 && y )
{
x = 80; y--;
}
if (x)
x--;
if (x) x--;
if( bootArgs->Video.v_display == VGA_TEXT_MODE )
{
setCursorPosition( x, y, 0 );
putca(' ', 0x07, 1);
//Azi: getchar/prompt stuff
} else
updateGraphicBootPrompt(kBackspaceKey);
*gBootArgsPtr-- = '\0';
}
}
else
{
updateGraphicBootPrompt();
}
}
break;
default:
if ( key >= ' ' && gBootArgsPtr < gBootArgsEnd)
{
if( bootArgs->Video.v_display == VGA_TEXT_MODE )
putchar(key); // echo to screen
else
updateGraphicBootPrompt(key);
*gBootArgsPtr++ = key;
// end
*gBootArgsPtr++ = key;
if( bootArgs->Video.v_display != VGA_TEXT_MODE ) updateGraphicBootPrompt();
else if ( key >= ' ' && key < 0x7f) putchar(key);
}
break;
}
}
// Draw the visible items.
if( bootArgs->Video.v_display == GRAPHICS_MODE )
if( bootArgs->Video.v_display != VGA_TEXT_MODE )
drawDeviceList(gMenuStart, gMenuEnd, gMenuSelection);
if ( gMenuItems == NULL )
return 0;
if( bootArgs->Video.v_display == GRAPHICS_MODE )
if( bootArgs->Video.v_display != VGA_TEXT_MODE )
{
int res;
}
// ensure we're in graphics mode if gui is setup
if (gui.initialised && bootArgs->Video.v_display == VGA_TEXT_MODE)
if (firstRun && gui.initialised && bootArgs->Video.v_display == VGA_TEXT_MODE)
{
setVideoMode(GRAPHICS_MODE, 0);
}
}
}
if (bootArgs->Video.v_display == GRAPHICS_MODE) {
if (bootArgs->Video.v_display != VGA_TEXT_MODE) {
// redraw the background buffer
gui.logo.draw = true;
drawBackground();
showBootPrompt( nextRow, showPrompt );
do {
if (bootArgs->Video.v_display == GRAPHICS_MODE) {
if (bootArgs->Video.v_display != VGA_TEXT_MODE) {
// redraw background
memcpy( gui.backbuffer->pixels, gui.screen.pixmap->pixels, gui.backbuffer->width * gui.backbuffer->height * 4 );
// reset cursor co-ords
gui.debug.cursor = pos( gui.screen.width - 160 , 10 );
}
key = getc(); //Azi: getchar();
key = getchar();
updateMenu( key, (void **) &menuBVR );
newShowPrompt = (gDeviceCount == 0) || (menuBVR->flags & kBVFlagNativeBoot);
* TODO: this needs to be refactored.
*/
if (strcmp( booterCommand, "video" ) == 0) {
if (bootArgs->Video.v_display == GRAPHICS_MODE) {
if (bootArgs->Video.v_display != VGA_TEXT_MODE) {
showInfoBox(getVBEInfoString(), getVBEModeInfoString());
} else {
printVBEModeInfo();
}
} else if ( strcmp( booterCommand, "memory" ) == 0) {
if (bootArgs->Video.v_display == GRAPHICS_MODE ) {
if (bootArgs->Video.v_display != VGA_TEXT_MODE ) {
showInfoBox("Memory Map", getMemoryInfoString());
} else {
printMemoryInfo();
// Switch between text & graphic interfaces
// Only Permitted if started in graphics interface
if (useGUI) {
if (bootArgs->Video.v_display == GRAPHICS_MODE) {
if (bootArgs->Video.v_display != VGA_TEXT_MODE) {
setVideoMode(VGA_TEXT_MODE, 0);
setCursorPosition(0, 0, 0);
gui.redraw = true;
setVideoMode(GRAPHICS_MODE, 0);
updateVRAM();
updateGraphicBootPrompt();
}
}
key = 0;
intline_offset;
intc;
if (bootArgs->Video.v_display == GRAPHICS_MODE) {
if (bootArgs->Video.v_display != VGA_TEXT_MODE) {
showInfoBox( "Press q to quit\n",buf );
return;
}
printf("[Type %s%sq to quit viewer]", (line_offset > 0) ? "p for previous page, " : "", (*bp != '\1') ? "space for next page, " : "");
}
c = getc(); //Azi: getchar();
c = getchar();
if (c == 'q' || c == 'Q') {
break;
}
void showHelp(void)
{
if (bootArgs->Video.v_display == GRAPHICS_MODE) {
if (bootArgs->Video.v_display != VGA_TEXT_MODE) {
showInfoBox("Help. Press q to quit.\n", (char *)BootHelp_txt);
} else {
showTextBuffer((char *)BootHelp_txt, BootHelp_txt_len);
printf("Typical boot devices are 80 (First HD), 81 (Second HD)\n");
printf("Enter two-digit hexadecimal boot device [%02x]: ", bootdevice);
do {
key = getc(); //Azi: getchar();
key = getchar();
switch (key & kASCIIKeyMask) {
case kBackspaceKey:
if (digitsI > 0) {
bool promptForRescanOption(void)
{
printf("\nWould you like to enable media rescan option?\nPress ENTER to enable or any key to skip.\n");
if (getc() == kReturnKey) { //Azi: getchar();
if (getchar() == kReturnKey) {
return true;
} else {
return false;
branches/azimutz/trunkGraphicsEnablerModules/i386/modules/GraphicsEnabler/NVIDIAGraphicsEnabler/nvidia.c
896896
897897
898898
899
899
900
900901
901902
902903
......
13751376
13761377
13771378
1378
1379
1379
1380
1381
1382
1383
1384
1385
13801386
13811387
13821388
headerlength = 8;
}
if (sig != 0x4edcbdcb) {
printf("bad display config block signature (0x%8x)\n", sig);
//Azi: match this with one below and add line number ?
printf("Bad display config block signature (0x%8x)\n", sig);
return PATCH_ROM_FAILED;
}
} else if (dcbtable_version >= 0x14) { /* some NV15/16, and NV11+ */
devprop_add_value(device, "rom-revision", (uint8_t*)biosVersion, strlen(biosVersion) + 1);
devprop_add_value(device, "@0,display-cfg", default_dcfg_0, DCFG0_LEN);
devprop_add_value(device, "@1,display-cfg", default_dcfg_1, DCFG1_LEN);
//add HDMI Audio back to nvidia
//http://forge.voodooprojects.org/p/chameleon/issues/67/
// uint8_t connector_type_1[]= {0x00, 0x08, 0x00, 0x00};
// devprop_add_value(device, "@1,connector-type",connector_type_1, 4);
//end Nvidia HDMI Audio
if (getBoolForKey(kVBIOS, &doit, &bootInfo->bootConfig) && doit) {
devprop_add_value(device, "vbios", rom, (nvBiosOveride > 0) ? nvBiosOveride : (rom[2] * 512));
}
branches/azimutz/trunkGraphicsEnablerModules/i386/modules/GraphicsEnabler/AMDGraphicsEnabler/ati.c
5555
5656
5757
58
5859
5960
6061
......
8889
8990
9091
92
9193
9294
9395
......
209211
210212
211213
212
214
215
216
217
218
219
220
221
222
223
224
225
213226
214227
215228
......
441454
442455
443456
444
445
446
457
458
459
460
461
462
463
447464
448
449
465
450466
451
452
453467
454468
455469
......
517531
518532
519533
520
521
522534
523
524
535
536
537
538
539
525540
526
527
541
542
543
544
545
528546
529
547
530548
531549
532550
CHIP_FAMILY_JUNIPER,
CHIP_FAMILY_CYPRESS,
CHIP_FAMILY_HEMLOCK,
//CHIP_FAMILY_GRANVILLE, //Azi: improvising ?? a bit here...
/* Northern Islands */
CHIP_FAMILY_BARTS,
CHIP_FAMILY_CAICOS,
"Juniper",// RV840
"Cypress",// RV870
"Hemlock",
//"Granville"//Azi: improvising ?? a bit here...
/* Northern Islands */
"Barts",
"Caicos",
} radeon_card_info_t;
static radeon_card_info_t radeon_cards[] = {
//Azi: REVIEW
//Azi: added devices
// issue #88
{ 0x6741,0x1646103C,CHIP_FAMILY_TURKS,/*???*/"AMD Radeon HD 6600M Series",kNull},
// issue #89
{ 0x68A8,0x050E1025,CHIP_FAMILY_CYPRESS,"AMD Radeon HD 6850M",kUakari}, //Azi: CHIP_FAMILY_GRANVILLE ??
// issue #90
{ 0x68E4,0x1c921043,CHIP_FAMILY_CEDAR,"ATI Radeon HD 5470M",kEulemur},
// issue #91
{ 0x68C0,0x1594103C,CHIP_FAMILY_REDWOOD,"AMD Radeon HD 6570M",kNull},
//==================================//================================//============================//
/* Earlier cards are not supported */
{ 0x9400,0x30001002, CHIP_FAMILY_R600,"ATI Radeon HD 2900 PRO",kNull},
{ 0x9400,0x25521002, CHIP_FAMILY_R600,"ATI Radeon HD 2900 XT",kNull},
{ 0x68F9,0x5530174B, CHIP_FAMILY_CEDAR,"ATI Radeon HD 5530",kNull},
/* Northen Islands */
{ 0x6718,0x0B001002, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6970",kNull},
{ 0x6718,0x31301682, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6970",kNull},
{ 0x6718,0x67181002, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6970",kNull},
{ 0x6718,0x0B001002,CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6970",kNull},
{ 0x6718,0x31301682,CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6970",kNull},
{ 0x6718,0x67181002,CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6970",kNull},
{ 0x6738,0x67381002,CHIP_FAMILY_BARTS,"AMD Radeon HD 6870",kDuckweed},
{ 0x6739,0x67391002,CHIP_FAMILY_BARTS,"AMD Radeon HD 6850",kDuckweed},
{ 0x6739,0x21F81458,CHIP_FAMILY_BARTS,"AMD Radeon HD 6850",kDuckweed},
{ 0x6738,0x67381002, CHIP_FAMILY_BARTS,"AMD Radeon HD 6870",kDuckweed},
{ 0x6739,0x67391002, CHIP_FAMILY_BARTS,"AMD Radeon HD 6850",kDuckweed},
{ 0x6759,0xE193174B,CHIP_FAMILY_TURKS,"AMD Radeon HD 6570",kNull},
{ 0x6759,0xE193174B, CHIP_FAMILY_TURKS,"AMD Radeon HD 6570",kNull},
/* standard/default models */
{ 0x9400,0x00000000, CHIP_FAMILY_R600,"ATI Radeon HD 2900 XT",kNull},
{ 0x9405,0x00000000, CHIP_FAMILY_R600,"ATI Radeon HD 2900 GT",kNull},
{ 0x68F9,0x00000000, CHIP_FAMILY_CEDAR,"ATI Radeon HD 5400 Series",kNull},
{ 0x6718,0x00000000, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6900 Series",kNull},
/* Northen Islands */
{ 0x6758,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 6670",kNull},
{ 0x6759,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 6500 Series",kNull},
{ 0x6718,0x00000000,CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6970 Series",kNull},
{ 0x6738,0x00000000,CHIP_FAMILY_BARTS,"AMD Radeon HD 6870 Series",kDuckweed},
{ 0x6739,0x00000000,CHIP_FAMILY_BARTS,"AMD Radeon HD 6850 Series",kDuckweed},
{ 0x673E,0x00000000,CHIP_FAMILY_BARTS,"AMD Radeon HD 6790 Series",kNull},
{ 0x6770,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6400 Series",kNull},
{ 0x6779,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6450 Series",kNull},
{ 0x6758,0x00000000,CHIP_FAMILY_TURKS,"AMD Radeon HD 6670 Series",kNull},
{ 0x6759,0x00000000,CHIP_FAMILY_TURKS,"AMD Radeon HD 6500 Series",kNull},
{ 0x6770,0x00000000,CHIP_FAMILY_CAICOS,"AMD Radeon HD 6400 Series",kNull},
{ 0x6779,0x00000000,CHIP_FAMILY_CAICOS,"AMD Radeon HD 6450 Series",kNull},
{ 0x0000,0x00000000, CHIP_FAMILY_UNKNOW,NULL,kNull}
{ 0x0000,0x00000000,CHIP_FAMILY_UNKNOW,NULL,kNull}
};
typedef struct {
branches/azimutz/trunkGraphicsEnablerModules/i386/modules/HelloWorld/HelloWorld.cpp
3535
3636
3737
38
38
3939
4040
4141
delete obj2;
printf("Hello world from ExecKernel hook. Binary located at 0x%X\n", binary);
getc(); //Azi: getchar(); ??
getchar();
}
void HelloWorld_start()
branches/azimutz/trunkGraphicsEnablerModules/i386/libsa/libsa.h
9393
9494
9595
96
96
9797
9898
9999
extern int strncmp(const char * s1, const char * s2, size_t n);
extern char * strcpy(char * s1, const char * s2);
extern char * strncpy(char * s1, const char * s2, size_t n);
extern size_t strlcpy(char * s1, const char * s2, size_t n); //Azi: ?? check!
extern size_t strlcpy(char * s1, const char * s2, size_t n);
extern char * strstr(const char *in, const char *str);
extern int atoi(const char * str);
extern int ptol(const char * str);
branches/azimutz/trunkGraphicsEnablerModules/i386/libsa/string.c
166166
167167
168168
169
169
170170
171171
172172
}
size_t
strlcpy(char * s1, const char * s2, size_t n) //Azi: libsa.h
strlcpy(char * s1, const char * s2, size_t n)
{
while (n && (*s1++ = *s2++))
n--;
branches/azimutz/trunkGraphicsEnablerModules/i386/util/fdisk/misc.c
142142
143143
144144
145
145
146146
147
147
148148
149149
150150
printf("%s [%c] ", str, default_answer ? 'y' : 'n');
fflush(stdout);
first = ch = getchar(); //Azi: what about these ?
first = ch = getchar();
while (ch != '\n' && ch != EOF)
ch = getchar(); //Azi: not messing them :P
ch = getchar();
if (ch == EOF || first == EOF)
errx(1, "eof");
branches/azimutz/trunkGraphicsEnablerModules/package/smbios.plist
44
55
66
7
7
88
99
1010
......
2020
2121
2222
23
23
2424
2525
2626
2727
2828
29
29
3030
3131
3232
3333
3434
35
35
3636
3737
3838
3939
4040
41
41
4242
4343
4444
......
4646
4747
4848
49
50
51
52
53
54
55
56
57
58
59
60
61
<dict>
<key>SMbiosversion</key>
<string>MP31.88Z.00C1.B00.0802091544</string>
<key>SMmanufacter</key>
<key>SMmanufacturer</key>
<string>Apple Inc.</string>
<key>SMproductname</key>
<string>MacPro3,1</string>
<string>19</string>
<key>SMmemspeed</key>
<string>800</string>
<key>SMmemmanufacter_1</key>
<key>SMmemmanufacturer_1</key>
<string>0xAD00000000000000</string>
<key>SMmemserial_1</key>
<string>0x00001020</string>
<key>SMmempart_1</key>
<string>0x48594D503131325336344350362D59352020</string>
<key>SMmemmanufacter_2</key>
<key>SMmemmanufacturer_2</key>
<string>0xAD00000000000000</string>
<key>SMmemserial_2</key>
<string>0x00003021</string>
<key>SMmempart_2</key>
<string>0x48594D503131325336344350362D59352020</string>
<key>SMmemmanufacter_3</key>
<key>SMmemmanufacturer_3</key>
<string>0xAD00000000000000</string>
<key>SMmemserial_3</key>
<string>0x00003021</string>
<key>SMmempart_3</key>
<string>0x48594D503131325336344350362D59352020</string>
<key>SMmemmanufacter_4</key>
<key>SMmemmanufacturer_4</key>
<string>0xAD00000000000000</string>
<key>SMmemserial_4</key>
<string>0x00003021</string>
<string>0x48594D503131325336344350362D59352020</string>
</dict>
</plist>
<!--
missing on the example above:
SMbiosvendor
SMbiosdate
SMfamily
SMboardmanufacturer
SMboardproduct
SMmemdevloc
SMmembankloc
SMcputype
SMbusspeed
-->
branches/azimutz/trunkGraphicsEnablerModules/CHANGES
44
55
66
7
78
89
910
number of bytes for boot2.
- Added new ATi/AMD Graphics Card Enabler.
- Added new SMBIOS patcher.
Includes changes to "manufacter" keys, from SM*manufacter to SM*manufacturer.
- Added module system.
- Added automatic P-States & C-States generation for native power management.
- Added Booter Log Dump Tool

Archive Download the corresponding diff file

Revision: 1040