Index: trunk/i386/libsaio/smbios.c =================================================================== --- trunk/i386/libsaio/smbios.c (revision 2280) +++ trunk/i386/libsaio/smbios.c (revision 2281) @@ -629,6 +629,18 @@ SMBWord structSize; int i; + /* http://forge.voodooprojects.org/p/chameleon/issues/361/ */ + bool forceFullMemInfo = false; + + if (structPtr->orig->type == kSMBTypeMemoryDevice) + { + getBoolForKey(kMemFullInfo, &forceFullMemInfo, &bootInfo->chameleonConfig); + if (forceFullMemInfo) + { + structPtr->orig->length = 27; + } + } + stringIndex = 1; stringsSize = 0; Index: trunk/i386/boot0/boot0.s =================================================================== --- trunk/i386/boot0/boot0.s (revision 2280) +++ trunk/i386/boot0/boot0.s (revision 2281) @@ -1,7 +1,7 @@ ; Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. ; ; @APPLE_LICENSE_HEADER_START@ -; +; ; Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights ; Reserved. This file contains Original Code and/or Modifications of ; Original Code as defined in and that are subject to the Apple Public @@ -9,7 +9,7 @@ ; except in compliance with the License. Please obtain a copy of the ; License at http://www.apple.com/publicsource and read it before using ; this file. -; +; ; The Original Code and all software distributed under the License are ; distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER ; EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, @@ -17,7 +17,7 @@ ; FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the ; License for the specific language governing rights and limitations ; under the License. -; +; ; @APPLE_LICENSE_HEADER_END@ ; ; Boot Loader: boot0 @@ -26,7 +26,7 @@ ; responsibility is to locate the active partition, load the ; partition booter into memory, and jump to the booter's entry point. ; It leaves the boot drive in DL and a pointer to the partition entry in SI. -; +; ; This boot loader must be placed in the Master Boot Record. ; ; In order to coexist with a fdisk partition table (64 bytes), and @@ -79,7 +79,7 @@ kHFSPSignature EQU 'H+' ; HFS+ volume signature kHFSPCaseSignature EQU 'HX' ; HFS+ volume case-sensitive signature kFAT32BootCodeOffset EQU 0x5a ; offset of boot code in FAT32 boot sector -kBoot1FAT32Magic EQU 'BO' ; Magic string to detect our boot1f32 code +kBoot1FAT32Magic EQU 'BO' ; Magic string to detect our boot1f32 code kGPTSignatureLow EQU 'EFI ' ; GUID Partition Table Header Signature @@ -92,7 +92,7 @@ ; in LBA 0 (that is, the first block) precedes the ; GUID Partition Table Header to maintain compatibility ; with existing tools that do not understand GPT partition structures. - ; The Protective MBR has the same format as a legacy MBR + ; The Protective MBR has the same format as a legacy MBR ; and contains one partition entry with an OSType set to 0xEE ; reserving the entire space used on the disk by the GPT partitions, ; including all headers. @@ -100,7 +100,7 @@ kPartActive EQU 0x80 ; active flag enabled kPartInactive EQU 0x00 ; active flag disabled kHFSGUID EQU 0x48465300 ; first 4 bytes of Apple HFS Partition Type GUID. -kAppleGUID EQU 0xACEC4365 ; last 4 bytes of Apple type GUIDs. +kAppleGUID EQU 0xACEC4365 ; last 4 bytes of Apple type GUIDs. kEFISystemGUID EQU 0x3BC93EC9 ; last 4 bytes of EFI System Partition Type GUID: ; C12A7328-F81F-11D2-BA4B-00A0C93EC93B @@ -117,7 +117,7 @@ ; giving the size of the structure. ; struc part -.bootid resb 1 ; bootable or not +.bootid resb 1 ; bootable or not .head resb 1 ; starting head, sector, cylinder .sect resb 1 ; .cyl resb 1 ; @@ -133,7 +133,7 @@ ; Format of GPT Partition Table Header ; struc gpth -.Signature resb 8 +.Signature resb 8 .Revision resb 4 .HeaderSize resb 4 .HeaderCRC32 resb 4 @@ -149,7 +149,7 @@ .PartitionEntryArrayCRC32 resb 4 endstruc -; +; ; Format of GUID Partition Entry Array ; struc gpta @@ -186,7 +186,7 @@ SEGMENT .text ORG kBoot0RelocAddr - + ;-------------------------------------------------------------------------- ; Boot code is loaded at 0:7C00h. ; @@ -404,6 +404,7 @@ mov [my_lba], eax ; save starting LBA for read_lba function mov cx, [si + gpth.NumberOfPartitionEntries] ; number of GUID Partition Array entries mov bx, [si + gpth.SizeOfPartitionEntry] ; size of GUID Partition Array entry + push bx ; push size of GUID Partition entry ; @@ -444,7 +445,7 @@ .gpt_loop: mov eax, [si + gpta.PartitionTypeGUID + kGUIDLastDwordOffs] - + cmp eax, kAppleGUID ; check current GUID Partition for Apple's GUID type je .gpt_ok @@ -472,7 +473,6 @@ jmp SHORT initBootLoader .gpt_continue: - add si, bx ; advance SI to next partition entry loop .gpt_loop ; loop through all partition entries @@ -496,7 +496,7 @@ ; loadBootSector: pusha - + mov al, 3 mov bx, kBoot0LoadAddr call load @@ -535,9 +535,7 @@ cmp WORD [di + kSectorBytes - 2], kBootSignature .exit: - popa - ret @@ -648,7 +646,7 @@ popad ret - + ;-------------------------------------------------------------------------- ; Write a string with 'boot0: ' prefix to the console. ; @@ -660,7 +658,7 @@ ; log_string: pusha - + push di mov si, log_title_str call print_string @@ -669,10 +667,10 @@ call print_string popa - + ret - + ;-------------------------------------------------------------------------- ; Write a string to the console. ; @@ -757,8 +755,8 @@ popa ret %endif ;DEBUG - + ;-------------------------------------------------------------------------- ; NULL terminated strings. ; @@ -793,8 +791,8 @@ pad_table_and_sig: times 510-($-$$) db 0 dw kBootSignature - - + + ABSOLUTE 0xE400 ; Index: trunk/i386/boot1/boot1h.s =================================================================== --- trunk/i386/boot1/boot1h.s (revision 2280) +++ trunk/i386/boot1/boot1h.s (revision 2281) @@ -25,7 +25,7 @@ ; This program is designed to reside in sector 0+1 of an HFS+ partition. ; It expects that the MBR has left the drive number in DL ; and a pointer to the partition entry in SI. -; +; ; This version requires a BIOS with EBIOS (LBA) support. ; ; This code is written for the NASM assembler. @@ -256,7 +256,7 @@ .fileMode resw 1 .special resd 1 endstruc - + ; ; FileInfo ; @@ -368,6 +368,7 @@ ; Set up the stack to grow down from kBoot1StackSegment:kBoot1StackAddress. ; Interrupts should be off while the stack is being manipulated. ; + cli ; interrupts off xor ax, ax ; zero ax mov ss, ax ; ss <- 0 @@ -510,7 +511,7 @@ ; Arguments: ; AX = number of 512-byte sectors to read (valid from 1-1280). ; EDX = pointer to where the sectors should be stored. -; ECX = sector offset in partition +; ECX = sector offset in partition ; ; Returns: ; CF = 0 success @@ -546,7 +547,7 @@ ; Arguments: ; AL = number of 512-byte sectors to read (valid from 1-127). ; EDX = pointer to where the sectors should be stored. -; ECX = sector offset in partition +; ECX = sector offset in partition ; [bios_drive_number] = drive number (0x80 + unit number) ; ; Returns: @@ -656,7 +657,7 @@ call print_string popad - + ret ;------------------------------------------------------------------------- @@ -714,7 +715,7 @@ popad ret - + print_nibble: and al, 0x0f add al, '0' @@ -773,7 +774,7 @@ inc cl ; increment string length count cmp al, NULL ; check for string terminator jne .loop - + pop di ; restore unicode string length pointer dec cl ; ignoring terminator from length count mov [di], cl ; save string length @@ -842,15 +843,15 @@ ; compareHFSPlusExtentKeys: pushad - + mov dl, 0 ; DL = result of comparison, DH = bestGuess mov eax, [si + HFSPlusExtentKey.fileID] cmp eax, [di + HFSPlusExtentKey.fileID] jne .checkFlags - + cmp BYTE [si + HFSPlusExtentKey.forkType], kForkTypeData jne .checkFlags - + mov eax, [si + HFSPlusExtentKey.startBlock] cmp eax, [di + HFSPlusExtentKey.startBlock] je compareHFSPlusCatalogKeys.exit @@ -913,10 +914,10 @@ .trialKeyGreater: dec dl jmp .exit - + .searchKeyGreater: inc dl - + .exit: mov [bp + BTree.searchResult], dl cmp dl, 0 ; set flags to check relation between keys Index: trunk/i386/boot2/boot.c =================================================================== --- trunk/i386/boot2/boot.c (revision 2280) +++ trunk/i386/boot2/boot.c (revision 2281) @@ -464,7 +464,7 @@ gBIOSBootVolume, gBIOSBootVolume->biosdev, gBIOSBootVolume->part_no, gBIOSBootVolume->flags); getchar(); #endif - + useGUI = true; // Override useGUI default getBoolForKey(kGUIKey, &useGUI, &bootInfo->chameleonConfig); Index: trunk/i386/boot2/boot.h =================================================================== --- trunk/i386/boot2/boot.h (revision 2280) +++ trunk/i386/boot2/boot.h (revision 2281) @@ -154,6 +154,9 @@ #define kHDEFLayoutID "HDEFLayoutID" /* hda.c */ #define kHDAULayoutID "HDAULayoutID" /* hda.c */ +/* Karas: added these keys */ +#define kMemFullInfo "ForceFullMemInfo" /* smbios.c */ + /* * Flags to the booter or kernel */ Index: trunk/doc/BootHelp.txt =================================================================== --- trunk/doc/BootHelp.txt (revision 2280) +++ trunk/doc/BootHelp.txt (revision 2281) @@ -135,7 +135,9 @@ EnableC3State=Yes Enable specific Processor power state, C3. EnableC4State=Yes Enable specific Processor power state, C4. - SMBIOS= Use an alternate SMBIOS.plist file + ForceFullMemInfo=Yes Force SMBIOS Table 17 to be 27 bytes long (disabled by default). + + SMBIOS= Use an alternate SMBIOS.plist file (default path: /smbios.plist /Extra/smbios.plist bt(0,0)/Extra/smbios.plist).