a0740109167815238b0fd97c2131de135e2f5b2bvboxsync * Floppy drive tables.
a0740109167815238b0fd97c2131de135e2f5b2bvboxsync * Copyright (C) 2011-2013 Oracle Corporation
a0740109167815238b0fd97c2131de135e2f5b2bvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
a0740109167815238b0fd97c2131de135e2f5b2bvboxsync * available from http://www.virtualbox.org. This file is free software;
a0740109167815238b0fd97c2131de135e2f5b2bvboxsync * you can redistribute it and/or modify it under the terms of the GNU
a0740109167815238b0fd97c2131de135e2f5b2bvboxsync * General Public License (GPL) as published by the Free Software
a0740109167815238b0fd97c2131de135e2f5b2bvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
a0740109167815238b0fd97c2131de135e2f5b2bvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
a0740109167815238b0fd97c2131de135e2f5b2bvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
a0740109167815238b0fd97c2131de135e2f5b2bvboxsync * Extended DPT (Disk Parameter Table) structure.
a0740109167815238b0fd97c2131de135e2f5b2bvboxsynctypedef struct
a0740109167815238b0fd97c2131de135e2f5b2bvboxsync uint8_t mot_wait; /* Motor wait time after operation. */
a0740109167815238b0fd97c2131de135e2f5b2bvboxsync uint8_t eot; /* End of Track (ID of last sector). */
a0740109167815238b0fd97c2131de135e2f5b2bvboxsync uint8_t mot_start; /* Motor start time (1/8 sec units). */
a0740109167815238b0fd97c2131de135e2f5b2bvboxsync/* Motor spin-up wait time in BIOS ticks (~2 seconds). */
a0740109167815238b0fd97c2131de135e2f5b2bvboxsync/* Data rates as stored in the DPT */
a0740109167815238b0fd97c2131de135e2f5b2bvboxsync/* In the 13-entry DPT, 7 entries are constant. Use a macro to set those. */
a0740109167815238b0fd97c2131de135e2f5b2bvboxsync#define MAKE_DPT_ENTRY(sp1, eot, gap, fgp, mxt, dtr) \
a0740109167815238b0fd97c2131de135e2f5b2bvboxsync { sp1, 2, MOTOR_WAIT, 2, eot, gap, 0xFF, fgp, 0xF6, 15, 8, mxt, dtr }
a0740109167815238b0fd97c2131de135e2f5b2bvboxsync MAKE_DPT_ENTRY(0xDF, 9, 0x2A, 0x50, 39, RATE_250K), /* 360K disk/360K drive */
a0740109167815238b0fd97c2131de135e2f5b2bvboxsync MAKE_DPT_ENTRY(0xDF, 9, 0x2A, 0x50, 39, RATE_300K), /* 360K disk/1.2M drive */
a0740109167815238b0fd97c2131de135e2f5b2bvboxsync MAKE_DPT_ENTRY(0xDF, 15, 0x1B, 0x54, 79, RATE_500K), /* 1.2M disk */
a0740109167815238b0fd97c2131de135e2f5b2bvboxsync MAKE_DPT_ENTRY(0xDF, 9, 0x2A, 0x50, 79, RATE_250K), /* 720K disk */
a0740109167815238b0fd97c2131de135e2f5b2bvboxsync MAKE_DPT_ENTRY(0xAF, 18, 0x1B, 0x6C, 79, RATE_500K), /* 1.44M disk */
a0740109167815238b0fd97c2131de135e2f5b2bvboxsync MAKE_DPT_ENTRY(0xAF, 36, 0x1B, 0x54, 79, RATE_1M), /* 2.88M disk */
a0740109167815238b0fd97c2131de135e2f5b2bvboxsync MAKE_DPT_ENTRY(0xAF, 255, 0x1B, 0x54, 255, RATE_500K) /* Fake mega-disk */
a0740109167815238b0fd97c2131de135e2f5b2bvboxsynctypedef struct {
a0740109167815238b0fd97c2131de135e2f5b2bvboxsync uint8_t dpt_entry; /* Index of entry in fd_parm. */
a0740109167815238b0fd97c2131de135e2f5b2bvboxsync/* Drive types as stored in the CMOS. Must match DevPCBios! */
a0740109167815238b0fd97c2131de135e2f5b2bvboxsync/* A table mapping (CMOS) drive types to DPT entries. */
a0740109167815238b0fd97c2131de135e2f5b2bvboxsync/* Find a DPT corresponding to the given drive type. */
a0740109167815238b0fd97c2131de135e2f5b2bvboxsync for (i = 0; i < sizeof(fd_map) / sizeof(fd_map[0]); ++i)
a0740109167815238b0fd97c2131de135e2f5b2bvboxsync /* As a fallback, return the 1.44M DPT. */