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:
parent
fa3b11ac64
commit
93556d6743
14 changed files with 157 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue