OSWORD &13

From BeebWiki
Jump to: navigation, search
OSWORD &13 (19): Local station information

Summary

These calls allow general local station information to be read and written.

  • 0 - Read File Server number
  • 1 - Write File Server number
  • 2 - Read Printer Server number
  • 3 - Write Printer Server number
  • 4 - Read Protection mask
  • 5 - Write Protection mask
  • 6 - Read context handles
  • 7 - Write context handles
  • 8 - Read local station number
  • 9 - Read number, and size, of arguments
  • 10 - Read error number
  • 11 - Read channel error occured on
  • 12 - Read Printer Server name
  • 13 - Write Printer Server name
  • 14 - Read space in NetPrint buffer
  • 15 - Read File Server retry delay
  • 16 - Write File Server retry delay
  • 17 - Translate net number

Read/Write File Server station - control byte=0/1

These calls allow the File Server number to be read and written. This value is used for all File Server commands including *I AM <user identifier> and OSWORD &14. To change onto a different File Server, context handles need to be written otherwise it is likely that any further operations will return the error 'Channel'. The ANFS utility '*FS' does both of these operations.

The BBC NFS ROM defaults to the value 0.254 (i.e. station 254 on the local network). On the Master, Compact and Econet Terminal the default File Server number is held in CMOS RAM and is configured by the command '*CONFIGURE FS <new number>'.

These calls should only be attempted with Econet selected as the current filing system.

On entry:

    XY+ 0 +-----------------------------+
          |         Control byte        |
          |     0 = Read FS number      |
          |     1 = Write FS number     |
        1 +-----------------------------+
          |     File Server station     |
        3 +-----------------------------+

On exit: For read operation the control block is modified as shown above. For write operation the control block is undefined.

Using the Net programming library, the file server station can be read and written with the following calls:

   station%=FNNet_Info(0,0)   :REM Read file server station number
   A%=FNNet_Info(1,station%)  :REM Write file server station number

Read/Write Printer Server station - control byte=2/3

These calls allow the network Printer Server station number to be read and written.

The BBC NFS ROM defaults to the value 0.235 (i.e. station 235 on the local network). On the Master, Compact and Econet Terminal the default File Server number is held in CMOS RAM and is configured be the command 'CONFIGURE PS <new number>'.

To send data to the network printer it is also necessary to set the printer type to the network, by issuing the command '*FX5,4'.

        On entry:
    XY+ 0 +-----------------------------+
          |         Control byte        |
          |     2 = Read FS number      |
          |     3 = Write FS number     |
        1 +-----------------------------+
          |   Printer Server station    |
        3 +-----------------------------+

On exit: For read operation the control block is modified as shown above. For write operation the control block is undefined.

Using the Net programming library, the network printer server station can be read and written with the following calls:

   station%=FNNet_Info(2,0)   :REM Read printer server station number
   A%=FNNet_Info(3,station%)  :REM Write printer server station number

Protection mask - control byte=4/5

These calls allow the user to read and write the protection mask of the local machine. Note that if a remote machine attempts to do an operation requiring parameters returned then various protection bits will be set until the parameters have been read (using OSWORD &12).

On entry:

    XY+ 0 +-----------------------------+
          |         Control byte        |
          |  4 = Read protection mask   |
          |  5 = Write protection mask  |
        1 +-----------------------------+
          |  Value of protection mask   |
        2 +-----------------------------+

If a bit of the protection mask is clear then the remote operation is allowed. The possible values of the protection mask are shown below:

  • bit Operation
  • 0 - Peek
  • 1 - Poke
  • 2 - JSR
  • 3 - User procedure call
  • 4 - Operation system procedure call
  • 5 - Halt

On exit: For read operation the control block is modified as shown above. For write operation the control block is undefined.

Using the Net programming library, the protection mask can be read and written with the following calls:

   prot%=FNNet_Info(4,0)   :REM Read protection mask
   A%=FNNet_Info(5,mask%)  :REM Write protection mask

Context handles - control byte=6/7

Three directory handles describing the current environment are required for most File Server operations. These are returned by the File Server by the command '*I AM <user identifier>. The three handles are:

User root directory (URD) - starting directory for that user. If the command '*DIR' is issued then the user will be returned to this directory.

Currently selected directory (CSD) - the directory that the user is currently in.

Library directory (LIB) - the directory that is searched if a filename is not found in the CSD.

These calls should only be attempted with NFS selected as the current filing system.

On entry:

    XY+ 0 +-----------------------------+
          |         Control byte        |
          |  6 = Read context handles   |
          |  7 = Write context handles  |
        1 +-----------------------------+
          |             URD             |
        2 +-----------------------------+
          |             CSD             |
        3 +-----------------------------+
          |             LIB             |
        4 +-----------------------------+

On exit: For read operation the control block is modified as shown above. For write operation the control block is undefined.

Using the Net programming library, the context can be read and written with the following calls:

   context%=FNNet_Info(6,0)   :REM Read user context
   A%=FNNet_Info(7,context%)  :REM Write user context

Read station - control byte=8

This call returns the local station number.

On entry:

    XY+ 0 +-----------------------------+
          |  8 = Read location station  |
          |            number           |
        1 +-----------------------------+
          |   Returned station number   |
        2 +-----------------------------+

