From d5d62c379dde5a852ad049286cbabb770c4955a1 Mon Sep 17 00:00:00 2001 From: Shao Miller Date: Fri, 31 Jul 2009 21:45:46 -0400 Subject: [PATCH] [memdisk] Add drive shift limit logic We will not shift drives greater than or equal to a maximum BIOS drive number. This is hard-coded to drive 0xFF for now. This addition is in support of future disk probing logic, which can decide what the drive shift limit should be. --- memdisk/memdisk.inc | 13 +++++++++++++ memdisk/setup.c | 4 ++++ 2 files changed, 17 insertions(+) diff --git a/memdisk/memdisk.inc b/memdisk/memdisk.inc index 3c79b62..7b63c05 100644 --- a/memdisk/memdisk.inc +++ b/memdisk/memdisk.inc @@ -147,6 +147,12 @@ Int13Start: jz our_drive ; If ZF=1, we have an exact match cmp dl,[cs:DriveNo] jb .nomatch ; Drive < Our drive + cmp dl,[cs:DriveShiftLimit] + jae .nomatch ; Drive > The maximum drive + ; number that we will shift for. + ; This leaves any higher-up BIOS + ; drives alone, such as an optical + ; disc drive 0xA0 or 0xE0 dec dl ; Drive > Our drive, adjust drive # .nomatch: TRACER '!' @@ -1013,6 +1019,13 @@ DPT_ptr dw 0 ; If nonzero, pointer to DPT MDI_Len equ $-MemDisk_Info ; ---- MDI structure ends here --- +DriveShiftLimit db 0ffh ; Installer will [soon] probe for + ; a range of contiguous drives. + ; Any BIOS drives above this region + ; shall not be impacted by our + ; shifting behaviour + db 0 ; pad to a DWORD + dw 0 ; pad to a QWORD MemInt1588 dw 0 ; 1MB-65MB memory amount (1K) Cylinders dw 0 ; Cylinder count diff --git a/memdisk/setup.c b/memdisk/setup.c index 7f02663..b2444f6 100644 --- a/memdisk/setup.c +++ b/memdisk/setup.c @@ -107,6 +107,10 @@ struct patch_area { uint16_t dpt_ptr; /* End of the official MemDisk_Info */ + uint8_t driveshiftlimit; /* Do not shift drives above this region */ + uint8_t _pad2; /* Pad to DWORD */ + uint16_t _pad3; /* Pad to QWORD */ + uint16_t memint1588; uint16_t cylinders; -- 2.7.4