1 #include "MBR.h" 2 #include <common/kprint.h> 3 #include <driver/disk/ahci/ahci.h> 4 5 struct MBR_disk_partition_table_t MBR_partition_tables[MBR_MAX_AHCI_CTRL_NUM][MBR_MAX_AHCI_PORT_NUM] = {0}; 6 7 /** 8 * @brief 读取磁盘的分区表 9 * 10 * @param ahci_ctrl_num ahci控制器编号 11 * @param ahci_port_num ahci端口编号 12 * @param buf 输出缓冲区(512字节) 13 */ MBR_read_partition_table(struct blk_gendisk * gd,void * buf)14int MBR_read_partition_table(struct blk_gendisk *gd, void *buf) 15 { 16 return gd->fops->transfer(gd, AHCI_CMD_READ_DMA_EXT, 0, 1, (uint64_t)buf); 17 }