Skip to content

Commit 405010f

Browse files
JohnForecasttlhackque
authored andcommitted
Various os/8 and rt11 fixes. Add support for Unix V7.
1 parent a6fb802 commit 405010f

21 files changed

Lines changed: 3847 additions & 160 deletions

converters/fsio/Changes

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,36 @@ Changes Since Alpha Release:
3333

3434
- Merged change from tvrusso to fix compilation on FreeBSD
3535

36+
20-Aug-20
37+
38+
- Fixed bug in OS/8 file deletion which incorrectly reduced the directory
39+
file count by 1
40+
41+
- Fix ASCII mode read in OS/8 where it would read an entire block into
42+
memory rather than a single line. When copying to local:, this would
43+
result in the destination file having unexpected <CR> characters.
44+
45+
15-Feb-21
46+
47+
- Added support Research Unix V7 file systems of RK05, RL01 and RL02 drives
48+
using file system type "unixv7"
49+
50+
3-Mar-23
51+
52+
- Added support for RK06 and RK07 Unix V7 drives
53+
- Added support for creating arbitrary sized Unix V7 file systems
54+
55+
26-Sep-24
56+
57+
- Fixed display of System ID during RT-11 mount if there is non-zero data
58+
following the System ID on the disk
59+
60+
13-Nov-24
61+
62+
- Fixed OS/8 ASCII file read/write to to handle ^Z marking the end of file
63+
64+
28-Nov-24
65+
66+
- Fixed RT11 scan to find the size of the partition. The old code would
67+
incorrectly terminate on an EMPTY marker rather than END-OF-SEGMENT.
68+

converters/fsio/Makefile

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ INSTALL=install
77
CC=gcc
88

99
EXECUTABLE=fsio
10-
SOURCES=fsio.c declib.c tape.c dos11.c rt11.c dosmt.c local.c os8.c
11-
INCLUDES=fsio.h declib.h tape.h dos11.h rt11.h dosmt.h os8.h
10+
SOURCES=fsio.c declib.c tape.c dos11.c rt11.c dosmt.c local.c os8.c unixv7.c
11+
INCLUDES=fsio.h declib.h tape.h dos11.h rt11.h dosmt.h os8.h unixv7.h
1212
LIBS=-lreadline
1313
MANPAGE=fsio.1
1414
MANPAGE_DOS=fsio-dos11.1
1515
MANPAGE_RT=fsio-rt11.1
1616
MANPAGE_DOSMT=fsio-dosmt.1
1717
MANPAGE_OS8=fsio-os8.1
18+
MANPAGE_UNIXV7=fsio-unixv7.1
1819
ARCHIVE=fsio.tgz
1920

2021
RELEASEFILES=$(BIN)/$(EXECUTABLE)
@@ -23,8 +24,16 @@ RELEASEFILES+=$(MAN)/$(MANPAGE_DOS)
2324
RELEASEFILES+=$(MAN)/$(MANPAGE_RT)
2425
RELEASEFILES+=$(MAN)/$(MANPAGE_DOSMT)
2526
RELEASEFILES+=$(MAN)/$(MANPAGE_OS8)
27+
RELEASEFILES+=$(MAN)/$(MANPAGE_UNIXV7)
2628
RELEASEFILES+=./fsio.txt ./fsioSimh.txt
2729

30+
MANPAGES=$(MANPAGE)
31+
MANPAGES+=$(MANPAGE_DOS)
32+
MANPAGES+=$(MANPAGE_RT)
33+
MANPAGES+=$(MANPAGE_DOSMT)
34+
MANPAGES+=$(MANPAGE_OS8)
35+
MANPAGES+=$(MANPAGE_UNIXV7)
36+
2837
$(EXECUTABLE): $(SOURCES) $(INCLUDES) Makefile
2938
$(CC) $(CFLAGS) $(DEFINES) -o $(EXECUTABLE) $(SOURCES) $(LIBS)
3039

@@ -33,14 +42,15 @@ $(EXECUTABLE): $(SOURCES) $(INCLUDES) Makefile
3342
clean:
3443
rm -f $(EXECUTABLE)
3544

