From 20853582d5385d12421433d21910e783caa00764 Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Sun, 13 Sep 2020 22:59:42 -0400 Subject: dirinfo command --- src/user/include/pland/syscall.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/user/include/pland/syscall.h') diff --git a/src/user/include/pland/syscall.h b/src/user/include/pland/syscall.h index 75383fc..e16a7fb 100644 --- a/src/user/include/pland/syscall.h +++ b/src/user/include/pland/syscall.h @@ -45,9 +45,16 @@ enum _scn { _SCN_GET_KEY, _SCN_ALLOCATE_RAM, _SCN_MEMORY_INFO, - _SCN_WAIT_FOR_TASK + _SCN_WAIT_FOR_TASK, + _SCN_ENUMERATE_DIR }; +typedef struct { + bool is_dir; + char name[100]; + uint32_t size; +} _dir_info_entry; + static inline uint32_t _sc0(enum _scn eax) { volatile uint32_t out; asm ( @@ -166,4 +173,8 @@ static inline void _wait_for_task(_process_handle_t handle) { _sc1(_SCN_WAIT_FOR_TASK, handle); } +static inline uint32_t _enumerate_dir(_drive_number_t drive_number, const char *path, _dir_info_entry *buffer, uint32_t max_count) { + return _sc4(_SCN_ENUMERATE_DIR, drive_number, (uint32_t)path, (uint32_t)buffer, max_count); +} + #endif \ No newline at end of file -- cgit v1.2.3