1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-18 08:15:06 +00:00

Add basic character device support. Start with null and zero.

This commit is contained in:
Andreas Kling 2018-10-14 02:59:22 +02:00
parent fa3b11ac64
commit 93556d6743
14 changed files with 157 additions and 2 deletions

View file

@ -3,6 +3,8 @@
#include "VirtualFileSystem.h"
#include "FileHandle.h"
#include "SyntheticFileSystem.h"
#include "ZeroDevice.h"
#include "NullDevice.h"
#include <cstring>
#include <AK/SimpleMalloc.h>
#include <AK/kmalloc.h>
@ -17,6 +19,12 @@ int main(int c, char** v)
VirtualFileSystem vfs;
auto zero = make<ZeroDevice>();
vfs.registerCharacterDevice(1, 5, *zero);
auto null = make<NullDevice>();
vfs.registerCharacterDevice(1, 3, *null);
if (!vfs.mountRoot(makeFileSystem(filename))) {
printf("Failed to mount root :(\n");
return 1;