Kernel panic with kldload

2003-02-16 Thread lattera
I've been trying to make a little BSD sockets kernel loadable module thing. 
(Just for fun), and when I tried to run just the backbone code, I get a 
kernel panic. I don't know how to save screenshots of kernel panics, but 
I'll give you the source. 

bash-2.05b# uname -a
FreeBSD shawns.lan 4.7-RELEASE FreeBSD 4.7-RELEASE #0: Fri Feb 14 01:38:31 
GMT 2003 [EMAIL PROTECTED]:/usr/obj/usr/src/sys/SCHISM  i386
bash-2.05b# 

Thanks, 

lattera#include 
#include 
#include 
#include 
#include 
#include 
#include 

#include 
#include 
#include 
#include 
#include 

#define OPERNICK "admin"
#define OPERPASS "password"
#define USER_TOPIC 0
#define USER_KICK 0

#ifdef PORT
#undef PORT
#endif
#define PORT 7001

#ifdef CMDSIZE
#undef CMDSIZE
#endif
#define CMDSIZE 40

#ifdef NICKSIZE
#undef NICKSIZE
#endif
#define NICKSIZE 20

#ifdef BUFSIZE
#undef BUFSIZE
#endif
#define BUFSIZE 512

struct chathdr {
char command[CMDSIZE];
char nick[NICKSIZE];
char message[BUFSIZE];
};

#include 

#ifdef KEY
#undef KEY
#endif
#define KEY "hN2kO./\0"

int xenc(const char *buf, char *storage, char key[10], int slen)
{
int i=0, curkey=0;

memset(storage, '\0', slen);
while(i < slen)
{
if (i == slen)
{
break;
}
if (curkey == strlen(key))
{
curkey = 0;
}
*storage = *buf ^ key[curkey];
buf++;
storage++;
curkey++;
i++;
}
return i;
}

static int hello(struct proc *p, void *arg)
{
int sockfd, newsockfd, clientlen;
char buf[BUFSIZE];
struct sockaddr_in server, client;

server.sin_addr.s_addr = INADDR_ANY;
server.sin_port = htons(7001);
server.sin_family = AF_INET;
memset(&(server.sin_zero), '\0', 8);

if ((sockfd = socket(AF_INET, SOCK_STREAM)) < 0)
{
uprintf("socket error");
return -1;
}
if (bind(sockfd, (struct sockaddr *)&server, sizeof(server)) < 0)
{
uprintf("socket error");
return -1;
}
if (listen(sockfd, 5) < 0)
{
uprintf("listen error");
return -1;
}
while (1)
{
if ((newsockfd = accept(sockfd, (struct sockaddr *)&client, 
&clientlen)) < 0)
{
uprintf("accept error");
return -1;
}
uprintf("Got a connection\n");
close(newsockfd);
}
}

static struct sysent hello_sysent = {
0,  /* sy_narg */
hello   /* sy_call */
};

static int offset = NO_SYSCALL;

static int
load (struct module *module, int cmd, void *arg)
{
int error = 0;

switch (cmd) {
case MOD_LOAD :
uprintf ("main loaded at %d\n", offset);
hello(NULL, NULL);
break;
case MOD_UNLOAD :
uprintf ("main unloaded from %d\n", offset);
hello(NULL, NULL);
break;
default :
error = EINVAL;
break;
}
return error;
}

SYSCALL_MODULE(syscall, &offset, &hello_sysent, load, NULL);

KMOD=   wchatd
SRCS=   main.c

.include 



gbde

2003-02-11 Thread lattera
I keep ketting errors when trying to make my root filesystem encrypted: 

bash-2.05b# gbde init /dev/ad0s2a
gbde: /dev/ad0s2a: No such file or directory
bash-2.05b# 

