Difference between revisions of "/dev/fs"

From WiiBrew
Jump to navigation Jump to search
(Undo revision 100489 by BrianJones (talk))
 
(19 intermediate revisions by 13 users not shown)
Line 1: Line 1:
 +
{{stub}}
 
The filesystem can be directly accessed through "/dev/fs".
 
The filesystem can be directly accessed through "/dev/fs".
 
   
 
   
Line 16: Line 17:
 
/import
 
/import
 
   
 
   
/shared2
+
[[:/shared2]]
 
   
 
   
 
/shared1
 
/shared1
 
   
 
   
[[/title]]
+
[[:/title]]
 
   
 
   
 
/ticket
 
/ticket
Line 26: Line 27:
 
/sys
 
/sys
  
For a more detailed example of how the file system structure can look, see http://www.openwii.org/forums/viewtopic.php?t=203&postdays=0&postorder=asc&start=30&sid=e60d31c04715f92a1d3414a71e3858b4.
+
== Ioctl listing ==
 +
 
 +
{| style="border-collapse: collapse; padding: 0.2em 0.2em 0.2em 0.2em;"
 +
|- style="background-color: #ddd;"
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #cdc;" | '''Request number'''
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ccd;" | '''Name'''
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ccc;" | '''input'''
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #fe9;" | '''output'''
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #dcc;" | '''notes'''
 +
|- style="background-color: #ddd;"
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ded;" | 0x1
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #dde;" | Format
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ddd;" | 0
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #fe9;" | 0
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #edd;" | Don't try this!!!
 +
|- style="background-color: #ddd;"
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ded;" | 0x2
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #dde;" | GetStats
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ddd;" | ?
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #fe9;" | ?
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #edd;" |
 +
|- style="background-color: #ddd;"
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ded;" | 0x3
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #dde;" | CreateDir
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ddd;" | ?
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #fe9;" | ?
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #edd;" |
 +
|- style="background-color: #ddd;"
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ded;" | 0x4
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #dde;" | ReadDir
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ddd;" |
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #fe9;" |
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #edd;" |
 +
 
 +
|- style="background-color: #ddd;"
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ded;" | 0x5
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #dde;" | SetAttr
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ddd;" | ?
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #fe9;" | ?
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #edd;" |
 +
|- style="background-color: #ddd;"
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ded;" | 0x6
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #dde;" | GetAttr
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ddd;" | 64 bytes for filename
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #fe9;" | 78 bytes for file attributes
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #edd;" |
 +
|- style="background-color: #ddd;"
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ded;" | 0x7
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #dde;" | Delete
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ddd;" | ?
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #fe9;" | ?
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #edd;" |
 +
|- style="background-color: #ddd;"
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ded;" | 0x8
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #dde;" | Rename
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ddd;" | ?
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #fe9;" | 0
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #edd;" |
 +
 
 +
|- style="background-color: #ddd;"
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ded;" | 0x9
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #dde;" | CreateFile
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ddd;" | 0x4C bytes: 4 for owner ID, 2 for group ID, 0x40 filename, 1 for each owner/group/other permissions, 1 for attributes, 2 unused (?)
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #fe9;" | 0
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #edd;" |
 +
|- style="background-color: #ddd;"
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ded;" | 0xb
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #dde;" | GetFileStats
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ddd;" | ?
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #fe9;" | ?
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #edd;" |
 +
|- style="background-color: #ddd;"
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ded;" | 0xd
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #dde;" | Shutdown
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ddd;" |
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #fe9;" |
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #edd;" |
 +
 
 +
|- style="background-color: #ddd;"
 +
|}
 +
 
 +
