News Categories |
Main /
Hard Disks
On this page… (hide)
1. Internal HD connection typesDOS actually doesn’t care at all about the connection, since it uses BIOS INT $13 to access the disk, however, because of the old roots of DOS, it does care about the, now very obsolete, “disk geometry”, and the “geometry” related parameters CHS (Cylinder, Head, Sector) still do “pollute” various structures of DOS and the filesystem, and can cause problems. 1.1 IDEUsed to be most popular for years, now dying. Needs a cheap but “thick” flat cable to connect the device (HD or CD/DVD) to the controller, also some IDE connectors have no mechanical protection against reversed plugging in. 1.2 SCSIWas the expensive high-tech in the past, now dying in favor of SATA. There are some SCSI drivers for DOS. No extensive documentation yet. 1.3 SATA or eSATAThe newest technology. SATA connectors and cables are much thinner than with old IDE (now also called PATA), data is transferred through few wires at a very high frequency. There are two different modes to access SATA hard disks: IDE Emulation Mode and AHCI. These modes can be set up in BIOS of the motherboard or in BIOS of the SATA controller. If there is no option in BIOS it’s probably in IDE Emulation Mode by default. Some mainboads have a “combo” controller: they provide one old IDE connector (to what one can connect 2 devices “chained” on 1 cable), and 2 SATA connectors (to what one can connect 2 devices using 2 separate cables). IDE Emulation ModeNo matter if booted from or if booted from other device. Usually no big problem, since controlled by BIOS at default, accessible by INT $13, works with DOS. If connected thought an SATA controller addon card it will be tertiary or quaternary IDE, a good tool to diagnose this is nssi . AHCIAHCI has some advantages if fully supported by the OS (= in Windows) such as Native Command Queuing and Hot Plug, in DOS it has more disadvantages. If your BIOS supports booting from (e)SATA (as it usually does, if you are using a SATA controller addon card you may need to set the BIOS up to boot SCSI) then DOS may access the device thought INT $13, performance is good but not very excellent, the BIOS will support AHCI but use it in a “simple and tiny mode” - small buffers, no queuing. Drivers, OS’es and applications using IDE (PIO or UDMA, legacy or native) will not find anything, where appropriate they “should” (and usually will) fall-back into INT $13 mode, but performance can be bad then. But if your boot device is another device then DOS will have no native access on it. There reportedly exists experimental AHCI code for DOS, but no ready-to-use driver yet. 1.4 AdaptersAdapters between IDE and SATA seem to exist (as of beginning of 2010) for both directions: IDE disk on SATA controller and SATA disk on IDE controller. No experience available. 2. SpeedThe speed of internal IDE and SATA HD’s accessed using the BIOS however can vary very much from mainboard model to model: some BIOS’es are pretty fast, some desperately slow, HD performance observed in DOS can be more than 10 times slower than it could be, and even much slower than with many “old” IDE-only PC’s! To detect IDE and SATA drives, measure the performance, and check the space for improvements, you can use Jahpeth ’s IDECHECK tool: japheth.de/dwnload4.html There are some DOS drivers available, allowing to bypass the BIOS and use the fast DMA modes: UIDE/XDMA/QDMA/QCACHE/XDMA32 , which can bring a dramatic speed boost on systems with a slow BIOS. Note that so far all of them use BIOS to search for the disks and just “replace” the BIOS implementation of INT $13, they will not find any additional disks unknown to BIOS. For the driver it wouldn’t be a big problem to support such disks, but DOS is unable to add disks after boot-up. To bypass this problem a major update of DOS kernel would be needed, with existing kernels a block device driver could do the job (as known from RAMDISK’s and some USB drivers), but no such is available for internal hard disks. 3. External USB hard disksLook at USB . 4. Hiding hard disksOn many PC’s the BIOS allows to “disable” or “hide” a hard disk in the BIOS settings without the need to actually physically disconnect it. This may be handy for multiboot purposes or for security reasons (Windows will most likely NOT infect or trash a disabled disk). Unfortunately this does not always work. Some BIOS’es do indeed have the “power” to disable the disk, so that Windows will not find it (and cannot trash it), on other PC’s the effect is unfortunately only hiding the disk from INT $13 (thus primarily from DOS), while Windows still can find and access it, as it searches the PCI bus bypassing INT $13. In such cases the remaining options are to hide partitions on the disk or to physically disconnect it. 5. Size limits, CHS vs LBAFor years hard disks suffered from size limits and bad hacks needed to bypass them. 5.1 IDE and SATAOriginal CHS sector addressing (limit cca 510 * 10^20 Bytes) got “enhanced” to “ECHS” by dropping the relation between real disk “geometry” and values passed when addressing sectors, so disks started to pretend having much more heads (8 to 255) than physically present (visible when opening the disk (don’t do this except for already dead disks !!!), usually 1 to 6). This allowed to use existing fixed amounts of bits in the IDE ports (3 sub-areas with a total of 24 bits) more efficiently, and increased the size limit to cca 7.8 * 10^30 Bytes, so YES, the size improvement factor achieved by this “move” was only cca 16. It didn’t take than long time until this limit became a problem also, so this (now “faked”) CHS method got finally dropped in favor of LBA, passing just one sector number to the disk. As this wouldn’t itself bring any useful improvement in the size limit (just 7.8 * 10^30 Bytes → 8 * 10^30 Bytes, as we got still only 24 bits to address sectors + 9 bits to address Bytes inside the sector), 4 more bits were “found” in the IDE registers giving a total amount of 28 bits, and size limit of 128 * 10^30 Bytes - this was called LBA28 then, and again, the improvement factor was only cca 16 (or 17 this time). Of course the problem was not finally fixed, and soon as next (more wise) step, a “double-decker” usage of the 24 bits in the IDE registers was introduced, giving 48 bits now, raising the limit by factor 2^20 (more than 1′000′000) - this is called LBA48 and the size limit is 128 * 2^50 Bytes, far above disk capacities existing in present or realistically expected in near future. All SATA disks use LBA48. 5.2 AHCIAHCI doesn’t depend from legacy IDE registers, and reportedly uses LBA64 (size limit of incredible 8 * 2^70 Bytes with a sector size of 512 Bytes). 5.3 USBUSB doesn’t depend from legacy IDE registers either. USB 1.0 UHCI and OHCI protocols use reportedly LBA32, so the size limit is 2 * 2^40 Bytes, EHCI uses LBA64 (?). 5.4 BIOS INT $13Doesn’t “directly” depend from legacy IDE registers, but the old subfunctions 2 and 3 of course are designed according to them. For LBA it has been enhanced several times (EDD 2, 3, 4, latest from 2008) and in the latest version, the new LBA subfunctions $42 and $43 can use not only LBA64, but also 64-bit addressing of RAM. So there is “virtually no size limit” at all, just the fact that this is a real mode call only is a pain when using it from protected mode. 6. Sector sizeFor decades hard disks used a sector size of 512 Bytes, and many OS’es, drivers and applications are hard-coded to this value. Nevertheless FAT filesystem reportedly supports bigger sizes also (1024, 2048 and 4096 Bytes), and even some DOS kernels. Recently informations / fears appeared that the sector size increase is finally coming (although there is no big point, since already present LBA48 is very sufficient even with just 512 Bytes per sector). The new disks might support a “legacy mode” faking 512 Bytes per sector (having internally more, an “internal pain” for the disk if you ask it to write a block not matching an integer amount of the big sectors), or not. 7. SSD - Solid State DisksSince cca 2008, the capacity explosion of “real” hard disks (those using rotating disks with magnetic surface) slowed down while the capacity and performance growth and price decay of “flash” devices continued. This way such devices (having been around for years before) became “interesting for the mainstream”, and obtained the public name SSD - Solid State Disk. Such devices are (apart from USB sticks and memory cards) available only (??) with SATA connection, and there is not much information about usage of such with DOS around, most reviews just point how “great the SSD support is in Windows 7″. The benefits of SSD are the seek time reduced to ZERO, less power consumption and heat, better mechanical durability, and a possibly longer life if idle or reading only, the flaws are the limited writability (but probably not a real problem), less capacity for same price (DOS isn’t that bloated, hey), and wiping problems (when trying to overwrite a sector, it may get “remapped” and thus the data will survive, no way (??) to erase the “mapped away” sectors, and risk (??) that such data can be read out some way later). 8. Compact Flash CardsCompact Flash Cards are an interesting alternative to classical IDE hard disks and SSD. They have been used in embedded PC’s for years. The electrical connection and communication of Compact Flash Cards is essentially IDE, this allows to connect the card to an IDE controller through a trivial and cheap adapter. Compact Flash Cards underwent the same evolution as hard disks, from PIO through MWDMA to UDMA. This means that a Compact Flash Card can be used as a drop-in replacement for a hard disk, with the same benefits as SSD (see above). Unfortunately tests showed that while the card usually works, there are some problems with the UDMA support, so that such a replacement can bring a slow-down. 9. File systemsCurrent DOS versions can natively use FAT12, FAT16, FAT32 and FAT16+/FAT32+ (EDR-DOS WIP only) filesystems. There are also installable drivers for Ext2 and NTFS? partitions available, but DOS can’t boot from them. 10. External resources
11. See also |
Recent Comments