The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
ata.h File Reference
#include "block_device.h"

Go to the source code of this file.

Data Structures

struct  ata_device_t
 ATA device structure. More...

Enumerations

enum  ata_channel_t { ATA_CHANNEL_PRIMARY = 0 , ATA_CHANNEL_SECONDARY = 1 }
 ATA channel selection. More...
enum  ata_drive_t { ATA_DRIVE_MASTER = 0 , ATA_DRIVE_SLAVE = 1 }
 ATA drive selection within a channel. More...

Functions

bool ata_initialize (ata_device_t *device, ata_channel_t channel, ata_drive_t drive)
 initialize an ATA device on the specified channel and drive position.

Enumeration Type Documentation

◆ ata_channel_t

ATA channel selection.

each channel has its own I/O base and control port.

Enumerator
ATA_CHANNEL_PRIMARY 
ATA_CHANNEL_SECONDARY 

◆ ata_drive_t

ATA drive selection within a channel.

Enumerator
ATA_DRIVE_MASTER 
ATA_DRIVE_SLAVE 

Function Documentation

◆ ata_initialize()

bool ata_initialize ( ata_device_t * device,
ata_channel_t channel,
ata_drive_t drive )

initialize an ATA device on the specified channel and drive position.

issues IDENTIFY DEVICE to confirm the drive is present and is not ATAPI. populates all port fields and wires up the block device interface.

Parameters
deviceATA device object to initialize.
channelATA_CHANNEL_PRIMARY or ATA_CHANNEL_SECONDARY.
driveATA_DRIVE_MASTER or ATA_DRIVE_SLAVE.
Returns
true on success, false if no drive responds or device is ATAPI.