Digital Research
This commit is contained in:
2020-11-06 18:50:37 +01:00
parent 621ed8ccaf
commit 31738079c4
8481 changed files with 1888323 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
vax b:readme.doc $$frants
vax b:serial.c $$frants
vax b:serial.dat $$frants
vax b:sernotes.doc $$frants

View File

@@ -0,0 +1,34 @@
The serialization program needs the following function in CLIB:
alrem
The compiler generates jsr alrem instead of jsr _alrem.
Solution -----> add another label to CLIB called alrem: pointing
to _alrem.
A>c serial
A>clink serial
A>serial 1 10000
Put files to serialize in a file called : SERIAL.DAT.
EX> pip.rel
stat.rel
ed.rel
nm68.rel
.
.
.
cpm.rel

View File

@@ -0,0 +1,269 @@
/*----------------------------------------------------------------------*\
| serial.c v1.0 |
| SERIALIZATION PROGRAM FOR CP/M-68K |
| ================================== |
| |
| date: 1/3/83 |
| ---- |
| |
| last modified: 2/3/83 |
| ------------- |
| |
| description: |
| ----------- This program replaces up to 20 occurances |
| of "654321" in all files found in "SERIAL.DAT". |
| The string "654321" is replaced by a serial |
| number. Leading zeros will be filled in by |
| the program. The starting and ending serial |
| number's are read in from the command line. |
| The user is prompted for the serialization |
| drive. |
| |
| |
| COPYRIGHT (C) 1983 |
| DIGITAL RESEARCH |
| BOX 579 |
| PACIFIC GROVE, CA. 93950 |
| |
\*----------------------------------------------------------------------*/
#include "stdio.h" /* standard I/O library */
#define islower(c) ('a' <= (c) && (c) <= 'z')
#define toupper(c) (islower(c) ? ((c)-040) : (c))
#define RESET 13
#define SELECT 14
/********************************/
/* GLOBAL VARIABLES */
struct _serial /********************************/
{ /* */
BYTE filename[13]; /* file to serialize */
}; /* */
struct _serial serial[150]; /* array of structures */
/* */
BYTE enddata[] = "xxxxxxxxxxxx"; /* end of filenames marker */
BYTE marker[] = "654321"; /* place in file to sub serial #*/
BYTE snum[] = "000000"; /* serial number */
BYTE drive = 0; /* serialization drive */
BYTE chtab[] = "0123456789"; /* table of digits */
FILE *stream; /* pointer to a stream file */
/********************************/
/********************************/
/* FUNCTIONS */
/********************************/
FILE *fopen(); /* returns a stream I/O pointer */
FILE *fopenb(); /* returns a stream I/O pointer */
BYTE *trans(); /* returns a pointer to a string*/
LONG atol(); /* returns a long number */
LONG ftell(); /* returns a long number */
/********************************/
main(argc,argv)
WORD argc;
BYTE *argv[];
{
REG LONG start_num; /* starting serial number */
REG LONG final_num; /* final serial number */
REG LONG num; /* current serial number */
BYTE buffer[32]; /* read buffer */
BYTE boot; /* y or n to system tracks */
if(argc != 3)
{
printf("\nUsage: A>serial starting ending");
exit(0);
}
printf("Serial.68K V1.0");
init(); /* try to open data file */
boot = 'N'; /* no serializing of system trks*/
/* check range of serial number's */
if(atol(argv[1]) > 999999L || atol(argv[2]) > 999999L ||
atol(argv[1]) < 0L || atol(argv[2]) < 0L)
{
printf("\nERROR: Serial # out of range: [0-999999]");
exit(0);
}
printf("\nSerialization drive ? "); gets(buffer);
drive = toupper(buffer[0]);
/* verify to user the serial number range */
printf("\nSTARTING serial number is: %s",argv[1]);
printf("\nFINAL serial number is : %s",argv[2]);
if(boot == 'Y')
printf("\nSystem tracks will be serialized");
printf("\n\n");
/************************************************/
/* */
/* MAIN SERIALIZATION LOOP */
/* ----------------------- */
/* */
/************************************************/
for(num = atol(argv[1]); num <= atol(argv[2]); num++)
{
__BDOS(RESET,(long)0);
printf("\n\nInsert new diskette in drive %c and type RETURN",drive);
getchar();
printf("\nCURRENT serial number is: %LD\n",num);
if(boot == 'Y')
boottrk(num);
patch(num);
}
}
/************************/
VOID init() /* Open SERIAL.DAT */
/* Read SERIAL.DAT */
/************************/
{
BYTE buf[40];
REG UWORD j;
REG struct _serial *p;
if((stream = fopen("SERIAL.DAT","r")) == NULL)
{
printf("\nUnable to open SERIAL.DAT");
exit(0);
}
/* read in the data line by line */
/* and fill the structure serial */
fgets(buf,40,stream);
p = &serial;
do
{
j = 0;
while((p->filename[j] = buf[j++]) != '\n');
p->filename[j-1] = '\0';
p++;
fgets(buf,40,stream);
}
while(!(feof(stream)));
for(j = 0;j < 12;j++)
p->filename[j] = 'x';
p->filename[12] = '\0';
fclose(stream);
}
/************************/
VOID patch(num) /* Plug Serialization */
/* bytes into file */
/************************/
LONG num;
{
REG struct _serial *p;
REG UWORD i,j;
LONG offset[21];
REG BYTE *pp;
REG UWORD ch;
REG WORD fd;
__BDOS(SELECT,(long)drive-'A');
p = &serial;
while(strcmp(p,enddata))
{
printf("\nSerializing: %s ",p);
for(i = 1;i <= (12 - strlen(p));i++)
printf(" ");
if((stream = fopenb(p,"r")) == NULL)
printf("Unable to open file: %s",p);
else
{
for(j = 0;j < 21;j++)
offset[j] = -1L;
i = j = 0;
pp = marker;
rewind(stream);
while(1)
{
ch = fgetc(stream);
if(feof(stream))
break;
if(ch == *pp)
{
i++;
if(pp == marker)
offset[j] = ftell(stream);
pp++;
}
else
{
pp = marker;
offset[j] = -1L;
i = 0;
}
if(i == 6)
{
j++;
if(j == 20)
break;
i = 0;
pp = marker;
}
}
fclose(stream);
if(offset[0] == -1L)
printf("file cannot be serialized");
else
{
fd = openb(p, 2);
if ( fd == -1 ) printf("cannot write to file");
else
{
j = 0;
while(offset[j] != -1L)
{
lseek(fd, --offset[j++], 0);
write(fd, trans(num), 6);
}
printf("Serialization complete %d",j);
close(fd);
}
}
}
p++;
}
}
VOID boottrk(num)
LONG num;
{
printf("\nSerializing Boot tracks");
}
BYTE *trans(num)
LONG num;
{
REG BYTE *p;
LONG x;
p = snum;
x = 100000;
while(x)
{
*p++ = chtab[num/x];
num %= x;
x /= 10;
}
return(snum);
}

View File

@@ -0,0 +1,8 @@
ed.68k
pip.68k
stat.68k
clib
nm68.68k
sendc68.68k
cpmlib

View File

@@ -0,0 +1,53 @@
CP/M-68K RELEASE SOFTWARE
========================= 1/19/83
DIRECTORY FILES THAT HAVE XXXX-0000-654321
========= ================================
AS68.DIR MAIN.C
CCP.DIR NONE
DOCS.DIR NONE
PIPEDSTAT.DIR UT68K.SA
TOOLS.DIR COPY.C
INIT.S
FORMAT.S
BDOS.DIR BDOSMISC.C
CGEN.DIR MAIN.C
KLIB.DIR NONE
PREPROC.DIR MAIN.C
BIOS.DIR NONE
CLIB.DIR COPYRT.S
LINK.DIR RELOC.C
SIZE68.C
AR68.C
LO68.C
DUMP.C
SENDC68.C
NM68.C
RELNOTES.DIR NONE
VMSLIB.DIR NONE
BOOT.DIR BDOSMAIN.C
DDT.DIR DDT1.C
DDTLOAD.S
PARSER.DIR MAIN.C
SERIAL.DIR NONE