make drive file(s) selectable
This commit is contained in:
parent
e5c834982f
commit
bd3579e0af
1 changed files with 11 additions and 11 deletions
18
boot.py
18
boot.py
|
@ -114,19 +114,16 @@ def boot_bin(p, fname, /, *, addr=0, deposit_only=False,
|
||||||
return addr if deposit_only else None
|
return addr if deposit_only else None
|
||||||
|
|
||||||
|
|
||||||
def make_unix_machine(loglevel='INFO'):
|
def make_unix_machine(*, loglevel='INFO', drivenames=[]):
|
||||||
p = PDP1170(loglevel=loglevel)
|
p = PDP1170(loglevel=loglevel)
|
||||||
|
|
||||||
p.associate_device(KW11(p.ub), 'KW') # line clock
|
p.associate_device(KW11(p.ub), 'KW') # line clock
|
||||||
p.associate_device(KL11(p.ub), 'KL') # console
|
p.associate_device(KL11(p.ub), 'KL') # console
|
||||||
p.associate_device(RPRM(p.ub), 'RP') # disk drive
|
p.associate_device(RPRM(p.ub, *drivenames), 'RP') # disk drive
|
||||||
return p
|
return p
|
||||||
|
|
||||||
|
|
||||||
def boot_unix(p=None, loglevel='INFO'):
|
def boot_unix(p):
|
||||||
|
|
||||||
if p is None:
|
|
||||||
p = make_unix_machine(loglevel=loglevel)
|
|
||||||
|
|
||||||
# load, and execute, the key-in bootstrap
|
# load, and execute, the key-in bootstrap
|
||||||
boot_hp(p)
|
boot_hp(p)
|
||||||
|
@ -153,9 +150,12 @@ if __name__ == "__main__":
|
||||||
|
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument('--debug', action='store_true')
|
parser.add_argument('--debug', action='store_true')
|
||||||
|
parser.add_argument('--drive', action='append', default=[], dest='drives')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
pdpoptions = {'drivenames': args.drives}
|
||||||
if args.debug:
|
if args.debug:
|
||||||
boot_unix(loglevel='DEBUG')
|
pdpoptions['loglevel'] = 'DEBUG'
|
||||||
else:
|
|
||||||
boot_unix()
|
p = make_unix_machine(**pdpoptions)
|
||||||
|
boot_unix(p)
|
||||||
|
|
Loading…
Add table
Reference in a new issue