File System theory: Z-OS FS
Posted: Tue Jun 23, 2009 4:22 pm
Before I finally post up my draft overall system, I'd like to post up the Filesystem I've drafted up for comments.
Here's some BG-info before I get into it: My OS will have a kernel loader that simply initializes interrupts, and several other basics, before memcpy()ing several modules from the HDD into memory, and then running the kernel "Tie-in" module, which will interface those, and load the GUI, and link it to the loaded modules. Then, that's that for bootup. (The Driver frame is one of the modules)
Now here's the FS:
Region 1: Volume Boot Sector. (The area with the boot magic: 0x55 and 0xAA, etc.)
Region 2: Root Directory.
File Data: Self explanatory...
From here: The FS has no FAT (like FAT32, etc.), or Master File Table (like NTFS), but the FS begins right after the Boot Sector. Hold on: before you fire off those questions, look at the format for a directory listing structure: (A directory)
With an accessing structure like so:
The last listing in any directory (the end marker) is a row with the zos_fs_directory->inode set to 0.
In every directory file there is a row (first row) with inode set to 1. This contains a pointer (segment, offset) which will indicate the previous directory file's physical address.
In the root directory listing, the row with inode set to 1 will, in the name field, hold the drive name, and a list of 'aliases' for the drive. Upon mounting the FS, these aliases will be read, and placed into a configuration buffer in memory. The aliases will be used for portability between *nix, W32, and my OS. A partition can have the name "John's drive", with aliases "/" and "C:".
Simple. The kernel's HDD driver handles the alias translation.
I'e already pseudocoded it, and wanted to see if it really seems wholesome to anyone other than myself. There's more to it, but I've explained the basics for now.
Here's some BG-info before I get into it: My OS will have a kernel loader that simply initializes interrupts, and several other basics, before memcpy()ing several modules from the HDD into memory, and then running the kernel "Tie-in" module, which will interface those, and load the GUI, and link it to the loaded modules. Then, that's that for bootup. (The Driver frame is one of the modules)
Now here's the FS:
Code: Select all
+------------------------------------------------------------------------------------+
| 1| 2| File Data |
| | | |
+------------------------------------------------------------------------------------+
Note that in a Z-OS drive (the drive where the OS is installed), there will be extra information packed into the are between (1) and (2), as well as certain pointers to physical locations on disk for OS purposes. The core system files will be packed into a read-only area between (1) and (2), and will have no means of being referenced within the FS. The Z-OS FS skips over this point using a special pointer system, and goes straight on to the Root Directory (2). So I believe this will at least aid in the prevention of virus corruption of system files.
Region 2: Root Directory.
File Data: Self explanatory...
From here: The FS has no FAT (like FAT32, etc.), or Master File Table (like NTFS), but the FS begins right after the Boot Sector. Hold on: before you fire off those questions, look at the format for a directory listing structure: (A directory)
Code: Select all
-> 32b | 16b| 32b| 256B| 32b| 16b|
+----------------------------------------------------------------------------------------+
| inode | HDD segment | offset | filename | filesize | permissions |
+----------------------------------------------------------------------------------------+
Code: Select all
struct zos_fs_dir_format
{
void *inode;
uword16 segment;
udword32 offset;
char name[256];
udword32 size;
uword16 perm
} zos_fs_directory;
In every directory file there is a row (first row) with inode set to 1. This contains a pointer (segment, offset) which will indicate the previous directory file's physical address.
In the root directory listing, the row with inode set to 1 will, in the name field, hold the drive name, and a list of 'aliases' for the drive. Upon mounting the FS, these aliases will be read, and placed into a configuration buffer in memory. The aliases will be used for portability between *nix, W32, and my OS. A partition can have the name "John's drive", with aliases "/" and "C:".
Simple. The kernel's HDD driver handles the alias translation.
I'e already pseudocoded it, and wanted to see if it really seems wholesome to anyone other than myself. There's more to it, but I've explained the basics for now.