Improved build system
Added new entries to .gitignore Moved away from source directory as central spot for all source code
This commit is contained in:
		
							
								
								
									
										29
									
								
								kernel/filesystem/EXT2/SuperBlock.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								kernel/filesystem/EXT2/SuperBlock.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,29 @@
 | 
			
		||||
#pragma once
 | 
			
		||||
#include <stdint.h>
 | 
			
		||||
struct SuperBlock {  
 | 
			
		||||
    uint32_t NumberOfInodes;
 | 
			
		||||
    uint32_t NumberOfBlocks;
 | 
			
		||||
    uint32_t NumberOfReservedBlocks;
 | 
			
		||||
    uint32_t NumberOfUnallocatedBlocks;
 | 
			
		||||
    uint32_t NumberOfUnallocatedInodes;
 | 
			
		||||
    uint32_t BlockNumberOfSuperBlock;
 | 
			
		||||
    uint32_t BlockSize;// Something about a shift left 
 | 
			
		||||
    uint32_t FragmentSize;
 | 
			
		||||
    uint32_t NumberOfBlocksInGroup;
 | 
			
		||||
    uint32_t NumberOfFragmentsInBlockGroup;
 | 
			
		||||
    uint32_t NumberOfInodesInBlockGroup;
 | 
			
		||||
    uint32_t LastMountTime; // POSIX
 | 
			
		||||
    uint32_t LastWrittenTime; // POSIX
 | 
			
		||||
    uint16_t TimesMountedSinceCheck; 
 | 
			
		||||
    uint16_t TimesMountedUntilCheck;
 | 
			
		||||
    uint16_t EXT_SIG ; // 0xef53
 | 
			
		||||
    uint16_t FS_STATE;
 | 
			
		||||
    uint16_t ON_ERR;
 | 
			
		||||
    uint16_t VERSION_MINOR;
 | 
			
		||||
    uint32_t TimeLastCheck; // POSIX
 | 
			
		||||
    uint32_t CheckInterval; //POSIX
 | 
			
		||||
    uint32_t OS_ID; // OS the FS was created with
 | 
			
		||||
    uint32_t VERSION_MAJOR;
 | 
			
		||||
    uint16_t UIDReservedBlocks; 
 | 
			
		||||
    uint16_t GIDReservedBlocks;
 | 
			
		||||
}__attribute__((packed));
 | 
			
		||||
							
								
								
									
										21
									
								
								kernel/filesystem/FAT/BiosParameterBlock.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								kernel/filesystem/FAT/BiosParameterBlock.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,21 @@
 | 
			
		||||
#pragma once
 | 
			
		||||
#include <stdint.h>
 | 
			
		||||
#include "./ExtendBootRecord.h"
 | 
			
		||||
 | 
			
		||||
struct BiosParameterBlock {
 | 
			
		||||
    uint8_t BootLoaderCodeSection [3];
 | 
			
		||||
    uint8_t OEM_id [8];
 | 
			
		||||
    uint16_t  BytesPerSector ; // I suspect would be 512
 | 
			
		||||
    uint8_t SectorsPerCluster ; 
 | 
			
		||||
    uint16_t ReservedSectors;
 | 
			
		||||
    uint8_t NumberOfFileAllocationTables; // Probably equals 2
 | 
			
		||||
    uint16_t NumberOfDirectoryEntries; // Root directory must contain entire sectors
 | 
			
		||||
    uint16_t TotalSectorsInLogicalVolume ; // 0 means >65535 sectors in volume , actual count can be found in LargeSectorCount
 | 
			
		||||
    uint8_t MediaDescriptor ; // Indication the media descriptor type
 | 
			
		||||
    uint16_t NumberOfSectorsPerFAT;// only in FAT12 / FAT 16
 | 
			
		||||
    uint16_t NumberOfSectorsPerTrack; 
 | 
			
