feat: reformatted code
This commit is contained in:
@@ -48,7 +48,7 @@ u8 mbr_block_dev_access(const block_device *device, u8 direction, u32 lba, u8 se
|
||||
return info->device->access(info->device, direction, actual_lba, sectors, target);
|
||||
}
|
||||
|
||||
u8 mbr_check_device(const block_device *device, u8* first_sector) {
|
||||
u8 mbr_check_device(const block_device *device, u8 *first_sector) {
|
||||
mbr_table *table = (mbr_table *) &first_sector[512 - sizeof(mbr_table)];
|
||||
if (table->signature[0] != 0x55 && table->signature[1] != 0xAA) { // AA 55 but in little endian
|
||||
return BLOCK_DEV_DRIVER_CHECK_NO_MATCH;
|
||||
@@ -90,10 +90,10 @@ u8 mbr_check_device(const block_device *device, u8* first_sector) {
|
||||
}
|
||||
|
||||
block_dev_driver mbr_driver = {
|
||||
.name = "mbr",
|
||||
.flags.root_only = 1,
|
||||
.check_device = mbr_check_device,
|
||||
.free_device = NULL, // todo
|
||||
.name = "mbr",
|
||||
.flags.root_only = 1,
|
||||
.check_device = mbr_check_device,
|
||||
.free_device = NULL, // todo
|
||||
};
|
||||
|
||||
void mbr_register_block_driver() {
|
||||
@@ -101,9 +101,9 @@ void mbr_register_block_driver() {
|
||||
}
|
||||
|
||||
void mbr_read_from_ide(u8 ide_drive) {
|
||||
char* mbr_data = malloc(0x200);
|
||||
char *mbr_data = malloc(0x200);
|
||||
ide_access(0, ide_drive, 0, 1, mbr_data);
|
||||
mbr_partition_table_entry* entry = (mbr_partition_table_entry *) (mbr_data + 0x1BE);
|
||||
mbr_partition_table_entry *entry = (mbr_partition_table_entry *) (mbr_data + 0x1BE);
|
||||
printf("Start at %d, count: %d\n", entry->start_lba, entry->num_lbas);
|
||||
free(mbr_data);
|
||||
}
|
||||
Reference in New Issue
Block a user