diff options
| author | Michael Brown | 2012-03-30 13:05:13 +0200 |
|---|---|---|
| committer | Michael Brown | 2012-03-30 18:32:32 +0200 |
| commit | 4dbb193c33deda44a966d81b018c73071b4bc9f6 (patch) | |
| tree | 632cac6447a4d94d8453124ce457f667972b4d05 /src/arch/i386/include | |
| parent | [comboot] Remove COMBOOT image support by default (diff) | |
| download | ipxe-4dbb193c33deda44a966d81b018c73071b4bc9f6.tar.gz ipxe-4dbb193c33deda44a966d81b018c73071b4bc9f6.tar.xz ipxe-4dbb193c33deda44a966d81b018c73071b4bc9f6.zip | |
[int13] Add support for emulating floppy disk drives
Tested-by: Robin Smidsrød <robin@smidsrod.no>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/arch/i386/include')
| -rw-r--r-- | src/arch/i386/include/bios.h | 1 | ||||
| -rw-r--r-- | src/arch/i386/include/int13.h | 52 |
2 files changed, 53 insertions, 0 deletions
diff --git a/src/arch/i386/include/bios.h b/src/arch/i386/include/bios.h index 70bb73dac..fadb9f1b7 100644 --- a/src/arch/i386/include/bios.h +++ b/src/arch/i386/include/bios.h @@ -4,6 +4,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); #define BDA_SEG 0x0040 +#define BDA_EQUIPMENT_WORD 0x0010 #define BDA_FBMS 0x0013 #define BDA_NUM_DRIVES 0x0075 diff --git a/src/arch/i386/include/int13.h b/src/arch/i386/include/int13.h index 0244acaf9..5d36b6378 100644 --- a/src/arch/i386/include/int13.h +++ b/src/arch/i386/include/int13.h @@ -71,6 +71,19 @@ FILE_LICENCE ( GPL2_OR_LATER ); /** Block size for non-extended INT 13 calls */ #define INT13_BLKSIZE 512 +/** @defgroup int13fddtype INT 13 floppy disk drive types + * @{ + */ + +/** 360K */ +#define INT13_FDD_TYPE_360K 0x01 +/** 1.2M */ +#define INT13_FDD_TYPE_1M2 0x02 +/** 720K */ +#define INT13_FDD_TYPE_720K 0x03 +/** 1.44M */ +#define INT13_FDD_TYPE_1M44 0x04 + /** An INT 13 disk address packet */ struct int13_disk_address { /** Size of the packet, in bytes */ @@ -394,4 +407,43 @@ enum eltorito_media_type { ELTORITO_NO_EMULATION = 0, }; +/** A floppy disk geometry */ +struct int13_fdd_geometry { + /** Number of tracks */ + uint8_t tracks; + /** Number of heads and sectors per track */ + uint8_t heads_spt; +}; + +/** Define a floppy disk geometry */ +#define INT13_FDD_GEOMETRY( cylinders, heads, sectors ) \ + { \ + .tracks = (cylinders), \ + .heads_spt = ( ( (heads) << 6 ) | (sectors) ), \ + } + +/** Get floppy disk number of cylinders */ +#define INT13_FDD_CYLINDERS( geometry ) ( (geometry)->tracks ) + +/** Get floppy disk number of heads */ +#define INT13_FDD_HEADS( geometry ) ( (geometry)->heads_spt >> 6 ) + +/** Get floppy disk number of sectors per track */ +#define INT13_FDD_SECTORS( geometry ) ( (geometry)->heads_spt & 0x3f ) + +/** A floppy drive parameter table */ +struct int13_fdd_parameters { + uint8_t step_rate__head_unload; + uint8_t head_load__ndma; + uint8_t motor_off_delay; + uint8_t bytes_per_sector; + uint8_t sectors_per_track; + uint8_t gap_length; + uint8_t data_length; + uint8_t format_gap_length; + uint8_t format_filler; + uint8_t head_settle_time; + uint8_t motor_start_time; +} __attribute__ (( packed )); + #endif /* INT13_H */ |
