UbixOS V2 2.0

Functions
hd.c File Reference
`#include <pci/hd.h>`
`#include <sys/io.h>`
`#include <sys/device.h>`
`#include <lib/kmalloc.h>`
`#include <lib/kprintf.h>`
`#include <devfs/devfs.h>`
`#include <string.h>`
`#include <fs/common/gpt.h>`
Include dependency graph for hd.c:

Go to the source code of this file.

## Functions
int | _initHardDisk (int hdD)
int | hdInit (struct device_node *dev)
int | hdIoctl ()
int | hdRead (struct driveInfo *hdd, void *baseAddr, uInt32 startSector, uInt32 sectorCount)
int | hdReset ()
int | hdStandby ()
int | hdStart ()
int | hdStop ()
int | hdWrite (struct driveInfo *hdd, void *baseAddr, uInt32 startSector, uInt32 sectorCount)
int | initHardDisk ()

## Function Documentation

## ◆ _initHardDisk()

int _initHardDisk | ( | int | hdD | ) |

Definition at line 47 of file hd.c.

References name.

Referenced by initHardDisk().

## ◆ hdInit()

int hdInit | ( | struct device_node * | dev | ) |

Definition at line 221 of file hd.c.

References ATA_COMMAND, ATA_DATA, ATA_DRIVE, ATA_IDENTIFY, driveInfo::ata_identify, ATA_IDENTIFY_COMMAND_SET_SUPPORTED1_48BIT_ENABLE, ATA_IDENTIFY_SECTOR_LARGER_THEN_512_ENABLE, ATA_S_BUSY, ata_identify_data::command_set_enabled1, device_node::devInfo, hdCmd, driveInfo::hdDev, driveInfo::hdEnable, hdHead, driveInfo::hdMask, driveInfo::hdMulti, driveInfo::hdPort, hdSecCount, driveInfo::hdShift, driveInfo::hdSize, device_interface::info, device_interface::initialized, inportByte(), inportWord(), kprintf(), driveInfo::lba_high, driveInfo::lba_low, ata_identify_data::max_48bit_lba, outportByte(), ata_identify_data::physical_logical_sector_info, driveInfo::sector_size, device_interface::size, ata_identify_data::total_num_sectors, and ata_identify_data::words_per_logical_sector.

Here is the call graph for this function:

## ◆ hdIoctl()

int hdIoctl | ( |  | ) |

Definition at line 211 of file hd.c.

## ◆ hdRead()

int hdRead | ( | struct driveInfo * | hdd,
|  | void * | baseAddr,
|  | uInt32 | startSector,
|  | uInt32 | sectorCount
| ) |  |

Definition at line 423 of file hd.c.

References driveInfo::hdCalc, hdCmd, hdCylHi, hdCylLow, hdData, driveInfo::hdDev, driveInfo::hdEnable, hdHead, driveInfo::hdMulti, driveInfo::hdPort, hdSecCount, hdSecNum, driveInfo::hdShift, hdStat, inportByte(), inportWord(), kprintf(), driveInfo::lba_start, outportByte(), and driveInfo::parOffset.

Here is the call graph for this function:

## ◆ hdReset()

int hdReset | ( |  | ) |

Definition at line 216 of file hd.c.

## ◆ hdStandby()

int hdStandby | ( |  | ) |

Definition at line 196 of file hd.c.

## ◆ hdStart()

int hdStart | ( |  | ) |

Definition at line 201 of file hd.c.

## ◆ hdStop()

int hdStop | ( |  | ) |

Definition at line 206 of file hd.c.

## ◆ hdWrite()

int hdWrite | ( | struct driveInfo * | hdd,
|  | void * | baseAddr,
|  | uInt32 | startSector,
|  | uInt32 | sectorCount
| ) |  |

Definition at line 356 of file hd.c.

References driveInfo::hdCalc, hdCmd, hdCylHi, hdCylLow, hdData, driveInfo::hdDev, driveInfo::hdEnable, hdHead, driveInfo::hdMulti, driveInfo::hdPort, hdSecCount, hdSecNum, driveInfo::hdShift, hdStat, inportByte(), kprintf(), driveInfo::lba_start, outportByte(), outportWord(), and driveInfo::parOffset.

Here is the call graph for this function:

## ◆ initHardDisk()

int initHardDisk | ( |  | ) |

Definition at line 42 of file hd.c.

References _initHardDisk().

Here is the call graph for this function: