All manual pages added to manifest file.
This commit is contained in:
@@ -14,7 +14,7 @@ SUBDIR = adb adc-demo aout ar as awk basic cc chflags chpass \
|
||||
cpp dc diff emg env fdisk find forth fstat glcdtest \
|
||||
hostname id la lcc lcpp ld ls login make man med \
|
||||
more nm passwd picoc portio printf pwm \
|
||||
rdprof ranlib re renice retroforth scm setty sl \
|
||||
ranlib re renice retroforth scm setty sl \
|
||||
sed sh smallc smlrc stty sysctl test uname wiznet xargs \
|
||||
zmodem gtest msec unixbench cron compress date2 tip \
|
||||
talloc devupdate uucp smux
|
||||
|
||||
@@ -7,11 +7,11 @@ TOPSRC = $(shell cd ../../..; pwd)
|
||||
|
||||
include $(TOPSRC)/target.mk
|
||||
OBJS = main.o
|
||||
CFLAGS += -g -Werror -Wall -Os
|
||||
|
||||
#include $(TOPSRC)/cross.mk
|
||||
#OBJS = cross.o
|
||||
|
||||
CFLAGS += -g -Werror -Wall -Os
|
||||
#CFLAGS += -g -Werror -Wall
|
||||
|
||||
# The program itself
|
||||
#
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/inode.h>
|
||||
#include <sys/fs.h>
|
||||
@@ -30,69 +31,10 @@ usage ()
|
||||
printf (" -t file Filename for temporary data.\n");
|
||||
}
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
struct fstab *fsp;
|
||||
int pid, passno, anygtr, sumstatus;
|
||||
char *name, inbuf[128], outbuf[128];
|
||||
|
||||
setbuffer(stdin, inbuf, sizeof (inbuf));
|
||||
setbuffer(stdout, outbuf, sizeof (outbuf));
|
||||
setlinebuf(stdout);
|
||||
sync();
|
||||
|
||||
while (--argc > 0 && **++argv == '-') {
|
||||
switch (*++*argv) {
|
||||
|
||||
case 't':
|
||||
if (**++argv == '-' || --argc <= 0)
|
||||
errexit("Bad -t option\n");
|
||||
strcpy(scrfile, *argv);
|
||||
break;
|
||||
|
||||
case 'd':
|
||||
debug++;
|
||||
break;
|
||||
|
||||
case 'n': /* default no answer flag */
|
||||
nflag++;
|
||||
yflag = 0;
|
||||
break;
|
||||
|
||||
case 'y': /* default yes answer flag */
|
||||
yflag++;
|
||||
nflag = 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
errexit("%c option?\n", **argv);
|
||||
}
|
||||
}
|
||||
if (argc == 0) {
|
||||
usage();
|
||||
return 0;
|
||||
}
|
||||
|
||||
memsize = sizeof (memdata);
|
||||
membase = memdata;
|
||||
|
||||
if (signal(SIGINT, SIG_IGN) != SIG_IGN)
|
||||
(void)signal(SIGINT, catch);
|
||||
if (preen)
|
||||
(void)signal(SIGQUIT, catchquit);
|
||||
while (argc-- > 0) {
|
||||
hotroot = 0;
|
||||
checkfilesys(*argv++);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
checkfilesys(filesys)
|
||||
char *filesys;
|
||||
{
|
||||
daddr_t n_ffree, n_bfree;
|
||||
register ino_t *zp;
|
||||
|
||||
devnam = filesys;
|
||||
@@ -195,3 +137,61 @@ checkfilesys(filesys)
|
||||
exit(4);
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
char inbuf[128], outbuf[128];
|
||||
|
||||
setbuffer(stdin, inbuf, sizeof (inbuf));
|
||||
setbuffer(stdout, outbuf, sizeof (outbuf));
|
||||
setlinebuf(stdout);
|
||||
sync();
|
||||
|
||||
while (--argc > 0 && **++argv == '-') {
|
||||
switch (*++*argv) {
|
||||
|
||||
case 't':
|
||||
if (**++argv == '-' || --argc <= 0)
|
||||
errexit("Bad -t option\n");
|
||||
strcpy(scrfile, *argv);
|
||||
break;
|
||||
|
||||
case 'd':
|
||||
debug++;
|
||||
break;
|
||||
|
||||
case 'n': /* default no answer flag */
|
||||
nflag++;
|
||||
yflag = 0;
|
||||
break;
|
||||
|
||||
case 'y': /* default yes answer flag */
|
||||
yflag++;
|
||||
nflag = 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
errexit("%c option?\n", **argv);
|
||||
}
|
||||
}
|
||||
if (argc == 0) {
|
||||
usage();
|
||||
return 0;
|
||||
}
|
||||
|
||||
memsize = sizeof (memdata);
|
||||
membase = memdata;
|
||||
|
||||
if (signal(SIGINT, SIG_IGN) != SIG_IGN)
|
||||
(void)signal(SIGINT, catch);
|
||||
if (preen)
|
||||
(void)signal(SIGQUIT, catchquit);
|
||||
while (argc-- > 0) {
|
||||
hotroot = 0;
|
||||
checkfilesys(*argv++);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -5,10 +5,9 @@
|
||||
*/
|
||||
#ifdef CROSS
|
||||
#include </usr/include/stdio.h>
|
||||
#define off_t unsigned long long
|
||||
//#define off_t unsigned long long
|
||||
#else
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -23,6 +22,8 @@
|
||||
#include <sys/swap.h>
|
||||
#include "fsck.h"
|
||||
|
||||
#define isspace(n) (n==' ' || n=='\t')
|
||||
|
||||
int returntosingle;
|
||||
|
||||
int
|
||||
|
||||
@@ -8,9 +8,8 @@ CFLAGS += -Werror -I../../../sys/include
|
||||
|
||||
SRCS = glcdtest.c
|
||||
OBJS = glcdtest.o
|
||||
MAN = glcdtest.0
|
||||
|
||||
all: glcdtest ${MAN}
|
||||
all: glcdtest
|
||||
|
||||
glcdtest: ${OBJS}
|
||||
${CC} ${LDFLAGS} -o glcdtest.elf ${OBJS} ${LIBS}
|
||||
@@ -20,11 +19,8 @@ glcdtest: ${OBJS}
|
||||
|
||||
.SUFFIXES: .0 .1
|
||||
|
||||
.1.0:
|
||||
${MANROFF} $*.1 > $@
|
||||
|
||||
clean:
|
||||
rm -f *.o *.elf ${MAN} *.elf *.dis tags *~ glcdtest
|
||||
rm -f *.o *.elf *.elf *.dis tags *~ glcdtest
|
||||
|
||||
depend: ${SRCS}
|
||||
mkdep ${CFLAGS} ${SRCS}
|
||||
|
||||
@@ -8,9 +8,8 @@ CFLAGS += -Wall -Werror -I../../../sys/include
|
||||
|
||||
SRCS = pwm.c
|
||||
OBJS = pwm.o
|
||||
MAN = pwm.0
|
||||
|
||||
all: pwm ${MAN}
|
||||
all: pwm
|
||||
|
||||
pwm: ${OBJS}
|
||||
${CC} ${LDFLAGS} -o pwm.elf ${OBJS} ${LIBS}
|
||||
@@ -20,11 +19,8 @@ pwm: ${OBJS}
|
||||
|
||||
.SUFFIXES: .0 .1
|
||||
|
||||
.1.0:
|
||||
${MANROFF} $*.1 > $@
|
||||
|
||||
clean:
|
||||
rm -f *.o *.elf ${MAN} *.elf *.dis tags *~ pwm
|
||||
rm -f *.o *.elf *.elf *.dis tags *~ pwm
|
||||
|
||||
depend: ${SRCS}
|
||||
mkdep ${CFLAGS} ${SRCS}
|
||||
|
||||
1
src/cmd/rdprof/.gitignore
vendored
1
src/cmd/rdprof/.gitignore
vendored
@@ -1 +0,0 @@
|
||||
rdprof
|
||||
@@ -1,40 +0,0 @@
|
||||
#
|
||||
# Public Domain. 1995/03/13 - Steven Schultz
|
||||
#
|
||||
TOPSRC = $(shell cd ../../..; pwd)
|
||||
include $(TOPSRC)/target.mk
|
||||
|
||||
CFLAGS += -Werror -I../../../sys/include
|
||||
|
||||
BIN = rdprof
|
||||
SRCS = $(BIN).c
|
||||
OBJS = $(BIN).o
|
||||
MAN = $(BIN).0
|
||||
|
||||
all: $(BIN) ${MAN}
|
||||
|
||||
$(BIN): ${OBJS}
|
||||
${CC} ${LDFLAGS} -o $@.elf ${OBJS} ${LIBS}
|
||||
${OBJDUMP} -S $@.elf > $@.dis
|
||||
${SIZE} $@.elf
|
||||
${ELF2AOUT} $@.elf $@
|
||||
|
||||
.SUFFIXES: .0 .1
|
||||
|
||||
.1.0:
|
||||
${MANROFF} $*.1 > $@
|
||||
|
||||
clean:
|
||||
rm -f *.o *.elf ${MAN} *.elf *.dis tags *~ $(BIN)
|
||||
|
||||
depend: ${SRCS}
|
||||
mkdep ${CFLAGS} ${SRCS}
|
||||
|
||||
install: all
|
||||
install -m 755 $(BIN) ${DESTDIR}/sbin
|
||||
|
||||
lint: ${SRCS}
|
||||
lint -hax ${SRCS}
|
||||
|
||||
tags: ${SRCS}
|
||||
ctags ${SRCS}
|
||||
@@ -1,196 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/rdisk.h>
|
||||
#include <time.h>
|
||||
|
||||
void usage()
|
||||
{
|
||||
printf("Usage: rdprof [-w] [-s <blocksize>] [-r repeat] [-b blocks] -d <device>\n");
|
||||
exit(10);
|
||||
}
|
||||
|
||||
int numblocks(int fd)
|
||||
{
|
||||
int size=0;
|
||||
ioctl(fd,RDGETMEDIASIZE,&size);
|
||||
return size;
|
||||
}
|
||||
|
||||
void read_test(char *dev, unsigned int blocks, int blocksize, int repeats)
|
||||
{
|
||||
int fd;
|
||||
int size;
|
||||
char buffer[blocksize];
|
||||
unsigned int toread;
|
||||
unsigned int start_time;
|
||||
unsigned int end_time;
|
||||
unsigned int time_taken;
|
||||
int i;
|
||||
float bps;
|
||||
|
||||
fd = open(dev,O_RDONLY);
|
||||
|
||||
if(!fd)
|
||||
{
|
||||
printf("Error: unable to open %s for reading.\n",dev);
|
||||
exit(10);
|
||||
}
|
||||
size = numblocks(fd);
|
||||
if(size==0)
|
||||
{
|
||||
printf("Error: unable to get media size.\n");
|
||||
close(fd);
|
||||
exit(0);
|
||||
}
|
||||
if(blocks>size)
|
||||
{
|
||||
printf("More blocks requested than media size. Reducing.\n");
|
||||
blocks = size;
|
||||
}
|
||||
if(blocks==0)
|
||||
{
|
||||
blocks=size;
|
||||
}
|
||||
|
||||
printf("Testing read of %s from 0 to %d with %d byte blocks...\n",
|
||||
dev,blocks-1,blocksize);
|
||||
|
||||
start_time = msec();
|
||||
for(i=0; i<repeats; i++)
|
||||
{
|
||||
lseek(fd,0,SEEK_SET);
|
||||
toread = blocks * 1024;
|
||||
while(toread > 0)
|
||||
{
|
||||
if(toread>blocksize)
|
||||
{
|
||||
toread -= read(fd,buffer,blocksize);
|
||||
} else {
|
||||
toread -= read(fd,buffer,toread);
|
||||
}
|
||||
}
|
||||
}
|
||||
end_time = msec();
|
||||
close(fd);
|
||||
time_taken = end_time - start_time;
|
||||
bps = (float)((blocks*repeats) * 1024) / ((float)time_taken / 1000.0);
|
||||
|
||||
printf("Time taken: %f seconds. Speed: %f KBytes/second\n",
|
||||
time_taken / 1000.0, bps/1024.0);
|
||||
}
|
||||
|
||||
void write_test(char *dev, unsigned int blocks, int blocksize, int repeats)
|
||||
{
|
||||
int fd;
|
||||
int size;
|
||||
char buffer[blocksize];
|
||||
unsigned int towrite;
|
||||
unsigned int start_time;
|
||||
unsigned int end_time;
|
||||
unsigned int time_taken;
|
||||
int i;
|
||||
float bps;
|
||||
|
||||
for(size=0; size<blocksize; size++)
|
||||
{
|
||||
buffer[size]=size;
|
||||
}
|
||||
|
||||
fd = open(dev,O_RDWR);
|
||||
|
||||
if(!fd)
|
||||
{
|
||||
printf("Error: unable to open %s for writing.\n",dev);
|
||||
exit(10);
|
||||
}
|
||||
size = numblocks(fd);
|
||||
if(size==0)
|
||||
{
|
||||
printf("Error: unable to get media size.\n");
|
||||
close(fd);
|
||||
exit(0);
|
||||
}
|
||||
if(blocks>size)
|
||||
{
|
||||
printf("More blocks requested than media size. Reducing.\n");
|
||||
blocks = size;
|
||||
}
|
||||
if(blocks==0)
|
||||
{
|
||||
blocks=size;
|
||||
}
|
||||
|
||||
printf("Testing write of %s from 0 to %d with %d byte blocks...\n",
|
||||
dev,blocks-1,blocksize);
|
||||
|
||||
start_time = msec();
|
||||
for(i=0; i<repeats; i++)
|
||||
{
|
||||
lseek(fd,0,SEEK_SET);
|
||||
towrite = blocks * 1024;
|
||||
while(towrite > 0)
|
||||
{
|
||||
if(towrite>blocksize)
|
||||
{
|
||||
towrite -= write(fd,buffer,blocksize);
|
||||
} else {
|
||||
towrite -= write(fd,buffer,towrite);
|
||||
}
|
||||
}
|
||||
}
|
||||
end_time = msec();
|
||||
close(fd);
|
||||
time_taken = end_time - start_time;
|
||||
bps = (float)((blocks*repeats) * 1024) / ((float)time_taken / 1000.0);
|
||||
|
||||
printf("Time taken: %f seconds. Speed: %f KBytes/second\n",
|
||||
time_taken / 1000.0, bps/1024.0);
|
||||
}
|
||||
|
||||
void main(int argc, char *argv[])
|
||||
{
|
||||
int opt;
|
||||
unsigned char write_enable = 0;
|
||||
char *device = NULL;
|
||||
unsigned int blocks = 0;
|
||||
int blocksize = 1024;
|
||||
int repeats = 1;
|
||||
|
||||
printf("RetroDisk Profiler\n");
|
||||
|
||||
while((opt = getopt(argc,argv,"wd:b:s:r:"))!=-1)
|
||||
{
|
||||
switch(opt)
|
||||
{
|
||||
case 'w':
|
||||
printf("Write tests enabled!\n");
|
||||
write_enable=1;
|
||||
break;
|
||||
case 'd':
|
||||
device = optarg;
|
||||
break;
|
||||
case 'b':
|
||||
blocks = atoi(optarg);
|
||||
break;
|
||||
case 's':
|
||||
blocksize = atoi(optarg);
|
||||
break;
|
||||
case 'r':
|
||||
repeats = atoi(optarg);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(device==NULL)
|
||||
{
|
||||
usage();
|
||||
}
|
||||
|
||||
read_test(device,blocks,blocksize,repeats);
|
||||
if(write_enable==1)
|
||||
write_test(device,blocks,blocksize,repeats);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user