docs - refresh man pages
This commit is contained in:
1 parent
7eda8b1a8d
commit
a463834e0a
21 files changed
+972
-524
No files matched your search
+24
-14
@@ -111,26 +111,30 @@
|
||||
<pre><code><strong>NAME</strong>
|
||||
open, read, getsize, close, readdir - file I/O system calls
|
||||
|
||||
|
||||
<strong>SYNOPSIS</strong>
|
||||
<strong> int montauk::open(const char* path);</strong>
|
||||
<strong> int montauk::read(int handle, uint8_t* buf, uint64_t offset, uint64_t size);</strong>
|
||||
<strong> uint64_t montauk::getsize(int handle);</strong>
|
||||
<strong> void montauk::close(int handle);</strong>
|
||||
<strong> int montauk::readdir(const char* path, const char** names, int max);</strong>
|
||||
<strong>int montauk::open(const char* path);</strong>
|
||||
<strong>int montauk::read(int handle, uint8_t* buf, uint64_t offset, uint64_t size);</strong>
|
||||
<strong>uint64_t montauk::getsize(int handle);</strong>
|
||||
<strong>void montauk::close(int handle);</strong>
|
||||
<strong>int montauk::readdir(const char* path, const char** names, int max);</strong>
|
||||
|
||||
|
||||
<strong>DESCRIPTION</strong>
|
||||
MontaukOS provides a Virtual File System (VFS) with read/write
|
||||
support. Drive 0 is the boot ramdisk; additional drives may be
|
||||
mounted from GPT partitions backed by FAT32 or ext2 (see
|
||||
syscalls(2), STORAGE section). Files are accessed via paths in
|
||||
<a href="syscalls.html">syscalls(2)</a>, STORAGE section). Files are accessed via paths in
|
||||
the format "<drive>:/<path>".
|
||||
|
||||
|
||||
<strong>open</strong>
|
||||
Opens a file and returns a non-negative handle on success, or a
|
||||
negative value on error (file not found, no free handles).
|
||||
|
||||
int h = montauk::open("0:/os/hello.elf");
|
||||
|
||||
|
||||
<strong>read</strong>
|
||||
Reads up to 'size' bytes starting at 'offset' into 'buf'.
|
||||
Returns the number of bytes actually read, or negative on error.
|
||||
@@ -140,16 +144,19 @@
|
||||
uint8_t buf[512];
|
||||
int n = montauk::read(h, buf, 0, 512);
|
||||
|
||||
|
||||
<strong>getsize</strong>
|
||||
Returns the total size in bytes of the file.
|
||||
|
||||
uint64_t sz = montauk::getsize(h);
|
||||
|
||||
|
||||
<strong>close</strong>
|
||||
Closes the file handle and frees kernel resources.
|
||||
|
||||
montauk::close(h);
|
||||
|
||||
|
||||
<strong>readdir</strong>
|
||||
Lists entries in a directory. Up to 'max' entry names (VFS cap
|
||||
256, driver-backed listings such as 0:/os/ cap 128) are written
|
||||
@@ -165,6 +172,7 @@
|
||||
call, use montauk::readdir_at(path, names, max, startIndex) and
|
||||
advance startIndex by the returned count until it returns 0.
|
||||
|
||||
|
||||
<strong>READING PATTERN</strong>
|
||||
The standard pattern for reading a file:
|
||||
|
||||
@@ -183,12 +191,13 @@
|
||||
}
|
||||
montauk::close(h);
|
||||
|
||||
|
||||
<strong>WRITING, DELETING, RENAMING</strong>
|
||||
<strong> int montauk::fcreate(const char* path);</strong>
|
||||
<strong> int montauk::fwrite(int handle, const uint8_t* buf, uint64_t offset, uint64_t size);</strong>
|
||||
<strong> int montauk::fdelete(const char* path);</strong>
|
||||
<strong> int montauk::fmkdir(const char* path);</strong>
|
||||
<strong> int montauk::frename(const char* oldPath, const char* newPath);</strong>
|
||||
<strong>int montauk::fcreate(const char* path);</strong>
|
||||
<strong>int montauk::fwrite(int handle, const uint8_t* buf, uint64_t offset, uint64_t size);</strong>
|
||||
<strong>int montauk::fdelete(const char* path);</strong>
|
||||
<strong>int montauk::fmkdir(const char* path);</strong>
|
||||
<strong>int montauk::frename(const char* oldPath, const char* newPath);</strong>
|
||||
|
||||
fcreate creates a new file and returns a handle. fwrite writes
|
||||
bytes at the given offset. fdelete removes a file, fmkdir
|
||||
@@ -201,15 +210,16 @@
|
||||
montauk::fs_mount), changes are written through to storage; use
|
||||
montauk::fs_sync() to flush caches before power-off.
|
||||
|
||||
|
||||
<strong>NOTES</strong>
|
||||
Drive 0 is loaded at boot from a USTAR tar archive into RAM.
|
||||
Other drives are mounted on demand from GPT partitions on
|
||||
SATA/NVMe/USB block devices; see syscalls(2), STORAGE and
|
||||
SATA/NVMe/USB block devices; see <a href="syscalls.html">syscalls(2)</a>, STORAGE and
|
||||
DEVICES sections.
|
||||
|
||||
<strong>SEE ALSO</strong>
|
||||
syscalls(2), spawn(2), malloc(3)</code></pre>
|
||||
|
||||
<strong>SEE ALSO</strong>
|
||||
<a href="syscalls.html">syscalls(2)</a>, <a href="spawn.html">spawn(2)</a>, <a href="malloc.html">malloc(3)</a></code></pre>
|
||||
<hr>
|
||||
|
||||
<div class="center">
|
||||
|
||||
Reference in new issue
Block a user