mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-24 00:24:38 +00:00
Add basic character device support. Start with null and zero.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user