[syslinux] Re: [fd-dev] Problem with memdisk and Free FDISK
H. Peter Anvin
hpa at zytor.com
Mon Jul 7 14:12:31 PDT 2003
Well, I haven't actually been able to compile Free FDISK because of
missing dependencies (if someone can give me a .bat file that I can just
run in the fdisk tree I'll try again, otherwise I don't really have time
for this. I *do* have Borland C++ 3.1 available.)
However, I noticed that it looks like part_table[].ext_int_13 never
actually gets initialized if INT 13h AH=41h returns CF=1
(Check_For_INT13_Extensions.)
Also, ah_register is set to a byte value, but the variable is an
unsigned int.
I suggest rewriting it something like this:
/* Check for interrupt 0x13 extensions */
void Check_For_INT13_Extensions()
{
int carry;
int drive_number=0x80;
unsigned char ah_register;
unsigned int bx_register;
unsigned int cx_register;
#ifdef DEBUG
if(debug.lba==TRUE)
{
Clear_Screen(NULL);
Print_Centered(0,"void Check_For_INT13_Extensions() debugging
screen",BOLD);
printf("\n\n drive int 0x13 ext? access w/packet\n\n");
}
#endif
do
{
carry=0;
asm{
mov ah,0x41
mov bx,0x55aa
mov dl,BYTE PTR drive_number
int 0x13
mov BYTE PTR ah_register,ah
mov WORD PTR bx_register,bx
mov WORD PTR cx_register,cx
adc WORD PTR carry, 0 /* Set carry if CF=1 */
}
part_table[(drive_number-128)].ext_int_13=FALSE;
if( !carry && (bx_register==0xaa55) )
{
flags.use_extended_int_13=TRUE;
part_table[(drive_number-128)].ext_int_13=TRUE;
/* ... etc ... */
More information about the Syslinux
mailing list