UbixOS  2.0
fdc.c File Reference
#include <isa/fdc.h>
#include <isa/8259.h>
#include <sys/video.h>
#include <sys/gdt.h>
#include <sys/idt.h>
#include <ubixos/spinlock.h>
#include <sys/io.h>
#include <sys/dma.h>
#include <sys/device.h>
#include <lib/kprintf.h>
#include <lib/kmalloc.h>
#include <devfs/devfs.h>
Include dependency graph for fdc.c:

Go to the source code of this file.

Functions

 asm (".globl floppyIsr \n" "floppyIsr: \n" " pusha \n" " push %ss \n" " push %ds \n" " push %es \n" " push %fs \n" " push %gs \n" " call floppyIsrhndlr \n" " pop %gs \n" " pop %fs \n" " pop %es \n" " pop %ds \n" " pop %ss \n" " popa \n" " iret \n")
 
void block2Hts (int block, int *head, int *track, int *sector)
 
int fdc_init ()
 
int fdcInit2 (struct device_node *dev)
 
void fdcRead (void *info, void *baseAddr, uInt32 startSector, uInt32 sectorCount)
 
bool fdcRw (int block, unsigned char *blockBuffer, bool read, unsigned long numSectors)
 
void fdcWrite (void *info, void *baseAddr, uInt32 startSector, uInt32 sectorCount)
 
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)
 

Variables

unsigned long tbaddr = 0x80000L
 

Function Documentation

◆ asm()

asm ( ".globl floppyIsr \n" "floppyIsr: \n" " pusha \n" " push %ss \n" " push %ds \n" " push %es \n" " push %fs \n" " push %gs \n" " call floppyIsrhndlr \n" " pop %gs \n" " pop %fs \n" " pop %es \n" " pop %ds \n" " pop %ss \n" " popa \n" " iret \n"  )

◆ block2Hts()

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

Definition at line 200 of file fdc.c.

Referenced by fdcRw().

◆ fdc_init()

◆ fdcInit2()

int fdcInit2 ( struct device_node dev)

Definition at line 56 of file fdc.c.

References device_node::devInfo, and device_interface::size.

Referenced by fdc_init().

◆ fdcRead()

void fdcRead ( void *  info,
void *  baseAddr,
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 *  baseAddr,
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:

◆ 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:

Variable Documentation

◆ tbaddr

unsigned long tbaddr = 0x80000L

Definition at line 54 of file fdc.c.