This lets us treat the file as though it were a physical disk. Now we attach the hard disk image file harddisk.img to a loopback device. Note: The partition is configured as the mtools C: drive, while under FreeDOS it is the D: drive.įormatting the Hard Disk Image using Linux Verify that you can copy files to/from the partition using the mtools utilities. Since the partition is already formatted, just mtsetup harddisk.img should do it. You will probably need to reboot FreeDOS after running fdisk, do so, and then use format to format the new partition (it should be the D: partition.) (All of this seems complicated, but I wish adding a new disk drive to a real PC were this easy.) Now create files and/or directories on your new D: partition.Ĭonfigure mtools to access the new partition. fdisk writes a boot loader and partition table to the MBR of the drive. (You still need the AT0 master drive because it contains the FreeDOS operating system.) Boot FreeDOS, use fdisk to create a single primary partition on the new disk drive (make sure you are partitioning the new slave drive and not the original master drive). So change the bochsrc.txt file so that harddisk.img is now the AT0 slave drive. Unfortunately, there is not an mtools utility for partitioning a hard disk image and writing a boot manager to the MBR. Create the image as follows (C HS 20 1663 = 20160):ĭd if=/dev/zero of=harddisk.img bs=512 count=20160įormatting the Hard Disk Image using FreeDOS We need an integer value for C so a value of C = 20 will give us about a 10 MB hard disk image. We will normally work with 10 MB hard disk images, not GB disk images.) Assuming S=63 and H=16, we can figure out how many cylinder we need for a 10 MB drive: C = (10x1024x1024)/(63x16x512) = 20.317. I'm not sure if Bochs and/or FreeDOS support LBA, but that doesn't really matter to us. (Note: Newer PC BIOSes use a different geometry scheme know as LBA that allows for much larger drives, but for a long time PCs could get by using CHS addressing because no one could dream of drives ever exceeding the 8.4 GB size limit. The largest allowable hard disk size is therefore 1024255 63512 or about 8.4 GB. The maximum allow value for H is 255 and that for S is 63. We can figure out the total disk capacity (in bytes) from: C HS 512. Each CD-ROM has a certain number of tracks (or cylinders) and each track has a certain number of disk sectors. The number of CD-ROM disks would correspond to the number of heads in a hard disk drive. Visualize a stack of CD-ROM disks all turning on a common spindle. Hard disks have a particular logical geometry that is specified in terms of cylinders/head/sectors or CHS. For the 10 megabyte example given, the corresponding bochs lines are:Īta0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14Īta0-master: type=disk, path="harddisk.img", cylinders=20, heads=16, spt=63, translation=auto, biosdetect=auto, model="Generic 1234" The following instructions describe how to make a disk image of arbitrary size. It was obtained by using dd_ to read the raw contents of a 1.44 megabyte floppy disk.Īnthony Richards was nice enough to post the following instructions to the RTEMS Users mailing list on how to create a file that is a hard disk image for use from Bochs. I used an old Grub floppy image from the 4.5.0 release series. TBD: Using Bochs Network Driver with RTEMS This page captures the instructions and setup information for Bochs and RTEMS.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |