Added sdump tool, added a coldboot option to build/Makefile, added a few
kernel comments.
This commit is contained in:
@@ -13,6 +13,10 @@ a.rim:
|
|||||||
$(AS) -f rim -o a.rim $(SYS)/sop.s $(SYS)/s[1-8].s
|
$(AS) -f rim -o a.rim $(SYS)/sop.s $(SYS)/s[1-8].s
|
||||||
$(AS) -f list -o a.lst $(SYS)/sop.s $(SYS)/s[1-8].s
|
$(AS) -f list -o a.lst $(SYS)/sop.s $(SYS)/s[1-8].s
|
||||||
|
|
||||||
|
coldboot:
|
||||||
|
$(AS) -f rim -o a.rim $(SYS)/sop.s $(SYS)/s[1-9].s
|
||||||
|
$(AS) -f list -o a.lst $(SYS)/sop.s $(SYS)/s[1-9].s
|
||||||
|
|
||||||
image.fs:
|
image.fs:
|
||||||
$(MKFS) --debug --format simh proto
|
$(MKFS) --debug --format simh proto
|
||||||
|
|
||||||
|
|||||||
+6
-6
@@ -3,11 +3,11 @@
|
|||||||
|
|
||||||
" allocate a free disk block for a file (data or indirect)
|
" allocate a free disk block for a file (data or indirect)
|
||||||
alloc: 0
|
alloc: 0
|
||||||
-1
|
-1 " Decrement the # free block numbers in the cache
|
||||||
tad s.nfblks
|
tad s.nfblks " kept at s.fblks. Jump to 1f if no free blocks left.
|
||||||
spa
|
spa
|
||||||
jmp 1f
|
jmp 1f
|
||||||
dac s.nfblks
|
dac s.nfblks " Update the count of free block numbers
|
||||||
tad fblksp
|
tad fblksp
|
||||||
jms laci
|
jms laci
|
||||||
dac 9f+t
|
dac 9f+t
|
||||||
@@ -16,7 +16,7 @@ alloc: 0
|
|||||||
jms dskwr
|
jms dskwr
|
||||||
dzm .savblk
|
dzm .savblk
|
||||||
lac 9f+t
|
lac 9f+t
|
||||||
jmp alloc i
|
jmp alloc i " Return from routine
|
||||||
1:
|
1:
|
||||||
lac s.nxfblk
|
lac s.nxfblk
|
||||||
sna
|
sna
|
||||||
@@ -30,7 +30,7 @@ alloc: 0
|
|||||||
dac s.nfblks
|
dac s.nfblks
|
||||||
jmp alloc+1
|
jmp alloc+1
|
||||||
|
|
||||||
" free a disk block
|
" free the disk block whose number is in AC
|
||||||
free: 0
|
free: 0
|
||||||
lmq
|
lmq
|
||||||
lac s.nfblks
|
lac s.nfblks
|
||||||
@@ -53,7 +53,7 @@ free: 0
|
|||||||
dzm .savblk
|
dzm .savblk
|
||||||
lac d1
|
lac d1
|
||||||
dac s.nfblks
|
dac s.nfblks
|
||||||
jmp free i
|
jmp free i " Return from the routine
|
||||||
t = t+1
|
t = t+1
|
||||||
|
|
||||||
" load AC indirect (without using indirect!)
|
" load AC indirect (without using indirect!)
|
||||||
|
|||||||
+8
-7
@@ -5,27 +5,28 @@
|
|||||||
|
|
||||||
" zero i-list
|
" zero i-list
|
||||||
|
|
||||||
dzm ii
|
dzm ii " Set ii to zero
|
||||||
jms copyz; dskbuf; 64
|
jms copyz; dskbuf; 64 " Zero the 64-word dskbuf
|
||||||
1:
|
1:
|
||||||
lac ii
|
lac ii " Zero blocks 0 to 709
|
||||||
jms dskio; 07000
|
jms dskio; 07000
|
||||||
isz ii
|
isz ii " Move up to next block number
|
||||||
-710
|
-710
|
||||||
tad ii
|
tad ii
|
||||||
sza
|
sza
|
||||||
jmp 1b
|
jmp 1b " Loop back until we reach block 710
|
||||||
|
" i.e. we don't write block 710
|
||||||
|
|
||||||
" free rest of disk
|
" free rest of disk
|
||||||
|
|
||||||
1:
|
1:
|
||||||
lac ii
|
lac ii " Free blocks 710 up to 6399
|
||||||
jms free
|
jms free
|
||||||
isz ii
|
isz ii
|
||||||
-6400
|
-6400
|
||||||
tad ii
|
tad ii
|
||||||
sza
|
sza
|
||||||
jmp 1b
|
jmp 1b " Loop back until we reach block 6400
|
||||||
|
|
||||||
" read in tapes
|
" read in tapes
|
||||||
|
|
||||||
|
|||||||
+10
-4
@@ -6,6 +6,7 @@
|
|||||||
#
|
#
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
use Fcntl qw(:flock SEEK_SET);
|
||||||
|
|
||||||
### read a word from a file in SimH format
|
### read a word from a file in SimH format
|
||||||
### return -1 on EOF
|
### return -1 on EOF
|
||||||
@@ -14,10 +15,10 @@ sub read_word {
|
|||||||
# Convert four bytes into one 18-bit word
|
# Convert four bytes into one 18-bit word
|
||||||
return -1 if ( read( $F, my $four, 4 ) != 4 ); # Not enough bytes read
|
return -1 if ( read( $F, my $four, 4 ) != 4 ); # Not enough bytes read
|
||||||
my ( $b1, $b2, $b3, $b4 ) = unpack( "CCCC", $four );
|
my ( $b1, $b2, $b3, $b4 ) = unpack( "CCCC", $four );
|
||||||
return ((($b1 & 0xff) << 24 ) |
|
return (($b1 & 0xff) |
|
||||||
(($b2 & 0xff) << 16 ) |
|
(($b2 & 0xff) << 8 ) |
|
||||||
(($b3 & 0xff) << 8) |
|
(($b3 & 0xff) << 16) |
|
||||||
($b4 & 0xff));
|
(($b3 & 0xff) << 24));
|
||||||
}
|
}
|
||||||
|
|
||||||
### Main program
|
### Main program
|
||||||
@@ -27,6 +28,11 @@ open(my $IN, "<", $ARGV[0]) || die("Couldn't open $ARGV[0]: $!\n");
|
|||||||
|
|
||||||
use constant NUMBLOCKS => 8000; # Number of blocks on a surface
|
use constant NUMBLOCKS => 8000; # Number of blocks on a surface
|
||||||
use constant WORDSPERBLK => 64; # 64 words per block
|
use constant WORDSPERBLK => 64; # 64 words per block
|
||||||
|
use constant BYTESPERWORD => 4; # We encode each word into 4 bytes
|
||||||
|
|
||||||
|
# Skip the first surface
|
||||||
|
seek($IN, NUMBLOCKS*WORDSPERBLK*BYTESPERWORD, SEEK_SET) ||
|
||||||
|
die("Cannot seek: $!\n");
|
||||||
|
|
||||||
foreach my $blocknum ( 0 .. NUMBLOCKS*2 - 1 ) {
|
foreach my $blocknum ( 0 .. NUMBLOCKS*2 - 1 ) {
|
||||||
printf("Block %d (%06o)\n", $blocknum, $blocknum );
|
printf("Block %d (%06o)\n", $blocknum, $blocknum );
|
||||||
|
|||||||
Reference in New Issue
Block a user