3 * INT 13h BIOS disk library.
4 * (C) 2010-2012 Jonathan Campbell.
5 * Hackipedia DOS library.
7 * This code is licensed under the LGPL.
8 * <insert LGPL legal text here>
10 * Compiles for intended target environments:
11 * - MS-DOS [pure DOS mode, or Windows or OS/2 DOS Box] */
13 #include <hw/cpu/cpu.h>
14 #include <hw/dos/dos.h>
17 struct biosdisk_drive {
19 uint8_t extended:1; /* use INT 13h extensions */
20 uint8_t ext_packet_access:1; /* can use packet read */
21 uint8_t drive_locking_eject:1;
22 uint8_t edd_support:1;
23 uint8_t write_enable:1; /* enable write functions (sanity checking!!!) */
24 uint8_t dma_crossed:1; /* set by CHS read/write functions if your IO crosses DMA boundaries */
26 uint16_t bytes_per_sector;
27 int16_t heads,cylinders,sectors_per_track;
28 uint64_t total_sectors;
31 #define BIOSDISK_EXTENDED 1
33 void biosdisk_free_resources();
34 int biosdisk_edd_get_geometry(struct biosdisk_drive *d,uint8_t index);
35 int biosdisk_check_extensions(struct biosdisk_drive *d,uint8_t index);
36 int biosdisk_classic_get_geometry(struct biosdisk_drive *d,uint8_t index);
37 int biosdisk_get_info(struct biosdisk_drive *d,uint8_t index,uint8_t flags);
38 int biosdisk_read(struct biosdisk_drive *d,
39 #if TARGET_MSDOS == 32
44 uint64_t sector,int num);
45 int biosdisk_write(struct biosdisk_drive *d,
46 #if TARGET_MSDOS == 32
51 uint64_t sector,int num);