// === GLOBALS ===
tVFS_Node NULLNode = {0};
-tSpinlock siDriverListLock = 0;
+tShortSpinlock slDriverListLock;
tVFS_Driver *gVFS_Drivers = NULL;
char *gsVFS_DriverFile = NULL;
int giVFS_DriverFileID = 0;
giVFS_MountFileID = SysFS_RegisterFile("VFS/Mounts", NULL, 0);
giVFS_DriverFileID = SysFS_RegisterFile("VFS/Drivers", NULL, 0);
- VFS_Mount("root", "/", "rootfs", "");
+ if( VFS_Mount("root", "/", "rootfs", "") != 0 ) {
+ Panic("Unable to mount root (Where the **** is rootfs?)");
+ return -1;
+ }
VFS_MkDir("/Devices");
VFS_MkDir("/Mount");
VFS_Mount("dev", "/Devices", "devfs", "");
tmp = VFS_GetAbsPath(Path);
if(tmp == NULL) return NULL;
+ //Log(" VFS_GetTruePath: tmp = '%s'", tmp);
node = VFS_ParsePath(tmp, &ret);
free(tmp);
+ //Log(" VFS_GetTruePath: node=%p, ret='%s'", node, ret);
if(!node) return NULL;
if(node->Close) node->Close(node);
void VFS_GetMemPath(char *Dest, void *Base, Uint Length)
{
Dest[0] = '$';
- itoa( &Dest[1], (Uint)Base, 16, BITS/4, '0' );
+ itoa( &Dest[1], (tVAddr)Base, 16, BITS/4, '0' );
Dest[BITS/4+1] = ':';
itoa( &Dest[BITS/4+2], Length, 16, BITS/4, '0' );
Dest[BITS/2+2] = '\0';
for(;drv;drv=drv->Next)
{
+// Log("strcmp('%s' (%p), '%s') == 0?", drv->Name, drv->Name, Name);
if(strcmp(drv->Name, Name) == 0)
return drv;
}
{
if(!Info) return -1;
- LOCK( &siDriverListLock );
+ SHORTLOCK( &slDriverListLock );
Info->Next = gVFS_Drivers;
gVFS_Drivers = Info;
- RELEASE( &siDriverListLock );
+ SHORTREL( &slDriverListLock );
VFS_UpdateDriverFile();