|
|
DataMuseum.dkPresents historical artifacts from the history of: Bogika Butler |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Bogika Butler Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 6144 (0x1800)
Types: TextFile
Names: »BOOTGEN.SA«
└─⟦e12db5ad4⟧ Bits:30009789/_.ft.Ibm2.50007357.imd Mogens Pelles Zilog 80,000 / EOS projekt
└─⟦this⟧ »BOOTGEN.SA«
æ*****************************************************************
Copyright 1984 by
NCR Corporation
Dayton, Ohio U.S.A.
All Rights Reserved
******************************************************************
EOS Software produced by:
NCR Systems Engineering - Copenhagen
Copenhagen
DENMARK
*****************************************************************å
program bootgen (input,output);
label
start, ask, errorstop;
type
byte = -128..127;
word = -32768..32767;
long = integer;
fname = stringÆ40Å;
ptr = ^spec;
spec =
record
next : ptr;
name : fname;
end;
rectype = (librec, eoshead1, eoshead2, code);
sad =
record
rsv, atr : word;
segname : packed array Æ1..4Å of char;
segstart : long;
segsize : long;
end;
mid =
record
first : word;
last : word;
end;
progrec =
record
case rectype of
librec:
(head1 : packed array Æ1..22Å of byte;
entry : long;
head2 : packed array Æ1..22Å of byte;
sads : array Æ1..8Å of sad;
mids : array Æ1..20Å of mid);
eoshead1:
(headsize : word;
progsize : long;
progkind : word;
progadr : word;
dummy : packed array Æ5..127Å of word);
eoshead2:
(eos : packed array Æ0..127Å of word);
code :
(data : packed array Æ0..255Å of byte);
end; æprogrecå
progfile = file of progrec;
var
inspec, first, last : ptr;
filename, kernelname, bootfilename : fname;
infile, outfile : progfile;
block : progrec;
c : char;
i, size, outsize, digit, error : word;
text : packed array Æ1..5Å of char;
procedure copyfile (name : fname);
var
i : word;
begin
i := 0;
while not eof (infile) do
begin
i := i + 1;
read (infile, block);
write (outfile, block);
end;
writeln (name:20, i, ' sectors copied');
end; æcopyfileå
begin
æ$A=2å
start:
writeln ('Type filename of Kernel (.LO will be added)');
readln (filename);
kernelname := concat (filename, '.LO');
writeln ('Type filenames of EOS object modules (.EO will be added)');
writeln ('one name per line, ''.'' ends the list');
first := nil;
repeat
readln (filename);
if filename <> '.' then
begin
new (inspec);
if first = nil then first := inspec
else last^.next := inspec;
last := inspec;
inspec^.name := concat (filename, '.EO');
end;
until filename = '.';
writeln ('Type filename of output file (.SY will be added)');
readln (filename);
bootfilename := concat (filename, '.SY');
ælist filenames and ask for verificationå
writeln ('Input files:');
writeln (' ':3, kernelname);
inspec := first;
while inspec <> nil do
begin
writeln (' ':3, inspec^.name);
inspec := inspec^.next;
end;
writeln ('Output file:');
writeln (' ':3, bootfilename);
ask:
writeln ('Ok (y/n)?');
readln (c);
if (c='n') or (c= 'N') then goto start;
if (c<>'y') and (c<>'Y') then goto ask;
writeln;
æfind size of output file: kernel-size + module-sizes + 1 + 1å
ækernel sizeå
reset (infile, kernelname);
if eof (infile) then
begin
error := 1;
filename := kernelname;
goto errorstop;
end;
read (infile, block);
outsize := block.sadsÆ1Å.segsize div 256;
if (block.sadsÆ2Å.segsize > 0) or
(block.midsÆ2Å.last > 0) or
(block.sadsÆ1Å.segstart <> 0) or
(block.midsÆ1Å.first <> 0) then
begin
error := 2;
goto errorstop;
end;
æmodule sizeså
inspec := first;
while inspec <> nil do
begin
filename := inspec^.name;
reset (infile, filename);
if eof (infile) then
begin
error := 1;
goto errorstop;
end;
read (infile, block);
size := block.progsize div 256;
if size <= 0 then
begin
error := 3;
goto errorstop;
end;
outsize := outsize + size;
inspec := inspec^.next;
end;
outsize := outsize + 1 + 1; æinclude LIB header and terminating
zero module in outfile sizeå
æconvert outsize into a textstring to be inserted in bootfilenameå
bootfilename := concat (bootfilename, ';C=');
i:= 1;
size := outsize;
repeat
digit := size mod 10;
textÆiÅ := chr (ord('0') + digit);
size := size div 10;
if size > 0 then i:= i + 1;
until size = 0;
for i:= i downto 1 do
bootfilename := concat (bootfilename, textÆiÅ);
writeln ('Outfile: ', bootfilename);
æcreate contiguous outfileå
rewrite (outfile, bootfilename);
æcopy Kernel into outfileå
reset (infile, kernelname);
read (infile, block); æLIB headerå
block.sadsÆ1Å.segsize := (outsize - 1) * 256;
block.midsÆ1Å.last := outsize - 2;
write (outfile, block);
writeln ('LIB header':20, 1, ' sector copied');
copyfile (kernelname);
æcopy EOS modules into outfileå
inspec := first;
while inspec <> nil do
begin
filename := inspec^.name;
reset (infile, filename);
copyfile (filename);
inspec := inspec^.next;
end;
æterminating zero moduleå
block.headsize := 0;
block.progsize := 0;
write (outfile, block);
writeln ('Zero module':20, 1, ' sector copied');
æerror messageså
if false then
begin
errorstop:
case error of
1: writeln (filename, ' is empty');
2: writeln (kernelname, ' is not correct load format');
3: writeln (filename, ' is not correct EOS format');
end;
end;
end.
«eof»