git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Usermode/ld-acess - Added two more ARM relocation types
[tpg/acess2.git]
/
Kernel
/
vfs
/
main.c
diff --git
a/Kernel/vfs/main.c
b/Kernel/vfs/main.c
index
45e20d9
..
cb798c1
100644
(file)
--- a/
Kernel/vfs/main.c
+++ b/
Kernel/vfs/main.c
@@
-13,19
+13,21
@@
extern tVFS_Driver gRootFS_Info;
extern tVFS_Driver gDevFS_Info;
// === PROTOTYPES ===
extern tVFS_Driver gDevFS_Info;
// === PROTOTYPES ===
- int VFS_Init();
-char *VFS_GetTruePath(char *Path);
+#if 0
+ int VFS_Init(void);
+char *VFS_GetTruePath(const char *Path);
void VFS_GetMemPath(char *Dest, void *Base, Uint Length);
void VFS_GetMemPath(char *Dest, void *Base, Uint Length);
-tVFS_Driver *VFS_GetFSByName(char *Name);
+tVFS_Driver *VFS_GetFSByName(c
onst c
har *Name);
int VFS_AddDriver(tVFS_Driver *Info);
int VFS_AddDriver(tVFS_Driver *Info);
-void VFS_UpdateDriverFile();
+#endif
+void VFS_UpdateDriverFile(void);
// === EXPORTS ===
EXPORT(VFS_AddDriver);
// === GLOBALS ===
tVFS_Node NULLNode = {0};
// === EXPORTS ===
EXPORT(VFS_AddDriver);
// === GLOBALS ===
tVFS_Node NULLNode = {0};
-tS
pinlock siDriverListLock = 0
;
+tS
hortSpinlock slDriverListLock
;
tVFS_Driver *gVFS_Drivers = NULL;
char *gsVFS_DriverFile = NULL;
int giVFS_DriverFileID = 0;
tVFS_Driver *gVFS_Drivers = NULL;
char *gsVFS_DriverFile = NULL;
int giVFS_DriverFileID = 0;
@@
-35,10
+37,10
@@
char *gsVFS_MountFile = NULL;
// === CODE ===
/**
// === CODE ===
/**
- * \fn int VFS_Init()
+ * \fn int VFS_Init(
void
)
* \brief Initialises the VFS for use by the kernel and user
*/
* \brief Initialises the VFS for use by the kernel and user
*/
-int VFS_Init()
+int VFS_Init(
void
)
{
// Core Drivers
gVFS_Drivers = &gRootFS_Info;
{
// Core Drivers
gVFS_Drivers = &gRootFS_Info;
@@
-49,28
+51,34
@@
int VFS_Init()
giVFS_MountFileID = SysFS_RegisterFile("VFS/Mounts", NULL, 0);
giVFS_DriverFileID = SysFS_RegisterFile("VFS/Drivers", NULL, 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 ) {
+ Log_KernelPanic("VFS", "Unable to mount root (Where the **** is rootfs?)");
+ return -1;
+ }
VFS_MkDir("/Devices");
VFS_MkDir("/Mount");
VFS_Mount("dev", "/Devices", "devfs", "");
VFS_MkDir("/Devices");
VFS_MkDir("/Mount");
VFS_Mount("dev", "/Devices", "devfs", "");
-
+
+ Log_Debug("VFS", "Setting max files");
CFGINT(CFG_VFS_MAXFILES) = 32;
return 0;
}
/**
CFGINT(CFG_VFS_MAXFILES) = 32;
return 0;
}
/**
- * \fn char *VFS_GetTruePath(char *Path)
+ * \fn char *VFS_GetTruePath(c
onst c
har *Path)
* \brief Gets the true path (non-symlink) of a file
*/
* \brief Gets the true path (non-symlink) of a file
*/
-char *VFS_GetTruePath(char *Path)
+char *VFS_GetTruePath(c
onst c
har *Path)
{
tVFS_Node *node;
char *ret, *tmp;
tmp = VFS_GetAbsPath(Path);
if(tmp == NULL) return NULL;
{
tVFS_Node *node;
char *ret, *tmp;
tmp = VFS_GetAbsPath(Path);
if(tmp == NULL) return NULL;
- node = VFS_ParsePath(tmp, &ret);
+ //Log(" VFS_GetTruePath: tmp = '%s'", tmp);
+ node = VFS_ParsePath(tmp, &ret, NULL);
free(tmp);
free(tmp);
+ //Log(" VFS_GetTruePath: node=%p, ret='%s'", node, ret);
if(!node) return NULL;
if(node->Close) node->Close(node);
if(!node) return NULL;
if(node->Close) node->Close(node);
@@
-85,22
+93,23
@@
char *VFS_GetTruePath(char *Path)
void VFS_GetMemPath(char *Dest, void *Base, Uint Length)
{
Dest[0] = '$';
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';
}
/**
Dest[BITS/4+1] = ':';
itoa( &Dest[BITS/4+2], Length, 16, BITS/4, '0' );
Dest[BITS/2+2] = '\0';
}
/**
- * \fn tVFS_Driver *VFS_GetFSByName(char *Name)
+ * \fn tVFS_Driver *VFS_GetFSByName(c
onst c
har *Name)
* \brief Gets a filesystem structure given a name
*/
* \brief Gets a filesystem structure given a name
*/
-tVFS_Driver *VFS_GetFSByName(char *Name)
+tVFS_Driver *VFS_GetFSByName(c
onst c
har *Name)
{
tVFS_Driver *drv = gVFS_Drivers;
for(;drv;drv=drv->Next)
{
{
tVFS_Driver *drv = gVFS_Drivers;
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(strcmp(drv->Name, Name) == 0)
return drv;
}
@@
-114,10
+123,10
@@
int VFS_AddDriver(tVFS_Driver *Info)
{
if(!Info) return -1;
{
if(!Info) return -1;
-
LOCK( &si
DriverListLock );
+
SHORTLOCK( &sl
DriverListLock );
Info->Next = gVFS_Drivers;
gVFS_Drivers = Info;
Info->Next = gVFS_Drivers;
gVFS_Drivers = Info;
-
RELEASE( &si
DriverListLock );
+
SHORTREL( &sl
DriverListLock );
VFS_UpdateDriverFile();
VFS_UpdateDriverFile();
@@
-125,10
+134,10
@@
int VFS_AddDriver(tVFS_Driver *Info)
}
/**
}
/**
- * \fn void VFS_UpdateDriverFile()
+ * \fn void VFS_UpdateDriverFile(
void
)
* \brief Updates the driver list file
*/
* \brief Updates the driver list file
*/
-void VFS_UpdateDriverFile()
+void VFS_UpdateDriverFile(
void
)
{
tVFS_Driver *drv;
int len = 0;
{
tVFS_Driver *drv;
int len = 0;
UCC
git Repository :: git.ucc.asn.au