Low Level File Entry Points =========================== BOSFILEb File and directory information Entry address: &FFDD On entry: A function code On exit: A object type XY pointer to control block XY preserved control block updated If function not supported, A is returned preserved. Control block: &00 Address of filename &02 Load address &06 Execution address &0A Length, or start address for SAVE &0E Attributes, or end address for SAVE &12 Functions: &FD Read file system information (System Internal Name). The attribute field is returned holding the sector start address. &FE Verifies file. Control block is as for A=&FF, Load. If the verification is successful, A is returned holding &01 and the control block holds the file information. If the verification fails, A is returned holding &00 and the load address is returned holding the address where the verification failed. If the file does not exist or is a directory or does not have read access, then an error is generated. &FF Loads a file into memory. If the low byte of the execution address is zero, the file's own load address is used, else the supplied address is used to load to. If the filename does not exist, or is a directory, or an execute-only file, or does not have read access, then an error is generated. &00 Save a file. If a file already exists with the same name, it is overwritten, with the file access staying the same, but the case of the name being the new name. If the file is locked, or a directory exists with the same name, then an error is generated. &01 Writes a file's reload address, execution address and attributes. &02 Writes a file's reload address. &03 Writes a file's execution address. &04 Writes a file's attributes. &05 Read object's catalogue information into the control block. &06 Delete object. If the object does not exist, A returned as &00. If the object is locked, or is not owned, then an error is generated. &07 Create an empty file of defined length. Block as for SAVE. &08 Create a directory. If a directory already exists, there is no error. The created directory is locked. If a file already exists, an error is generated. &09 Object types returned in the A register are: &FF Execute-only file &00 Object not found &01 File found &02 Directory found File attributes: These are held in four bytes as follows: Byte &0E bit 7 Privatised 6 Execute only by others 5 Writable by others 4 Readable by others 3 Locked 2 Execute only for owner 1 Writable by owner 0 Readable by owner Byte &0F bits 0-4 Date: day of month 5-7 Date: year since 1981, bits 4-6 Byte &10 bits 0-3 Date: month of year 4-7 Date: year since 1981, bits 0-3 Byte &11 bits 0-7 Undefined (zero) BOSFINDb Open or close a file Entry address: &FFCE On entry: A function code On exit: A channel number, or Y channel number for A=0 or 0 if no file opened XY pointer to filename XY preseved If function not supported, A is returned as zero. Functions: &00 Close the file on channel in Y. If Y=0 then close all files. &4X Open file for input. &8X Open file for output. If file already exists, tries to delete it first. If no file exists, a file is created with load and execution addresses set to &FFFFFFFF. &CX Open file for update. If no file exists, A is returned with 0. The bottom four bits of A control how the file is opened: If b3 is set, returns an error if file not found, instead of zero handle. If b2 is set, error is generated if attempt to open a directory. BOSBGETb Read (get) a byte Entry address: &FFD7 On entry: Y channel number On exit: A byte read Y preserved Cy EOF status. If the byte read is after the end of file, the carry flag is set on exit and the EOF-error-flag is set. After the EOF byte has been read, the next read produces an error. An error is generated if the object is a directory or doesn't have read access. BOSBPUTb Write (put) a byte Entry address: &FFD4 On entry: A byte to be written On exit: All preserved Y channel number An error is generated is the object is a directory or doesn't have write access. The EOF-error-flag is cleared. BOSARGSb Attribute of open object Entry address: &FFDA On entry: A function code On exit: A see below X points to zero page location X preserved Y file handle or 0 Y preserved If function not supported, A is returned preserved. Functions: Y=0 &FD HADFS: Return version number and capabilities to zero page. &FE Return last drive used. &FF Update all files to media. &00 Return filing system number in A: 0 No current filing system 20 RawKbd: 1 1200 baud cassette filing system 21 DeskFS: 2 300 baud cassette filing system 22 Computer Concepts RomFS: 3 ROM filing system 23 RamFS: 4 Disk filing system 24 RISCiXFS: 5 Econet network filing system 25 Streamer: 6 Teletext/Prestel telesoftware 26 SCSIFS: 7 IEEE filing system 27 Digitiser: 8 Acorn ADFS 28 Scanner: 9 Host filing system 29 MultiFS: 10 Videodisk filing system 11 33 NFS: 12 Ram filing system NetPrint: 37 CDFS: 13 Null: 43 DOSFS: 14 Printer: 46 ResourceFS: 15 Serial: 47 PipeFS: 16 Harston ADFS 17 Vdu: 53 DeviceFS: 18 RawVdu: 54 Parallel: 19 Kbd: Extra Archimedes filing systems are suffixed with B:b. &01 Return address of any parameters after a filename to zero page. &02 Return version number in A. &03 Return libfs number in A. &04 Return disk space used to zero page. &05 Return disk free space to zero page. Y<>0 &FD HADFS: Read or set context. &FE Arch: Read info on file handle. &FF Update file on channel Y to media. &00 Read PTR for channel Y to zero page. &01 Write PTR for channel Y from zero page. If PTR is moved past the end of an output file, the file is extended with zeroes and zero returned in A. If PTR is moved past the end of an input file, an error is generated. The EOF-error-flag is cleared. &02 Read EXT for channel Y to zero page. &03 Write EXT for channel Y. If the length of the file is reduced, the end disappears. If the length is increased, the file is extended as with &01 and zero is returned in A. The EOF-error-flag is cleared. &04 Read size allocated to file on channel Y to zero page. &05 Read EOF status for channel Y. If PTR=EXT then zero page is set to -1, else zero page is set to 0. &06 Ensure file size of at least the value in zero page. Actual size allocated is returned in zero page. &07 Arch: convert file handle to filename. Zero page points to buffer. &08 Arch: informs of change in image stamp. If zero page is not used, then it is ignored and so X may be left set to anything on entry. BOSGBPBb Read or write multiple bytes Entry address: &FFD1 On entry: A function code On exit: A see below XY pointer to control block XY preserved control block updated If function not supported, A is returned preserved. Control block: &00 Channel number/cycle number or zero &01 Data address &05 Number of bytes/filenames to transfer &09 PTR for transfer/directory pointer &0D Functions: &01 Write bytes to media using new PTR. If XY+0 is 0, undefined. &02 Write bytes to media ignoring new PTR. If XY+0 is 0, undefined. &03 Read bytes from media using new PTR. If XY+0 is 0, undefined. &04 Read bytes from media ignoring new PTR. If XY+0 is 0, undefined. On exit from calls &01 to &04 the 'number of bytes' field holds the number of bytes not transfered. The 'data address' field is updated to point to the next location for data transfer. The PTR for the file is updated by the number of bytes transfered and placed in the 'PTR' field. In functions &01 and &03 the PTR is first set to the supplied value before transfering data. The carry flag is returned set if EOF was met. The EOF-error-flag is reset. An error occurs if the object is a directory or does not have the correct access. &05 Get media title of CSD disk and boot option into data block: &00 length of title (n) &01 title in ASCII characters &01+n startup option &02+n drive number &03+n &06 Get currently selected directory name into data block: &00 length of drive identity (n) &01 ASCII drive identity (drive number) &01+n length of directory name (m) &02+n directory name in ASCII characters &02+n+m ownership: &00 - owner, &FF - public &03+n+m &07 Get current library name into data block: &00 length of drive identity (n) &01 ASCII drive identity (drive number) &01+n length of library name (m) &02+n library name in ASCII characters &02+n+m ownership: &00 - owner, &FF - public &03+n+m &08 Read filenames from current directory into data block: &00 length of filename 1 (n) &01 filename 1 in ASCII characters &01+n length of filename 2 (m) &02+n filename 2 in ASCII characters &02+n+m etc... The first call to function &08 should be made with the directory pointer set to zero. This will read the first filename, and the pointer will be updated so that the next call will read the next filename. When no filenames are left, the call returns with the 'number of filenames' left unchanged and the carry flag set. &09 Reads work/login filename, command line tail or entries from specified directory. If XY+0 is zero, reads work/login filename or command tail: &00 length of drive identity or command line tail (n) &01 ASCII drive identity (drive number) or comand line tail &01+n length of work/login filename (m) &02+n work/login filename &02+n+m If XY+0 is a channel number of an open directory, reads a null- terminated list of directory entries. The function is called as for OSGBPB 8, but XY+5 returns the number of filenames read. &0A Read entries and information from the opened directory whose channel number is in XY+0. This function is called as for OSGBPB 9. Each record is a whole multiple of four bytes long: &00 Load address &04 Execution address &08 Length &0C Attributes &10 Object type (1=file, 2=directory) &14 Object name, null terminated xxx next record &0B Read entries and information from the opened directory whose channel number is in XY+0. This function is called as for OSGBPB 9. Each record is a whole multiple of four bytes long: &00 Load address &04 Execution address &08 Length &0C Attributes &10 Object type (1=file, 2=directory) &14 Sector start address &18 Five zeros (reserved for centisecond time since 1900) &1D Object name, null terminated xxx next record BFSCVb Filing system control This vector is only called by the operating system, and should not be called directly. This list just shows the full list of calls. Functions: &00 *OPT command. X and Y hold parameters &01 EOF being checked with Osbyte &7F. On exit, X=&FF if EOF, X=&00 otherwise. &02 */ command. XY points to the command text. HADFS tries to run the command from the CSD or the LIB. &03 Unrecognised Oscli. XY points to the command text. HADFS checks the command against its own commands, then tries to run it from disk as with function &02. &04 *RUN command. XY points to filename. HADFS tries to run this from the CSD only. &05 *CAT command. XY points to any pathname. &06 A new filing system is about to take over. This call is generated by filing systems themselves before they start their initialisation. &07 File handle range request. Lowest returned in X, highest in Y. &08 Oscli command being processed. This is used to facilitate the *ENABLE command. &09 *EX command. XY points to any pathname. &0A *INFO command. XY points to the filename. &0B *RUN from library. XY points to the filename. &0C *RENAME command. XY points to the filenames after the command.