![]() |
FrostWing
A lightweight raw-control operating system.
|
Header definitions and structures for the AHCI Driver. More...


Go to the source code of this file.
Classes | |
| struct | ahci_port_mem_t |
| struct | ahci_port_t |
| AHCI port registers and command header pointer. More... | |
| struct | ahci_hba_mem_t |
| struct | ahci_disk_info_t |
| struct | block_device_info_t |
| struct | general_partition_t |
| struct | mount_entry |
Macros | |
| #define | AHCI_PORT_DET_PRESENT 3 |
| #define | AHCI_PORT_IPM_ACTIVE 1 |
| #define | AHCI_PORT_CMD_ST (1 << 0) |
| #define | AHCI_PORT_CMD_FRE (1 << 4) |
| #define | AHCI_PORT_CMD_FR (1 << 14) |
| #define | AHCI_PORT_CMD_CR (1 << 15) |
| #define | READ_DMA_EXT 0x25 |
| #define | SECTOR_SIZE 512 |
| #define | ATA_CMD_WRITE_DMA_EXT 0x35 |
| #define | ATA_CMD_IDENTIFY 0xEC |
| #define | MAX_PARTITIONS 128 |
| #define | MAX_BLOCK_DEVICES 64 |
| #define | AHCI_MAX_PRDT 16 |
| #define | PRDT_MAX_BYTES (4 * 1024 * 1024) |
| #define | sata_disk 0x00000101 |
| AHCI device signatures. | |
| #define | satapi_disk 0xEB140101 |
| #define | semb_disk 0xC33C0101 |
| #define | port_multiplier 0x96690101 |
| #define | AHCI_CMD_HDR_CFL_MASK 0x001F /* bits 0-4 */ |
| #define | AHCI_CMD_HDR_A_BIT 0x0020 |
| #define | AHCI_CMD_HDR_W_BIT 0x0040 |
| #define | AHCI_CMD_HDR_P_BIT 0x0080 |
| #define | AHCI_CMD_HDR_R_BIT 0x0100 |
| #define | AHCI_CMD_HDR_B_BIT 0x0200 |
| #define | AHCI_CMD_HDR_C_BIT 0x0400 |
| #define | AHCI_CMD_HDR_PMP_MASK 0xF000 /* bits 12-15 */ |
Typedefs | |
| typedef struct mount_entry | mount_entry_t |
Enumerations | |
| enum | block_device_type_t { BLOCK_DEVICE_AHCI = 0 , BLOCK_DEVICE_NVME } |
| enum | partition_fs_type_t { FS_UNKNOWN = 0 , FS_FAT12 , FS_FAT16 , FS_FAT32 , FS_EXFAT , FS_EXT2 , FS_EXT3 , FS_EXT4 , FS_XFS , FS_BTRFS , FS_NTFS , FS_ISO9660 , FS_UDF , FS_PROC , FS_DEV } |
| GENERAL PARITION LAYOUT BEGIN. More... | |
| enum | partition_table_type_t { PART_TABLE_MBR , PART_TABLE_GPT } |
Functions | |
| struct | __attribute__ ((packed)) |
| AHCI command header structure. | |
| void | detect_ahci_devices (ahci_hba_mem_t *ahci_ctrl) |
| Probes and detects all AHCI devices connected to the controller. | |
| void | handle_sata_disk (int portno) |
| void | handle_satapi_disk (int portno) |
| void | ahci_init_port (int portno) |
| int | ahci_read_sector (int portno, uint64_t lba, void *buffer, uint32_t count) |
| int | ahci_write_sector (int portno, uint64_t lba, void *buffer, uint32_t count) |
| int | ahci_identify (int portno, void *buffer) |
| int | block_register_device (block_device_type_t type, int backend_index, uint64_t total_sectors, uint32_t sector_size, const char *name) |
| block_device_info_t * | block_get_device (int device_id) |
| const char * | block_get_device_name (int device_id) |
| int | block_read_sector (int device_id, uint64_t lba, void *buffer, uint32_t count) |
| int | block_write_sector (int device_id, uint64_t lba, void *buffer, uint32_t count) |
| general_partition_t * | add_general_partition (partition_table_type_t table_type, uint64 lba_start, uint64 lba_end, uint64 sector_count, uint64 ahci_port, bool bootable, partition_fs_type_t fs_type, cstring name, uint8_t mbr_type, const uint8_t *gpt_guid) |
| general_partition_t * | search_general_partition (cstring partition_name) |
| mount_entry_t * | add_mount (const char *mount_point, const char *part_name, partition_fs_type_t type, void *fs_ptr) |
| mount_entry_t * | find_mount_by_point (const char *mount_point) |
| int | remove_mount (const char *mount_point) |
| void | list_all_mounts (void) |
Variables | |
| ahci_cmd_header_t | |
| prdt_entry_t | |
| ahci_cmd_table_t | |
| ahci_port_mem_t | port_mem [32] |
| ahci_disk_info_t | ahci_disks [32] |
| general_partition_t | ahci_partitions [128] |
| mount_entry_t | mounted_partitions [128] |
| block_device_info_t | block_devices [64] |
| int | general_partition_count |
| int | mounted_partition_count |
| int | block_device_count |
| ahci_hba_mem_t * | global_ahci_ctrl |
| Global AHCI controller pointer. | |
Header definitions and structures for the AHCI Driver.
Definition in file ahci.h.
| enum partition_fs_type_t |
| struct __attribute__ | ( | (packed) | ) |
| void detect_ahci_devices | ( | ahci_hba_mem_t * | ahci_ctrl | ) |
Probes and detects all AHCI devices connected to the controller.
| ahci_ctrl | Pointer to the AHCI controller structure. |