Merge into main the new state of the operating system/kernel #1
@ -28,9 +28,9 @@ extern "C"
 | 
			
		||||
#include "ide/ide.h"
 | 
			
		||||
#include "./drivers/IO/ata/ataDevice.h"
 | 
			
		||||
#include "./PartitionTable/MBR/MasterBootRecord.h"
 | 
			
		||||
#include "./filesytems/FAT/BiosParameterBlock.h"
 | 
			
		||||
#include "./filesytems/FAT/ExtendBootRecord.h"
 | 
			
		||||
#include "./filesytems/FAT/DirectoryEntry.h"
 | 
			
		||||
#include "./filesystems/FAT/BiosParameterBlock.h"
 | 
			
		||||
#include "./filesystems/FAT/ExtendBootRecord.h"
 | 
			
		||||
#include "./filesystems/FAT/DirectoryEntry.h"
 | 
			
		||||
#include "drivers/ACPI/rsdp.h"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										9
									
								
								src/kernel/vfs/File.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								src/kernel/vfs/File.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,9 @@
 | 
			
		||||
#pragma once
 | 
			
		||||
 | 
			
		||||
class File {
 | 
			
		||||
 | 
			
		||||
public:
 | 
			
		||||
    virtual const File* Open () const ; // TODO: figure out a proper return value 
 | 
			
		||||
    virtual const char* Read() const;
 | 
			
		||||
    virtual void Write();
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										50
									
								
								src/kernel/vfs/VFS.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										50
									
								
								src/kernel/vfs/VFS.cpp
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,50 @@
 | 
			
		||||
#include "VFS.h"
 | 
			
		||||
/*
 | 
			
		||||
 * TODO: Implement this!!
 | 
			
		||||
 * 
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
void VirtualFileSystem::Initialize(FS* root)
 | 
			
		||||
{
 | 
			
		||||
    root = root;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void VirtualFileSystem::Open(const char* path)
 | 
			
		||||
{
 | 
			
		||||
    /*
 | 
			
		||||
        What does this mean?
 | 
			
		||||
        1. Parse the path string 
 | 
			
		||||
        2. Traverse the graph (Finding the correct Node)
 | 
			
		||||
        3. Create some kind of open file pointer thingy
 | 
			
		||||
    */
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void VirtualFileSystem::Read()
 | 
			
		||||
{
 | 
			
		||||
    // NOTE: we need some way to know what file we wish to read from 
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void VirtualFileSystem::Write()
 | 
			
		||||
{
 | 
			
		||||
   // NOTE: we need some way to know what file we wish to write to 
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void VirtualFileSystem::Mount(const char* path, FS* FileSystem)
 | 
			
		||||
{
 | 
			
		||||
    /*
 | 
			
		||||
        What does this mean?
 | 
			
		||||
        1. Parse the path string
 | 
			
		||||
        2. Add a node to our internal graph 
 | 
			
		||||
    */
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void VirtualFileSystem::UnMount(FS* FileSystem)
 | 
			
		||||
{
 | 
			
		||||
 /*
 | 
			
		||||
        What does this mean?
 | 
			
		||||
        1. Parse the path string
 | 
			
		||||
        2. Remve a node to our internal graph 
 | 
			
		||||
    */
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										29
									
								
								src/kernel/vfs/VFS.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								src/kernel/vfs/VFS.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,29 @@
 | 
			
		||||
#pragma once
 | 
			
		||||
 | 
			
		||||
class VirtualFileSystem{
 | 
			
		||||
public: 
 | 
			
		||||
    void Initialize( FS* root);
 | 
			
		||||
    void Open (const char* path);
 | 
			
		||||
    void Read();
 | 
			
		||||
    void Write();
 | 
			
		||||
 | 
			
		||||
    void Mount(const char* path,FS* FileSystem);
 | 
			
		||||
    void UnMount(FS* FileSystem);
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
    FS* root;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct FS
 | 
			
		||||
{
 | 
			
		||||
    const char* name ;
 | 
			
		||||
    int DeviceID;
 | 
			
		||||
    int ManufacturerID;
 | 
			
		||||
    FS* next;
 | 
			
		||||
    char**(Read)();
 | 
			
		||||
    void*(Write)();
 | 
			
		||||
    void*(Open)();
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user