#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "math.h"
#include "assembly/io.h"
#include "drivers/harddisk/harddisk_header.h"
#include "harddisk_ata_command_matrix.h"
Go to the source code of this file.
◆ __harddisk_ata_get_disk_space()
Get space of hard disk.
- Parameters
-
data | Pointer to identify data of device. |
- Returns
- Space in bytes.
◆ __harddisk_ata_get_user_addressable_sectors()
Get user addressable sectors of hard disk.
- Parameters
-
data | Pointer to identify data of device. |
- Returns
- Number of user addressable sectors.
◆ __harddisk_ata_poll()
int8_t __harddisk_ata_poll |
( |
uint16_t |
port | ) |
|
Doing pooling.
Check if disk is ready.
- Parameters
-
- Returns
- 1 if ready, -1 if error
◆ __harddisk_ata_read_sector()
Reads hard disk sector.
- Parameters
-
type | Type of harddisk. |
bus | Type of bus. |
high_lba | Higher bits of lba (24 bits are used). |
low_lba | Lower bits of lba (24 bits are used). |
buffer | Buffer of 256 16-bits values for store data. |
- Returns
- 1 = success, -1 = disk error, -2 = parameter error.
◆ __harddisk_ata_write_sector()
Write hard disk sector.
- Parameters
-
type | Type of harddisk. |
bus | Type of bus. |
high_lba | Higher bits of lba (24 bits are used). |
low_lba | Lower bits of lba (24 bits are used). |
buffer | Buffer of 256 16-bits values for store data. |
- Returns
- 1 = success, -1 = disk error, -2 = parameter error.