Chameleon

Chameleon Commit Details

Date:2015-08-01 00:40:42 (8 years 8 months ago)
Author:ErmaC
Commit:2745
Parents: 2744
Message:Complete adding support for (LZVN) grey logo (credits to Pike R. Alpha)
Changes:
M/branches/ErmaC/Enoch/CHANGES
M/branches/ErmaC/Enoch/i386/boot2/IOHibernatePrivate.h
M/branches/ErmaC/Enoch/i386/boot2/options.c
M/branches/ErmaC/Enoch/i386/libsaio/hfs.c
M/branches/ErmaC/Enoch/i386/boot2/graphics.c
M/branches/ErmaC/Enoch/i386/boot2/boot.c
M/branches/ErmaC/Enoch/i386/boot2/gui.c
M/branches/ErmaC/Enoch/i386/boot2/graphics.h
M/branches/ErmaC/Enoch/i386/boot2/boot.h

File differences

branches/ErmaC/Enoch/i386/libsaio/hfs.c
161161
162162
163163
164
164
165165
166166
167167
......
255255
256256
257257
258
258
259
259260
260261
261262
......
284285
285286
286287
287
288
288289
289290
290291
......
323324
324325
325326
326
327
327328
328329
329330
......
336337
337338
338339
339
340
340341
341342
342343
......
344345
345346
346347
347
348
348349
349350
350351
351352
352353
353354
354
355
355356
356357
357358
......
479480
480481
481482
482
483
483484
484485
485486
......
511512
512513
513514
514
515
515516
516517
517518
......
529530
530531
531532
532
533
533534
534535
535536
......
578579
579580
580581
581
582
582583
583584
584585
......
596597
597598
598599
599
600
600601
601602
602603
603604
604605
605606
606
607
607
608
608609
609610
610611
......
671672
672673
673674
674
675
675676
676677
677678
......
12251226
12261227
12271228
1228
1229
12291230
12301231
12311232
#ifdef __i386__
CacheInit(ih, gCacheBlockSize);
#endif
return 0;
return 0L;
}
#ifdef __i386__
{
verbose("HFS signature was not present.\n");
gCurrentIH = 0;
return -1;
return -1L;
}
gIsHFSPlus = 1;
CacheInit(ih, gCacheBlockSize);
}
return 0;
return 0L;
}
//==============================================================================
if (dirID == 0)
{
return -1;
return -1L;
}
filePath++;
if ((result == -1) || ((flags & kFileTypeMask) != kFileTypeFlat))
{
return -1;
return -1L;
}
#if UNUSED
// Check file owner and permissions.
if (flags & (kOwnerNotRoot | kPermGroupWrite | kPermOtherWrite))
{
return -1;
return -1L;
}
#endif
result = ReadFile(entry, &length, base, offset);
if (result == -1)
{
return -1;
return -1L;
}
getDeviceDescription(ih, devStr);
if (HFSInitPartition(ih) == -1)
{
return -1;
return -1L;
}
dirID = kHFSRootFolderID;
if ((result == -1) || ((flags & kFileTypeMask) != kFileTypeFlat))
{
printf("HFS: Resolve path '%s' failed\n", filePath);
return -1;
return -1L;
}
if (gIsHFSPlus)
printf("Allocation offset 0x%x\n", (unsigned long)gAllocationOffset);
#endif
*firstBlock = ((u_int64_t) GetExtentStart(extents, 0) * (u_int64_t) gBlockSize + gAllocationOffset) / 512ULL;
return 0;
return 0L;
}
{
printf("ReadFile(HFS%s): Offset is too large.\n", gIsHFSPlus ? "+" : "");
return -1;
return -1L;
}
if ((*length == 0) || ((offset + *length) > fileLength))
*length = ReadExtent((char *)extents, fileLength, fileID, offset, *length, (char *)base, 0);
return 0;
return 0L;
}
//==============================================================================
static long GetCatalogEntryInfo(void * entry, long * flags, u_int32_t * time, FinderInfo * finderInfo, long * infoValid)
{
u_int32_t tmpTime = 0;
long valid = 0;
u_int32_t tmpTime = 0L;
long valid = 0L;
// Get information about the file.
*infoValid = valid;
}
return 0;
return 0L;
}
//==============================================================================
static u_int32_t GetExtentSize(void * extents, u_int32_t index)
{
u_int32_t size = 0;
u_int32_t size = 0L;
HFSExtentDescriptor *hfsExtents = extents;
HFSPlusExtentDescriptor *hfsPlusExtents = extents;
branches/ErmaC/Enoch/i386/boot2/graphics.c
271271
272272
273273
274
275
274
276275
277276
278277
......
286285
287286
288287
289
290
291
288
289
290
292291
293292
294293
295294
296
297
295
298296
299297
300298
......
303301
304302
305303
306
304
307305
308306
309307
310
308
311309
312310
313311
314
315
316
317
318
312
313
319314
320315
321316
322317
323
324
325
326
327
318
319
328320
329321
330322
331323
332324
333
325
334326
335327
336328
337329
338
339
330
340331
341332
342333
343334
344335
345336
346
347
348
337
349338
350339
351
340
352341
353342
354343
355344
356345
357
358
359
346
347
360348
361
349
362350
363351
364
365
366
352
353
367354
368
355
369356
370357
371358
372
359
373360
374361
375362
......
377364
378365
379366
380
367
381368
382369
383370
......
391378
392379
393380
394
381
395382
396383
397384
......
420407
421408
422409
423
424
425
426
410
427411
428412
429
413
430414
431415
432416
433417
434418
435
436
437
438
439
440
419
420
441421
442422
443423
444424
445425
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483426
484427
485428
......
489432
490433
491434
492
435
493436
494
437
495438
496
497
498
499
500
501
439
502440
503441
504
505
442
443
444
445
446
447
448
506449
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522450
523451
524452
......
528456
529457
530458
531
459
460
461
462
532463
533
534464
535465
536
466
537467
538
539
540
541
542
543
544
468
469
545470
546
547
548
549
550
551
552
471
472
473
474
553475
554
555
556
557
476
477
478
479
480
481
482
558483
484
559485
486
560487
561488
562489
......
758685
759686
760687
761
688
762689
763690
764691
......
776703
777704
778705
779
706
780707
781
782
783708
784709
785710
......
789714
790715
791716
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
717
812718
813719
814720
815
816721
817722
818723
......
826731
827732
828733
829
734
830735
831736
832737
......
849754
850755
851756
852
853
854
855
856
757
857758
858759
859760
......
957858
958859
959860
960
861
961862
962863
963864
......
11911092
11921093
11931094
1194
1095
11951096
11961097
1197
11981098
11991099
12001100
12011101
12021102
12031103
1204
1205
1206
1207
1208
1209
1210
1211
1212
1104
1105
12131106
12141107
12151108
12161109
12171110
1218
1219
1220
1221
1222
1223
1111
1112
12241113
12251114
12261115
12271116
1228
1229
12301117
12311118
12321119
// Loop through the mode list, and find the matching mode.
for ( modePtr = VBEDecodeFP( unsigned short *, vbeInfo.VideoModePtr );
*modePtr != modeEndOfList; modePtr++ )
for ( modePtr = VBEDecodeFP( unsigned short *, vbeInfo.VideoModePtr ); *modePtr != modeEndOfList; modePtr++ )
{
// Get mode information.
#if DEBUG
printf("Mode %x: %dx%dx%d mm:%d attr:%x\n",
*modePtr, modeInfo.XResolution, modeInfo.YResolution,
modeInfo.BitsPerPixel, modeInfo.MemoryModel,
modeInfo.ModeAttributes);
*modePtr, modeInfo.XResolution, modeInfo.YResolution,
modeInfo.BitsPerPixel, modeInfo.MemoryModel,
modeInfo.ModeAttributes);
#endif
// Filter out unwanted modes based on mode attributes.
if ( ( ( modeInfo.ModeAttributes & attributesSet ) != attributesSet )
|| ( ( modeInfo.ModeAttributes & attributesClear ) != 0 ) )
if (((modeInfo.ModeAttributes & attributesSet) != attributesSet) || ((modeInfo.ModeAttributes & attributesClear) != 0))
{
continue;
}
modeBitsPerPixel = modeInfo.BitsPerPixel;
if ( ( modeBitsPerPixel == 4 ) && ( modeInfo.MemoryModel == 0 ) )
if ((modeBitsPerPixel == 4) && (modeInfo.MemoryModel == 0))
{
// Text mode, 16 colors.
}
else if ( ( modeBitsPerPixel == 8 ) && ( modeInfo.MemoryModel == 4 ) )
else if ((modeBitsPerPixel == 8) && (modeInfo.MemoryModel == 4))
{
// Packed pixel, 256 colors.
}
else if ( ( ( modeBitsPerPixel == 16 ) || ( modeBitsPerPixel == 15 ) )
&& ( modeInfo.MemoryModel == 6 )
&& ( modeInfo.RedMaskSize == 5 )
&& ( modeInfo.GreenMaskSize == 5 )
&& ( modeInfo.BlueMaskSize == 5 ) )
else if (((modeBitsPerPixel == 16) || (modeBitsPerPixel == 15)) && (modeInfo.MemoryModel == 6) && (modeInfo.RedMaskSize == 5) &&
(modeInfo.GreenMaskSize == 5) && (modeInfo.BlueMaskSize == 5))
{
// Direct color, 16 bpp (1:5:5:5).
modeInfo.BitsPerPixel = modeBitsPerPixel = 16;
}
else if ( ( modeBitsPerPixel == 32 )
&& ( modeInfo.MemoryModel == 6 )
&& ( modeInfo.RedMaskSize == 8 )
&& ( modeInfo.GreenMaskSize == 8 )
&& ( modeInfo.BlueMaskSize == 8 ) )
else if ((modeBitsPerPixel == 32) && (modeInfo.MemoryModel == 6) && (modeInfo.RedMaskSize == 8) &&
(modeInfo.GreenMaskSize == 8) && (modeInfo.BlueMaskSize == 8))
{
// Direct color, 32 bpp (8:8:8:8).
}
else
{
continue; // Not a supported mode.
continue;// Not a supported mode.
}
// Modes larger than the specified dimensions are skipped.
if ( ( modeInfo.XResolution > width ) ||
( modeInfo.YResolution > height ) )
if ((modeInfo.XResolution > width) || (modeInfo.YResolution > height))
{
continue;
}
// Perfect match, we're done looking.
if ( ( modeInfo.XResolution == width ) &&
( modeInfo.YResolution == height ) &&
( modeBitsPerPixel == bitsPerPixel ) )
if (modeInfo.XResolution == width && modeInfo.YResolution == height && modeBitsPerPixel == bitsPerPixel)
{
matchedMode = *modePtr;
bcopy( &modeInfo, outModeInfo, sizeof(modeInfo) );
bcopy(&modeInfo, outModeInfo, sizeof(modeInfo));
break;
}
// Save the next "best" mode in case a perfect match is not found.
if ( modeInfo.XResolution == outModeInfo->XResolution &&
modeInfo.YResolution == outModeInfo->YResolution &&
modeBitsPerPixel <= outModeInfo->BitsPerPixel )
if (modeInfo.XResolution == outModeInfo->XResolution && modeInfo.YResolution == outModeInfo->YResolution &&
modeBitsPerPixel <= outModeInfo->BitsPerPixel)
{
continue; // Saved mode has more depth.
continue;// Saved mode has more depth.
}
if ( modeInfo.XResolution < outModeInfo->XResolution ||
modeInfo.YResolution < outModeInfo->YResolution ||
modeBitsPerPixel < outModeInfo->BitsPerPixel )
if (modeInfo.XResolution < outModeInfo->XResolution || modeInfo.YResolution < outModeInfo->YResolution ||
modeBitsPerPixel < outModeInfo->BitsPerPixel)
{
continue; // Saved mode has more resolution.
continue;// Saved mode has more resolution.
}
matchedMode = *modePtr;
bcopy( &modeInfo, outModeInfo, sizeof(modeInfo) );
bcopy(&modeInfo, outModeInfo, sizeof(modeInfo));
}
return matchedMode;
//==========================================================================
// setupPalette
/*
static void setupPalette( VBEPalette *p, const unsigned char *g )
{
int i;
(*p)[i] |= ((unsigned long)((*source++) >> 2)); // Blue
}
}
*/
//==========================================================================
// Simple decompressor for boot images encoded in RLE format.
//==========================================================================
// setVESAGraphicsMode
static int setVESAGraphicsMode( unsigned short width,
unsigned short height,
unsigned char bitsPerPixel,
unsigned short refreshRate )
static int setVESAGraphicsMode( unsigned short width, unsigned short height, unsigned char bitsPerPixel, unsigned short refreshRate )
{
VBEModeInfoBlock minfo;
unsigned short mode;
unsigned short mode = 280; // Default to 1024 * 768 * 32 (1920 * 1200 * 32 would be 330)
unsigned short vesaVersion;
int err = errFuncNotSupported;
do {
mode = getVESAModeWithProperties( width, height, bitsPerPixel,
maColorModeBit |
maModeIsSupportedBit |
maGraphicsModeBit |
maLinearFrameBufferAvailBit,
0,
&minfo, &vesaVersion );
maColorModeBit | maModeIsSupportedBit | maGraphicsModeBit | maLinearFrameBufferAvailBit,
0, &minfo, &vesaVersion );
if ( mode == modeEndOfList )
{
break;
}
//
// FIXME : generateCRTCTiming() causes crash.
//
// if ( (vesaVersion >> 8) >= 3 && refreshRate >= 60 &&
// (gBootMode & kBootModeSafe) == 0 )
// {
// VBECRTCInfoBlock timing;
//
// // Generate CRTC timing for given refresh rate.
//
// generateCRTCTiming( minfo.XResolution, minfo.YResolution,
// refreshRate, kCRTCParamRefreshRate,
// &timing );
//
// // Find the actual pixel clock supported by the hardware.
//
// getVBEPixelClock( mode, &timing.PixelClock );
//
// // Re-compute CRTC timing based on actual pixel clock.
//
// generateCRTCTiming( minfo.XResolution, minfo.YResolution,
// timing.PixelClock, kCRTCParamPixelClock,
// &timing );
//
// // Set the video mode and use specified CRTC timing.
//
// err = setVBEMode( mode | kLinearFrameBufferBit |
// kCustomRefreshRateBit, &timing );
// }
// else
// {
// // Set the mode with default refresh rate.
//
// err = setVBEMode( mode | kLinearFrameBufferBit, NULL );
// }
// Set the mode with default refresh rate.
err = setVBEMode(mode | kLinearFrameBufferBit, NULL);
break;
}
// Set 8-bit color palette.
// Is this required for buggy Video BIOS implementations? If so for which adapter?
if ( minfo.BitsPerPixel == 8 )
if (minfo.BytesPerScanline == 0)
{
VBEPalette palette;
setupPalette( &palette, AppleLogoClut );
if ((err = setVBEPalette(palette)) != errSuccess)
{
break;
}
minfo.BytesPerScanline = (minfo.XResolution * minfo.BitsPerPixel) >> 3; // ((1920 * 32 = 61440) >> 3) = 7680
}
// Is this required for buggy Video BIOS implementations?
// On which adapter?
// Update bootArgs with the data provided by the selected VESA mode.
bootArgs->Video.v_display= GRAPHICS_MODE;
bootArgs->Video.v_width= minfo.XResolution;/* 1920 or 1600 */
bootArgs->Video.v_height= minfo.YResolution;/* 1200 or 900 */
bootArgs->Video.v_depth= minfo.BitsPerPixel;/* 32 */
bootArgs->Video.v_rowBytes= minfo.BytesPerScanline;/* 7680 or 6400 */
bootArgs->Video.v_baseAddr= VBEMakeUInt32(minfo.PhysBasePtr);
if ( minfo.BytesPerScanline == 0 )
{
minfo.BytesPerScanline = ( minfo.XResolution * minfo.BitsPerPixel ) >> 3;
}
// 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);
} while ( 0 );
return err;
int convertImage( unsigned short width, unsigned short height, const unsigned char *imageData, unsigned char **newImageData )
{
int cnt;
int index = 0;
int size = (width * height); // 16384
int depth = VIDEO(depth);
unsigned char *img = 0;
unsigned short *img16;
unsigned long *img32;
switch ( VIDEO(depth) )
switch (depth)
{
case 16 :
img16 = malloc(width * height * 2);
if ( !img16 ) break;
for (cnt = 0; cnt < (width * height); cnt++)
img16[cnt] = lookUpCLUTIndex(imageData[cnt], 16);
img = (unsigned char *)img16;
break;
case 32:
img32 = malloc(size * 4);
case 32 :
img32 = malloc(width * height * 4);
if ( !img32 ) break;
for (cnt = 0; cnt < (width * height); cnt++)
img32[cnt] = lookUpCLUTIndex(imageData[cnt], 32);
img = (unsigned char *)img32;
break;
if (!img32)
{
break;
}
default :
img = malloc(width * height);
bcopy(imageData, img, width * height);
break;
for (; index < size; index++)
{
img32[index] = lookUpCLUTIndex(imageData[index]);
}
img = (unsigned char *)img32;
break;
}
*newImageData = img;
return 0;
}
}
//==============================================================================
// ProgressBar
void drawCheckerBoard()
{
uint32_t *vram = (uint32_t *) VIDEO(baseAddr);
//==========================================================================
// LookUpCLUTIndex
unsigned long lookUpCLUTIndex( unsigned char index, unsigned char depth )
unsigned long lookUpCLUTIndex( unsigned char index )
{
long result;
long colorIndex = (index * 3);
long red;
long green;
green = AppleLogoClut[ colorIndex++ ];
blue = AppleLogoClut[ colorIndex++ ];
switch (depth)
{
case 16 :
result = ((red & 0xF8) << 7) |
((green & 0xF8) << 2) |
((blue & 0xF8) >> 3);
result |= (result << 16);
break;
case 32 :
result = (red << 16) | (green << 8) | blue;
break;
default :
result = index | (index << 8);
result |= (result << 16);
break;
}
return result;
return (red << 16) | (green << 8) | blue;
}
//==========================================================================
// drawColorRectangle
void *stosl(void *dst, long val, long len)
{
//==============================================================================
void drawColorRectangle( uint32_t color )
void setBackgroundColor( uint32_t color )
{
longpixelBytes = VIDEO(depth) / 8;
char*vram = (char *) VIDEO(baseAddr) + VIDEO(rowBytes) + pixelBytes;
//==========================================================================
// drawDataRectangle
void drawDataRectangle( unsigned short x,
unsigned short y,
unsigned short width,
unsigned short height,
unsigned char *data )
void drawDataRectangle( unsigned short x, unsigned short y, unsigned short width, unsigned short height, unsigned char *data )
{
unsigned short drawWidth;
rowBytes = VIDEO (rowBytes);
// Set the screen to 75% grey.
drawColorRectangle(0xffbfbfbf);
setBackgroundColor(0xffbfbfbf);
}
pixelShift = VIDEO (depth) >> 4;
//
// Set the video mode to VGA_TEXT_MODE or GRAPHICS_MODE.
void setVideoMode( int mode, int drawgraphics)
void setVideoMode( int mode )
{
unsigned long params[4];
int count;
int err = errSuccess;
if ( mode == GRAPHICS_MODE )
{
if ( (err = initGraphicsMode()) == errSuccess )
{
if (gVerboseMode)
{
// Tell the kernel to use text mode on a linear frame buffer display
bootArgs->Video.v_display = FB_TEXT_MODE;
}
else
{
bootArgs->Video.v_display = GRAPHICS_MODE;
}
// Tell the kernel to use text mode on a linear frame buffer display
bootArgs->Video.v_display = (gVerboseMode) ? /* 2 */ FB_TEXT_MODE : /* 1 */ GRAPHICS_MODE;
}
}
if ( (mode == VGA_TEXT_MODE) || (err != errSuccess) )
{
count = getNumberArrayFromProperty(kTextModeKey, params, 2);
if ( count < 2 )
{
params[0] = 80; // Default text mode is 80x25.
params[1] = 25;
}
params[0] = 80; // Default text mode is 80x25.
params[1] = 25;
setVESATextMode(params[0], params[1], 4);
bootArgs->Video.v_display = VGA_TEXT_MODE;
}
currentIndicator = 0;
}
//==============================================================================
branches/ErmaC/Enoch/i386/boot2/graphics.h
2020
2121
2222
23
23
2424
25
25
2626
2727
2828
int loadPngImage(const char *filename, uint16_t *width, uint16_t *height, uint8_t **imageData);
unsigned long lookUpCLUTIndex( unsigned char index, unsigned char depth );
unsigned long lookUpCLUTIndex( unsigned char index );
void drawColorRectangle( uint32_t color );
void setBackgroundColor( uint32_t color );
void drawDataRectangle( unsigned short x, unsigned short y, unsigned short width, unsigned short height, unsigned char * data );
int convertImage( unsigned short width, unsigned short height, const unsigned char *imageData, unsigned char **newImageData );
branches/ErmaC/Enoch/i386/boot2/boot.c
218218
219219
220220
221
221
222222
223223
224224
......
854854
855855
856856
857
857
858858
859859
860860
// verbose mode.
if (gVerboseMode)
{
setVideoMode(GRAPHICS_MODE, 0);
setVideoMode( GRAPHICS_MODE );
}
else
{
// if we are already in graphics-mode,
if (getVideoMode() == GRAPHICS_MODE)
{
setVideoMode(VGA_TEXT_MODE, 0); // switch back to text mode.
setVideoMode( VGA_TEXT_MODE ); // switch back to text mode.
}
}
branches/ErmaC/Enoch/i386/boot2/boot.h
266266
267267
268268
269
269
270270
271271
272272
273
273
274274
275275
276276
* graphics.c
*/
extern void printVBEModeInfo();
extern void setVideoMode(int mode, int drawgraphics);
extern void setVideoMode(int mode);
extern int getVideoMode();
extern void spinActivityIndicator();
extern void clearActivityIndicator();
extern void drawColorRectangle( uint32_t color );
extern void setBackgroundColor( uint32_t color );
extern void drawDataRectangle(
unsigned short x,
unsigned short y,
branches/ErmaC/Enoch/i386/boot2/gui.c
5454
5555
5656
57
5758
5859
5960
......
159160
160161
161162
163
162164
163165
164166
......
416418
417419
418420
421
419422
420423
421424
......
10341037
10351038
10361039
1037
1040
10381041
10391042
10401043
......
24092412
24102413
24112414
2412
2415
24132416
24142417
24152418
......
24192422
24202423
24212424
2422
2425
24232426
24242427
24252428
iDeviceGeneric_o,
iDeviceHFS,
iDeviceHFS_o,
iDeviceHFS_cap,
iDeviceHFS_cap_o,
iDeviceHFS_yos,
{.name = "device_generic_o", .image = NULL},
{.name = "device_hfsplus", .image = NULL},
{.name = "device_hfsplus_o", .image = NULL},
{.name = "device_hfsplus_cap", .image = NULL},
{.name = "device_hfsplus_cap_o", .image = NULL},
{.name = "device_hfsplus_yos", .image = NULL},
LOADPNG(device_generic_o, iDeviceGeneric);
LOADPNG(device_hfsplus, iDeviceGeneric);
LOADPNG(device_hfsplus_o, iDeviceHFS);
LOADPNG(device_hfsplus_cap, iDeviceHFS);
LOADPNG(device_hfsplus_cap_o, iDeviceHFS_cap);
LOADPNG(device_hfsplus_yos, iDeviceHFS);
// lets copy the screen into the back buffer
memcpy( gui.backbuffer->pixels, gui.screen.pixmap->pixels, gui.backbuffer->width * gui.backbuffer->height * 4 );
setVideoMode( GRAPHICS_MODE, 0 );
setVideoMode( GRAPHICS_MODE );
gui.initialised = true;
return 0;
// Set graphics mode if the booter was in text mode or the screen resolution has changed.
if (bootArgs->Video.v_display == VGA_TEXT_MODE || (screen_params[0] != oldScreenWidth && screen_params[1] != oldScreenHeight) )
{
setVideoMode(GRAPHICS_MODE, 0);
setVideoMode(GRAPHICS_MODE );
}
if (getValueForKey("-checkers", &dummyVal, &length, &bootInfo->chameleonConfig))
else
{
// Fill the background to 75% grey (same as BootX).
drawColorRectangle(0xffbfbfbf);
setBackgroundColor(0xffbfbfbf);
}
if ((bootImageData) && (usePngImage))
branches/ErmaC/Enoch/i386/boot2/IOHibernatePrivate.h
2626
2727
2828
29
30
2931
3032
3133
3234
3335
34
36
37
3538
3639
3740
......
356359
357360
358361
362
359363
360364
361365
......
371375
372376
373377
374
378
375379
376380
377381
......
386390
387391
388392
389
390
393
394
391395
392396
393397
394398
399
400
395401
396402
397403
......
503509
504510
505511
506
507
508512
509513
510514
......
540544
541545
542546
543
547
548
549
544550
545551
546552
......
573579
574580
575581
576
582
583
577584
578585
579586
......
594601
595602
596603
597
604
605
598606
599607
600608
601609
602610
603
611
612
604613
605614
606615
* @APPLE_OSREFERENCE_LICENSE_HEADER_END@
*/
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifdef KERNEL
#include <crypto/aes.h>
#include <libkern/crypto/aes.h>
#include <uuid/uuid.h>
#endif
#ifndef __IOKIT_IOHIBERNATEPRIVATE_H
void IOHibernateSystemInit(IOPMrootDomain * rootDomain);
IOReturn IOHibernateSystemSleep(void);
IOReturn IOHibernateOpenForDebugData(void);
IOReturn IOHibernateIOKitSleep(void);
IOReturn IOHibernateSystemHasSlept(void);
IOReturn IOHibernateSystemWake(void);
typedef void (*kern_get_file_extents_callback_t)(void * ref, uint64_t start, uint64_t size);
struct kern_direct_file_io_ref_t *
kern_open_file_for_direct_io(const char * name,
kern_open_file_for_direct_io(const char * name, boolean_t create_file,
kern_get_file_extents_callback_t callback,
void * callback_ref,
uint64_t * partitionbase_result,
uint64_t * maxiocount_result,
uint32_t * oflags);
void
kern_close_file_for_direct_io(struct kern_direct_file_io_ref_t * ref,
int kern_write_file(struct kern_direct_file_io_ref_t * ref, off_t offset, caddr_t addr, vm_size_t len, int ioflag);
void kern_close_file_for_direct_io(struct kern_direct_file_io_ref_t * ref,
off_t write_offset, caddr_t addr, vm_size_t write_length,
off_t discard_offset, off_t discard_end);
#endif /* _SYS_CONF_H_ */
void vm_compressor_do_warmup(void);
hibernate_page_list_t *
hibernate_page_list_allocate(boolean_t log);
extern uint8_t gIOHibernateRestoreStack[];
extern uint8_t gIOHibernateRestoreStackEnd[];
extern IOHibernateImageHeader * gIOHibernateCurrentHeader;
extern hibernate_graphics_t * gIOHibernateGraphicsInfo;
extern hibernate_cryptwakevars_t * gIOHibernateCryptWakeVars;
#define HIBLOG(fmt, args...)\
{ kprintf(fmt, ## args); printf(fmt, ## args); }
enum
{
kIOHibernateHeaderSignature = 0x73696d65,
kIOHibernateHeaderInvalidSignature = 0x7a7a7a7a
kIOHibernateHeaderInvalidSignature = 0x7a7a7a7a,
kIOHibernateHeaderOpenSignature = 0xf1e0be9d,
kIOHibernateHeaderDebugDataSignature = 0xfcddfcdd
};
// kind for hibernate_set_page_state()
#define kIOHibernateOptionsKey "IOHibernateOptions"
#define kIOHibernateGfxStatusKey "IOHibernateGfxStatus"
enum {
enum
{
kIOHibernateGfxStatusUnknown = ((int32_t) 0xFFFFFFFF)
};
#define kIOHibernateUseKernelInterpreter 0x80000000
enum {
enum
{
kIOPreviewImageIndexDesktop = 0,
kIOPreviewImageIndexLockScreen = 1,
kIOPreviewImageCount = 2
};
enum {
enum
{
kIOScreenLockNoLock = 1,
kIOScreenLockUnlocked = 2,
kIOScreenLockLocked = 3,
branches/ErmaC/Enoch/i386/boot2/options.c
809809
810810
811811
812
812
813813
814814
815815
......
11271127
11281128
11291129
1130
1130
11311131
11321132
11331133
......
11561156
11571157
11581158
1159
1159
11601160
11611161
11621162
// ensure we're in graphics mode if gui is setup
if (firstRun && gui.initialised && bootArgs->Video.v_display == VGA_TEXT_MODE)
{
setVideoMode(GRAPHICS_MODE, 0);
setVideoMode( GRAPHICS_MODE );
}
// Clear command line boot arguments
{
if (bootArgs->Video.v_display != VGA_TEXT_MODE)
{
setVideoMode(VGA_TEXT_MODE, 0);
setVideoMode( VGA_TEXT_MODE );
setCursorPosition(0, 0, 0);
clearScreenRows(0, kScreenLastRow);
else
{
gui.redraw = true;
setVideoMode(GRAPHICS_MODE, 0);
setVideoMode( GRAPHICS_MODE );
updateVRAM();
updateGraphicBootPrompt();
}
branches/ErmaC/Enoch/CHANGES
1
12
23
34
- Pike R. Alpha : Add support for (LZVN) grey logo.
- Slice : Added NvidiaSingle
- cparm : Rock - Paper - Scissors algo
- Bronya : Improve support for AMD CPU.

Archive Download the corresponding diff file

Revision: 2745