FreeDOS 1.3 Installation

From docs
Jump to navigation Jump to search

Install FreeDOS on the xi8088 with a floppy and hard drive

This page describes how to install FreeDOS 1.3 on the Xi8088 however the same steps "should" work on any other system. If you want to save time then just purchase a Compact Flash card with a bootable FreeDOS already installed at my eBay store: [https://www.ebay.com/usr/numberf55/]. Its sold under the XT-CF Lite Parts listing.

First ensure that your Floppy and XTIDE cards are working properly. If something is not working see the troubleshooting sections for the card on wiki.noami.us.

Download the [FreeDOS 1.3 Floppy Edition] and write the floppy images to your disks. Both the [Gotek] and physical floppy drives work in this situation.

In order to have control over the size of your drive it is recommended to partition your CF card before installing FreeDOS. If you have access to a Linux machine or a Raspberry Pi system you can use that to partition your CF card. I used a USB to compact flash adapter (also available at my eBay store) to attach to my Raspberry Pi.

Use the following steps to partition your compact flash.

# ***********************************************************************************
# *** WARNING *** before running any of the commands below make sure you know the 
#                 device id of the disk you are targeting for example run: sudo lsblk
# ***********************************************************************************
# Insert the flash card and try to identify device name
# In my case it was /dev/sdc but it may be different for your system.

# Use fdisk and enter the following commands:
#d - Delete any existing partitions
#o - Create a DOS Partition table
#n - Create a new (P)rimary partition (1) with default first sector and sector (+2G) in size
#t - Change the partition type to (6) which is FAT16
#a - Press (a) to make the partition boot-able
# finally press (p) to print the settings and type (w) to write them

Disk /dev/sdc: 3.8 GiB, 4017807360 bytes, 7847280 sectors
Disk model: USB CARD READER
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x8d2910c2

Device     Boot Start     End Sectors Size Id Type
/dev/sdc1  *     2048 4196351 4194304   2G  6 FAT16

Now that your compact flash is partitioned you can proceed to install FreeDOS from floppies.

Select or insert the first floppy disk and restart the Xi8088.

Keep your finger close to the A key on the keyboard. Once prompted by XTIDE type A to boot from the floppy disk. The FreeDOS installation will begin. Just follow the on screen instructions to proceed with the install. It takes a few hours to install best to just insert the next floppy and walk away for about an hour for each disk. Once installed it will ask you to reboot the system. This time just let it boot from the C drive.

The floppy freeDOS setup takes a few hours and about 95MB of hard drive space. The rest of 2GB of space on the C: primary partition is available to use for your programs. If your CF card has more than 2Gb then you can create extended partitions to use that space but that topic will not be covered here.

Once you have FreeDOS installed its a good idea to back it up to avoid spending the few hours again incase you want to reinstall it.

To backup the primary partition + MBR

# Turn off the system and place the CF card into the Linux machine.
# You may optionally zero fill the empty space in the partition to save space when zipping. see the link to do this below
# To take an image of the partition type:
sudo dd if=/dev/sdc1 of=freeDOS13_2048_4196351.img bs=2M
# You will also need to copy the Master Boot Record which is the first 512 bytes of the /dev/sdc device
sudo dd if=/dev/sdc of=freeDOS13_2048_4196351.mbr bs=512 count=1

# /dev/sdc1 - this is the name of the primary partition your system may identify it differently
# the numbers in the output filename denote the start and end sector which will be copied. check the output of fdisk to determine these numbers.
# These numbers are important to know because the way FAT file system works. FAT basically records file data as a linked list of sector numbers. In order for the FAT table to remain valid you need to write that file data to the same sector locations. That means when you restore the image you will need to restore it to a partition that begin and end on those sector numbers.

# once dd is complete you will have the following file
-rw-r--r--  1 pi       pi       2147483648 Mar 26 20:40 freeDOS13_2048_4196351.img
-rw-r--r--  1 pi       pi              512 Mar 26 21:11 freeDOS13_2048_4196351.mbr
# if you zero filled the empty space it will only take about 75Mb when zipped
-rw-r--r--  1 pi       pi        75M Mar 26 20:46 freeDOS13_2048_4196351.img.zip

Python3 script to zero fill the disk

To restore the primary partition + MBR

To restore the partition from an image to the CF Card do the following

# ***********************************************************************************
# *** WARNING *** before running any of the commands below make sure you know the 
#                 device id of the disk you are targeting for example run: sudo lsblk
# ***********************************************************************************
sudo dd if=freeDOS13_2048_4196351.img of=/dev/sdc1 bs=2M
# /dev/sdc1 - this is the name of the primary partition your system may identify it differently
# make sure that the /dev/sdc1 begins on sector 2048 and ends on sector 4196351 use fdisk to adjust the partition if it doesn't.
# make sure your partition has boot flag set

# Restore the Master Boot Record
sudo dd if=freeDOS13_2048_4196351.mbr of=/dev/sdc bs=512 count=1