Chameleon

Chameleon Commit Details

Date:2010-01-29 02:29:24 (14 years 2 months ago)
Author:Rekursor
Commit:42
Parents: 41
Message:- Fixed problem loading absolute paths since last mods - Fixed potential problem with the new getSmbiosChar16() function in fake_efi.c - Set verbose mode to 0 by default - Updated few debug display and potential bug when return vbios file improvements from recent asere mods - few otehr minor cosmetic changes
Changes:
M/trunk/doc/BootHelp.txt
M/trunk/i386/libsaio/platform.c
M/trunk/i386/boot1/boot1.s
M/trunk/i386/libsaio/fake_efi.c
M/trunk/i386/libsaio/nvidia.c
M/trunk/i386/boot2/boot.h
M/trunk/i386/libsaio/ati.c

File differences

trunk/doc/BootHelp.txt
9696
9797
9898
99
99
100
"Rescan Prompt"=Yes Prompts for enable CD-ROM rescan mode.
SystemId=<UUID> Set manually the system id UUID,
SMUUID in smbios config is a reserved field is not used.
So SMUUID has no effect on SystemId.
SystemType=<n> Set the system type where n is between 0..6
(default =1 (Desktop)
trunk/i386/libsaio/nvidia.c
588588
589589
590590
591
591
592592
593593
594594
......
656656
657657
658658
659
659
660
661
662
663
664
665
660666
661667
662668
......
686692
687693
688694
689
690
695
696
691697
692698
693699
......
700706
701707
702708
703
709
704710
705711
706712
}
size = read(fd, (char *)buf, size);
close(fd);
return size;
return size > 0 ? size : 0;
}
static int devprop_add_nvidia_template(struct DevPropDevice *device)
if (getBoolForKey(kUseNvidiaROM, &doit, &bootInfo->bootConfig) && doit) {
verbose("Looking for nvidia video bios file %s\n", nvFilename);
nvBiosOveride = load_nvidia_bios_file(nvFilename, rom, NVIDIA_ROM_SIZE);
DBG("%s Signature 0x%02x%02x %d bytes\n", nvFilename, rom[0], rom[1], nvBiosOveride);
if (nvBiosOveride > 0) {
verbose("Using nVidia Video BIOS File %s (%d Bytes)\n", nvFilename, nvBiosOveride);
DBG("%s Signature 0x%02x%02x %d bytes\n", nvFilename, rom[0], rom[1], nvBiosOveride);
} else {
printf("ERROR: unable to open Vidia Video BIOS File %s\n", nvFilename);
return false;
}
} else {
// Otherwise read bios from card
nvBiosOveride = 0;
// Valid Signature ?
if (rom[0] != 0x55 && rom[1] != 0xaa) {
verbose("Unable to locate video bios.\n");
return 0;
printf("ERROR: Unable to locate nVidia Video BIOS\n");
return false;
} else {
DBG("ROM Address 0x%x Signature 0x%02x%02x\n", nvRom, rom[0], rom[1]);
}
}
if ((nvPatch = patch_nvidia_rom(rom)) == PATCH_ROM_FAILED) {
printf("nVidia ROM Patching Failed!\n");
printf("ERROR: nVidia ROM Patching Failed!\n");
return false;
}
trunk/i386/libsaio/ati.c
384384
385385
386386
387
387
388388
389389
390390
......
700700
701701
702702
703
704
703
704
705
706
707
708
709
705710
706
707
708
709711
710712
711713
}
size = read(fd, (char *)buf, size);
close(fd);
return size;
return size > 0 ? size : 0;
}
static char *get_ati_model(uint32_t id)
verbose("looking for ati video bios file %s\n", tmp);
rom = malloc(0x20000);
rom_size = load_ati_bios_file(tmp, rom, 0x20000);
if (rom_size > 0x10000) {
rom_size = 0x10000; //we dont need rest anyway;
if (rom_size > 0) {
verbose("Using ATI Video BIOS File %s (%d Bytes)\n", tmp, rom_size);
if (rom_size > 0x10000) {
rom_size = 0x10000; //we dont need rest anyway;
}
} else {
printf("ERROR: unable to open ATI Video BIOS File %s\n", tmp);
}
if (rom_size == 0) {
printf("ATI ROM File '%s' not found\n", tmp);
}
}
if (rom_size == 0) {
if (boot_display) {// no custom rom
trunk/i386/libsaio/platform.c
55
66
77
8
89
910
1011
1112
1213
14
1315
1416
1517
......
3436
3537
3638
39
40
41
3742
3843
3944
4045
4146
47
48
49
50
51
52
53
54
4255
*/
#include "libsaio.h"
#include "boot.h"
#include "bootstruct.h"
#include "pci.h"
#include "platform.h"
#include "cpu.h"
#include "mem.h"
#include "spd.h"
#ifndef DEBUG_PLATFORM
#define DEBUG_PLATFORM 0
void scan_platform(void)
{
const char*value;
intlen;
memset(&Platform, 0, sizeof(Platform));
build_pci_dt();
scan_cpu(&Platform);
scan_memory(&Platform);
scan_spd(&Platform);
Platform.Type = 1;/* Desktop */
if (getValueForKey(kSystemType, &value, &len, &bootInfo->bootConfig) && value != NULL) {
Platform.Type = (unsigned char) strtoul(value, NULL, 10);
if (Platform.Type > 6) {
verbose("Error: system-type must be 0..6. Defaulting to 1!\n");
Platform.Type = 1;
}
}
}
trunk/i386/libsaio/fake_efi.c
338338
339339
340340
341
342
343
344
341
342
343
344
345345
346346
347347
......
471471
472472
473473
474
474
475475
476476
477477
......
491491
492492
493493
494
495494
496495
497496
498497
499498
499
500
501
502
500503
501504
502505
......
547550
548551
549552
550
551
552
553
554
555
556
557
558
559
553
560554
561555
562556
if (!key || !(*key) || !len || !src) return 0;
*len = strlen(src);
dst = (EFI_CHAR16*) malloc(((*len)+1)*2);
for (; i<*len; i++) dst[i] = src[i];
dst[*len] = '\0';
*len = strlen(src)+1;
dst = (EFI_CHAR16*) malloc( (*len) * 2 );
for (; i < (*len) - 1; i++) dst[i] = src[i];
dst[(*len) - 1] = '\0';
return dst;
}
// Rek: new SMsystemid option conforming to smbios notation standards, this option should
// belong to smbios config only ...
const char * sysId = getStringForKey("SystemId", &bootInfo->bootConfig);
const char * sysId = getStringForKey(kSystemID, &bootInfo->bootConfig);
EFI_CHAR8* ret = getUUIDFromString(sysId);
if(!sysId || !ret) { // try bios dmi info UUID extraction
EFI_CHAR8* ret=0;
size_t len=0;
Node *node;
EFI_CHAR8 SystemType=1;
const char *value;
node = DT__FindNode("/", false);
if (node == 0) stop("Couldn't get root node");
/* Export system-type */
verbose("Using system-type=0x%02x\n", Platform.Type);
DT__AddProperty(node, SYSTEM_TYPE_PROP, sizeof(Platform.Type), &Platform.Type);
/* We could also just do DT__FindNode("/efi/platform", true)
* But I think eventually we want to fill stuff in the efi node
if((ret=getSystemID()))
DT__AddProperty(efiPlatformNode, SYSTEM_ID_PROP, UUID_LEN, (EFI_UINT32*) ret);
/* Export system-type. Allowed values are: 0x01 for desktop computer (default), 0x02 for portable computers */
if ((value=getStringForKey("system-type", &bootInfo->bootConfig))) {
if (*value != '1' && *value != '2')
verbose("Error: system-type must be 1 (desktop) or 2 (portable). Defaulting to 1!\n");
else
SystemType = (unsigned char) (*value-'0');
}
DT__AddProperty(node, SYSTEM_TYPE_PROP, sizeof(EFI_CHAR8), &SystemType);
/* Export SystemSerialNumber if present */
/* Export SystemSerialNumber if present */
if ((ret16=getSmbiosChar16("SMserial", &len)))
DT__AddProperty(efiPlatformNode, SYSTEM_SERIAL_PROP, len, ret16);
trunk/i386/boot1/boot1.s
5252
5353
5454
55
55
5656
5757
5858
;
; Set to 1 to enable verbose mode.
;
VERBOSEEQU1
VERBOSEEQU0
;
; Various constants.
trunk/i386/boot2/boot.h
6969
7070
7171
72
73
72
73
7474
7575
7676
#define kDropSSDT"DropSSDT"/* dsdt_patcher.c */
#define kRestartFix"RestartFix"/* dsdt_patcher.c */
#define kSMBIOS"SMBIOS"/* fake_efi.c */
#define kSystemID"system-id"/* fake_efi.c */
#define kSystemType"system-type"/* fake_efi.c */
#define kSystemID"SystemId"/* fake_efi.c */
#define kSystemType"SystemType"/* fake_efi.c */
#define kUseNvidiaROM"UseNvidiaROM"/* nvidia.c */
#define kVBIOS"VBIOS"/* nvidia.c */
#define kPCIRootUID"PCIRootUID"/* pci_root.c */

Archive Download the corresponding diff file

Revision: 42