floppyt.c revision a0740109167815238b0fd97c2131de135e2f5b2b
/* $Id$ */
/** @file
* Floppy drive tables.
*/
/*
* Copyright (C) 2011-2013 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#include <stdint.h>
#include <string.h>
#include "biosint.h"
#include "inlines.h"
/**
* Extended DPT (Disk Parameter Table) structure.
*/
typedef struct
{
} dpt_ext;
/* Motor spin-up wait time in BIOS ticks (~2 seconds). */
#define MOTOR_WAIT 0x25
/* Data rates as stored in the DPT */
#define RATE_250K 0x80
#define RATE_300K 0x40
#define RATE_500K 0x00
#define RATE_1M 0xC0
/* In the 13-entry DPT, 7 entries are constant. Use a macro to set those. */
};
typedef struct {
} fd_map_entry;
/* Drive types as stored in the CMOS. Must match DevPCBios! */
#define FDRV_360K 1
#define FDRV_1_2M 2
#define FDRV_720K 3
#define FDRV_1_44M 4
#define FDRV_2_88M 5
#define FDRV_15M 14
#define FDRV_63M 15
/* A table mapping (CMOS) drive types to DPT entries. */
fd_map_entry fd_map[] = {
{ FDRV_360K, 0 },
{ FDRV_1_2M, 2 },
{ FDRV_720K, 3 },
{ FDRV_1_44M, 4 },
{ FDRV_2_88M, 5 },
{ FDRV_15M, 6 },
{ FDRV_63M, 6 }
};
/* Find a DPT corresponding to the given drive type. */
{
int i;
return &fd_parm[i];
/* As a fallback, return the 1.44M DPT. */
return &fd_parm[5];
}