From 73bb0e48640b842824a0b45fe4854df8ff7faf7b Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Sun, 6 Sep 2020 13:44:20 -0400 Subject: bugfixes, init program, hello world --- src/user/include/knob/block.h | 8 -------- src/user/include/knob/file.h | 2 ++ src/user/include/knob/task.h | 9 +++++++++ src/user/include/pland/syscall.h | 5 +++-- 4 files changed, 14 insertions(+), 10 deletions(-) delete mode 100644 src/user/include/knob/block.h create mode 100644 src/user/include/knob/task.h (limited to 'src/user/include') diff --git a/src/user/include/knob/block.h b/src/user/include/knob/block.h deleted file mode 100644 index 53b3deb..0000000 --- a/src/user/include/knob/block.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef KNOB_BLOCK_H -#define KNOB_BLOCK_H - -#include - -void blockcpy(void *to, const void *from, uint32_t count); - -#endif \ No newline at end of file diff --git a/src/user/include/knob/file.h b/src/user/include/knob/file.h index 6068077..4d0da87 100644 --- a/src/user/include/knob/file.h +++ b/src/user/include/knob/file.h @@ -5,6 +5,8 @@ struct file; +const char *remove_prefix(const char *path, uint8_t *dn_out); + struct file *open_file(const char *path); void close_file(struct file *f); diff --git a/src/user/include/knob/task.h b/src/user/include/knob/task.h new file mode 100644 index 0000000..ea5df62 --- /dev/null +++ b/src/user/include/knob/task.h @@ -0,0 +1,9 @@ +#ifndef KNOB_TASK_H +#define KNOB_TASK_H + +#include + +bool try_run_command(const char *path); +void yield_task(); + +#endif \ No newline at end of file diff --git a/src/user/include/pland/syscall.h b/src/user/include/pland/syscall.h index 01f7151..5858d16 100644 --- a/src/user/include/pland/syscall.h +++ b/src/user/include/pland/syscall.h @@ -2,6 +2,7 @@ #define PLAND_SYSCALL_H #include +#include typedef uint32_t _file_handle_t; typedef uint32_t _task_handle_t; @@ -120,8 +121,8 @@ static inline uint32_t _file_size(_file_handle_t handle) { return _sc1(_SCN_FILE_SIZE, handle); } -static inline void _start_task(_drive_number_t drive_number, char *path) { - _sc2(_SCN_START_TASK, drive_number, (uint32_t)path); +static inline bool _start_task(_drive_number_t drive_number, const char *path) { + return (bool)_sc2(_SCN_START_TASK, drive_number, (uint32_t)path); } static inline void _log_string(const char *sz) { -- cgit v1.2.3