DIRECTORY PrincOps USING [ControlLink, FrameHandle, InterimPageState, PageCount--, PageNumber--], DiskFace USING [FileID, Type, DontCare, wordsPerPage]; BootFile: DEFINITIONS = BEGIN currentVersion: CARDINAL = 101; Location: TYPE = MACHINE DEPENDENT RECORD[ deviceType(0): DiskFace.Type, deviceOrdinal(1): CARDINAL, vp(2): SELECT OVERLAID * FROM disk => [ diskFileID(2): DiskFileID], ethernet => [bootFileNumber(2): CARDINAL, net(3), host(4): CARDINAL _ 0], any => [ a(2), b(3), c(4), d(5), e(6), f(7), g(10B), h(11B): UNSPECIFIED ], ENDCASE ]; DiskFileID: TYPE = MACHINE DEPENDENT RECORD[ fID: DiskFace.FileID,-- for disk label -- firstPage: INT,-- for disk label -- firstLink: DiskFace.DontCare--initial boot chain link-- ]; nullLink: DiskFace.DontCare = LOOPHOLE[LONG[0]]; 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(10B): ARRAY [0..0) OF Entry]; Trailer: TYPE = MACHINE DEPENDENT RECORD [ -- entry table after exhausting "Header" version(0): CARDINAL _ currentVersion, entries(1): ARRAY [0..0) OF Entry]; 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): PrincOps.ControlLink], resumptive => [ mdsi(0:8..15): MDSIndex -- for WriteMDS hack --, resumee(1): PrincOps.FrameHandle], ENDCASE]; ContinuationKind: TYPE = {initial, resumptive}; Entry: TYPE = MACHINE DEPENDENT RECORD [ page (0): CARDINAL--PrincOps.PageNumber--, value (1): PrincOps.InterimPageState]; MDSIndex: TYPE = RECORD [index: [0..256)]; -- high order bits of MDS base pointer MemorySizeToFileSize: PROCEDURE [countReal: PrincOps.PageCount] RETURNS [INT] = INLINE BEGIN RETURN[ countReal -- total data pages +1 -- header page +(MAX[countReal, maxEntriesPerHeader]-maxEntriesPerHeader+maxEntriesPerTrailer-1) /maxEntriesPerTrailer -- trailer pages ] END; maxEntriesPerHeader: CARDINAL = (DiskFace.wordsPerPage-SIZE[Header])/SIZE[Entry]; maxEntriesPerTrailer: CARDINAL = (DiskFace.wordsPerPage-SIZE[Trailer])/SIZE[Entry]; END. Cedar Nucleus: Layout of bootfiles. BootFile.mesa Andrew Birrell April 29, 1983 4:11 pm for boot files written using these definitions (see Header below) Identification of a boot file for loading it. Commentary: 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. ʘJšœ#™#Jšœ ™ Jšœ&™&J™šÏk ˜ Jšœ œ7Ïcœ˜WJšœ œ(˜6—J˜Jšœ œ˜J˜Jš˜J˜šœœ˜JšœA™A—J˜š œ œœ œœ˜*J˜Jšœœ˜šœœœ˜J˜%Jšœ œœ˜IJšœ= œ˜KJš˜—J˜—J˜š œ œœ œœ˜,Jšœ-™-Jšœž˜)Jšœ œž˜#Jšœœž˜7J˜—J˜Jšœœœ˜0J˜šœ ™ J™JšœÅ™ÅJ˜Jšœk™kJ™Jšœ`™`J˜Jšœ©™©J˜Jšœh™hJ˜Jšœƒ™ƒJ™Jšœ‘™‘J™Jšœq™qJ˜Jšœ·™·—J˜š œœœ œœž˜DJšœ œ˜&Jšœœœž˜;Jšœœž8˜VJšœ˜Jšœ˜Jšœœž0˜HJšœœœ˜%—J˜š œ œœ œœž(˜SJšœ œ˜&Jšœ œœ˜#—J˜Jšœ œ˜#J˜š œœœ œœ˜/šœœ ˜1šœ ˜ Jšœ˜Jšœ&˜&—šœ˜Jšœžœ˜0Jšœ"˜"—Jšœ˜ ——J˜Jšœœ˜/J˜š œœœ œœ˜(Jšœ žœ˜*Jšœ&˜&—J˜Jšœ œœž&˜QJ˜šÏnœ œ!œœ˜OJšœR™RJšœ˜ Jš œ žœžœœcžœ˜²Jšœ˜J˜Jšœœœ œ˜QJ˜Jšœœœ œ˜S—J˜Jšœ˜—…— f