Migrate from GitHub to SourceForge with this tool. Check out all of SourceForge's recent improvements.

#169 Automatic LASTDRIVE is set wrong when booting from floppy and 3 hd partitions are present

lastdrive (1)

I have created a simple FreeDOS bootdisk using latest kernel (exact version and build date visible on attached screenshots).

According to the FreeDOS help, no LASTDRIVE directive in CONFIG.SYS should be required in the most typical case (one CD drive only):

By default, FreeDOS will set x high enough for all floppy drives and
detectable hard drive partitions, plus one for a CD or other drive.
You may want to set x higher if you wish to use more than one drive that
FreeDOS cannot detect automatically (CD drives, zip drives etc.).

Unfortunately the above doesn't seem to be correct, at least not when tested under VirtualBox. The boot disk is able to provide a letter drive for the CD driver as long as there is less than 3 partitions on the local hard disk. But if I create 3 partitions (either three primary partitions or one primary and one extended with two logical inside), then the CD driver is unable to obtain a drive letter any more.

Attached screenshots should be self-explanatory. As soon as I set manually LASTDRIVE=Z, the CD driver is able to work again, independently of the hd partitionning scheme.

Note: the problem does not occur when FreeDOS is being booted from hard disk. It only happens when booted from a floppy (either floppy drive or a floppy image emulated by a boot CD).

1 Attachments


  • Mateusz Viste

    Mateusz Viste - 2016-12-05

    and here the content of the autoexec.bat and config.sys boot files

  • Mateusz Viste

    Mateusz Viste - 2016-12-05

    erratum: the problem does appear both when booted from a floppy and when booted from hard disk, sorry for the confusion.

  • Anthony Williams

    AFAIK, DOS usually sets "LASTDRIVE=E" by default unless told to do otherwise.

  • JohnT

    JohnT - 2017-01-07

    My system is currently set to have three DOS partitions and several Linux partitions, as well as a couple of thumb drives usually sitting in USB ports. The installer can't find the CD/DVD drive, so I can't get the FreeDOS upgrade installed and see if upgrading works reasonably.


Log in to post a comment.