From 21106945c4a28d45334824c02f8b139d1db91c45 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Fri, 1 May 2020 20:50:49 +0200 Subject: Added devfs and basic standard devices --- src/kernel/fs/dev.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/kernel/fs/dev.h (limited to 'src/kernel/fs/dev.h') diff --git a/src/kernel/fs/dev.h b/src/kernel/fs/dev.h new file mode 100644 index 0000000..40263e6 --- /dev/null +++ b/src/kernel/fs/dev.h @@ -0,0 +1,25 @@ +#ifndef MELVIX_DEV_H +#define MELVIX_DEV_H + +#include +#include + +struct dev { + char name[128]; + uint32_t block_size; + read read; + write write; + + uint8_t bus; + uint8_t drive; +}; + +void dev_make(char *name, read read, write write); +uint32_t dev_read(struct fs_node *dev, uint32_t offset, uint32_t size, char *buffer); +uint32_t dev_write(struct fs_node *dev, uint32_t offset, uint32_t size, char *buffer); + +void dev_stdout(); +void dev_stdin(); +void dev_stderr(); + +#endif \ No newline at end of file -- cgit v1.2.3