Sorry for the cross-post, but I do not know whether this is a bug in Free FDISK, memdisk, or neither. This problem is with Free FDISK 1.2.1 and memdisk 2.04. I am using PXELINUX+memdisk to boot to a virtual hard drive containing MS-DOS 6.22. This works fine; DOS boots and the virtual drive appears as C:. Now I want to use Free FDISK to partition the *physical* drive. But when I run any of the following commands: fdisk /info fdisk /info 1 fdisk /info 2 ...it says: Invalid drive designation...Operation Terminated. It then exits with status 5. However, if I do: set FFD_VERSION=6 fdisk /info ...it correctly displays the partition table for the virtual drive. If I then do "fdisk /info 2", it displays the partition table for the physical disk, but only the first 8 gigabytes (not surprisingly). So setting FFD_VERSION=6 is only a partial workaround, because sometimes I need to partition the entire drive. Browsing the fdisk source code, I suspect I could work around this problem by setting "EMULATE_DISK=1", but since my copy of fdisk.exe does not have debugging enabled, this option is not recognized. Questions: 1) Where can I obtain a copy of fdisk.exe with DEBUG enabled? (Do I have to purchase Borland C++ and build it myself?) 2) This appears to be some sort of bug with INT13 extensions. Is it most likely a bug in fdisk, memdisk, or my BIOS? Just curious. 3) What can I do to help fix this? Thanks! - Pat
Brian E. Reifsnyder
2003-Jul-06 00:02 UTC
[syslinux] Re: Problem with memdisk and Free FDISK
Hello,> Sorry for the cross-post, but I do not know whether this is a bug in > Free FDISK, memdisk, or neither.. . .> > It then exits with status 5. > > However, if I do: > > set FFD_VERSION=6 > fdisk /info > > ...it correctly displays the partition table for the virtual drive.This indicates that the problem is with the BIOS (virtual BIOS?). When FFD_VERSION=6 is set, Free FDISK only accesses the hard disks via legacy interrupt 0x13. Support for hard disks > 8GB is disabled.> If I then do "fdisk /info 2", it displays the partition table for the > physical disk, but only the first 8 gigabytes (not surprisingly). So > setting FFD_VERSION=6 is only a partial workaround, because sometimes > I need to partition the entire drive. > > Browsing the fdisk source code, I suspect I could work around this > problem by setting "EMULATE_DISK=1", but since my copy of fdisk.exe > does not have debugging enabled, this option is not recognized.Nope. The EMULATE_DISK function only creates a fake simulation of a hard disk in the buffers used by Free FDISK. This "emulated drive" is used in order to debug a partitioning issue when a test hard disk is not available. (i.e. I originally used it when I re-wrote Free FDISK on a laptop....no test hard drive was available.) Over 90% of all partitioning problems could be resolved without another hard drive once the functions to physically access the hard disk were working.> Questions: > > 1) Where can I obtain a copy of fdisk.exe with DEBUG enabled? (Do I > have to purchase Borland C++ and build it myself?)If you would like, I could compile one for you.> 2) This appears to be some sort of bug with INT13 extensions. Is it > most likely a bug in fdisk, memdisk, or my BIOS? Just curious.My first thought would be that it is in memdisk. But, I am not familiar with PXELINUX. My guess, from your description, is that you are attempting to run Free FDISK from within an emulated DOS machine (DOS Emu? Bochs?).> 3) What can I do to help fix this?I suppose that it would be possible to add the capability to selectively support interupt 0x13 extensions. For example, change Free FDISK such that you could instruct it to use interrupt 0x13 extensions with disk 1 but not with disk 2. I don't think it would be too hard to do this. What do you think? Regards, Brian Reifsnyder reifsnyderb at mindspring.com
Patrick J. LoPresti
2003-Jul-07 19:00 UTC
[syslinux] Re: [fd-dev] Problem with memdisk and Free FDISK
"Brian E. Reifsnyder" <reifsnyderb at mindspring.com> writes:> > Browsing the fdisk source code, I suspect I could work around this > > problem by setting "EMULATE_DISK=1", but since my copy of fdisk.exe > > does not have debugging enabled, this option is not recognized. > > Nope. The EMULATE_DISK function only creates a fake simulation of a > hard disk in the buffers used by Free FDISK.As long as it makes it skip drive 1 and move on to drive 2, that would actually be enough. But it would be a hack, anyhow. I would much prefer to see Free FDISK and memdisk play together nicely.> > Questions: > > > > 1) Where can I obtain a copy of fdisk.exe with DEBUG enabled? (Do I > > have to purchase Borland C++ and build it myself?) > > If you would like, I could compile one for you.If we can get this fixed easily, that will not be necessary...> My first thought would be that it is in memdisk. But, I am not > familiar with PXELINUX. My guess, from your description, is that > you are attempting to run Free FDISK from within an emulated DOS > machine (DOS Emu? Bochs?).It is real Microsoft DOS 6.22, but on a virtual disk. memdisk hooks the BIOS to create a virtual drive from which you can boot DOS (among other things). I use it in my project (http://unattended.sourceforge.net/) to support booting from CD-ROM and from the network. You can download the source from the SYSLINUX home page at <http://syslinux.zytor.com/>.> I suppose that it would be possible to add the capability to > selectively support interupt 0x13 extensions. For example, change > Free FDISK such that you could instruct it to use interrupt 0x13 > extensions with disk 1 but not with disk 2. I don't think it would > be too hard to do this. What do you think?That would solve my problem. Although it might be conceptually simpler to just skip drive 1 entirely when I tell fdisk to operate on drive 2... But having these tools work together seamlessly would be even better. Thanks! - Pat