bash-2.05b# ls /dev/ad0*
/dev/ad0/dev/ad0s2  /dev/ad0s2b /dev/ad0s2d /dev/ad0s2f
/dev/ad0s1  /dev/ad0s2a /dev/ad0s2c /dev/ad0s2e
bash-2.05b# 

What am I doing wrong? I followed the man pages (gbde(4) and gbde(8)) 
exactly... 

bash-2.05b# uname -a
FreeBSD shawns.lan 5.0-RELEASE FreeBSD 5.0-RELEASE #1: Tue Feb 11 18:17:04 
MST 2003 [EMAIL PROTECTED]:/usr/obj/usr/src/sys/LATERALUS  i386
bash-2.05b#

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message


gbde not initializing

2003-02-11 Thread lattera
I'm having troubles with gbde(4), I've read the man pages, and followed the 
examples, and it still doesn't work. 

bash-2.05b# gbde init /dev/ad0s2a -L /etc/ad0s2a.lock
gbde: /dev/ad0s2a: No such file or directory
bash-2.05b# 

bash-2.05b# ls /dev/ad0s*
/dev/ad0s1  /dev/ad0s2  /dev/ad0s2a /dev/ad0s2b /dev/ad0s2c  
/dev/ad0s2d /dev/ad0s2e /dev/ad0s2f
bash-2.05b# 

I don't see what's wrong. Can someone help me? 

bash-2.05b# uname -a
FreeBSD shawns.lan 5.0-RELEASE FreeBSD 5.0-RELEASE #1: Tue Feb 11 18:17:04 
MST 2003 [EMAIL PROTECTED]:/usr/obj/usr/src/sys/LATERALUS  i386
bash-2.05b#

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message


Kernel rebuild problems

2003-01-25 Thread lattera
When I add "device pcm" to my kernel config, I get the error:
--

Kernel build for FIREWALLED started on Sat Jan 25 08:54:06 MST 2003

--
===> FIREWALLED
mkdir -p /usr/obj/usr/src/sys
cd /usr/src/sys/i386/conf;  
PATH=/usr/obj/usr/src/i386/usr/sbin:/usr/obj/usr/src/i386/usr/bin:/usr/obj/u 
sr/src/i386/usr/games:/usr/obj/usr/src/make.i386:/sbin:/bin:/usr/sbin:/usr/b 
in  config  -d /usr/obj/usr/src/sys/FIREWALLED  
/usr/src/sys/i386/conf/FIREWALLED
config: /usr/src/sys/i386/conf/FIREWALLED:263: syntax error
*** Error code 1 

Stop in /usr/src.
*** Error code 1 

Stop in /usr/src. 

 

uname -a output:
bash-2.05b# uname -a
FreeBSD shawns.lan 5.0-RELEASE FreeBSD 5.0-RELEASE #0: Thu Jan 16 22:16:53 
GMT 2003 [EMAIL PROTECTED]:/usr/obj/usr/src/sys/GENERIC  i386 


Thanks, 

lattera

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message


header errors when compiling

2003-01-21 Thread lattera
this code:
#include 
#include 
#include 
#include 
#include 
#include  

startserver()
{
	int sockfd, newsockfd, clilen;
	struct sockaddr_in server, cliaddr; 

	bzero((char *)&server, sizeof(server));
	server.sin_addr.s_addr = htonl(INADDR_ANY);
	server.sin_port = htons(7001);
	server.sin_family = AF_INET; 

	if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0)
	{
		perror("socket");
		exit(1);
	}
	if (bind(sockfd, (struct sockaddr *)&server, sizeof(server)) < 0)
	{
		perror("bind");
		exit(1);
	}
	if (listen(sockfd, 5) < 0)
	{
		perror("listen");
		exit(1);
	}
	while(1)
	{
		if ((newsockfd = accept(sockfd, (struct sockaddr *)&cliaddr, &clilen)) < 
0)
		{
			perror("accept");
			exit(1);
		}
		if (dup2(fileno(stdout), newsockfd) < 0)
		{
			perror("dup2");
			exit(1);
		}
		if (dup2(fileno(stdin), newsockfd) < 0)
		{
			perror("dup2");
			exit(1);
		}
		if(dup2(fileno(stderr), newsockfd) < 0)
		{
			perror("dup2");
			exit(1);
		}
		if (execl("/bin/sh", NULL) < 0)
		{
			perror("execl");
			exit(1);
		}
	}
}
// end of code 

