DIRECTORY DiskFace USING [DiskAddress, DontCare, FileID, wordsPerPage], PrincOps USING [ControlLink, FrameHandle, PageCount, PageValue], Pup USING [Host, Net], XNS USING [Address]; BootFile: DEFINITIONS = BEGIN OPEN PrincOps; HostNumber: TYPE = MACHINE DEPENDENT RECORD [a, b, c, d, e, f: BYTE]; nullHostNumber: HostNumber = [0, 0, 0, 0, 0, 0]; -- Not assigned as either a physical or multicast address. DiskFaceFilePageNumber: TYPE = LONG CARDINAL; DeviceType: TYPE = PRIVATE RECORD [CARDINAL]; FloppyDiskFaceDiskAddress: TYPE = MACHINE DEPENDENT RECORD [ cylinder(0): CARDINAL, --must be IN [0..numberOfCylinders) head(1:0..7): BYTE, --must be IN [0..numberOfHeads) sector(1:8..15): BYTE]; --must be IN [1..maxSectorsPerTrack] currentVersion: CARDINAL = 102; Location: TYPE = MACHINE DEPENDENT RECORD[ deviceType(0:0..15): DeviceType, deviceOrdinal(1:0..15): CARDINAL, vp(2:0..9*16-1): SELECT OVERLAID * FROM disk => [ diskFileID(2:0..9*16-1): DiskFileID ], ethernetBSP => [ -- pup bootFileNumber(2:0..15): CARDINAL, net(3:0..15): Pup.Net _ [0], host(4:0..15): Pup.Host _ [0] ], ethernetSPP => [ -- xns ethernetRequest(2:0..9*16-1): EthernetRequest ], floppy => [ floppyDiskFileID(2:0..9*16-1): FloppyDiskFileID ], any => [word(2:0..9*16-1): ARRAY [0..9) OF WORD], ENDCASE ]; DiskFileID: TYPE = MACHINE DEPENDENT RECORD[ fID (0:0..5*16-1): DiskFace.FileID, -- for disk label firstPage (5:0..2*16-1): INT, -- for disk label firstLink (7:0..2*16-1): DiskFace.DontCare -- initial boot chain link ]; FloppyDiskFileID: TYPE = MACHINE DEPENDENT RECORD[ fID (0:0..5*16-1): DiskFace.FileID, -- for disk label firstPage (5:0..2*16-1): INT, da (7:0..2*16-1): FloppyDiskFaceDiskAddress -- initial boot chain link ]; DiskBootChainLink: TYPE = DiskFace.DiskAddress; nullDiskBootChainLink: DiskBootChainLink = LOOPHOLE[LONG[0]]; eofDiskBootChainLink: DiskBootChainLink = LOOPHOLE[LAST[CARD32]]; nullLink: DiskFace.DontCare = LOOPHOLE[LONG[0]]; EthernetRequest: TYPE = MACHINE DEPENDENT RECORD [ bfn(0:0..3*16-1): EthernetBootFileNumber, address(3:0..6*16-1): XNS.Address ]; EthernetBootFileNumber: TYPE = RECORD [HostNumber]; nullEthernetBootFileNumber: EthernetBootFileNumber = [nullHostNumber]; Header: TYPE = MACHINE DEPENDENT RECORD [ -- first page of boot file version(0): CARDINAL _ currentVersion, creationDate(1): LONG CARDINAL, -- System.GreenwichMeanTime pStartListHeader(3): POINTER, -- when continuation kind=initial (relative to that mds) inLoadMode(4): InLoadMode, continuation(5): Continuation, countData(7): CARDINAL, -- number of nonvacant pages (not counting germ) entries(HeaderStart): HeaderArray ]; HeaderStart: NAT = 10B; HeaderArray: TYPE = ARRAY [0..maxEntriesPerHeader) OF Entry; maxEntriesPerHeader: CARDINAL = (DiskFace.wordsPerPage-HeaderStart)/SIZE[Entry]; Trailer: TYPE = MACHINE DEPENDENT RECORD [ -- entry table after exhausting "Header" version(0): CARDINAL _ currentVersion, entries(1): TrailerArray ]; TrailerStart: NAT = 1; TrailerArray: TYPE = ARRAY [0..maxEntriesPerTrailer) OF Entry; maxEntriesPerTrailer: CARDINAL = (DiskFace.wordsPerPage-TrailerStart)/SIZE[Entry]; Entry: TYPE = MACHINE DEPENDENT RECORD [ page(0:0..15): CARDINAL, --PageNumber-- value(1:0..31): PageValue ]; InLoadMode: TYPE = {load, restore}; Continuation: TYPE = MACHINE DEPENDENT RECORD [ vp(0): SELECT kind(0:0..7): ContinuationKind FROM initial => [ mdsi(0:8..15): MDSIndex, destination(1): ControlLink ], resumptive => [ mdsi(0:8..15): MDSIndex, -- for WriteMDS hack -- resumee(1): FrameHandle ], ENDCASE ]; ContinuationKind: TYPE = {initial, resumptive}; MDSIndex: TYPE = RECORD [index: [0..256)]; -- high order bits of MDS base pointer MemorySizeToFileSize: PROC [countReal: PageCount] RETURNS [INT] = INLINE { RETURN[ countReal -- total data pages +1 -- header page +(MAX[countReal, maxEntriesPerHeader]-maxEntriesPerHeader+maxEntriesPerTrailer-1) /maxEntriesPerTrailer -- trailer pages ] }; END. XBootFile.mesa Copyright Σ 1985, 1986 by Xerox Corporation. All rights reserved. Andrew Birrell April 29, 1983 4:11 pm Russ Atkinson (RRA) February 27, 1985 8:39:30 pm PST Willie-Sue, November 5, 1986 6:27:03 pm PST Doug Wyatt, December 12, 1986 6:27:16 pm PST Layout of boot files. Borrowed from 7.0 Version, Location for boot files written using these definitions (see Header below) (102 corresponds to changes that allow > 1 Mword physical memory) (103 corresponds to increased boot Locations (types) ) Disk Location Data Identification of a boot file for loading it. Identification of a boot file for loading it. This is written in the boot chain link field of all but the last page of each disk run of the bootable portion of a file. A valid disk address is written in the last page of each interior disk run of the bootable portion of a file. "End of file". This must be written in the boot chain link field of the last page of the bootable portion of a file which is loaded by the microcode (hard microcode, soft microcode, diagnostic microcode, germ). It is required to delimit the end of the file to the microcode. Ethernet Location Data Ethernet boot file numbers are allocated from the same name space as HostNumbers. Of course, these numbers do not represent hosts. Boot file format A boot file is intended to capture the state of real memory and the relevant processor registers, most notably the map. It consists of a Header page followed by one or more data pages, followed by zero or more groups each consisting of a Trailer page followed by one or more data pages. Each Header or Trailer page assigns virtual and real addresses and flag bits to the accompanying data pages. The Header page contains some additional global state. Assertion: if Entry[p, v] precedes Entry[p', v'] in a boot file, then p is less than (and not equal to) p'. If a boot file does NOT contain an entry for a given page, that page is understood to be vacant. There are two variations of boot files, corresponding to whether the captured state is a snapshot of a running program or has been fabricated with "bit tweezers". In the former case (resumptive Continuation), some process is waiting on the BootSwap.pMon.condResponse condition variable. In the latter case (initial Continuation), a distinguished PSB is made ready to xfer to a given control link and the BootSwapGerm waits. There is an additional distinction depending on whether the inLoadMode of a boot file is load or resume. An inLoadMode=load signifies that the program captured in the boot file does not care into which real pages it is loaded. In this case InLoad expects all real memory to be mapped to an initial prefix of virtual memory; it leaves all excess real memory mapped immediately following the last virtual page it loads. (Thus those virtual pages between ones which are loaded are set vacant.) An inLoadMode=restore signifies that the program captured in the boot file expects to be reloaded into the real pages specified in the boot file. With either inLoadMode, the flags (W, D, R) of the loaded pages are set to the values specified in the boot file. To be distributed via the current ethernet boot servers, one of these boot files would have to be "encapsulated" by preceding it with a dummy page containing an appropriate timestamp. Calculate upper bound on file pages for boot file as function of real memory size. Κδ˜codešœ ™ KšœB™BKšœ&™&K™4K™+K™,—K™K™K™šΟk ˜ Kšœ œ/˜=Kšœ œ2˜@Kšœœ ˜Kšœœ ˜—K˜KšΟnœ ˜Kšœœœ ˜head™Jš œ œœ œœœ˜Ešœ1Οc:˜kJ˜—šœœœœ˜-K˜—Kš œ œœœœ˜-K˜š œœœ œœ˜—K™—™šœœ˜šœA™AK™AK™6——K˜š œ œœ œœ˜*K˜ Kšœœ˜!šœœœ˜'šœ ˜ Kšœ#˜#Kšœ˜—šœŸ˜Kšœœ˜#Kšœ˜Kšœ˜Kšœ˜—šœŸ˜Kšœ-˜-Kšœ˜—˜ Kšœ/˜/K˜—Kšœœœœ˜1Kš˜—K˜——šœ™š œ œœ œœ˜,Kšœ-™-Kšœ#Ÿ˜5KšœœŸ˜/Kšœ!œŸ˜EK˜K˜—š œœœ œœ˜2Kšœ-™-Kšœ#Ÿ˜5Kšœœ˜Kšœ+Ÿ˜FK˜—K˜Kšœœ˜/šœ+œœ˜=K™η—šœ*œœœ˜AK™’K™—Kšœœœ˜0—šœ™š œœœ œœ˜2Kšœ)˜)Kšœœ˜!Kšœ˜K˜—šœœœ˜3K™‚K˜—˜FK˜——™KšœΕ™ΕK˜Kšœk™kK™Kšœ`™`K˜Kšœ©™©K˜Kšœh™hK˜Kšœƒ™ƒK™Kšœ‘™‘K™Kšœq™qK˜Kšœ·™·—˜š œœœ œœŸ˜DKšœ œ˜&KšœœœŸ˜;KšœœŸ8˜VKšœ˜Kšœ˜KšœœŸ0˜HKšœ!˜!Kšœ˜—Kšœ œ˜Kšœ œœœ˜Kšœœ(œ˜RK˜š œœœ œœ˜(KšœœŸ˜'Kšœ˜Kšœ˜—K˜Kšœ œ˜#K˜š œœœ œœ˜/šœœ ˜1šœ ˜ Kšœ˜Kšœ˜Kšœ˜—šœ˜KšœŸ˜0Kšœ˜Kšœ˜—Kš˜—Kšœ˜K˜—šœœ˜/K˜—Kšœ œœŸ&˜QK˜š žœœœœœ˜JKšœR™RKš œ ŸœŸœœcŸœ˜²Kšœ˜K˜——K™Kšœ˜—…—f"’