bfs − description of the boot file server protocol The protocol is spoken between the bfs protocol module of the standalone library and the UMIPS-BSD program The protocol allows standalone programs to read files across an ethernet from a host UMIPS-BSD system. The protocol is layer on top of the UDP, IP, and ARP protocols and relies upon them for establishing datagram service with the bfsd server. The format of a bfs packet header is:
struct bfshdr {
charbh_rev;/* protocol revision */
charbh_type;/* packet type */
u_short bh_pathlen;/* pathname length */
shortbh_datalen;/* data length */
shortbh_pad;/* pad to int boundry */
u_intbh_offset;/* file offset */
intbh_flags;/* open flags to use */
charbh_server[BFS_MAXSERVER+1]; /* server */
};
A bfs packet consists of a bfs packet header followed by a null-terminated UNIX file pathname followed by data. The bfs header fields have the following uses: Defines a protocol revision level, currently on revision level 1 is supported. Indicates the type of packet. Packet types are described below. Indicates the length in bytes of the UNIX file pathname which follows immediately after the bfs header. Indicates the length in bytes of the data which follows immediately after the pathname. Two bytes of fill to maintain data alignment requirements of the R2000. The contents is always ignored by bfs protocol participants. The file offset for data transfer requests. Flag indicating if the file is to be opened for reading (0), writing (1), or both (2). Filled in by the server to indicate to the standalone program the host satisfying the request. The following bfs packet types are defined: An enquire packet is broadcast by the standalone system to determine systems which can serve the file indicated by the UNIX pathname after the bfs header. The pathname may be preceeded by a hostname and a colon to restrict the request to a single host. The indicates read/write intentions. Currently, writing files via is not supported. The field indicates the length of the pathname. The and fields are undefined. Sent by a in reply to an packet if the can serve the file. The and UNIX pathname are returned identically to the request. The field is filled with the name of the host on which is running. Sent by a standalone program to an appropriate server determined by enquiry. The packet maintains the UNIX pathname of the file to be served after the bfs packet header and has the length of the pathname in the field. The field indicates the offset into the file at which the data transfer should begin. The field indicates the amount of desired. The data length must be less than or equal to 1024 bytes. Sent by a server in response to a packet. The packet maintains the UNIX pathname of the file to be served after the bfs packet header and has the length of the pathname in the field. The field indicates the offset into the file at which the data transfer began. The field indicates the amount of data actually in the packet. The data length must be less than or equal to 1024 bytes. The field may be less than the amount requested in the packet. A of zero indicates end of file; a of -1 indicates an error on attempting to read the requested data. A packet may be sent by a server to indicate the nature of an error in attempting to respond to a request. It should be followed by a packet with a data length of -1. The should maint maintain the UNIX pathname of the file to being served after the bfs packet header and have the length of the pathname in the field. The error message to be sent to the standalone program should appear after the pathname and be null-terminated. The length of the error message should be assigned to the field. boot(1spp), bfs(4spp)