Miller, Shao
2009-Jun-02 00:33 UTC
[syslinux] [PATCH] [memdisk] Add some DriveShiftLimit logic
Let's try that patch again... Here's a better one, instead. I tested with: qemu -kernel memdisk -initrd memdsk.hdd -append pause -hda one.hdd -hdb two.hdd -hdc three.hdd -hdd four.hdd On each HDD image, I had a file (and volume label) to identify the HDD with the DOS 'dir' command. The expected behaviour was met; I wound up with DOS drive letters: C: memdsk.hdd D: one.hdd E: two.hdd F: three.hdd G: four.hdd Always room for improvement, but seems to work. I probe with INT 13h, AH=15h. One can enable a little debug message by #defining DBG_DSKPROBE. Enjoy! - Shao Miller -----Original Message----- From: Miller, Shao Sent: Monday, June 01, 2009 16:48 To: For discussion of Syslinux and tftp-hpa Subject: [PATCH] [memdisk] Add some DriveShiftLimit logic Instead of MEMDISK always inserting itself and shifting all BIOS drives up by one, we are pursuing logic whereby MEMDISK's "installer" stage will: 1. Decide which BIOS drive numer we desire 2. Probe for a contiguous range of already-present BIOS drives starting with our desired number 3. Save the top-most drive number of this contiguous range 4. Install the INTerrupt hooks 5. Our INTerrupt code will only shift drive numbers within this range Why? As an example, suppose that we have BIOS drives 0x00, 0x80, 0x81, 0xE8. If we wish to hook our MEMDISK disk as the new 0x80, we shift the previous 0x80 to become 0x81, we shift the previous 0x81 to become 0x82, but we leave 0xE8 alone, because it's outside of the contiguous range we probed for starting at 0x80. In this way, any system code already installed and relying on drive 0xE8 will be left sane. Previously, drive 0xE8 would have been shifted to become 0xE9, possibly breaking such system code. This is just an example. This patch adds a DriveShiftLimit field to store the top-most drive numer that we are interested in shifting. The drive probing logic is not fully implemented in this patch, but the "stage is set" for further refinement. - Shao Miller -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001--memdisk-Add-some-DriveShiftLimit-logic.patch Type: application/octet-stream Size: 7441 bytes Desc: 0001--memdisk-Add-some-DriveShiftLimit-logic.patch URL: <http://www.zytor.com/pipermail/syslinux/attachments/20090601/91cef348/attachment.obj>