Finished custom filesystem and got it to boot normally

This commit is contained in:
2024-08-14 10:43:12 +02:00
parent d37abb7b65
commit 40e84e5b70
6 changed files with 39 additions and 57 deletions
+7 -9
View File
@@ -6,20 +6,18 @@
#include <disk/disk.h>
#include <stdint.h>
char* currentDir;
superblock_t* impl_superblock = (superblock_t*)SUPERBLOCK_LOC;
inode_t* getInode(char* path) {
dirEntry_t* dentry = (dirEntry_t*)SCRATCH_BLOCK_LOC;
while (dentry->name[0] != '\0') {
if (strcmp(dentry->name, path)) break;
dentry++;
inode_t* getInode(char* path, dirEntry_t* dentries) {
while (dentries->name[0] != '\0') {
if (strcmp(dentries->name, path) == 0) break;
dentries++;
}
if (dentry->name[0] == '\0') return NULL;
if (dentries->name[0] == '\0') return NULL;
inode_t* inode = (inode_t*)BOOT_FIRST_INODE_LOC;
while (inode->id != dentry->id) { inode++; }
while (inode->id != dentries->id) { inode++; }
return inode;
}