Basic idea's are created for the storage solution
- Added boot device info parsing to the kernel - Added a pointer in the kernel to our pre-kernel BootInfo structure - Created a layout for the FAT driver - Created a layout for the virtual filesystem - Separated IDE driver from the basic atapio driver. This will ensure we are not using one or the other - The create_harddrive shell script will now actually build a harddrive image of the kernel - The virtual filesystem initializes and creates a filesystem structure for every FAT16 partition in the master boot record
This commit is contained in:
49
kernel/storage/filesystems/FAT/FAT.h
Normal file
49
kernel/storage/filesystems/FAT/FAT.h
Normal file
@ -0,0 +1,49 @@
|
||||
//
|
||||
// Created by nigel on 21/02/23.
|
||||
//
|
||||
#pragma once
|
||||
#include "ExtendBootRecord.h"
|
||||
#include "BiosParameterBlock.h"
|
||||
#include "DirectoryEntry.h"
|
||||
#include "../../vfs/StorageTypes.h"
|
||||
|
||||
// Date Format
|
||||
// [0..4] Day
|
||||
// [5..8] Month
|
||||
// [9..15] Year
|
||||
|
||||
// Time Format
|
||||
// [0..4] Seconds
|
||||
// [5..10] Minute
|
||||
// [11..15] Hour
|
||||
|
||||
|
||||
class FAT {
|
||||
public:
|
||||
|
||||
|
||||
|
||||
static bool Validate(PTR_PARTITION partition );
|
||||
|
||||
static FILE Open(char* filename);
|
||||
static void Read(PFILE file, unsigned char* buffer , unsigned int length);
|
||||
static void Write(PFILE file, unsigned char* buffer, unsigned int length);
|
||||
|
||||
static void Info(_PARTITION *pPartition, PFS pSystem);
|
||||
|
||||
private:
|
||||
enum struct TYPE{
|
||||
FAT,
|
||||
FAT16,
|
||||
FAT32,
|
||||
VFAT
|
||||
};
|
||||
enum ATTRIBUTES {
|
||||
ATTR_READ_ONLY = 0x01,
|
||||
ATT_HIDDEN = 0x02,
|
||||
ATTR_SYSTEM = 0x04,
|
||||
ATTR_VOLUME_ID = 0x08,
|
||||
ATTR_DIRECTORY = 0x10,
|
||||
ATTR_ARCHIVE = 0x20
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user