Subversion Repositories Spectranet

[/] [trunk/] [rom/] [vfsinterface.txt] - Rev 570

Go to most recent revision | Compare with Previous | Blame | View Log

Standard parameters for all VFS calls. All strings are null terminated C
strings. This is the public interface:

mount                   IX - pointer to an 10 byte structure that contains:
                        byte 0,1 - pointer to null terminated protocol
                        byte 2,3 - pointer to null terminated hostname
                        byte 4,5 - pointer to null terminated mount source
                        byte 6,7 - pointer to null terminated user id
                        byte 8,9 - pointer to null terminated passwd
                        A - Mount point ("mount handle") - 0 to 3
umount                  A - Mount point (0 to 3)
opendir                 HL - pointer to directory name
open                    HL - pointer to filename
                        D  - Flags (POSIX style)
                        E  - Mode (POSIX style)
unlink                  HL - pointer to filename
mkdir                   HL - pointer to directory name
rmdir                   HL - pointer to directory name
size                    A  - mount point
free                    A  - mount point
stat                    HL - pointer to filename or directory name
                        DE - where to return the result
chmod                   HL - pointer to filename, DE - filemode
read                    A - file descriptor
                        DE - buffer to return data into
                        BC - maximum bytes ot read
                        (on return BC = bytes read)
write                   A - file descriptor
                        HL - buffer to write
                        BC - size of the buffer
                        (on return BC = bytes written)
lseek                   A - file descriptor
close                   A - file descriptor
poll                    A - file descriptor
readdir                 A - directory handle
                        DE - Buffer to fill with the directory entry
closedir                A - directory handle
chdir                   HL - directory name
getcwd                  DE - pointer to buffer where result should go
rename                  HL - pointer to source path
                        DE - pointer to destination path

On success, functions return something meaningful in A (such as a file
handle or directory handle, where required) and carry reset. On error,
carry is set and A set to the error number. The mount function is different -
a successful mount should return with Z and C flags reset. If the protocol
is not recognised, it should return with Z set and C reset. If the protocol
was recognised but mounting failed, it should return with C set and A
as the error number.

Filesystem module interface:
As above, but most functions will receive the mount point handle in A
where applicable (all filesystem level functions - rename, getcwd, chdir,
opendir, open, chmod, stat, free, size, mkdir, rmdir, unlink). The FS
module must determine what it needs to do for handle based functions
(read, write, lseek, readdir, poll, close, closedir) since the file/dir handle
should be associated with some sort of internal data that allows the
operation to take place.

Go to most recent revision | Compare with Previous | Blame | View Log