Skip to content
This repository has been archived by the owner on Dec 14, 2023. It is now read-only.

Commit

Permalink
Import Joyent/SmartOS fix for BIOS extended write.
Browse files Browse the repository at this point in the history
This is taken from the bug report:
"OS-6604 uefi-edk2 needs to support extended write for bhyve"
https://smartos.org/bugview/OS-6604

 and the patch from
TritonDataCenter/illumos-extra@065d8bd
  • Loading branch information
Peter Grehan committed Apr 8, 2018
1 parent a8616db commit 789e449
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions BhyvePkg/Csm/BhyveCsm16/Bios.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,22 @@ InterruptVector0x13(EFI_IA32_REGISTER_SET *Regs)

Status = mDeviceBlockIo->ReadBlocks(mDeviceBlockIo, mDeviceBlockIo->Media->MediaId, AddressPacket->Lba, AddressPacket->NumberOfBlocks * mDeviceBlockIo->Media->BlockSize, (VOID *)(UINT64)(((AddressPacket->SegOffset >> 16) << 4) + (UINT16)AddressPacket->SegOffset));

DPRINTF (DBG_VERB, ("XXX Status = 0x%x\n", Status));
Regs->E.EFlags.CF = 0;
Regs->H.AH = 0;
break;
case 0x43: /* Extended Write */
DPRINTF (DBG_VERB, ("XXX InterruptVector0x13() Extended Write Drive=0%x Packet=0x%x:0x%x\n", Regs->H.DL, Regs->E.DS, Regs->X.SI));
AddressPacket = (EDD_DEVICE_ADDRESS_PACKET *)(UINT64)((Regs->X.DS << 4) + (Regs->X.SI));

DPRINTF (DBG_VERB, ("XXX Packet->NumberOfBlocks=%d\n", AddressPacket->NumberOfBlocks));
DPRINTF (DBG_VERB, ("XXX Packet->Lba=0x%llx\n", AddressPacket->Lba));
DPRINTF (DBG_VERB, ("XXX Packet->SegOffset=0x%x\n", AddressPacket->SegOffset));
DPRINTF (DBG_VERB, ("XXX Packet->TransferBuffer=0x%llx\n", AddressPacket->TransferBuffer));
DPRINTF (DBG_VERB, ("XXX Segment 0x%x Offset=0x%x %x\n", AddressPacket->SegOffset >> 16, AddressPacket->SegOffset & 0xffff, (((AddressPacket->SegOffset >> 16) << 4) + (UINT16)AddressPacket->SegOffset)));

Status = mDeviceBlockIo->WriteBlocks(mDeviceBlockIo, mDeviceBlockIo->Media->MediaId, AddressPacket->Lba, AddressPacket->NumberOfBlocks * mDeviceBlockIo->Media->BlockSize, (VOID *)(UINT64)(((AddressPacket->SegOffset >> 16) << 4) + (UINT16)AddressPacket->SegOffset));

DPRINTF (DBG_VERB, ("XXX Status = 0x%x\n", Status));
Regs->E.EFlags.CF = 0;
Regs->H.AH = 0;
Expand Down

0 comments on commit 789e449

Please sign in to comment.