From a6a2c400bf0a04990b53f164159759ec09ee4485 Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Sun, 20 Nov 2011 16:25:55 +0100 Subject: [PATCH] Hard-code-mounted the initd at /bin. --- sortix/mount.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/sortix/mount.cpp b/sortix/mount.cpp index 6c7ddd46..34a422b0 100644 --- a/sortix/mount.cpp +++ b/sortix/mount.cpp @@ -24,24 +24,35 @@ #include "platform.h" #include +#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"); } } } }