== /dev/fs error codes ==
 +
 
 +
{| style="border-collapse: collapse; padding: 0.2em 0.2em 0.2em 0.2em;"
 +
|- style="background-color: #ddd;"
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #cdc;" | '''Error code'''
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ccd;" | '''POSIX equivalent'''
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #dcc;" | '''notes'''
 +
|- style="background-color: #ddd;"
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ded;" | -1
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #dde;" | EACCES
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #edd;" | Permission denied
 +
|- style="background-color: #ddd;"
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ded;" | -2
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #dde;" | EEXIST
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #edd;" | File exists
 +
|- style="background-color: #ddd;"
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ded;" | -4
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #dde;" | EINVAL
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #edd;" | Invalid argument
 +
|- style="background-color: #ddd;"
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ded;" | -6
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #dde;" | ENOENT
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #edd;" | File not found
 +
|- style="background-color: #ddd;"
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ded;" | -8
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #dde;" | EBUSY
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #edd;" | Resource busy
 +
|- style="background-color: #ddd;"
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ded;" | -12
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #dde;" | EIO ?
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #edd;" | returned on ECC error
 +
|- style="background-color: #ddd;"
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ded;" | -22
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #dde;" | ENOMEM
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #edd;" | Alloc failed during request
 +
|- style="background-color: #ddd;"
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ded;" | -101
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #dde;" | EINVAL
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #edd;" | Invalid argument (again? Returned e.g. by /dev/fs IOCtls)
 +
|- style="background-color: #ddd;"
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ded;" | -102
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #dde;" | EACCESS
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #edd;" | Permission denied
 +
|- style="background-color: #ddd;"
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ded;" | -103
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #dde;" | EIO?
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #edd;" | returned for "corrupted" NAND
 +
|- style="background-color: #ddd;"
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ded;" | -105
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #dde;" | EEXIST
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #edd;" | File exists
 +
|- style="background-color: #ddd;"
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ded;" | -106
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #dde;" | ENOENT
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #edd;" | File not found
 +
|- style="background-color: #ddd;"
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ded;" | -107
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #dde;" | ENFILE
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #edd;" | Too many fds open
 +
|- style="background-color: #ddd;"
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ded;" | -108
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #dde;" | ?
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #edd;" | Memory is full
 +
|- style="background-color: #ddd;"
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ded;" | -109
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #dde;" | ENFILE
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #edd;" | Too many fds open
 +
|- style="background-color: #ddd;"
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ded;" | -110
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #dde;" | ENAMETOOLONG
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #edd;" | pathname is too long
 +
|- style="background-color: #ddd;"
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ded;" | -111
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #dde;" | ?
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #edd;" | FD is already open
 +
|- style="background-color: #ddd;"
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ded;" | -114
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #dde;" | EIO?
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #edd;" | returned on ECC error
 +
|- style="background-color: #ddd;"
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ded;" | -115
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #dde;" | ENOTEMPTY
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #edd;" | Directory not empty
 +
|- style="background-color: #ddd;"
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ded;" | -116
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #dde;" | ENAMETOOLONG?
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #edd;" | max directory depth exceeded
 +
|- style="background-color: #ddd;"
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ded;" | -118
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #dde;" | EBUSY
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #edd;" | Resource busy
 +
|- style="background-color: #ddd;"
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ded;" | -119
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #dde;" | ?
 +
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #edd;" | fatal error
 +
|- style="background-color: #ddd;"
 +
|}
 +
 
 +
[[Category:IOS API documentation]]

Latest revision as of 07:00, 5 August 2012

The filesystem can be directly accessed through "/dev/fs".

There are several IOS functions for FS like Delete/Create/List/Rename/.. .

Files can be directly opened with IOS_Open("/tmp/data.bin",1);



The root folder looks like that:

/tmp

/meta

/import

/shared2

/shared1

/title

/ticket

/sys

Ioctl listing

Request number Name input output notes
0x1 Format 0 0 Don't try this!!!
0x2 GetStats ? ?
0x3 CreateDir ? ?
0x4 ReadDir
0x5 SetAttr ? ?
0x6 GetAttr 64 bytes for filename 78 bytes for file attributes
0x7 Delete ? ?
0x8 Rename ? 0
0x9 CreateFile 0x4C bytes: 4 for owner ID, 2 for group ID, 0x40 filename, 1 for each owner/group/other permissions, 1 for attributes, 2 unused (?) 0
0xb GetFileStats ? ?
0xd Shutdown

/dev/fs error codes

Error code POSIX equivalent notes
-1 EACCES Permission denied
-2 EEXIST File exists
-4 EINVAL Invalid argument
-6 ENOENT File not found
-8 EBUSY Resource busy
-12 EIO ? returned on ECC error
-22 ENOMEM Alloc failed during request
-101 EINVAL Invalid argument (again? Returned e.g. by /dev/fs IOCtls)
-102 EACCESS Permission denied
-103 EIO? returned for "corrupted" NAND
-105 EEXIST File exists
-106 ENOENT File not found
-107 ENFILE Too many fds open
-108 ? Memory is full
-109 ENFILE Too many fds open
-110 ENAMETOOLONG pathname is too long
-111 ? FD is already open
-114 EIO? returned on ECC error
-115 ENOTEMPTY Directory not empty
-116 ENAMETOOLONG? max directory depth exceeded
-118 EBUSY Resource busy
-119 ? fatal error