UbixOS V2 2.0

Data Structures | Macros | Typedefs | Functions
fdc.h File Reference
`#include <sys/types.h>`
Include dependency graph for fdc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Data Structures
struct | DrvGeom

## Macros
#define | cmdRead (0xe6)
#define | cmdRecal (0x07)
#define | cmdSeek (0x0f)
#define | cmdSensei (0x08)
#define | cmdSpecify (0x03)
#define | cmdWrite (0xc5)
#define | dg144Gap3rw 0x1b
#define | dg144Heads 2 /* heads per drive (1.44M) */
#define | dg144Spt 18
#define | dg144Tracks 80
#define | dg168Gap3rw 0x1c
#define | fdcCcr (0x3f7)
#define | fdcData (0x3f5)
#define | fdcDir (0x3f7)
#define | fdcDor (0x3f2)
#define | fdcDrs (0x3f4)
#define | fdcMsr (0x3f4)

## Typedefs
typedef struct DrvGeom | drvGeom

## Functions
void | block2Hts (int block, int *head, int *track, int *sector)
int | fdc_init ()
void | fdcRead (void *info, void *, uInt32 startSector, uInt32 sectorCount)
bool | fdcRw (int block, unsigned char *blockBuffer, bool read, unsigned long numSectors)
void | fdcWrite (void *info, void *, uInt32 startSector, uInt32 sectorCount)
void | floppyIsr ()
void | floppyIsrhndlr ()
int | getByte ()
void | motorOff (void)
void | motorOn (void)
bool | readBlock (int block, Int8 *blockBuffer, unsigned long numSectors)
void | recalibrate (void)
void | reset (void)
bool | seek (int track)
void | sendByte (int Int8)
bool | waitFdc (bool sensei)
bool | writeBlock (int block, Int8 *blockBuffer, unsigned long numSectors)

## Macro Definition Documentation

## ◆ cmdRead

#define cmdRead (0xe6)

Definition at line 49 of file fdc.h.

## ◆ cmdRecal

#define cmdRecal (0x07)

Definition at line 52 of file fdc.h.

## ◆ cmdSeek

#define cmdSeek (0x0f)

Definition at line 50 of file fdc.h.

## ◆ cmdSensei

#define cmdSensei (0x08)

Definition at line 51 of file fdc.h.

## ◆ cmdSpecify

#define cmdSpecify (0x03)

Definition at line 53 of file fdc.h.

## ◆ cmdWrite

#define cmdWrite (0xc5)

Definition at line 48 of file fdc.h.

## ◆ dg144Gap3rw

#define dg144Gap3rw 0x1b

Definition at line 58 of file fdc.h.

## ◆ dg144Heads

#define dg144Heads 2 /* heads per drive (1.44M) */

Definition at line 55 of file fdc.h.

## ◆ dg144Spt

#define dg144Spt 18

Definition at line 57 of file fdc.h.

## ◆ dg144Tracks

#define dg144Tracks 80

Definition at line 56 of file fdc.h.

## ◆ dg168Gap3rw

#define dg168Gap3rw 0x1c

Definition at line 59 of file fdc.h.

## ◆ fdcCcr

#define fdcCcr (0x3f7)

Definition at line 44 of file fdc.h.

## ◆ fdcData

#define fdcData (0x3f5)

Definition at line 42 of file fdc.h.

## ◆ fdcDir

#define fdcDir (0x3f7)

Definition at line 43 of file fdc.h.

## ◆ fdcDor

#define fdcDor (0x3f2)

Definition at line 45 of file fdc.h.

## ◆ fdcDrs

#define fdcDrs (0x3f4)

Definition at line 46 of file fdc.h.

## ◆ fdcMsr

#define fdcMsr (0x3f4)

Definition at line 41 of file fdc.h.

## Typedef Documentation

## ◆ drvGeom

typedef struct DrvGeom drvGeom

## Function Documentation

## ◆ block2Hts()

