Showing changes from revision #1 to #2:
Added | Removed | Changed
Entry | |
---|---|
R1 | File handle used by your filing system/image filing system |
R2 | Pointer to buffer |
R3 | Number of bytes to read into buffer |
R4 | File offset from which to get data |
Exit | |
---|---|
- |
This entry point is used by FileSwitch to request that you read a number of bytes from an open file, and place them in memory.
The file handle is guaranteed by FileSwitch not to be a directory, but not necessarily to have had read access granted at the time of the open – see the last case given below.
The memory address is not guaranteed to be of any particular alignment. You should if possible optimise your filing system’s transfers to word-aligned locations in particular, as FileSwitch’s and most clients do tend to be word-aligned. The speed of your transfer routine is vital to filing system performance.
The number of bytes to read, and the file offset from which to read data are guaranteed to be a multiple of the buffer size for this file. The file offset will be within the file’s extent.
This call is made by FileSwitch for several purposes:
Note that FileSwitch holds no buffered data immediately after a file has been opened.
Entry | |
---|---|
R1 | File handle used by your filing system/image filing system |
Exit | |
---|---|
R0 | byte read, C clear |
or undefined, C set if attempting to read at end of file |
This entry point is called by FileSwitch to get a single byte from an unbuffered file from the position given by the file’s sequential pointer. The sequential pointer must be incremented by one, unless the end of the file has been reached.
The file handle is guaranteed by FileSwitch not to be a directory and to have had read access granted at the time of the open.
Your filing system must not try to keep its own EOF-error-on-next-read flag – instead it must return with C set whenever the file’s sequential pointer is equal to its extent before a byte is read. It is FileSwitch’s responsibility to keep the EOF-error-on-next-read flag.
If your filing system does not support unbuffered GBPB directly, then FileSwitch will call this entry the necessary number of times to complete its client’s request, stopping if you return with the C flag set (EOF).