36-
install: $(EXECUTABLE) $(MANPAGE) $(MANPAGE_DOS) $(MANPAGE_RT)
45+
install: $(EXECUTABLE) $(MANPAGES)
3746
$(INSTALL) -p -m u=rx,g=rx,o=rx $(EXECUTABLE) $(BIN)
3847
mkdir -p $(MAN)
3948
$(INSTALL) -p -m u=r,g=r,o=r $(MANPAGE) $(MAN)
4049
$(INSTALL) -p -m u=r,g=r,o=r $(MANPAGE_DOS) $(MAN)
4150
$(INSTALL) -p -m u=r,g=r,o=r $(MANPAGE_RT) $(MAN)
4251
$(INSTALL) -p -m u=r,g=r,o=r $(MANPAGE_DOSMT) $(MAN)
4352
$(INSTALL) -p -m u=r,g=r,o=r $(MANPAGE_OS8) $(MAN)
53+
$(INSTALL) -p -m u=r,g=r,o=r $(MANPAGE_UNIXV7) $(MAN)
4454

4555
uninstall:
4656
rm -f $(BIN)/$(EXECUTABLE)
@@ -49,6 +59,7 @@ uninstall:
4959
rm -f $(MAN)/$(MANPAGE_RT)
5060
rm -f $(MAN)/$(MANPAGE_DOSMT)
5161
rm -f $(MAN)/$(MANPAGE_OS8)
62+
rm -f $(MAN)/$(MANPAGE_UNIXV7)
5263

5364
# This assumes that fsio has been "installed" on the current system
5465
archive: $(RELEASEFILES)