void block2Hts | ( | int | block,
|  | int * | head,
|  | int * | track,
|  | int * | sector
| ) |  |

Definition at line 200 of file fdc.c.

Referenced by fdcRw().

## ◆ fdc_init()

int fdc_init | ( |  | ) |

Definition at line 61 of file fdc.c.

References devfs_makeNode(), device_add(), dInt, dPresent, fdcInit2(), fdcRead(), fdcWrite(), floppyIsr(), device_interface::init, irqEnable(), kmalloc(), device_interface::major, mVec, device_interface::read, device_interface::reset, reset(), setVector(), and device_interface::write.

Here is the call graph for this function:

## ◆ fdcRead()

void fdcRead | ( | void * | info,
|  | void * | ,
|  | uInt32 | startSector,
|  | uInt32 | sectorCount
| ) |  |

Definition at line 303 of file fdc.c.

References spinLock().

Referenced by fdc_init().

Here is the call graph for this function:

## ◆ fdcRw()

bool fdcRw | ( | int | block,
|  | unsigned char * | blockBuffer,
|  | bool | read,
|  | unsigned long | numSectors
| ) |  |

Definition at line 127 of file fdc.c.

References block2Hts(), fdcDir, inportByte(), motorOn(), and read().

Referenced by readBlock(), and writeBlock().

Here is the call graph for this function:

## ◆ fdcWrite()

void fdcWrite | ( | void * | info,
|  | void * | ,
|  | uInt32 | startSector,
|  | uInt32 | sectorCount
| ) |  |

Definition at line 309 of file fdc.c.

References writeBlock().

Referenced by fdc_init().

Here is the call graph for this function:

## ◆ floppyIsr()

void floppyIsr | ( |  | ) |

Referenced by fdc_init().

## ◆ floppyIsrhndlr()

void floppyIsrhndlr | ( |  | ) |

Definition at line 96 of file fdc.c.

## ◆ getByte()

int getByte | ( |  | ) |

Definition at line 114 of file fdc.c.

References fdcData, fdcMsr, and inportByte().

Here is the call graph for this function:

## ◆ motorOff()

void motorOff | ( | void |  | ) |

Definition at line 213 of file fdc.c.

Referenced by recalibrate().

## ◆ motorOn()

void motorOn | ( | void |  | ) |

Definition at line 206 of file fdc.c.

Referenced by fdcRw(), and recalibrate().

## ◆ readBlock()

bool readBlock | ( | int | block,
|  | Int8 * | blockBuffer,
|  | unsigned long | numSectors
| ) |  |

Definition at line 240 of file fdc.c.

References fdcRw(), and TRUE.

Here is the call graph for this function:

## ◆ recalibrate()

void recalibrate | ( | void |  | ) |

Definition at line 280 of file fdc.c.

References cmdRecal, motorOff(), motorOn(), sendByte(), TRUE, and waitFdc().

Here is the call graph for this function:

## ◆ reset()

void reset | ( | void |  | ) |

Definition at line 288 of file fdc.c.

References fdcDor, and outportByte().

Referenced by fdc_init().

Here is the call graph for this function:

## ◆ seek()

bool seek | ( | int | track | ) |

Definition at line 221 of file fdc.c.

## ◆ sendByte()

void sendByte | ( | int | Int8 | ) |

Definition at line 101 of file fdc.c.

References fdcData, fdcMsr, inportByte(), and outportByte().

Referenced by recalibrate().

Here is the call graph for this function:

## ◆ waitFdc()

bool waitFdc | ( | bool | sensei | ) |

Definition at line 255 of file fdc.c.

Referenced by recalibrate().

## ◆ writeBlock()

bool writeBlock | ( | int | block,
|  | Int8 * | blockBuffer,
|  | unsigned long | numSectors
| ) |  |

Definition at line 251 of file fdc.c.

References FALSE, and fdcRw().

Referenced by fdcWrite().

Here is the call graph for this function: