Import backup from 2004-03-15

This commit is contained in:
josh committed 2017-07-25 22:23:46 -04:00
1 parent ab576bf18f
commit 7110307896
4 files changed
+160 -163

No files matched your search

+42 -33
View File
@@ -1,33 +1,42 @@
// vfs.c
// Author: Josh Holtrop
// Date: 03/11/04
#include "vfs.h"
#include "hos_defines.h"
Volume *firstVolume = 0;
void vfs_init()
{
dword initrdLoaded = *(byte *)BOOT_HASRD;
}
Volume *vfs_newVolume()
{
Volume *vol = malloc(sizeof(Volume));
vfs_getLastVolume()->link = vol;
return vol;
}
Volume *vfs_getLastVolume()
{
Volume *vol = firstVolume;
while (vol)
vol = vol->link;
return vol;
}
// vfs.c
// Author: Josh Holtrop
// Date: 03/11/04
#include "vfs.h"
#include "hos_defines.h"
Volume *firstVolume = 0;
Volume *rootVolume = 0;
void vfs_init()
{
if(*(byte *)BOOT_HASRD) //bootloader loaded an initial ram disk
{
Volume *initrd = vfs_newVolume();
RamDisk *rd = rd_newDisk(0xC0200000, 1440*1024);
initrd->diskDevice = rd;
initrd->deviceType = VFS_RD;
strcpy(initrd->label, "rd0");
initrd->link = 0;
rootVolume = initrd;
}
}
Volume *vfs_newVolume()
{
Volume *vol = malloc(sizeof(Volume));
vfs_getLastVolume()->link = vol;
return vol;
}
Volume *vfs_getLastVolume()
{
Volume *vol = firstVolume;
while (vol)
vol = vol->link;
return vol;
}