-*- Mode:Text; Package:USER; Fonts:(MEDFNT MEDFNB); Base:10 -*- Filename: AZA:KEITH;MAC-K-AREA.TEXT Date: May 3, 1988 Maintained by: Keith Corbett Description: Notes from the discussion of the proposed MAC/K inter- communications area. Based on today's meeting among Rick Greenblatt, Jim O'Dell, Keith Corbett, Peter DeWolf, and David Saslav. NOTES 1) Area will be located in MAC-internal memory. (We need a way to pass the base location to the K.) 2) Byte-ordering will be "MAC-friendly". The convention for arguments, values, etc., will also be modified to be MAC-friendly as desired. 3) Each processor will only send one "major command" at a time. (This makes the interrupt processing more straight-forward.) Major commands are requests that must be dealt with at a high priority; these requests may be accompanied by interrupting the other processor for immediate attention. Minor command areas will be dealt with in normal processing loop. For example, the K can set up several file command(s) before the MAC deals with them; but it can issue the major command to reset files, reset network, or reset the entire state, at any time. 4) Interlocking is done typically by a flag word or byte. Generally, the values of such flags are along the following lines: 0 = NULL-STATE == thing is available, action is not required 1 = BUSY-STATE == action is underway, waiting -1 = DONE-STATE == action is completed For some flags, non-unitary values of the appropriate sign may be used to indicate error or status codes. It will be clearly established in each context which of the two processors is exclusively responsible for manipulating a flag. 5) In diagram below, arrows (--->) indicate offset pointers to other structures. Words in mixed case are structure names; words in upper case indicate actual numeric constants that may appear in the structure. Words in braces ({}) indicate variable values. 6) In diagram, 32-bit words are enclosed in brackets ([]). Individual bytes are separated by slashes (/), half-words by double slashes (//). ********************************* MAC-K-Area ********************************* Minor-Command-Area ********************************* [ MAC-K-AREA-HEADER-TOKEN ] [ {Major-Command-Area-Pointer} ] ;Intervening words are for : ; minor command areas : [ ---> Keyboard-Mouse-Area ] ;Interrupt-type keystrokes [ ---> Screen-Interface-Area ] ;Screen drawing, moving [ ---> Raw-Disk-Area ] ;Paging, load bands [ ---> FileSystem-Area ] ;Access to MAC file system [ ---> Network-Area ] ;Access to MAC network controller(s) [ ---> Serial-Port-Area ] ;Serial I/O / modem [ ---> Printer-Area ] ;PostScript-type printing? : : ********************************* Major-Command-Area ********************************* [ {K-To-MAC-Command-Opcode} ;Table (to be done) // {K-To-MAC-Status} ] ;0=null, 1=ongoing, -1=finished [ {K-to-MAC-Argument-Count} ] ;Or fixed # arguments? [ ---> K-to-MAC-Command-Block-1 ] ;Pointer to argument length/string : [ ---> K-to-MAC-Command-Block-8 ] ;How many? [ {K-to-MAC-Values-Count} ] ;Or fixed # values? [ ---> K-to-MAC-Values-Block-1 ] ;Pointer to argument length/string : [ ---> K-to-MAC-Values-Block-8 ] [ {MAC-To-K-Command-Opcode} ;Table (to be done) // {MAC-To-K-Status} ] ;0=null, 1=ongoing, -1=finished [ {MAC-To-K-Argument-Count} ] ;Or fixed # arguments? [ ---> MAC-To-K-Command-Block-1 ] ;Pointer to argument length/string : [ ---> MAC-To-K-Command-Block-8 ] [ {MAC-To-K-Values-Count} ] ;Or fixed # values? [ ---> MAC-To-K-Values-Block-1 ] ;Pointer to argument length/string : [ ---> MAC-To-K-Values-Block-8 ] MAJOR COMMANDS Major commands are very high priority, and may be accompanied by an interrupt. Some of the ones we've discussed so far are: *** COLD-START, WARM-START *** OPEN-FILE (CLOSE-FILE?) *** CLOSE-ALL-FILES *** PRIORITY-{AREA} Means, "pay attention to my area", where some minor command area action is blocking. The MAC needn't guarantee always to respond as desired, but it will return something -- at least a response status string. (We can use this, e.g., in the who-line to indicate what the MAC is thinking about.) *** MOVING-WINDOW Perhaps to give a way from the MAC side to move the LISP window, even to a different monitor. (Obviously requires priority interrupt.) *** HOW-ARE-YOU ...If somebody wants/needs a "keep-alive" reassurance. 1FILESYSTEM COMMANDS* ********************************* FileSystem-Area ********************************* [ {File-Handle-Count} ] ;Number of established file handles ; (MAC limitations may improve?) [ ---> FileHandle-1 ] ;If 0, handle is "available" : [ ---> FileHandle-{N} ] ;What is current limit? ********************************* FileHandle ********************************* [ {File-Open-Flag} ] ;Used e.g. by K to close, MAC to say OK [ {File-Open-Mode} ] ;READ-SEQUENTIAL, WRITE-SEQUENTIAL, etc. [ {File-Buffer-Count} ] [ ---> FileBuffer-1 ] : [ ---> FileBuffer-N ] ********************************* The FileSystem-Area is used by the K to access files in the MAC local file space. 1Command*: OPEN-MAC-FILE 1Description*: K asks MAC to open a native (Macintosh) file, given its name and (standard LISP) I/O mode. MAC returns a "file handle", an index into the FileSystem-Area. MAC sets open flag after preparing pointers to (requested number of) buffers. Depending on mode, MAC may initiate I/O immediately (e.g. on sequential read, MAC could transfer first buffers' worth). Thereafter, until the K closes file, both sides manipulate file buffer pointers in standard LISP fashion. Closing a file, from the K's point of view, could well be handled in the FileHandle area, for example, by setting the {File-Open-Flag} to -1. ZetaLISP interfaces: a K-MAC host/device, Macintosh pathname host type, and K-MAC file access method are all required. 1Comments*: We want I/O to be generalized (few artificial requirements, e.g. pre-fixed byte counts), but flexible for implementing standard file streams efficiently. This should be done in a subsequent on-site meeting. 1SCREEN-INTERFACE COMMANDS* This area is used by the MAC to tell the K where to (re)establish its screen drawing region. Obviously the details of K/MAC screen interaction, and the varying proposed strategies, need to be discussed further. Command: DRAW-LISP-SCREEN Arguments: base (NuBus), height (X), width (Y). (Scaling?) 1KEYBOARD-MOUSE COMMANDS* Used to establish control of the mouse. Commands: TAKE-MOUSE, SURRENDER-MOUSE 1RAW-DISK COMMANDS* Similar to the FileSystem commands, but used to establish raw disk partitions. These are used by LISP for paging, world-loading, and metering. (Any other standard usages envisioned?) To the MAC, these partitions might look like (large) files in the native sense.