mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-21 09:46:35 +00:00
🆕 读取fat32文件系统的基础信息
This commit is contained in:
44
kernel/filesystem/MBR.h
Normal file
44
kernel/filesystem/MBR.h
Normal file
@ -0,0 +1,44 @@
|
||||
/**
|
||||
* @file MBR.h
|
||||
* @author fslongjin (longjin@RinGoTek.cn)
|
||||
* @brief MBR分区表
|
||||
* @version 0.1
|
||||
* @date 2022-04-19
|
||||
*
|
||||
* @copyright Copyright (c) 2022
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
#include <common/glib.h>
|
||||
|
||||
/**
|
||||
* @brief MBR硬盘分区表项的结构
|
||||
*
|
||||
*/
|
||||
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; // 分区类型ID
|
||||
uint8_t ending_head; // 结束磁头号
|
||||
|
||||
uint16_t ending_sector:6, // 结束扇区号
|
||||
ending_cylinder:10; // 结束柱面号
|
||||
|
||||
uint32_t starting_LBA; // 起始逻辑扇区
|
||||
uint32_t total_sectors; // 分区占用的磁盘扇区数
|
||||
|
||||
}__attribute__((packed));
|
||||
|
||||
/**
|
||||
* @brief MBR磁盘分区表结构体
|
||||
*
|
||||
*/
|
||||
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));
|
Reference in New Issue
Block a user