On Wed, Jan 05, 2011 at 09:32:33PM -0500, Kevin O'Connor wrote:
On Wed, Jan 05, 2011 at 05:18:38PM +0200, Gleb Natapov wrote:
Some guests (such as Linux) expect BIOS to behave according to T13 EDD3.0 spec. T13 spec is much better then Phoenix since it provides more information about interface and device paths. This patch adds support for the spec. If guest provides buffer with enough space for T13 EDD info return EDD according to T13 spec otherwise use Phoenix one.
I think Sebastian has looked at this as well.
Yes, I saw the thread. You suggested there to handle both specs simultaneously and this is what I did here.
Signed-off-by: Gleb Natapov gleb@redhat.com diff --git a/src/disk.c b/src/disk.c index f7bfe9c..fb7833a 100644 --- a/src/disk.c +++ b/src/disk.c @@ -503,6 +503,7 @@ static void disk_1348(struct bregs *regs, struct drive_s *drive_g) { u16 size = GET_INT13DPT(regs, size);
u16 t13 = size == 74;
// Buffer is too small if (size < 26) {
@@ -553,8 +554,9 @@ disk_1348(struct bregs *regs, struct drive_s *drive_g) // EDD 2.x
int bdf;
- u16 iobase1;
- u64 device_path;
- u16 iobase1 = 0;
- u64 device_path = 0;
- u8 channel = 0; SET_INT13DPT(regs, size, 30); if (type == DTYPE_ATA || type == DTYPE_ATAPI) { u16 ebda_seg = get_ebda_seg();
@@ -573,6 +575,7 @@ disk_1348(struct bregs *regs, struct drive_s *drive_g) iobase1 = GET_GLOBALFLAT(chan_gf->iobase1); bdf = GET_GLOBALFLAT(chan_gf->pci_bdf); device_path = slave;
channel = GET_GLOBALFLAT(chan_gf->chanid); u16 options = 0; if (type == DTYPE_ATA) {
@@ -613,8 +616,6 @@ disk_1348(struct bregs *regs, struct drive_s *drive_g) SET_INT13DPT(regs, dpte_segment, 0); SET_INT13DPT(regs, dpte_offset, 0); bdf = GET_GLOBAL(drive_g->cntl_id);
device_path = 0;
iobase1 = 0;
}
if (size < 66) {
@@ -632,17 +633,20 @@ disk_1348(struct bregs *regs, struct drive_s *drive_g) SET_INT13DPT(regs, host_bus[0], 'P'); SET_INT13DPT(regs, host_bus[1], 'C'); SET_INT13DPT(regs, host_bus[2], 'I');
SET_INT13DPT(regs, host_bus[3], 0);
SET_INT13DPT(regs, host_bus[3], ' ');
What if we're not in t13 mode? Should this be: u8 fillchar = t13 ? ' ' : 0; SET_INT13DPT(regs, host_bus[3], fillchar);
Phoenix does not specify padding. Are you sure phoenix has to have zero padding?
[...]
- if (13) {
That looks like a typo.
Oops. Will resend.
-- Gleb.