Hard-code-mounted the initd at /bin.

This commit is contained in:
Jonas 'Sortie' Termansen 2011-11-20 16:25:55 +01:00
parent 190989646b
commit a6a2c400bf
1 changed files with 14 additions and 3 deletions

View File

@ -24,24 +24,35 @@
#include "platform.h"
#include <libmaxsi/memory.h>
#include "panic.h"
#include "mount.h"
#include "fs/ramfs.h"
#include "fs/initfs.h"
namespace Sortix
{
namespace Mount
{
DevRAMFS* fs;
DevFileSystem* initfs;
DevFileSystem* rootfs;
DevFileSystem* WhichFileSystem(const char* path, size_t* pathoffset)
{
if ( path[0] == '/' && path[1] == 'b' && path[2] == 'i' && path[3] == 'n' && (path[4] == '/' || path[4] == 0) )
{
*pathoffset = 4;
return initfs;
}
*pathoffset = 0;
return fs;
return rootfs;
}
void Init()
{
fs = new DevRAMFS();
initfs = new DevInitFS();
if ( !initfs ) { Panic("Unable to allocate initfs"); }
rootfs = new DevRAMFS();
if ( !rootfs ) { Panic("Unable to allocate rootfs"); }
}
}
}