Index: trunk/doc/BootHelp.txt =================================================================== --- trunk/doc/BootHelp.txt (revision 41) +++ trunk/doc/BootHelp.txt (revision 42) @@ -96,4 +96,5 @@ "Rescan Prompt"=Yes Prompts for enable CD-ROM rescan mode. SystemId= 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= Set the system type where n is between 0..6 + (default =1 (Desktop) Index: trunk/i386/libsaio/nvidia.c =================================================================== --- trunk/i386/libsaio/nvidia.c (revision 41) +++ trunk/i386/libsaio/nvidia.c (revision 42) @@ -588,7 +588,7 @@ } size = read(fd, (char *)buf, size); close(fd); - return size; + return size > 0 ? size : 0; } static int devprop_add_nvidia_template(struct DevPropDevice *device) @@ -656,7 +656,13 @@ 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; @@ -686,8 +692,8 @@ // 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]); } @@ -700,7 +706,7 @@ } if ((nvPatch = patch_nvidia_rom(rom)) == PATCH_ROM_FAILED) { - printf("nVidia ROM Patching Failed!\n"); + printf("ERROR: nVidia ROM Patching Failed!\n"); return false; } Index: trunk/i386/libsaio/ati.c =================================================================== --- trunk/i386/libsaio/ati.c (revision 41) +++ trunk/i386/libsaio/ati.c (revision 42) @@ -384,7 +384,7 @@ } size = read(fd, (char *)buf, size); close(fd); - return size; + return size > 0 ? size : 0; } static char *get_ati_model(uint32_t id) @@ -700,12 +700,14 @@ 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 Index: trunk/i386/libsaio/platform.c =================================================================== --- trunk/i386/libsaio/platform.c (revision 41) +++ trunk/i386/libsaio/platform.c (revision 42) @@ -5,11 +5,13 @@ */ #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 @@ -34,9 +36,20 @@ void scan_platform(void) { + const char *value; + int len; + 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; + } + } } Index: trunk/i386/libsaio/fake_efi.c =================================================================== --- trunk/i386/libsaio/fake_efi.c (revision 41) +++ trunk/i386/libsaio/fake_efi.c (revision 42) @@ -338,10 +338,10 @@ 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; } @@ -471,7 +471,7 @@ // 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 @@ -491,12 +491,15 @@ 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 @@ -547,16 +550,7 @@ 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); Index: trunk/i386/boot1/boot1.s =================================================================== --- trunk/i386/boot1/boot1.s (revision 41) +++ trunk/i386/boot1/boot1.s (revision 42) @@ -52,7 +52,7 @@ ; ; Set to 1 to enable verbose mode. ; -VERBOSE EQU 1 +VERBOSE EQU 0 ; ; Various constants. Index: trunk/i386/boot2/boot.h =================================================================== --- trunk/i386/boot2/boot.h (revision 41) +++ trunk/i386/boot2/boot.h (revision 42) @@ -69,8 +69,8 @@ #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 */