B10.3.2 The RECEIVE CONTROL BLOCKb To receive data, a receive control block must be set up. Its format follows: BBC Microcomputer ATOM and Systems 0 ------------------------- 0 ------------------------- | Receive block number | | Flag | | (initially &00) | | | 1 |-----------------------| 1 |-----------------------| | Flag | | Port number | | | | | 2 |-----------------------| 2 |-----------------------| | Port number | | Station number (lo) | | | | | 3 |-----------------------| 3 |-----------------------| | Station number (lo) | | Station number (hi) | | | | | 4 |-----------------------| 4 |-----------------------| | Station number (hi) | | Pointer to Buffer (lo)| | | | | 5 |-----------------------| 5 | ------- | | Pointer to Buffer (0) | | Pointer to Buffer (hi)| | | | | 6 | ------- | 6 |-----------------------| | Pointer to Buffer (1) | | Pointer | | | | to Buffer end (lo) | 7 | ------- | 7 | ------- | | Pointer to Buffer (2) | | Pointer | | | | to Buffer end (hi) | 8 | ------- | 8 |-----------------------| | Pointer to Buffer (3) | | | 9 |-----------------------| | Pointer | | to Buffer end (0) | 10 | ------- | | Pointer | | to Buffer end (1) | 11 | ------- | | Pointer | | to Buffer end (2) | 12 | ------- | | Pointer | | to Buffer end (3) | 13 |-----------------------| The RECEIVE BLOCK NUMBER should be &00 on entry. On exit, it will be set to the control block number, or &00 if the block was unable to be opened because the space limit was reached. On the ATOM and SYSTEMS the program has to interrogate the network system to see if a reception has happened. The FLAG byte indicates the state of the RXCB. It should initially be set to &7F to indicate readiness to receive, it will be altered on reception (see 10.3.4). The STATION number indicates what station the control block will accept messages from. If this is 0, it will accept messages from any station (but only on the specified port). The PORT number indicates on which port messages will be accepted. A port number of 0 indicates any port. 77 Both the station number and port can be zero, and the station will then accept any message which is addressed to it from any station on any port. B10.3.3 The Receive Control Block After Receptionb After a message is received, the following changes will occur to fields in the control block which accepted the message: 1) The top bit of the flag byte is set. The rest of the byte contains the control code sent from byte 0 of the corresponding transmit control block. 2) The station number, if originally zero, is modified to indicate which station actually sent the received message. 3) The port number, if originally zero, is modified to indicate the port of the received message. 4) The Buffer End pointer is modified to point to the end of the message in the buffer, if the message length is shorter than the bufferlength. Notethat messages longer then the buffer length will not be accepted. The 'end of the message' is the byte after the last byte of the message. B10.4 Broadcastb If a station sets up a suitable control block, as given below, the data within the block can be received by ANY BBC Machine with a suitable receive block set up (the broadcast facility is not available for ATOM and SYSTEM computers). The recive block must be set up to listen to station &FF or station &00 and the correct port (or port 0). The TRANSMIT control block for broadcast is: 0 ----------------------------- | Flag | 1 |---------------------------| | Port number | 2 |---------------------------| | &FF | 3 |---------------------------| | &FF | 4 |---------------------------| | eight bytes of data | | | |---------------------------| 78 B10.5.6 MACHINE TYPEb This primitive is designed to give some indication of the type of another machine on the network. It is effectively a peek of a store area which has been set by the low-level software in the distant machine. In all machines, this is set to be in the ECONET EPROM, and consists of the following: +--------------------------+ | Machine type number (lo) | + -------- + | Machine type number (hi) | +--------------------------| | Software release no. (lo)| + -------- + | Software release no. (hi)| +--------------------------+ The machine type numbers and corresponding strings are: Type number Machine 0 Reserved 1 BBC Microcomputer 2 ATOM 3 System 3 or 4 4 System 5 5 Master 128 6 Electron 7 Archimedes 8 (Reserved) 9 Acorn Communicator 10 Master ET 11 Acorn Filestore 12 Master Compact 13 IBM PC with Acorn EcoLink card 14 RISCiX Workstation 15 16 : : : &FFF8 &FFF9 &FFFA SJ SCSI Interface &FFFB IBM PC with SJ Econet card &FFFC Nascom-2 &FFFD Research Machines 480Z &FFFE SJ Research Fileserver &FFFF Research machines 380Z or CP/M 85 Control block: BBC Microcomputer ATOM and Systems 0 ------------------------- 0 ------------------------- | Flag = &88 | | Flag = &88 | | | | | 1 |-----------------------| 1 |-----------------------| | Zero | | Zero | | | | | 2 |-----------------------| 2 |-----------------------| | Station number (lo) | | Station number (lo) | | | | | 3 |-----------------------| 3 |-----------------------| | Station number (hi) | | Station number (hi) | | | | | 4 |-----------------------| 4 |-----------------------| | Pointer to BUFFER | | Pointer to BUFFER | | in local machine (0) | | in local machine (lo)| 5 | ------- | 5 | ------- | | Pointer to BUFFER | | Pointer to BUFFER | | in local machine (1) | | in local machine (hi)| 6 | ------- | 6 |-----------------------| | Pointer to BUFFER | | Pointer | | in local machine (2) | | to Buffer end (lo) | 7 | ------- | 7 | ------- | | Pointer to BUFFER | | Pointer | | in local machine (3) | | to Buffer end (hi) | 8 |-----------------------| 8 |-----------------------| | Pointer | | to Buffer end (0) | 9 | ------- | | Pointer | | to Buffer end (1) | 10 | ------- | | Pointer | | to Buffer end (2) | 11 | ------- | | Pointer | | to Buffer end (3) | 12 |-----------------------| 86 B10.5.9 Read Registersb This operation reads the ARM registers in an Archimedes to the block of memory in the local machine. The call only works between Archimedes computers. The primitive has a control flag of &89. The data read back is 20 4-byte words, each of which has an ARM register, in the following order: 0 +-------------+ | R0 | 4 +-------------+ | R1 | 8 +-------------+ | R2 | 12 +-------------+ | R3 | 16 +-------------+ | R4 | 20 +-------------+ | R5 | 24 +-------------+ | R6 | 28 +-------------+ | R7 | 32 +-------------+ | R8 | 36 +-------------+ | R9 | 40 +-------------+ | R10 | 44 +-------------+ | R11 | 48 +-------------+ | R12 | 52 +-------------+ | R13 | 56 +-------------+ | R14 | 60 +-------------+ | PC (R15) | 64 +-------------+ | R13_irg | 68 +-------------+ | R14_irg | 72 +-------------+ | R13_svc | 76 +-------------+ | R14_svc | 80 +-------------+ 86a Control block: 0 ------------------------- | Flag=&89 | | | 1 |-----------------------| | Zero | | | 2 |-----------------------| | Station number (lo) | | | 3 |-----------------------| | Station number (hi) | | | 4 |-----------------------| | Pointer to BUFFER | | in local machine (0) | 5 | -------- | | Pointer to BUFFER | | in local machine (1) | 6 | -------- | | Pointer to BUFFER | | in local machine (2) | 7 | -------- | | Pointer to BUFFER | | in local machine (3) | 8 |-----------------------| | Pointer | | to Buffer end (0) | 9 | -------- | | Pointer | | to Buffer end (1) | 10 | -------- | | Pointer | | to Buffer end (2) | 11 | -------- | | Pointer | | to Buffer end (3) | 12 |-----------------------| 86b B13.9.13 Read disk info - code 14b 1/ Client -> File server (command port) Bytes 1-5 = Standard TX header Byte 6 = first drive number to get info on Byte 7 = number of drives to get info on 2/ File server -> Client (reply port) Bytes 1-2 = Standard RX header Byte 3 = number of drives found Byte 4 = Drive number of first drive requested Bytes 5-20= Disk name on drive padded with spaces Byte 21 = Drive dumber of second drive requested Bytes 22-37= Disk name on second drive Bytes 38+ = Info on remaining drives in same format Generally only two drives are present, but the interface will cope with any number. B13.9.14 Read logged on users - code 15b 1/ Client -> File server (command port) Bytes 1-5 = Standard TX header Byte 6 = First user entry to get info on Byte 7 = number of user entries to examine 2/ File server -> Client (reply port) Bytes 1-2 = Standard RX header Byte 3 = number of users found Bytes 4-5 = machine number where user logged on (lo then hi) Bytes 6+xx= User id. terminated by CR Byte yy = privilege of user - 0 unprivileged, non-0 privileged Bytes zz+ = Further entries in same format Note that the number of users found will be zero if the first user entry to be examined is greater than the number of users logged on. Also, some file servers only list unprivileged users if the client is also an unprivileged user. B13.9.15 Read date and time - code 16b 1/ Client -> File server (command port) Bytes 1-5 = Standard TX header 2/ File server -> Client (reply port) Bytes 1-2 = Standard RX header Bytes 3-4 = Date, standard format: byte 3 (lo 5 bits) = day byte 3 (hi 3 bits) = (year since 1982) DIV 16 byte 4 (lo 4 bits) = month byte 4 (hi 4 bits) = year since 1981 Bytes 5-7 = 0 or >59 if no time-board attached to file server byte 5 - hours byte 6 - minutes byte 7 - seconds 110 B13.9.22 Log-off - code 23b 1/ Client -> File server (command port) Bytes 1-5 = Standard TX header 2/ File server -> Client (reply port) Bytes 1-2 = Standard RX header B13.9.23 Read user info - code 24b 1/ Client -> File server (command port) Bytes 1-5 = Standard TX header Bytes 6+ = User name, terminated by CR 2/ Filer server -> Client (reply port) Bytes 1-2 = Standard RX header Byte 3 = User privilege (0 - unprivileged, non-0 - privileged) Bytes 4-5 = Machine number logged on (lo byte first) An error will be returned if the user is not logged on. B13.9.24 Read File Server version number - code 25b 1/ Client -> File server (command port) Bytes 1-5 = Standard TX header 2/ File server -> Client (reply port) Bytes 1-2 = Standard RX header Bytes 3+ = Character string descibing version, terminated by CR. B13.9.25 Read File Server Free Space - code 26b 1/ Client -> File server (command port) Bytes 1-5 = Standard TX header Bytes 6+ = Disk name, terminated by CR 2/ File server -> Client (reply port) Bytes 1-2 = Standard RX header Bytes 3-5 = Number of free blocks on disk An error will be returned if the disk is not present. B13.9.26 Create a directory - code 27b 1/ Client -> File server (command port) Bytes 1-5 = Standard TX header Bytes 6+ = Directory name, terminated by CR 2/ File server -> Client (reply port) Bytes 1-2 = Standard RX header 113 B10.5.5 Remote Procedure Callb This primitive allows remote procedure calls to be made in a remote machine. A procedure is identified by a 16 bit number and is completely independant of the program counter. In the BBC Machine, the mechanism for reading the arguments to the call is the same as for REMOTE JSR. An OPERATING SYSTEM PROCEDURE CALL primitive is provided with an identical control block to the procedure call. This primitive has a control flag of &85. This should not be used by ordinary users, and is called by other routines.