1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- #pragma once
- #include <common/glib.h>
- #include <common/blk_types.h>
- #define MBR_MAX_AHCI_CTRL_NUM 4
- #define MBR_MAX_AHCI_PORT_NUM 32
- struct MBR_disk_partition_table_entry_t
- {
- uint8_t flags;
- uint8_t starting_head;
- uint16_t starting_sector : 6,
- starting_cylinder : 10;
- uint8_t type;
- uint8_t ending_head;
- uint16_t ending_sector : 6,
- ending_cylinder : 10;
- uint32_t starting_LBA;
- uint32_t total_sectors;
- } __attribute__((packed));
- struct MBR_disk_partition_table_t
- {
- uint8_t reserved[446];
- struct MBR_disk_partition_table_entry_t DPTE[4];
- uint16_t BS_TrailSig;
- } __attribute__((packed));
- extern struct MBR_disk_partition_table_t MBR_partition_tables[MBR_MAX_AHCI_CTRL_NUM][MBR_MAX_AHCI_PORT_NUM];
- int MBR_read_partition_table(struct blk_gendisk* gd, void *buf);
|