		||||
    uint16_t NumberOfHeadsOnMedia;
 | 
			
		||||
    uint32_t NumberOfHiddenSectors;
 | 
			
		||||
    uint32_t LargeSectorCount;
 | 
			
		||||
    ExtendedBootRecord_FAT16 ebpb;
 | 
			
		||||
}__attribute__((packed));
 | 
			
		||||
							
								
								
									
										19
									
								
								kernel/filesystem/FAT/DirectoryEntry.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								kernel/filesystem/FAT/DirectoryEntry.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,19 @@
 | 
			
		||||
#pragma once 
 | 
			
		||||
#include <stdint.h>
 | 
			
		||||
 | 
			
		||||
struct DirectoryEntry {
 | 
			
		||||
    uint8_t filename [8];
 | 
			
		||||
    uint8_t Extension [3];
 | 
			
		||||
    uint8_t attribute;
 | 
			
		||||
    uint8_t Reserved;
 | 
			
		||||
    uint8_t creation;
 | 
			
		||||
    uint16_t CreationTime;
 | 
			
		||||
    uint16_t CreationDate;
 | 
			
		||||
    uint16_t LastAccessDate;
 | 
			
		||||
    uint16_t ReservedFAT32;
 | 
			
		||||
    uint16_t LastWriteTime;
 | 
			
		||||
    uint16_t LastWriteDate;
 | 
			
		||||
    uint16_t StartingCluster;
 | 
			
		||||
    uint32_t FilesizeInBytes;
 | 
			
		||||
 | 
			
		||||
}__attribute__((packed));
 | 
			
		||||
							
								
								
									
										32
									
								
								kernel/filesystem/FAT/ExtendBootRecord.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								kernel/filesystem/FAT/ExtendBootRecord.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,32 @@
 | 
			
		||||
#pragma once 
 | 
			
		||||
#include <stdint.h>
 | 
			
		||||
 | 
			
		||||
struct ExtendedBootRecord_FAT16{
 | 
			
		||||
    uint8_t DriveNumber;
 | 
			
		||||
    uint8_t Reserved;
 | 
			
		||||
    uint8_t Signature;
 | 
			
		||||
    const uint32_t VOLUME_ID_SERIAL_NUMBER;
 | 
			
		||||
    uint8_t volume_label [11];
 | 
			
		||||
    uint8_t Identifier_string [8];
 | 
			
		||||
    uint8_t bootCode [448];
 | 
			
		||||
    uint16_t partitionSignature;
 | 
			
		||||
}__attribute__((packed));
 | 
			
		||||
 | 
			
		||||
struct ExtendedBootRecord_FAT32{
 | 
			
		||||
    uint32_t SectorsPerFAT;
 | 
			
		||||
    uint16_t Flags;
 | 
			
		||||
    const uint16_t FAT_VERSION_NUMBER;
 | 
			
		||||
    uint32_t rootDirectory_clusterNumber;// Often set to 2;
 | 
			
		||||
    uint16_t FSInfo_SectorNumber;
 | 
			
		||||
    uint16_t backup_bpb_sectorNumber;
 | 
			
		||||
    uint8_t Reserved [12];
 | 
			
		||||
    uint8_t DriveNumber;
 | 
			
		||||
    uint8_t Reserved2;
 | 
			
		||||
    uint8_t Signature; // must be 0x28 or 0x29 
 | 
			
		||||
    uint32_t VOLUME_ID_SERIAL;
 | 
			
		||||
    uint8_t volume_label[11];
 | 
			
		||||
    uint8_t SystemIdentifierString [8]; // ALWAYS "FAT32 " but spec says do not trust
 | 
			
		||||
    uint8_t BootCode [420]; // NICE
 | 
			
		||||
    uint16_t PartitionSignature; // 0xAA55
 | 
			
		||||
 | 
			
		||||
}__attribute__((packed));
 | 
			
		||||
		Reference in New Issue
	
	Block a user