diff options
author | Alex AUVOLAT <alexis211@gmail.com> | 2012-05-17 13:30:09 +0200 |
---|---|---|
committer | Alex AUVOLAT <alexis211@gmail.com> | 2012-05-17 13:30:09 +0200 |
commit | 7c9a48b4e6d66cf4f62e7bad9e22ab06923e47ef (patch) | |
tree | df44a926f105c913c77525d35441d20a632f1440 /doc | |
parent | c6d35a5f4fdda6ae2e98498f19a4adaee6d95692 (diff) | |
download | TCE-7c9a48b4e6d66cf4f62e7bad9e22ab06923e47ef.tar.gz TCE-7c9a48b4e6d66cf4f62e7bad9e22ab06923e47ef.zip |
Beginning of a VFS implemented. C++ is great.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/syscalls.txt | 33 | ||||
-rw-r--r-- | doc/vfs.txt | 3 |
2 files changed, 32 insertions, 4 deletions
diff --git a/doc/syscalls.txt b/doc/syscalls.txt index 952b95e..39982c0 100644 --- a/doc/syscalls.txt +++ b/doc/syscalls.txt @@ -15,11 +15,36 @@ id=eax Name Parameters Description 7 irq_wait ebx: irq number Waits for an IRQ (requires privilege PL_DRIVER) 8 proc_priv none Returns current process privilege level - 9 sbrk ebx: size Allocates some memory - 10 brk ebx: new_end Allocates/frees some memory + 10 sbrk ebx: size Allocates some memory + 11 brk ebx: new_end Allocates/frees some memory - 11 mmap (see linux specs) not implemented - 12 munmap (see linux specs) not implemented + 12 mmap (see linux specs) not implemented + 13 munmap (see linux specs) not implemented + + 20 open ebx: char* filename open a file, returns a descriptor + ecx: mode + 21 open_relative ebx: root open a file, returns a descriptor + ecx: char* filename + edx: mode + 22 stat ebx: char* filename get file info + ecx: struct* info + 23 stat_relative ebx: root get file info + ecx: char* filename + edx: struct* info + 24 statf ebx: file descriptor get file info + ecx: struct* info + 25 close ebx: file descriptor close file + 26 read ebx: file descriptor read from file + ecx: offset + edx: length + esi: pointer to data + 27 write ebx: file descriptor write to file + ecx: offset + edx: length + esi: pointer to data + 28 link ebx: char* from symlink/hardlink/mount/... + ecx: char* to + edx: mode If a processes wishes to exit with an error code, it HAS to use process_exit. thread_exit will do nothing. diff --git a/doc/vfs.txt b/doc/vfs.txt index 255ddb0..5a6a0b2 100644 --- a/doc/vfs.txt +++ b/doc/vfs.txt @@ -8,11 +8,13 @@ File are objects that implement an abstract file class in the kernel. Its method - int stat(struct file_info *info) - file* get_child(char* name) - int add_child(char* name, file *child) +- int get_size() The following syscall interface is given to the process (fd_t is a file descriptor, an int) : - fd_t open(char* filename, int mode) - fd_t open_relative(fd_t root, char* filename, int mode) - int stat(char* filename, struct file_info *info) +- int stat_relative(fd_t root, char* filename, struct file_info *info) - int statf(fd_t file, struct file_info *info) - void close(fd_t file) - int read(fd_t file, size_t offset, size_t len, char *buffer) @@ -33,6 +35,7 @@ File open modes flags : - FM_APPEND append data - FM_TRUNC truncate existing file - FM_CREATE create file if it doesn't exist +- FM_DELETE delete the file - incompatible with everything else note : if mode contains neither FM_READ nor FM_WRITE, then the file will be created/truncated according to the flags given, but will not be actually oppenned, so the return value of open will be 0. |