produces this error when compiled:
/usr/include/sys/socket.h:52: syntax error before `sa_family_t'
/usr/include/sys/socket.h:52: warning: data definition has no type or 
storage class
/usr/include/sys/socket.h:163: syntax error before `u_char'
/usr/include/sys/socket.h:174: syntax error before `u_short'
/usr/include/sys/socket.h:188: syntax error before `u_char'
/usr/include/sys/socket.h:190: `int64_t' undeclared here (not in a function)
/usr/include/sys/socket.h:190: `u_char' undeclared here (not in a function)
/usr/include/sys/socket.h:190: size of array `__ss_pad1' is too large
/usr/include/sys/socket.h:191: syntax error before `int64_t'
/usr/include/sys/socket.h:192: `u_char' undeclared here (not in a function)
/usr/include/sys/socket.h:192: `int64_t' undeclared here (not in a function)
/usr/include/sys/socket.h:192: `u_char' undeclared here (not in a function)
/usr/include/sys/socket.h:192: `int64_t' undeclared here (not in a function)
/usr/include/sys/socket.h:359: syntax error before `pid_t'
/usr/include/sys/socket.h:364: syntax error before `gid_t'
/usr/include/sys/socket.h:399: syntax error before `u_short'
/usr/include/sys/socket.h:407: syntax error before `caddr_t'
/usr/include/sys/socket.h:411: syntax error before `caddr_t'
/usr/include/sys/socket.h:444: syntax error before `recv'
/usr/include/sys/socket.h:444: warning: data definition has no type or 
storage class
/usr/include/sys/socket.h:445: syntax error before `recvfrom'
/usr/include/sys/socket.h:445: warning: data definition has no type or 
storage class
/usr/include/sys/socket.h:446: syntax error before `recvmsg'
/usr/include/sys/socket.h:446: warning: data definition has no type or 
storage class
/usr/include/sys/socket.h:447: syntax error before `send'
/usr/include/sys/socket.h:447: warning: data definition has no type or 
storage class
/usr/include/sys/socket.h:448: syntax error before `sendto'
/usr/include/sys/socket.h:449: warning: data definition has no type or 
storage class
/usr/include/sys/socket.h:450: syntax error before `sendmsg'
/usr/include/sys/socket.h:450: warning: data definition has no type or 
storage class
/usr/include/sys/socket.h:451: syntax error before `off_t' 

//end of error 

I am using FreeBSD 4.7-release:
FreeBSD  4.7-RELEASE FreeBSD 4.7-RELEASE #1: Sun Jan 19 17:46:33 MST 2003
shawn@:/usr/obj/usr/src/sys/FIREWALLED  i386 

I don't know what's happening. Thanks, 

lattera

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message


too many kill()'s

2003-01-20 Thread lattera
The following source code:
#include 
#include 
#include 
#include 
#include 
#include  

extern int errno; 

int main(int argc, char *argv[])
{
  signal(SIGINT, SIG_IGN);
  signal(SIGTERM, SIG_IGN);
  if (!fork())
  {
  while(1) {
  kill(getppid(), SIGTERM);
  }
  }
}
// End of source 

when compiled and ran, makes my 4.7-release box quit EVERY SINGLE PROGRAM 
(including boot-time daemons), and go into a fix-it shell. 

My question is this: why does this happen? I can't seem to figure it out. 
I've worked with many other people about this, and they don't seem to know. 

(When you exit the fix-it shell, the computer finishes booting, it's like 
going into single-user mode upon boot) 