On exit: Control block is modified to hold local station number.

Using the Net programming library, the station number can be read with the following call:

   station%=FNNet_Info(8,0)   :REM Read local station number

Read argument information - control byte=9

This call is used to find the size of the argument block used by remote JSR and remote procedure call, currently held by the NFS, and the maximum size of argument block possible.

On entry:

    XY+ 0 +-----------------------------+
          |     9 = Read arguments      |
        1 +-----------------------------+
          |          Undefined          |
        3 +-----------------------------+

On exit:

    XY+ 0 +-----------------------------+
          |          Undefined          |
        1 +-----------------------------+
          |     Number of arguments     |
        2 +-----------------------------+
          | Maximum number of arguments |
        3 +-----------------------------+

Using the Net programming library, the argument information can be read with the following call:

   args%=FNNet_Info(9,0)   :REM Read argument information

Read error - control byte=10

This call is used to find the actual error number after a 'catch-all' error (error number &A8) has happened, or the screen MODE after a 'Mode x' error from '*VIEW'.

On entry:

    XY+ 0 +-----------------------------+
          |       10 = Read error       |
        1 +-----------------------------+
          |          Undefined          |
        2 +-----------------------------+

On exit:

    XY+ 0 +-----------------------------+
          |          Undefined          |
        1 +-----------------------------+
          |        Error number         |
        2 +-----------------------------+

Using the Net programming library, the error information can be read with the following call:

   error%=FNNet_Info(10,0)   :REM Read extended error

Channel error occured on - control byte=11

This call reads the channel number the last error occured on if it occured on an open file as the result of a random access operation, or zero if it was not the result of a random access operation. This is the channel number given in the 'error on channel xx' message.

On entry:

    XY+ 0 +-----------------------------+
          |    10 = Read error number   |
        1 +-----------------------------+
          |           Channel           |
        2 +-----------------------------+

On exit: The control block is modified to hold the channel number.

Using the Net programming library, the channel number can be read with the following call:

   channel%=FNNet_Info(10,0)   :REM Read channel error occured on

Read/Write Printer Server name - control byte=12/13

These calls allow the printer server to be selected by name.

On entry:

    XY+ 0 +-----------------------------+
          |         Control byte        |
          |   12 = Read printer name    |
          |   13 = Write printer name   |
        1 +-----------------------------+
          | Printer server name padded  |
          |         with spaces         |
        7 +-----------------------------+

On exit: For read operations, the control block is modified as above. For write operations, the control block is undefined.

Using the Net programming library, the printer server name can be read and written with the following calls:

   A%=FNNet_Info(12,0):X%?7=13:name$=$(X%+1)  :REM Read printer server name    
   $(X%+1)=name$:A%=FNNet_Info(13,X%!1)       :REM Set printer server name   

Read space in NetPrint buffer - control byte=14

This call reads the amount of free space in the NetPrint buffer used by the network printer device selected by *FX5,4.

On entry:

    XY+ 0 +-----------------------------+
          |   12 = Read free space in   |
          |       NetPrint buffer       |
        1 +-----------------------------+
          |   Returns number of free    |
          |  bytes in NetPrint buffer   |
        2 +-----------------------------+

On exit: The control block is modified to hold the number of free bytes in the NetPrint buffer.

Using the Net programming library, the free space in the NetPrint buffer can be read with the following call:

   space%=FNNet_Info(14,0)    :REM Read space in NetPrint buffer

Read/Write fileserver retry delays - control byte=15/16

These calls read and write the delays used when retrying calls to the fileserver.

On entry:

    XY+ 0 +-----------------------------+
          |         Control byte        |
          |   15 = Read retry delay     |
          |   16 = Write retry delays   |
        1 +-----------------------------+
          |     Not listening delay     |
        2 +-----------------------------+
          |       No reply delay        |
        3 +-----------------------------+
          |     Machine Peek delay      |
        4 +-----------------------------+

On exit: For read operations, the control block is modified as above. For write operations, the control block is undefined.

This call is also the way to determine if ANFS is being used, as follows:

   a) Read the retry delays
   b) Invert them with X%!1=X%!1 EOR &AAAAAA and remember them
   c) Read the retry delays again
   d) If the contents of the control block have changed, then ANFS is being
      used

Using the Net programming library, the file server retries can be read and written with the following calls:

   retries%=FNNet_Info(15,0)     :REM Read file server retries
   A%=FNNet_Info(16,retries%)    :REM Write file server retries

Translate net number - control byte=17

This call reads the current network number of the local machine or the file server, or translates a supplied network number.

On entry:

    XY+ 0 +-----------------------------+
          |  17 = Translate net number  |
        1 +-----------------------------+
          |       this net or &00       |
        2 +-----------------------------+
          |          undefined          |
        3 +-----------------------------+
          |    translated net number    |
        4 +-----------------------------+

If XY+1 if &00, then XY+3 is returned holding the local network number. If XY+3=0, returns XY+3=file server net number If XY+3=this net, then returns XY+3=0 If XY+3<>this net, then returns XY+3 unchanged

On exit: The control block is modified as above.

Using the Net programming library, the file server retries can be read and written with the following calls:

   thisnet%=FNNet_Info(17,0)  :REM Get network number           

See Also

Networking calls

Jgharston 13:26, 26 May 2009 (UTC)