#121 ioctl functions 08/48 41/61 address the wrong sector

open
nobody
None
5
2014-08-23
2014-05-27
No

On FreeDOS kernel 2040, ioctl (INT 21, AX=440D) subfunctions CH=08/48 CL=41/61 address the sector relative to the beginning of the filesystem/partition.

On MS-DOS 6.22 the same functions address the sector relative to the beginning of the device, so that head=0 cylinder=0 sector=0 refers to the MBR.

Discussion

  • Kenneth Davis

    Kenneth Davis - 2014-05-30

    Bug is confirmed in FD kernel, working on a fix.

     
  • H. Peter Anvin

    H. Peter Anvin - 2014-05-31

    This was, indeed, exposed by the Syslinux installer, in particular the -m option (write MBR).

     
  • H. Peter Anvin

    H. Peter Anvin - 2014-05-31

    Once this is fixed, it would be great to know if there is a way to detect the faulty FreeDOS versions so we can print an error message rather than overwriting someone's filesystem, or apply a workaround if one exists.

     
  • Kenneth Davis

    Kenneth Davis - 2014-05-31

    Int 0x21 function 0x30 get DOS version, if BH=0xFD and BL < 42 then will use partition relative reads/writes (faulty versions).

     

Log in to post a comment.