converters/fsio/dos11.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2018 John Forecast. All Rights Reserved.
2+
* Copyright (C) 2018 - 2025 John Forecast. All Rights Reserved.
33
*
44
* Redistribution and use in source and binary forms, with or without
55
* modification, are permitted provided that the following conditions are met:
@@ -2473,6 +2473,7 @@ struct FSdef dos11FS = {
24732473
dos11Umount,
24742474
dos11Size,
24752475
dos11Newfs,
2476+
NULL,
24762477
dos11Set,
24772478
dos11Info,
24782479
dos11Dir,

converters/fsio/dosmt.c

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2018 John Forecast. All Rights Reserved.
2+
* Copyright (C) 2018 - 2025 John Forecast. All Rights Reserved.
33
*
44
* Redistribution and use in source and binary forms, with or without
55
* modification, are permitted provided that the following conditions are met:
@@ -385,9 +385,21 @@ static int dosmtReadBytes(
385385
break;
386386
}
387387
}
388-
*buf++ = file->buf[file->nextb++];
389-
len--;
390-
count++;
388+
if (SWISSET('a')) {
389+
char ch = file->buf[file->nextb++] & 0177;
390+
391+
if ((ch != 0) && (ch != 0177)) {
392+
*buf++ = ch;
393+
count++;
394+
}
395+
len--;
396+
if (ch == '\n')
397+
break;
398+
} else {
399+
*buf++ = file->buf[file->nextb++];
400+
len--;
401+
count++;
402+
}
391403
}
392404
return count;
393405
}
@@ -982,6 +994,7 @@ static void *dosmtOpenFileW(
982994
file->nextb = 0;
983995
file->tm = 0;
984996
file->error = 0;
997+
memset(file->buf, 0, DOSMTRCLNT);
985998
}
986999
return file;
9871000
}
@@ -1015,8 +1028,8 @@ static off_t dosmtFileSize(
10151028
uint32_t length;
10161029

10171030
/*
1018-
* Compute the length of this file. The estimate may larger than the
1019-
* actual size of the file size don't know the actual EOF position
1031+
* Compute the length of this file. The estimate may be larger than the
1032+
* actual size of the file since we don't know the actual EOF position
10201033
* within the last block of the file.
10211034
*/
10221035
do {
@@ -1097,13 +1110,21 @@ static void dosmtCloseFile(
10971110

10981111
data->eot = tapeGetPosition(mount->container);
10991112

1100-
if (tapeWriteEOM(mount->container, 1) == 0)
1113+
/*
1114+
* Write 2 tape marks indicating the end of tape (DOS/BATCH requires
1115+
* 3 TM in a row, 1 for the EOF and the last 2 to indicate EOT) and then
1116+
* backup over the last 2 TMs.
1117+
*/
1118+
if ((tapeWriteTM(mount->container) == 0) ||
1119+
(tapeWriteTM(mount->container) == 0))
11011120
file->error = 1;
11021121

11031122
if (file->error != 0) {
11041123
ERROR("Panic: Error writing on \"%s\"\n", mount->name);
11051124
exit(3);
11061125
}
1126+
1127+
tapeSetPosition(mount->container, data->eot);
11071128
}
11081129

11091130
free(file);
@@ -1304,6 +1325,7 @@ struct FSdef dosmtFS = {
13041325
dosmtUmount,
13051326
NULL,
13061327
NULL,
1328+
NULL,
13071329
dosmtSet,
13081330
dosmtInfo,
13091331
dosmtDir,

converters/fsio/fsio-dos11.1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH FSIO-DOS11 1 "Jun 21,2019" "FFS I/O - DOS-11"
1+
.TH FSIO-DOS11 1 "Feb 14,2021" "FFS I/O - DOS-11"
22
.SH NAME
33
fsio-dos11 \- Foreign File System I/O - DOS-11
44
.br
@@ -14,6 +14,9 @@ group number and user number. Wildcard characters are only valid with the
1414
.SH NEWFS OPERATION
1515
\fInewfs\fP creates a blank RK05 image (2.5MB, 4800 blocks) with no UFD
1616
entries.
17+
.SH COPY OPERATION
18+
In ASCII mode ('-a'), characters will be converted to 7-bits and NULL and
19+
delete characters will not be copied.
1720
.SH SET OPERATION
1821
The following \fIset\fP commands are supported:
1922
.br
@@ -46,6 +49,7 @@ Creates an empty UFD and sets default UIC for file access.
4649
.BR fsio-rt11 (1)
4750
.BR fsio-dosmt (1)
4851
.BR fsio-os8 (1)
52+
.BR fsio-unixv7 (1)
4953
.SH AUTHOR
5054
John Forecast, <john@forecast.name>
5155
.br

converters/fsio/fsio-dosmt.1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH FSIO-DOSMT 1 "Jun 25,2019" "FFS I/O - DOS-11 magtape"
1+
.TH FSIO-DOSMT 1 "Feb 14,2021" "FFS I/O - DOS-11 magtape"
22
.SH NAME
33
fsio-dosmt \- Foreign File System I/O - DOS-11 magtape
44
.br
@@ -31,6 +31,9 @@ command, fsio will make use of the extra 3 characters on file lookup,
3131
directory listing and file creation.
3232
.SH NEWFS OPERATION
3333
\fInewfs\fP creates an empty (zero length) file.
34+
.SH COPY OPERATION
35+
In ASCII mode ('-a'), characters will be converted to 7-bits and NULL and
36+
delete characters will not be copied.
3437
.SH SET OPERATION
3538
The following \fIset\fP commands are supported:
3639
.br
@@ -106,6 +109,7 @@ determine the current tape position).
106109
.BR fsio-dos11 (1)
107110
.BR fsio-rt11 (1)
108111
.BR fsio-os8 (1)
112+
.BR fsio-unixv7 (1)
109113
.SH AUTHOR
110114
John Forecast, <john@forecast.name>
111115
.br

converters/fsio/fsio-os8.1

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH FSIO-OS8 1 "Sep 218,2019" "FFS I/O - OS/8"
1+
.TH FSIO-OS8 1 "Feb 14,2021" "FFS I/O - OS/8"
22
.SH NAME
33
fsio-os8 \- Foreign File System I/O - OS/8
44
.br
@@ -15,16 +15,16 @@ place multiple file systems on each physical device.
1515
.br
1616
OS/8 does not write any type of signature on the device and each device type
1717
has it's own partitioning scheme so the \fImount\fP command must use the
18-
"\fI-f type\fP switch so that \fBfsio\fP can determine the file system
18+
"\fI-t type\fP switch so that \fBfsio\fP can determine the file system
1919
layout. \fBfsio\fP uses a set of heuristics to verify the integrity of
2020
the OS/8 file system(s) but it is quite possible for a random disk to pass
2121
these tests and later crash \fBfsio\fP.
2222
.SH MOUNT OPERATION
23-
\fImount\fP requires the "\fI-f type\fP" switch so that it can determine the
23+
\fImount\fP requires the "\fI-t type\fP" switch so that it can determine the
2424
type of the underlying disk (See NEWFS OPERATION below for details).
2525
.SH NEWFS OPERATION
2626
\fInewfs\fP creates an RK05 disk image with 2 file systems. If the
27-
"\fI-f type\fP" switch is present a different container file will be created
27+
"\fI-t type\fP" switch is present a different container file will be created
2828
depending on the type of the device specified:
2929
.br
3030
.RS
@@ -75,6 +75,7 @@ the default state after mount.
7575
.BR fsio-dos11 (1)
7676
.BR fsio-dosmt (1)
7777
.BR fsio-rt11 (1)
78+
.BR fsio-unixv7 (1)
7879
.SH AUTHOR
7980
John Forecast, <john@forecast.name>
8081
.br

converters/fsio/fsio-rt11.1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH FSIO-RT11 1 "Jun 25,2019" "FFS I/O - RT-11"
1+
.TH FSIO-RT11 1 "Feb 14,2021" "FFS I/O - RT-11"
22
.SH NAME
33
fsio-rt11 \- Foreign File System I/O - RT-11
44
.br
@@ -84,6 +84,7 @@ No \fIset\fP commands are currently supported.
8484
.BR fsio-dos11 (1)
8585
.BR fsio-dosmt (1)
8686
.BR fsio-os8 (1)
87+
.BR fsio-unixv7 (1)
8788
.SH AUTHOR
8889
John Forecast, <john@forecast.name>
8990
.br

converters/fsio/fsio-unixv7.1

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
.TH FSIO-UNIXV7 1 "Mar 2,2023" "FFS I/O - UNIX V7"
2+
.SH NAME
3+
fsio-unixv7 \- Foreign File System I/O - Unix V7
4+
.br
5+
.SH DESCRIPTION
6+
\fBfsio\fP allows access to Unix V7 file systems using the file system type
7+
"\fIunixv7\fP". Note that you must use "\fI/etc/rawfs\fP" on Ultrix-11 3.0/3.1
8+
to access files on disks created by \fBfsio\fP.
9+
.br
10+
.SH UNIX V7 PHYSICAL DISKS
11+
UNIX V7 uses a logical block size of 512 bytes. \fBfsio\fP supports access to
12+
disks which have their super block stored at block 2. Unix V7 does not write
13+
any type of signature on the device so the \fImount\fP command uses a set of
14+
heuristics to determine if the file system is valid.
15+
.SH MOUNT OPERATION
16+
\fImount\fP accepts the optional "\fI-t type\fP" switch to provide an additonal
17+
check on the integrity of the file system (e.g. check for blocks addresses
18+
larger than the specified disk) (See NEWFS OPERATION below for details).
19+
.br
20+
21+
\fImount\fP also accepts the optional "\fI-o nnn\fP" switch where nnn is the
22+
block offset of the start of the partition to be mounted. Since most, if not
23+
all, UNIX V7 implementations hard code the partition layout for a specific
24+
disk within the device driver, you will have to examine the device driver
25+
code to calculate this offset.
26+
.SH NEWFS OPERATION
27+
\fInewfs\fP requires either the "\fI-b blocks\fP" or the "\fI-t type\fP" switch
28+
to determine the size of the container file to be created:
29+
.br
30+
.RS
31+
.TP
32+
\fIrk05\fP \- RK05 image (2436 blocks, 776 inodes)
33+
.br
34+
.TP
35+
\fIrl01\fP \- RL01 image (10240 blocks, 3272 inodes)
36+
.br
37+
.TP
38+
\fIrl02\fP \- RL02 image (20480 blocks, 6552 inodes)
39+
.br
40+
.TP
41+
\fIrk06\fP \- RK06 image (27126 blocks, 8680 inodes)
42+
.br
43+
.TP
44+
\fIrk07\fP \- RK07 image (53790 blocks, 17208 inodes)
45+
.br
46+
.RE
47+
.br
48+
49+
If neither switch is present, an RK05-sized disk will be created.
50+
.br
51+
52+
By default, inodes occupy 4% of the disk space. This can be overridden by
53+
using the "\fI-i num\fP" switch, where \fInum\fP can be in the range 8 - 65500
54+
and the resulting inode space cannot occupy more than 50% of the disk space
55+
(8 inodes consume 1 disk block).
56+
.br
57+
.SH SET OPERATION
58+
The following \fIset\fP commands are supported:
59+
.br
60+
.TP
61+
.B "\fIuid\fP n"
62+
Sets the default UID for created files and directories (was 0 after mount).
63+
.TP
64+
.B "\fIgid\fP n"
65+
Sets the default GID for created files and directories (was 0 after mount).
66+
.SH SEE ALSO
67+
.BR fsio (1)
68+
.BR fsio-dos11 (1)
69+
.BR fsio-dosmt (1)
70+
.BR fsio-os8 (1)
71+
.BR fsio-rt11 (1)
72+
.SH AUTHOR
73+
John Forecast, <john@forecast.name>
74+
.br

0 commit comments

Comments
 (0)