mirror of
https://github.com/EnderIce2/Fennix.git
synced 2025-07-01 18:39:16 +00:00
fix(kernel/vfs): support multiple roots
This commit is contained in:
@ -15,6 +15,8 @@
|
||||
along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <filesystem/ramfs.hpp>
|
||||
|
||||
#include "../../kernel.h"
|
||||
|
||||
namespace Subsystem::Linux
|
||||
@ -23,5 +25,23 @@ namespace Subsystem::Linux
|
||||
|
||||
void InitializeSubSystem()
|
||||
{
|
||||
if (fs->RootExists(1) == false)
|
||||
{
|
||||
FileNode *nmnt = fs->GetByPath("/mnt", fs->GetRoot(0));
|
||||
assert(MountRAMFS(nmnt, "linux", 1));
|
||||
FileNode *linux = fs->GetRoot(1);
|
||||
|
||||
FileNode *bin = fs->ForceCreate(linux, "bin", 0755);
|
||||
FileNode *boot = fs->ForceCreate(linux, "boot", 0755);
|
||||
FileNode *dev = fs->ForceCreate(linux, "dev", 0755);
|
||||
FileNode *etc = fs->ForceCreate(linux, "etc", 0755);
|
||||
FileNode *home = fs->ForceCreate(linux, "home", 0755);
|
||||
FileNode *lib = fs->ForceCreate(linux, "lib", 0755);
|
||||
FileNode *lib64 = fs->ForceCreate(linux, "lib64", 0755);
|
||||
FileNode *media = fs->ForceCreate(linux, "media", 0755);
|
||||
FileNode *mnt = fs->ForceCreate(linux, "mnt", 0755);
|
||||
FileNode *opt = fs->ForceCreate(linux, "opt", 0755);
|
||||
FileNode *proc = fs->ForceCreate(linux, "proc", 0755);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -15,6 +15,8 @@
|
||||
along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <filesystem/ramfs.hpp>
|
||||
|
||||
#include "../../kernel.h"
|
||||
|
||||
namespace Subsystem::Windows
|
||||
@ -23,5 +25,17 @@ namespace Subsystem::Windows
|
||||
|
||||
void InitializeSubSystem()
|
||||
{
|
||||
if (fs->RootExists(2) == false)
|
||||
{
|
||||
FileNode *nmnt = fs->GetByPath("/mnt", fs->GetRoot(0));
|
||||
assert(MountRAMFS(nmnt, "windows", 2));
|
||||
FileNode *win = fs->GetRoot(2);
|
||||
|
||||
FileNode *windows = fs->ForceCreate(win, "Windows", 0755);
|
||||
FileNode *programFiles = fs->ForceCreate(windows, "Program Files", 0755);
|
||||
FileNode *programFilesX86 = fs->ForceCreate(windows, "Program Files (x86)", 0755);
|
||||
FileNode *programData = fs->ForceCreate(windows, "ProgramData", 0755);
|
||||
FileNode *users = fs->ForceCreate(windows, "Users", 0755);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user