diff options
| -rw-r--r-- | Private/NewBoot/BootKit/BootKit.hxx | 10 | ||||
| -rw-r--r-- | Private/NewBoot/Source/HEL/AMD64/BootTextWriter.cxx | 4 | ||||
| -rw-r--r-- | Private/NewBoot/Source/makefile | 2 |
3 files changed, 8 insertions, 8 deletions
diff --git a/Private/NewBoot/BootKit/BootKit.hxx b/Private/NewBoot/BootKit/BootKit.hxx index 76bfbfb0..2d8b535d 100644 --- a/Private/NewBoot/BootKit/BootKit.hxx +++ b/Private/NewBoot/BootKit/BootKit.hxx @@ -229,12 +229,12 @@ public: return false; } - if (blockPart->DiskSize != this->fDiskDev.GetDiskSize()) { + if (blockPart->DiskSize != this->fDiskDev.GetDiskSize() || + blockPart->DiskSize < 1 || + blockPart->SectorSize != BootDev::kSectorSize) { EFI::ThrowError(L"Invalid-Disk-Geometry", L"Invalid disk geometry."); - } - - if (blockPart->DiskSize < 1) { - EFI::ThrowError(L"Invalid-Disk-Geometry", L"Invalid disk geometry."); + } else if (blockPart->PartitionName[0] == 0) { + EFI::ThrowError(L"Invalid-Partition-Name", L"Invalid disk partition."); } BTextWriter writer; diff --git a/Private/NewBoot/Source/HEL/AMD64/BootTextWriter.cxx b/Private/NewBoot/Source/HEL/AMD64/BootTextWriter.cxx index ff30ff95..fc91a02a 100644 --- a/Private/NewBoot/Source/HEL/AMD64/BootTextWriter.cxx +++ b/Private/NewBoot/Source/HEL/AMD64/BootTextWriter.cxx @@ -75,8 +75,8 @@ BTextWriter &BTextWriter::Write(const Long &x) { BTextWriter &BTextWriter::_Write(const Long &x) { #ifdef __DEBUG__ - int y = x / 16; - int h = x % 16; + UInt64 y = (x > 0 ? x : -x) / 16; + UInt64 h = (x > 0 ? x : -x) % 16; if (y) this->_Write(y); diff --git a/Private/NewBoot/Source/makefile b/Private/NewBoot/Source/makefile index 4d8e1100..92128b02 100644 --- a/Private/NewBoot/Source/makefile +++ b/Private/NewBoot/Source/makefile @@ -70,7 +70,7 @@ run-efi-amd64: .PHONY: epm-img epm-img: - qemu-img create -f qcow2 $(IMG) 1G + qemu-img create -f qcow2 $(IMG) 512M qemu-img create -f qcow2 $(IMG_2) 512M .PHONY: download-edk |
