]> code.delx.au - refind/blobdiff - gptsync/os_efi.c
BIOS-mode boot support now works when compiled with GNU-EFI
[refind] / gptsync / os_efi.c
index 91ee3a750d2c74a2ef33fda5e544382d9cd28b54..fa48733e8cfb7cfac5b9d3479585ce3afe2c8f61 100644 (file)
@@ -51,7 +51,7 @@ EFI_BLOCK_IO    *BlockIO = NULL;
 
 // Returns size of disk in blocks
 UINT64 disk_size(VOID) {
-   return (UINT64) BlockIO->Media->LastBlock;
+   return (UINT64) (BlockIO->Media->LastBlock + 1);
 } // UINT64 disk_size()
 
 UINTN read_sector(UINT64 lba, UINT8 *buffer)
@@ -149,8 +149,6 @@ UINTN input_boolean(CHARN *prompt, BOOLEAN *bool_out)
 
 #ifdef __MAKEWITH_TIANO
 
-extern EFI_DXE_SERVICES  *gDS;
-
 // EFI_GUID gEfiDxeServicesTableGuid = { 0x05AD34BA, 0x6F02, 0x4214, { 0x95, 0x2E, 0x4D, 0xA0, 0x39, 0x8E, 0x2B, 0xB9 }};
 
 // Minimal initialization function
@@ -160,7 +158,6 @@ static VOID InitializeLib(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *System
    gBS            = SystemTable->BootServices;
    //    gRS            = SystemTable->RuntimeServices;
    gRT = SystemTable->RuntimeServices; // Some BDS functions need gRT to be set
-//   EfiGetSystemConfigurationTable (&gEfiDxeServicesTableGuid, (VOID **) &gDS);
 
 //   InitializeConsoleSim();
 }