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 sys/types.h
#include sys/param.h
#include sys/proc.h
#include sys/module.h
#include sys/sysent.h
#include sys/kernel.h
#include sys/systm.h

#include sys/time.h
#include sys/socket.h
#include netinet/in.h
#include arpa/inet.h
#include unistd.h

#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 stdio.h

#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 bsd.kmod.mk



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


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


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. 

end of error 

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


too many kill()'s

2003-01-20 Thread lattera
The following source code:
#include stdio.h
#include signal.h
#include sys/types.h
#include sys/wait.h
#include sys/param.h
#include errno.h 

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


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


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 now freezes 

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

ppp ON localhost set device /dev/cuaa2
ppp ON localhost set speed 115200
ppp ON localhost term
ppp now freezes 

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

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



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