-- Temporary implementation of Booting.mesa. Permanent one will subsume SnapshotImpl
-- BootingImpl.mesa
-- Andrew Birrell February 6, 1983 1:10 pm
DIRECTORY
Booting,
MicrocodeBooting USING[ BootSpecificMicrocode, GetBootFileNumber ],
Snapshot USING[ InLoad, OutLoad ],
TemporaryBooting USING[ BootButton, BootFromFile, BootFromPhysicalVolume, BootFromVolume, InstallPhysicalVolumeBootFile, InstallVolumeBootFile, MakeBootable ],
Volume USING[ ID, systemID ];
BootingImpl: CEDAR PROGRAM
IMPORTS MicrocodeBooting, Snapshot, TemporaryBooting, Volume
EXPORTS Booting =
BEGIN
Boot: PUBLIC PROC[boot: Booting.Bootee, switches: Booting.Switches, outload: Booting.BootFile] = TRUSTED
BEGIN
Vol: PROC[volume: Volume.ID] RETURNS[Volume.ID] = CHECKED INLINE
{ RETURN[ IF volume = Booting.nullVolume THEN Volume.systemID ELSE volume] };
IF outload # Booting.nullBootFile
THEN BEGIN
inLoaded: BOOL = Snapshot.OutLoad[file: outload.file, firstPage: outload.firstPage];
IF inLoaded THEN RETURN;
END;
WITH b: boot SELECT FROM
bootButton => TemporaryBooting.BootButton[switches];
microcode => MicrocodeBooting.BootSpecificMicrocode[b.bfn];
physical => TemporaryBooting.BootFromPhysicalVolume[Vol[b.volume], switches];
logical => TemporaryBooting.BootFromVolume[Vol[b.volume], switches];
file => TemporaryBooting.BootFromFile[b.file.file, b.file.firstPage, switches];
inload => Snapshot.InLoad[pMicrocode: NIL, pGerm: NIL, countGerm: 0,
file: b.file.file, firstPage: b.file.firstPage, switches: switches];
ENDCASE => ERROR;
ERROR -- can't get here --
END;
GetBootFileNumber: PUBLIC PROC[type: Booting.MicrocodeType] RETURNS[Booting.BootFileNumber] = TRUSTED
{ RETURN[ MicrocodeBooting.GetBootFileNumber[type] ] };
MakeBootable: PUBLIC PROC[file: Booting.BootFile] = TRUSTED
{ TemporaryBooting.MakeBootable[file: file.file, firstPage: file.firstPage] };
InstallVolumeBootFile: PUBLIC PROC[file: Booting.BootFile] = TRUSTED
{ TemporaryBooting.InstallVolumeBootFile[file: file.file, firstPage: file.firstPage] };
InstallPhysicalVolumeBootFile: PUBLIC PROC[file: Booting.BootFile] = TRUSTED
{ TemporaryBooting.InstallPhysicalVolumeBootFile[file: file.file, firstPage: file.firstPage] };
END.