diff options
author | abial <abial@FreeBSD.org> | 1999-02-12 20:36:13 +0000 |
---|---|---|
committer | abial <abial@FreeBSD.org> | 1999-02-12 20:36:13 +0000 |
commit | 35ae892d35e97cc238430bf3e32169128149f546 (patch) | |
tree | bb7a4b243a657d86bc84571a2b73ab96f25a2afe /release/picobsd/tinyware | |
parent | a36bb76941a692c75575f75edde8496549fcc44b (diff) | |
download | FreeBSD-src-35ae892d35e97cc238430bf3e32169128149f546.zip FreeBSD-src-35ae892d35e97cc238430bf3e32169128149f546.tar.gz |
Merge from RELENG_3.
Diffstat (limited to 'release/picobsd/tinyware')
-rw-r--r-- | release/picobsd/tinyware/kget/README | 4 | ||||
-rw-r--r-- | release/picobsd/tinyware/kget/kget.c | 59 | ||||
-rw-r--r-- | release/picobsd/tinyware/simple_httpd/Makefile | 3 | ||||
-rw-r--r-- | release/picobsd/tinyware/simple_httpd/README | 25 | ||||
-rw-r--r-- | release/picobsd/tinyware/simple_httpd/simple_httpd.c | 54 |
5 files changed, 112 insertions, 33 deletions
diff --git a/release/picobsd/tinyware/kget/README b/release/picobsd/tinyware/kget/README index 9490dd7..967356d 100644 --- a/release/picobsd/tinyware/kget/README +++ b/release/picobsd/tinyware/kget/README @@ -28,7 +28,7 @@ In simplest form you can do kget - -to list current in-core parameters, or +to list on stdout changes from original configuration, and kget /kernel.config @@ -38,4 +38,4 @@ it to /kernel.config file - it already contains required keywords. Andrzej Bialecki <abial@freebsd.org> -$Id: README,v 1.3 1998/11/01 20:19:40 abial Exp $ +$Id: README,v 1.4 1999/01/08 21:09:42 abial Exp $ diff --git a/release/picobsd/tinyware/kget/kget.c b/release/picobsd/tinyware/kget/kget.c index b8426e4..a7bd46c 100644 --- a/release/picobsd/tinyware/kget/kget.c +++ b/release/picobsd/tinyware/kget/kget.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: kget.c,v 1.1 1999/01/08 21:09:42 abial Exp $ + * $Id: kget.c,v 1.2.2.1 1999/02/12 20:14:47 abial Exp $ */ #include <stdio.h> @@ -31,8 +31,10 @@ #include <sys/types.h> #include <sys/sysctl.h> #include "i386/isa/isa_device.h" +#include "i386/isa/pnp.h" struct isa_device *id; +struct pnp_cinfo *c; char *p; int @@ -40,7 +42,8 @@ main(int argc, char *argv[]) { int len,i; char *buf; - char *mib="machdep.uc_devlist"; + char *mib1="machdep.uc_devlist"; + char *mib2="machdep.uc_pnplist"; char name[9]; FILE *fout; @@ -60,14 +63,15 @@ main(int argc, char *argv[]) /* We use sysctlbyname, because the oid is unknown (OID_AUTO) */ + /* First, print the changes made to ISA devices */ /* get the buffer size */ - i=sysctlbyname(mib,NULL,&len,NULL,NULL); + i=sysctlbyname(mib1,NULL,&len,NULL,NULL); if(i) { perror("buffer sizing"); exit(-1); } buf=(char *)malloc(len*sizeof(char)); - i=sysctlbyname(mib,buf,&len,NULL,NULL); + i=sysctlbyname(mib1,buf,&len,NULL,NULL); if(i) { perror("retrieving data"); exit(-1); @@ -106,6 +110,53 @@ main(int argc, char *argv[]) } i+=sizeof(struct isa_device)+8; } + free(buf); + /* Now, print the changes to PnP override table */ + /* get the buffer size */ + i=sysctlbyname(mib2,NULL,&len,NULL,NULL); + if(i) { + perror("buffer sizing"); + exit(-1); + } + buf=(char *)malloc(len*sizeof(char)); + i=sysctlbyname(mib2,buf,&len,NULL,NULL); + if(i) { + perror("retrieving data"); + exit(-1); + } + i=0; + /* Print the PnP override table. Taken from userconfig.c */ + do { + c = (struct pnp_cinfo *)(buf+i); + if (c->csn >0 && c->csn != 255) { + int pmax, mmax; + char buf1[256]; + + if(c->enable==0) { + fprintf(fout,"pnp %d %d disable\n", + c->csn, c->ldn); + continue; + } + fprintf(fout,"pnp %d %d %s irq0 %d irq1 %d drq0 %d drq1 %d", + c->csn, c->ldn, + c->override ? "os":"bios", + c->irq[0], c->irq[1], c->drq[0], c->drq[1]); + if (c->flags) + fprintf(fout," flags 0x%lx",c->flags); + pmax=0; + while(c->port[pmax]!=0 && pmax<8) { + fprintf(fout," port%d %d",pmax,c->port[pmax]); + pmax++; + } + mmax=0; + while(c->mem[mmax].base!=0 && mmax<8) { + fprintf(fout," mem%d %d",mmax,c->mem[mmax].base); + mmax++; + } + fprintf(fout,"\n"); + } + + } while ((i+=sizeof(struct pnp_cinfo))<len); fprintf(fout,"q\n"); fclose(fout); free(buf); diff --git a/release/picobsd/tinyware/simple_httpd/Makefile b/release/picobsd/tinyware/simple_httpd/Makefile index 10ea6df..1c36b52 100644 --- a/release/picobsd/tinyware/simple_httpd/Makefile +++ b/release/picobsd/tinyware/simple_httpd/Makefile @@ -1,7 +1,8 @@ -# $Id: Makefile,v 1.1 1998/08/31 13:10:25 abial Exp $ +# $Id: Makefile,v 1.2.2.1 1999/02/05 12:21:41 abial Exp $ # PROG=simple_httpd SRCS= simple_httpd.c +CFLAGS+=-g NOMAN=yes .include <bsd.prog.mk> diff --git a/release/picobsd/tinyware/simple_httpd/README b/release/picobsd/tinyware/simple_httpd/README index ef0956e..a73d2bf 100644 --- a/release/picobsd/tinyware/simple_httpd/README +++ b/release/picobsd/tinyware/simple_httpd/README @@ -1,6 +1,23 @@ -Contributed by Marc Nicholas <marc@netstor.com> +This is a small HTTP server. This version is under BSD license. +It's very simple, yet sufficient for serving basic Web contents, +including ability to run CGI scripts. -This is a simple HTTP server. It is free for non-commercial -use only - see the source code for info on commercial licensing. +How to use it? +============== -$Id: README,v 1.1.1.1 1998/08/27 17:38:45 abial Exp $ +Compile, and run: + + simple_httpd <port> + +If you're root, the document directory will be /httphome. If you're +not, then first of all you need to use the <port> option (>1023). +Then, the document root will be ${HOME}/httphome. + +Log messages will be written out to /var/log/jhttpd.log . + +Credits +======= + +This program was contributed by Marc Nicholas <marc@netstor.com> + +$Id: README,v 1.2.2.1 1999/02/05 12:21:41 abial Exp $ diff --git a/release/picobsd/tinyware/simple_httpd/simple_httpd.c b/release/picobsd/tinyware/simple_httpd/simple_httpd.c index 5b02244..8e7c55b 100644 --- a/release/picobsd/tinyware/simple_httpd/simple_httpd.c +++ b/release/picobsd/tinyware/simple_httpd/simple_httpd.c @@ -1,19 +1,31 @@ -/* simpleHTTPd (C) 1998 netSTOR Technologies, Inc. ("netSTOR") - FreeBSD port and additional work by Marc Nicholas <marc@netstor.com> - Based on work by:- - Thierry Leconte & Yury Shimanovsky - My Russian webserver writing friends :-) - - This is an HTTP daemon that will serve up HTML, text files, JPEGs, - GIFs and do simple CGI work. - - You may use this code for non-commercial distribution only. Commercial - distribution requires the express, written permission of netSTOR. No - warranty is implied or given -- use at your own risk! -*/ - -/* - * $Id: simple_httpd.c,v 1.1.1.1 1998/08/27 17:38:45 abial Exp $ +/*- + * SimpleHTTPd v1.0 - a very small, barebones HTTP server + * + * Copyright (c) 1998-1999 Marc Nicholas <marc@netstor.com> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $Id: simple_httpd.c,v 1.2.2.1 1999/02/05 12:21:41 abial Exp $ */ #include <stdio.h> @@ -31,7 +43,6 @@ #include <string.h> #include <signal.h> #include <sys/wait.h> -#define LOGDIR "/var/log" int http_sock, con_sock; int http_port = 80; @@ -130,7 +141,7 @@ traite_req() strcat(logfile,"/"); strcat(logfile,"jhttp.log"); } - else strcpy(logfile, LOGDIR "/jhttpd.log"); + else strcpy(logfile,"/var/log/jhttpd.log"); if ( access(logfile,W_OK)) { @@ -350,9 +361,8 @@ char *adate() struct tm *t; time(&now); t = localtime(&now); - - sprintf(out, "%4d/%02d/%02d %02d:%02d:%02d", - t->tm_year+1900, t->tm_mon+1, t->tm_mday, - t->tm_hour, t->tm_min, t->tm_sec ); + sprintf(out, "%02d:%02d:%02d %02d/%02d/%02d", + t->tm_hour, t->tm_min, t->tm_sec, + t->tm_mday, t->tm_mon+1, t->tm_year ); return out; } |