将具体磁盘类型与fat32文件系统进行分离

This commit is contained in:
fslongjin
2022-09-06 14:10:17 +08:00
parent 0fcba99282
commit 339053a20e
23 changed files with 307 additions and 138 deletions

View File

@ -9,12 +9,9 @@ struct MBR_disk_partition_table_t MBR_partition_tables[MBR_MAX_AHCI_CTRL_NUM][MB
*
* @param ahci_ctrl_num ahci控制器编号
* @param ahci_port_num ahci端口编号
* @param buf 输出缓冲区512字节
*/
struct MBR_disk_partition_table_t *MBR_read_partition_table(uint8_t ahci_ctrl_num, uint8_t ahci_port_num)
int MBR_read_partition_table(struct blk_gendisk *gd, void *buf)
{
unsigned char buf[512];
memset(buf, 0, 512);
ahci_operation.transfer(AHCI_CMD_READ_DMA_EXT, 0, 1, (uint64_t)&buf, ahci_ctrl_num, ahci_port_num);
MBR_partition_tables[ahci_ctrl_num][ahci_port_num] = *(struct MBR_disk_partition_table_t *)buf;
return &MBR_partition_tables[ahci_ctrl_num][ahci_port_num];
return gd->fops->transfer(gd, AHCI_CMD_READ_DMA_EXT, 0, 1, (uint64_t)buf);
}