gEmuVirtualDisksGuid = { 0xf2ba331a, 0x8985, 0x11db, { 0xa4, 0x06, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } }\r
gEmuPhysicalDisksGuid = { 0xf2bdcc96, 0x8985, 0x11db, { 0x87, 0x19, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } }\r
\r
-# gEmuFileSystemGuid = {0xf2c16b9e, 0x8985, 0x11db, {0x92, 0xc8, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35}}\r
-# gEmuSerialPortGuid = {0x6d3a727d, 0x66c8, 0x4d19, {0x87, 0xe6, 0x02, 0x15, 0x86, 0x14, 0x90, 0xf3}}\r
-# gEmuNetworkGuid = {0x081603B4, 0x0F1D, 0x4022, {0xB6, 0xFD, 0x4C, 0xE3, 0x5E, 0x09, 0xA1, 0xA6}}\r
-\r
[PcdsFixedAtBuild]\r
gInOsEmuPkgTokenSpaceGuid.PcdEmuFlashNvStorageVariableBase|0x0|UINT64|0x00001014\r
gInOsEmuPkgTokenSpaceGuid.PcdEmuFlashNvStorageFtwSpareBase|0x0|UINT64|0x00001015\r
gInOsEmuPkgTokenSpaceGuid.PcdEmuMemorySize|L"64!64"|VOID*|0x0000100c\r
\r
#\r
- # filename[:][R|F][O|W]\r
+ # filename[:[R|F][O|W]][:BlockSize]\r
# filename can be a device node, like /dev/disk1\r
# R - Removable Media F - Fixed Media\r
# O - Write protected W - Writable\r
# Default is Fixed Media, Writable\r
- # Size comes from file or device. \r
+ # For a file the default BlockSize is 512, and can be overridden via BlockSize,\r
+ # for example 2048 for an ISO CD image. The block size for a device comes from\r
+ # the device and is not configurable. \r
+ # Device Size comes from file or device. \r
# On Mac OS X you can use Disk Utility to create .dmg files and mount then like disks\r
- gInOsEmuPkgTokenSpaceGuid.PcdEmuVirtualDisk|L"FW;40960;512"|VOID*|0x00001001\r
+ gInOsEmuPkgTokenSpaceGuid.PcdEmuVirtualDisk|L"disk.dmg:FW"|VOID*|0x00001001\r
\r
gInOsEmuPkgTokenSpaceGuid.PcdEmuGop|L"GOP Window"|VOID*|0x00001018\r
gInOsEmuPkgTokenSpaceGuid.PcdEmuFileSystem|L".!../../../../../EdkShellBinPkg/bin/ia32/Apps"|VOID*|0x00001004\r
BOOLEAN WriteProtected;\r
\r
UINT64 NumberOfBlocks;\r
+ UINT32 BlockSize;\r
\r
EMU_BLOCK_IO_PROTOCOL EmuBlockIo;\r
EFI_BLOCK_IO_MEDIA *Media;\r
}\r
#endif\r
\r
- } else if (fstatfs (Private->fd, &buf) == 0) {\r
- //\r
- // Works for files, not devices\r
- //\r
- Private->Media->BlockSize = buf.f_bsize;\r
- Private->Media->OptimalTransferLengthGranularity = buf.f_iosize/buf.f_bsize;\r
+ } else {\r
+ Private->Media->BlockSize = Private->BlockSize;\r
Private->NumberOfBlocks = DivU64x32 (FileSize, Private->Media->BlockSize);\r
Private->Media->LastBlock = Private->NumberOfBlocks - 1;\r
+ \r
+ if (fstatfs (Private->fd, &buf) == 0) {\r
+ Private->Media->OptimalTransferLengthGranularity = buf.f_iosize/buf.f_bsize;\r
+ }\r
} \r
\r
DEBUG ((EFI_D_INIT, "%HEmuOpenBlock: opened %a%N\n", Private->Filename));\r
Private->Signature = EMU_BLOCK_IO_PRIVATE_SIGNATURE;\r
Private->Thunk = This;\r
CopyMem (&Private->EmuBlockIo, &gEmuBlockIoProtocol, sizeof (gEmuBlockIoProtocol));\r
- Private->fd = -1;\r
+ Private->fd = -1;\r
+ Private->BlockSize = 512;\r
\r
Private->Filename = StdDupUnicodeToAscii (This->ConfigString);\r
if (Private->Filename == NULL) {\r
if (*Str == 'O' || *Str == 'W') {\r
Private->WriteProtected = (BOOLEAN) (*Str == 'O');\r
}\r
+ if (*Str == ':') {\r
+ Private->BlockSize = strtol (++Str, NULL, 0);\r
+ break;\r
+ }\r
}\r
}\r
\r
## @file\r
#\r
-# EFI/Framework Emulation Platform with UEFI HII interface supported.\r
+# UEFI/PI Emulation Platform with UEFI HII interface supported.\r
#\r
# The Emulation Platform can be used to debug individual modules, prior to creating\r
# a real platform. This also provides an example for how an DSC is created.\r
\r
gInOsEmuPkgTokenSpaceGuid.PcdEmuApCount|L"1"\r
\r
+ # For a CD-ROM/DVD use L"diag.dmg:RO:2048"\r
gInOsEmuPkgTokenSpaceGuid.PcdEmuVirtualDisk|L"disk.dmg:FW"\r
gInOsEmuPkgTokenSpaceGuid.PcdEmuGop|L"GOP Window"\r
gInOsEmuPkgTokenSpaceGuid.PcdEmuFileSystem|L".!../../../../EdkShellBinPkg/Bin"\r
[Components]\r
!if $(SEC_ONLY)\r
##\r
- # SEC Phase modules\r
+ # Emulator, OS POSIX application\r
##\r
InOsEmuPkg/Unix/Sec/SecMain.inf\r
!else\r
MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf\r
IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf\r
MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf \r
- # {\r
- # <LibraryClasses> \r
- # NULL|InOsEmuPkg/Library/DevicePathTextLib/DevicePathTextLib.inf\r
- # }\r
+ #{\r
+ # <LibraryClasses> \r
+ # NULL|InOsEmuPkg/Library/DevicePathTextLib/DevicePathTextLib.inf\r
+ #}\r
\r
MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf\r
MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf\r
ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf\r
SortLib|ShellPkg/Library/UefiSortLib/UefiSortLib.inf\r
PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf\r
+# SafeBlockIoLib|ShellPkg/Library/SafeBlockIoLib/SafeBlockIoLib.inf\r
+# SafeOpenProtocolLib|ShellPkg/Library/SafeOpenProtocolLib/SafeOpenProtocolLib.inf\r
+\r
<PcdsFixedAtBuild>\r
gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0xFF\r
gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE\r