|
ginnOS
The reference: libc, the libraries and the kernel
|
SATA disks through an AHCI controller (PCI class 01:06:01). More...
#include "block_device.h"#include "common/stdint.h"#include "kernel/memory/phys.h"#include "kernel/sync/completion.h"#include "kernel/sync/mutex.h"Go to the source code of this file.
Data Structures | |
| struct | ahci_disk_t |
Macros | |
| #define | AHCI_MAX_DISKS 4 |
Functions | |
| uint32_t | ahci_init (void) |
| find the AHCI controller (the first one) and its disks. | |
| ahci_disk_t * | ahci_disk (uint32_t index) |
| a disk by index (0 to the number ahci_init returned). | |
SATA disks through an AHCI controller (PCI class 01:06:01).
ahci_init finds the controller, maps its registers (BAR 5) and sets up each port that has a SATA disk. each disk is a block_device_t of 512-byte sectors. the transfers use DMA with 48-bit LBA commands. a process that waits for a command sleeps until the port interrupts; during boot, or without an interrupt, the driver polls the port.
| #define AHCI_MAX_DISKS 4 |
| uint32_t ahci_init | ( | void | ) |
find the AHCI controller (the first one) and its disks.
call after pci_init and mmio_init.
| ahci_disk_t * ahci_disk | ( | uint32_t | index | ) |
a disk by index (0 to the number ahci_init returned).