forked from PoliEcho-holding-org/kern
Finished custom filesystem and got it to boot normally
This commit is contained in:
+7
-9
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user