MCPcopy Create free account
hub / github.com/Bananymous/banan-os / initialize

Method initialize

kernel/kernel/FS/VirtualFileSystem.cpp:167–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165 }
166
167 void VirtualFileSystem::initialize(BAN::StringView root_path)
168 {
169 ASSERT(!s_instance);
170 s_instance = MUST(BAN::RefPtr<VirtualFileSystem>::create());
171
172 s_instance->m_root_fs = load_root_filesystem(root_path);
173 if (!s_instance->m_root_fs)
174 panic("Could not load root filesystem");
175
176 Credentials root_creds { 0, 0, 0, 0 };
177 MUST(s_instance->mount(root_creds, &DevFileSystem::get(), "/dev"_sv));
178
179 MUST(s_instance->mount(root_creds, &ProcFileSystem::get(), "/proc"_sv));
180
181 auto tmpfs = MUST(TmpFileSystem::create(-1, 01777, 0, 0));
182 MUST(s_instance->mount(root_creds, tmpfs, "/tmp"_sv));
183 }
184
185 VirtualFileSystem& VirtualFileSystem::get()
186 {

Callers

nothing calls this directly

Calls 2

load_root_filesystemFunction · 0.85
mountMethod · 0.80

Tested by

no test coverage detected