[Simh] Automatically setting time and date under RTE (basic idea is probably usable for other systems)
Ken Cornetet
Ken.Cornetet at kimball.com
Wed Jul 2 13:42:52 EDT 2008
One thing that annoyed me was having to set the date and time every time
I booted RTE up so I came up with this notion: Run a perl program from
the .sim file that creates a text file with the OS command required to
set the time and date. Connect the virtual paper tape reader to this
file. Have the OS startup procedure read the paper tape device and
execute the command. Here's the implementation for RTE
Copy the following lines to "datetime.pl" in your 2100 folder
use strict;
use POSIX;
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
localtime(time());
print POSIX::strftime(":SYTM,%Y,%j,%H,%M,%S\n", $sec, $min, $hour,
$mday, $mon, $year, -1, -1, -1);
exit 0;
Put the following lines in your .sim file
set PTR dev=52 (substitute the correct select code for the paper tape
reader in your system)
! perl datetime.pl > datetime.txt
attach PTR datetime.txt
Lastly, put this in your WELCOM file
:PU,*ST::2
:ST,4,*ST::2 (substitute the correct LU for your paper tape reader)
:TR,*ST::2
Viola! The date and time are set automatically when you start RTE
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.trailing-edge.com/pipermail/simh/attachments/20080702/dcfbee50/attachment-0003.html>
More information about the Simh
mailing list