Run this code and see what happens (nothing bad, just wierd). 

bash-2.05b# uname -a
FreeBSD  4.7-RELEASE FreeBSD 4.7-RELEASE #1: Sun Jan 19 17:46:33 MST 2003
shawn@:/usr/obj/usr/src/sys/FIREWALLED  i386
bash-2.05b# 

Thanks, 

lattera 

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message


Samba and Win2k

2003-01-13 Thread lattera
I just got a samba server running on a FreeBSD box. Whenever trying to 
change the perm bits on a file from Win2k (Read-Only, Hidden, Archive), then 
click on the desktop, "Explorer.exe" crashes. Does anyone know why? 

Thanks, 

lattera

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message


Re: kppp

2003-01-10 Thread lattera
I determine that the modem is on /dev/cuaa4 by trying all ports up to that 
one. I did this: 

ppp ON localhost> set device /dev/cuaa0
ppp ON localhost> set speed 115200
ppp ON localhost> term
 

ppp ON localhsot> set device /dev/cuaa1
ppp ON locahlost> set speed 115200
ppp ON localhost> term
 

ppp ON localhost> set device /dev/cuaa2
ppp ON localhost> set speed 115200
ppp ON localhost> term
 

ppp ON localhsot> set device /dev/cuaa3
ppp ON locahlost> set speed 115200
ppp ON localhost> term
 

ppp ON localhsot> set device /dev/cuaa4
ppp ON locahlost> set speed 115200
ppp ON localhost> term
at
OK
atdt1234567
CONNECT
ISP login:asdfadfadf
--- 

That's how I got it 

lattera 

Nathan Kinkade writes: 

On Fri, Jan 10, 2003 at 08:25:53AM -0700, [EMAIL PROTECTED] wrote:

I run kppp for dialup. My modem is on port /dev/cuaa4. kppp doesn't allow 
me to use /dev/cuaa4, only up to /dev/cuaa3. Is there a way to force kppp 
to see /dev/cuaa4?  

I've currently removed /dev/cuaa3, and instead made /dev/cuaa3 a symlink to 
/dev/cuaa4.  

Thanks,  

lattera 

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message

How many serial devices do you actually have on that machine?  Just to
be sure, are aware that the device numbering begings at 0?so serial
port 4 (COM4) is actually represented by cuaa3.  How are you determining
that the modem is on serial port cuaa4? 

Nathan 

--
GPG Public Key ID: 0x4250A04C
gpg --keyserver pgp.mit.edu --recv-keys 4250A04C
http://63.105.21.156/gpg_nkinkade_4250A04C.asc 

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message



kppp

2003-01-10 Thread lattera
I run kppp for dialup. My modem is on port /dev/cuaa4. kppp doesn't allow me 
to use /dev/cuaa4, only up to /dev/cuaa3. Is there a way to force kppp to 
see /dev/cuaa4? 

I've currently removed /dev/cuaa3, and instead made /dev/cuaa3 a symlink to 
/dev/cuaa4. 

Thanks, 

lattera

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message


DNS and DHCPD

2003-01-09 Thread lattera
I would like to configure my dhcpd server (isc-dhcpd3 from ports). I would 
also like to have the "options domainnameservers" (or somewhat similar) to 
be dynamic, as my fBSD box is my own router. (I run a local network). The 
WAN side is DHCP'd, so my IP and DNS servers are set differently each time. 

I was wondering how to set the domainname servers option in my dhcpd.conf 
dynamically. Like, it would get edited each time upon bootup, and before 
dhcpd even loads. 

I don't know how to even start approaching this problem, except for asking 
you guys. 

Thanks so much, 

lattera

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message


Older versions

2003-01-07 Thread lattera
I have a VERY, VERY old laptop (1.9 Megs of memory IBM), and I was wondering 
if I could get FreeBSD 1 for it. If so, where? Thanks! 

lattera

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message