diff options
author | Marvin Borner | 2021-04-25 13:43:14 +0200 |
---|---|---|
committer | Marvin Borner | 2021-04-25 13:43:14 +0200 |
commit | f2b4acb2fe6a366288b19843e0d2678b8590bdf4 (patch) | |
tree | 1eb869f237908ec0b2516c00f940c6562c5cc5bd /kernel/inc | |
parent | cd46cefdd74b9ad0b225706f4d4b5864e87d97d6 (diff) |
Chu chuu, using the bus for everything now!
Well, I know: bus != train. But I like trains. So I don't care.
Go away!
Diffstat (limited to 'kernel/inc')
-rw-r--r-- | kernel/inc/io.h | 9 | ||||
-rw-r--r-- | kernel/inc/logger.h | 8 | ||||
-rw-r--r-- | kernel/inc/proc.h | 10 |
3 files changed, 13 insertions, 14 deletions
diff --git a/kernel/inc/io.h b/kernel/inc/io.h index e0b817b..ed7920e 100644 --- a/kernel/inc/io.h +++ b/kernel/inc/io.h @@ -1,7 +1,7 @@ // MIT License, Copyright (c) 2021 Marvin Borner -#ifndef DEV_H -#define DEV_H +#ifndef IO_H +#define IO_H #include <boot.h> #include <def.h> @@ -11,7 +11,7 @@ struct io_dev { res (*read)(void *buf, u32 offset, u32 count) NONNULL; - res (*write)(void *buf, u32 offset, u32 count) NONNULL; + res (*write)(const void *buf, u32 offset, u32 count) NONNULL; res (*control)(u32 request, void *arg1, void *arg2, void *arg3); res (*ready)(void); }; @@ -21,12 +21,13 @@ void io_add(enum io_type io, struct io_dev *dev) NONNULL; // No NONNULL on syscalls res io_control(enum io_type io, u32 request, void *arg1, void *arg2, void *arg3); -res io_write(enum io_type io, void *buf, u32 offset, u32 count); +res io_write(enum io_type io, const void *buf, u32 offset, u32 count); res io_read(enum io_type io, void *buf, u32 offset, u32 count); res io_poll(u32 *devs); res io_ready(enum io_type io); void io_block(enum io_type io, struct proc *proc) NONNULL; void io_unblock(enum io_type io); +void io_unblock_pid(u32 pid); #endif diff --git a/kernel/inc/logger.h b/kernel/inc/logger.h new file mode 100644 index 0000000..61ec576 --- /dev/null +++ b/kernel/inc/logger.h @@ -0,0 +1,8 @@ +// MIT License, Copyright (c) 2021 Marvin Borner + +#ifndef LOGGER_H +#define LOGGER_H + +void logger_install(void); + +#endif diff --git a/kernel/inc/proc.h b/kernel/inc/proc.h index 1e3f037..5b8fbea 100644 --- a/kernel/inc/proc.h +++ b/kernel/inc/proc.h @@ -22,25 +22,15 @@ #define RING(regs) ((regs->cs) & 3) -#define STREAM_MAX_SIZE 4096 -enum stream_defaults { STREAM_IN, STREAM_OUT, STREAM_ERR, STREAM_LOG, STREAM_UNKNOWN = -1 }; - enum proc_priv { PROC_PRIV_NONE, PROC_PRIV_ROOT, PROC_PRIV_KERNEL }; enum proc_state { PROC_RUNNING, PROC_BLOCKED }; -struct stream { - u32 offset_read; - u32 offset_write; - char data[STREAM_MAX_SIZE]; -}; - struct proc { u32 pid; u32 entry; char name[64]; char dir[64]; - struct stream streams[4]; struct page_dir *page_dir; struct regs regs; enum proc_priv priv; |