From 20853582d5385d12421433d21910e783caa00764 Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Sun, 13 Sep 2020 22:59:42 -0400 Subject: dirinfo command --- doc/ints.txt | 43 ++++++++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 15 deletions(-) (limited to 'doc/ints.txt') diff --git a/doc/ints.txt b/doc/ints.txt index 191d719..d8abd6d 100644 --- a/doc/ints.txt +++ b/doc/ints.txt @@ -24,20 +24,19 @@ invalid system call numbers change eax to -1, and have no other effect. table 1: - function | eax | eax out | ebx | ecx | edx | esi | edi ----------------|-----|---------------|---------------|-------------|-----------|--------|----- - open file | 0x0 | handle | drive number | path | | | - close file | 0x1 | | handle | | | | - file read | 0x2 | read | handle | file offset | count | buffer | - get file size | 0x3 | size | handle | | | | - start task | 0x4 | handle | drive number | path | passed sz | | - log string | 0x5 | | sz string | | | | - get key | 0x6 | keycode | | | | | - allocate ram | 0x7 | start pointer | pages | | | | - memory info | 0x8 | see table 2 | see table 2 | | | | - wait for task | 0x9 | | handle | | | | - - + function | eax | eax out | ebx | ecx | edx | esi | edi +---------------|-----|---------------|---------------|-------------|-------------|--------|----- + open file | 0x0 | handle | drive number | path | | | + close file | 0x1 | | handle | | | | + file read | 0x2 | read | handle | file offset | count | buffer | + get file size | 0x3 | size | handle | | | | + start task | 0x4 | handle | drive number | path | passed sz | | + log string | 0x5 | | sz string | | | | + get key | 0x6 | keycode | | | | | + allocate ram | 0x7 | start pointer | pages | | | | + memory info | 0x8 | see table 2 | see table 2 | | | | + wait for task | 0x9 | | handle | | | | + enumerate dir | 0xa | count | drive number | path | see table 3 | max | table 2: @@ -50,4 +49,18 @@ eax -1 indicates unrecognized ebx 0x1 | kernel dynamic area left 0x2 | total userspace size 0x3 | total userspace left - 0x4 | this process memory left \ No newline at end of file + 0x4 | this process memory left + + +table 3: +edx of "enumerate dir" is a pointer to a buffer where an array of "directory info"s can be put. +esi is the maximum number of "directory info"s to be placed in the buffer. +the "directory info" structure is defined as follows: + struct { + bool is_dir; + char name[100]; + uint32_t size; + } +"is_dir" here indicates whether or not the entry is another directory. +"name" is a null-terminated string, up to 99 characters, indicating the name of the entry. +"size" is the size of the file this entry refers to, in bytes. \ No newline at end of file -- cgit v1.2.3