feat: setup structure for block devices
added ide block device added mbr block device driver started fat block device driver reordered boot start timer before pci/ide/etc. enable interrupts earlier fixed exception from ide controller cleanup code more printfs
This commit is contained in:
53
kernel/fs/fat.c
Normal file
53
kernel/fs/fat.c
Normal file
@@ -0,0 +1,53 @@
|
||||
//
|
||||
// Created by rick on 07-02-21.
|
||||
//
|
||||
|
||||
#include "fat.h"
|
||||
|
||||
#include <types.h>
|
||||
|
||||
typedef struct {
|
||||
struct {
|
||||
u8 jump[3];
|
||||
char oem_identifier[8];
|
||||
u16 bytes_per_sector;
|
||||
u8 sectors_per_cluster;
|
||||
u16 reserved_sectors;
|
||||
u8 fats;
|
||||
u16 directories;
|
||||
u16 total_sectors;
|
||||
u8 media_descriptor;
|
||||
u16 sectors_per_fat;
|
||||
u16 sectors_per_track;
|
||||
u16 heads_sides;
|
||||
u32 hidden_sectors;
|
||||
u32 large_sector_count;
|
||||
} bpb;
|
||||
union {
|
||||
struct {
|
||||
u8 drive_number;
|
||||
u8 flags;
|
||||
u8 signature;
|
||||
u32 serial;
|
||||
u8 label[11];
|
||||
u8 system_id[8];
|
||||
} ebr_12_16;
|
||||
struct {
|
||||
u32 sectors_per_fat;
|
||||
u16 flags;
|
||||
u16 fat_version;
|
||||
u32 root_directory;
|
||||
u16 fs_info;
|
||||
u16 backup_boot;
|
||||
u8 reserved[12];
|
||||
u8 drive_number;
|
||||
u8 flags_nt;
|
||||
u8 signature;
|
||||
u32 serial;
|
||||
u8 label[11];
|
||||
u8 system_id[8];
|
||||
} ebr_32;
|
||||
};
|
||||
} fat_bpb;
|
||||
|
||||
// steal validation code from here https://github.com/torvalds/linux/blob/fcadab740480e0e0e9fa9bd272acd409884d431a/fs/fat/inode.c#L1456
|
||||
Reference in New Issue
Block a user