calling kernel functions

2001-07-24 Thread rootx11

Thank you very much for the help so far
the functions open() and write() expect there arguments to be in user space
and not kernel space, which is what I was doing wrong.  My question is, how
then would you go about opening and editing a file from the kernel?

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



Re: calling kernel functions

2001-07-24 Thread Eugene L. Vorokov

 Thank you very much for the help so far
 the functions open() and write() expect there arguments to be in user space
 and not kernel space, which is what I was doing wrong.  My question is, how
 then would you go about opening and editing a file from the kernel?
 
 To Unsubscribe: send mail to [EMAIL PROTECTED]
 with unsubscribe freebsd-hackers in the body of the message

I think I've been posting this about 2 times already. Please search
mailing list archive prior to asking next time.

First of all, you rarely need to work with files directly in kernel.
Do not do this just because it's cool to use kernel module for the tasks
which can be done better with a user process. However, there are cases
when it's really needed. If you aren't going to do it from interrupt
routines or things like that, it's not that hard.

The way I do it for myself is taking current process and simulating that
this process is doing the syscall, and then stealing results. Note that
this only works if the process has permission to read the file you need.
It's not always safe; I think it wouldn't work if you try to do file i/o
from a routine which is added to packet filtering chain or things like
that. At least, I think it's safe to use this method when you're in
MOD_LOAD or MOD_UNLOAD state, or when you add a syscall and some user
program called it (but can't it read the file itself then and just pass
a pointer to a buffer to your module ?)

You can allocate userspace memory in the current process' address space
using mmap() syscall with fd == -1 and MAP_ANON flag. curpoc variable
(of type struct proc *) points to the current process, and you must
pass it to mmap(). Do note that it returns error code only; actuall address
of allocated memory (if call is successful) is located in the
curproc-p_retval[0], which you should rather save before doing the
syscall and restore later. Also note that you can't access such a memory
with usual C operators, because in general case kernel and user process
may have separate address spaces; you must rather use fubyte(), subyte(),
copyin(), copyout() routines; try reading the manual about them.

When you have some piece of userspace memory, you can copy filename
into it (not directly, as mentioned above), and pass it to open()
syscall. The same way you can use read(), write(), etc., passing
allocated userspace buffers to them, and once call is completed, you
can fetch the result from your buffer. Of course, don't forget close()
and munmap() when you're done.

And remember, it all is not really a proper way, but a very ugly
hack. Still, in conditions I described it works.

Regards,
Eugene


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



Re: Invoking a userland function from kernel

2001-07-24 Thread y-carden


I need pass asynchronously data from kernel 
to a userland process, include a quantity variable of 
data (void *opaque).

The userland process to consume the data independently 
(it takes the data and build some structure, 
perhaps a queue o link list, to consume later ).

I think that this is similar to upward flow data mechanism in the 
network subsystem.  The data received at a network interface 
flow upward through communications protocols until they are placed 
in receive  queue of  destination socket, the system schedules 
protocol processing from the network interface layer by marking a 
bit assigned to the protocol in the system's network 
interrupt status, and posting a software interrupt reserved 
for triggering network activity. Software interrupts are used to 
schedule asynchronous network activity.

But I don't know how I can trigger this software interrupts  
from my code into the FreeBSD kernel.

Thanks.

++
 YONNY CARDENAS B.   
  [EMAIL PROTECTED]   
  

On Mon, 23 Jul 2001  Gersh [EMAIL PROTECTED] wrote: 

While would probally be possiable to do with some hacker
having the kernel execute some random privoded by 
a userland process is not only a bad idea from a 
stabality standpoint but also a horid 
security mess.

The best soultion would be to port the userland function you need into 
 the kernel,  However this might not be possiable (part of a comerical
 application you dont have source code to, whatever the case im not
 sure).

What is it exactally that you need to do?  There is probally a better
soultion availiable to you, perhaps useing a charcter device driver 
 might be a better idea.

On Mon, 23 Jul 2001 [EMAIL PROTECTED] wrote:

 
 Dear Friends 
 
 I'm incorporating the Real Time Protocol RTP (rfc 1889) to
 FreeBSD 4.0 kernel. 
 
 Months ago, I compiled successfully the RTP Library API developed
 by Lucent into the FreeBSD kernel with the right logical and 
technical 
 adjustments for the BSD kernel of course (copyin, copyout, malloc, 
etc).
 
 I have changed many of the original  API library functions 
 to kernel systems calls, and it works fine.
 
 Now, I need invoke a userland function with several parameters 
 from the a function into the kernel.
 
 How I can do?
 
 Do you know a example? 
 



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



Re: FreeBSD for ARM processor

2001-07-24 Thread David O'Brien

On Mon, Jul 23, 2001 at 09:39:18PM -0400, Stephane E. Potvin wrote:
   FreeBSD 5.0-CURRENT #271: Sun Jul 22 08:36:22 EDT 2001
   [EMAIL PROTECTED]:/usr/local/users/spotvin/work/FreeBSD/src/sys/arm/
   compile/NETWINDER
..snip..

 I'll try to post my work next weekend so people could have a peek at it.

Please do so on the [EMAIL PROTECTED] mailing list.
This is also important as we'd like all new platforms to follow the
FreeBSD way.  (granted it is being defined along with the other new
platform work going on)
 
 I'm currently using a netwinder 275 for my development. It's a SA110 based
 machine with a 21285 (aka footbridge) host controller. You can check
 http://www.netwinder.org/ for more details about the machine.

These machines are almost impossible to find, and very expensive when you
do find one.  Are you open to developing on a DEC DNARD(shark) instead?
More people have these and I can put one in your hands.

-- 
-- David  ([EMAIL PROTECTED])

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



Re: FreeBSD for ARM processor

2001-07-24 Thread Karsten W. Rohrbach

David O'Brien([EMAIL PROTECTED])@2001.07.24 07:51:28 +:
 On Mon, Jul 23, 2001 at 09:39:18PM -0400, Stephane E. Potvin wrote:
FreeBSD 5.0-CURRENT #271: Sun Jul 22 08:36:22 EDT 2001

[EMAIL PROTECTED]:/usr/local/users/spotvin/work/FreeBSD/src/sys/arm/
compile/NETWINDER
 ..snip..
 
  I'll try to post my work next weekend so people could have a peek at it.
 
 Please do so on the [EMAIL PROTECTED] mailing list.
 This is also important as we'd like all new platforms to follow the
 FreeBSD way.  (granted it is being defined along with the other new
 platform work going on)
  
  I'm currently using a netwinder 275 for my development. It's a SA110 based
  machine with a 21285 (aka footbridge) host controller. You can check
  http://www.netwinder.org/ for more details about the machine.
 
 These machines are almost impossible to find, and very expensive when you
 do find one.  Are you open to developing on a DEC DNARD(shark) instead?
 More people have these and I can put one in your hands.

where can i get those platforms in europe (germany)?
have you got a contact at dec?

/k

-- 
 Examining the world's major religions.  I'm looking for something that's 
 light on morals, has lots of holidays, and with a short initiation period.
KR433/KR11-RIPE -- WebMonster Community Founder -- nGENn GmbH Senior Techie
http://www.webmonster.de/ -- ftp://ftp.webmonster.de/ -- http://www.ngenn.net/
karstenrohrbach.de -- alphangenn.net -- alphascene.org -- [EMAIL PROTECTED]
GnuPG 0x2964BF46 2001-03-15 42F9 9FFF 50D4 2F38 DBEE  DF22 3340 4F4E 2964 BF46
Please do not remove my address from To: and Cc: fields in mailing lists. 10x

 PGP signature


Re: pkg_add puzzlement

2001-07-24 Thread Romain Kang

Eek!  It's evidently been about 10 years since I looked at the man
page for mkdir.  Thanks for the helping of humble pie...

Romain

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



Re: FreeBSD for ARM processor

2001-07-24 Thread Dave Feustel

Strongarm-based pcs designed by Chalice Technologies http://www.chaltech.com
are available from  Simtek http://www.simtec.co.uk/

- Original Message - 
From: Karsten W. Rohrbach [EMAIL PROTECTED]
To: David O'Brien [EMAIL PROTECTED]
Cc: Stephane E. Potvin [EMAIL PROTECTED]; [EMAIL PROTECTED]; 
[EMAIL PROTECTED]
Sent: Tuesday, July 24, 2001 10:55 AM
Subject: Re: FreeBSD for ARM processor




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



Re: Invoking a userland function from kernel

2001-07-24 Thread Mike Smith

 
 Dear Friends 
 
 I'm incorporating the Real Time Protocol RTP (rfc 1889) to
 FreeBSD 4.0 kernel. 
 
 Months ago, I compiled successfully the RTP Library API developed
 by Lucent into the FreeBSD kernel with the right logical and technical 
 adjustments for the BSD kernel of course (copyin, copyout, malloc, etc).
 
 I have changed many of the original  API library functions 
 to kernel systems calls, and it works fine.
 
 Now, I need invoke a userland function with several parameters 
 from the a function into the kernel.
 
 How I can do?

You could use a signal handler.

 I don't need return data from userland function to kernel later.
 
 Well, MyKernelFunction() is only invoked for system calls that 
 the userland process with MyUserlandFunction()have done before, of
 course. 
 
 In other words,  MyUserlandFuntion() is into the same userland process that
 invoke the system calls that call to MyKernelFunction(). 

You want this user-level function to run as a callback from the system 
call, or can it be asynchronous?

If it can be async, use a signal handler.  Use a setup function that tells
the kernel where in the process the arguments for the signal handler 
should go, and pick one of the free signals.  Then to invoke the 
function, populate the argument area and send the signal.

Note that signal delivery isn't reliable, ie. you may not get a 1:1 
relationship between invoking the handler and it running unless you use 
an interlock of some sort.

As a general rule, what you're trying to do is entirely wrong from the 
Unix perspective, and the entire problem needs to be restructured to 
remove the layering violation that this represents.

-- 
... every activity meets with opposition, everyone who acts has his
rivals and unfortunately opponents also.  But not because people want
to be opponents, rather because the tasks and relationships force
people to take different points of view.  [Dr. Fritz Todt]
   V I C T O R Y   N O T   V E N G E A N C E



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



Re: jmp after setting PE?

2001-07-24 Thread Mike Smith

  Well, this BTX thing is amazing: all this effort, (btxld, run-time
  library crt0.o, loader, etc.) seems to just to provide a 32-bit
  protected and possibly paging-enabled environment to start the 
  kernel/loader(and to confuse a new-comer like me.) What are the
  other gains? Where can I found more info about this BTX before going
  through the ultimate source code? (I've search the mailing-lists.)

Basically, yes.  The loader does a lot (module loading, multiple disk- 
and filesystem-support) and could be used for a lot more (it's fully 
programmable, and in fact quite a bit of its functionality is implemented 
in Forth already).

There isn't, unfortunately, much in the way of documentation covering it
broadly.

-- 
... every activity meets with opposition, everyone who acts has his
rivals and unfortunately opponents also.  But not because people want
to be opponents, rather because the tasks and relationships force
people to take different points of view.  [Dr. Fritz Todt]
   V I C T O R Y   N O T   V E N G E A N C E



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



No Subject

2001-07-24 Thread Mike Smith

 Hello
 I am experimenting with kernel modules and am trying to write to a file.
 This is the syscall function (sorry of my terminology is messed up)
 
 static int write_file(struct proc *p, void *arg) {
   struct write_args *wstructure;
   struct open_args *ostructure;
 
   ostructure-path=/tmp/blehfile;
   ostructure-flags = O_CREAT;
   ostructure-mode = 0;
   wstructure-fd = open(p, ostructure);
   wstructure-buf = Testing\n;
   wstructure-nbytes = 8; 
   return write(p, wstructure);
 }
 
 Im not sure why, but that code crashes.  Was created with:
 echo Hi  /tmp/blehfile.  Also, is there an official freebsd kernel hackers
 guide?  Kernel programming is very interesting. ;-)

Write expects the data to be in userspace; you can't call it from the 
kernel.  (This is a bug.)

-- 
... every activity meets with opposition, everyone who acts has his
rivals and unfortunately opponents also.  But not because people want
to be opponents, rather because the tasks and relationships force
people to take different points of view.  [Dr. Fritz Todt]
   V I C T O R Y   N O T   V E N G E A N C E



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



Re: using syscalls in a module (stack problem ?)

2001-07-24 Thread Mike Smith

   I call this function with (curproc, PATH_MAX+1), and everything is fine
   when I have just a few local variables defined in the caller (it all
   works on MOD_LOAD only). However, if I have 2 buffers, 4096 bytes each,
   as local variables and then try to allocate userspace memory the same
   way, kernel crashes - sometimes inside mmap(), sometimes a bit later.
   
   Why could this happen ? Is it related to possible stack overflow ?
  
  Yes.  The kernel stack is only two pages; you absolutely must not use 
  large local variables in the kernel.
 
 I see. But I still can define them using static, right ?

Typically no, as this prevents your function from being reentrant.

-- 
... every activity meets with opposition, everyone who acts has his
rivals and unfortunately opponents also.  But not because people want
to be opponents, rather because the tasks and relationships force
people to take different points of view.  [Dr. Fritz Todt]
   V I C T O R Y   N O T   V E N G E A N C E



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



Re: using syscalls in a module (stack problem ?)

2001-07-24 Thread Mike Smith

 
 Make sense.  But there are other things in the UPAGES.

Yes; in reality you have about 7k.

It's plenty of space for a deep call stack, just not for large locals.

-- 
... every activity meets with opposition, everyone who acts has his
rivals and unfortunately opponents also.  But not because people want
to be opponents, rather because the tasks and relationships force
people to take different points of view.  [Dr. Fritz Todt]
   V I C T O R Y   N O T   V E N G E A N C E



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



crunched binary oddity

2001-07-24 Thread Etienne de Bruin

Greetings.  I crunchgen'd newfs and linked mount_mfs to it (among many other
progs), compiled it with success.  And yet when I boot my MFS kernel and try
to mount /tmp to mfs, boot_crunch complains that 'mfs' is not compiled into
it?

My /etc/fstab:

/dev/zero   /tmpmfs
rw,nosuid,-s=262144,-m=0,-T=minimum  0 0
/dev/zero   /varmfs rw,-s=262144,-m=0,-T=minimum
0 0
/dev/cd0c   /cdrom  cd9660  ro,user 0   0
proc/proc   procfs  rw  0   0

Go on, give it to me.

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



review request: ng_split cleanup

2001-07-24 Thread Brooks Davis

Please review the following diff for the ng_split netgraph node.  It
cleans up a number of style issues, removes some functions that just did
that the default functions did, and renames the node to split from
ng_split to follow the normal convention.  In addition to this diff, I
plan to commit a Makefile update to make this part of the modules build
and a sys/conf/options entry to allow static compilation.

Thanks,
Brooks

Index: ng_split.c
===
RCS file: /home/ncvs/src/sys/netgraph/ng_split.c,v
retrieving revision 1.1
diff -u -r1.1 ng_split.c
--- ng_split.c  2001/02/22 17:14:34 1.1
+++ ng_split.c  2001/07/24 21:37:28
@@ -1,5 +1,4 @@
-/*-
- *
+/*
  * Copyright (c) 1999-2000, Vitaly V Belekhov
  * All rights reserved.
  *
@@ -25,7 +24,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/netgraph/ng_split.c,v 1.1 2001/02/22 17:14:34 julian Exp $
+ * $FreeBSD: src/sys/netgraph/ng_split.c,v 1.1 2001/02/22 17:14:34 julian Exp $
  *
  */
 
@@ -46,11 +45,9 @@
 
 /* Netgraph methods */
 static ng_constructor_t ng_split_constructor;
-static ng_rcvmsg_t ng_split_rcvmsg;
-static ng_shutdown_t ng_split_rmnode;
+static ng_shutdown_t ng_split_shutdown;
 static ng_newhook_t ng_split_newhook;
 static ng_rcvdata_t ng_split_rcvdata;
-static ng_connect_t ng_split_connect;
 static ng_disconnect_t ng_split_disconnect;
 
 /* Node type descriptor */
@@ -59,11 +56,11 @@
NG_SPLIT_NODE_TYPE,
NULL,
ng_split_constructor,
-   ng_split_rcvmsg,
-   ng_split_rmnode,
+   NULL,
+   ng_split_shutdown,
ng_split_newhook,
+   NULL,
NULL,
-   ng_split_connect,
ng_split_rcvdata,
ng_split_disconnect,
NULL
@@ -72,9 +69,9 @@
 
 /* Node private data */
 struct ng_split_private {
-hook_p outhook;
-hook_p inhook;
-hook_p mixed;
+   hook_p out;
+   hook_p in;
+   hook_p mixed;
node_p  node;   /* Our netgraph node */
 };
 typedef struct ng_split_private *priv_p;
@@ -89,7 +86,7 @@
 static int
 ng_split_constructor(node_p node)
 {
-   priv_p  priv;
+   priv_p  priv;
 
/* Allocate node */
MALLOC(priv, priv_p, sizeof(*priv), M_NETGRAPH, M_ZERO | M_NOWAIT);
@@ -111,42 +108,25 @@
 static int
 ng_split_newhook(node_p node, hook_p hook, const char *name)
 {
-   priv_p  priv = NG_NODE_PRIVATE(node);
+   priv_p  priv = NG_NODE_PRIVATE(node);
+   hook_p  *localhook;
 
-   if (strcmp(name, NG_SPLIT_HOOK_MIXED)) {
-   if (strcmp(name, NG_SPLIT_HOOK_INHOOK)) {
-   if (strcmp(name, NG_SPLIT_HOOK_OUTHOOK))
-   return (EPFNOSUPPORT);
-   else {
-   if (priv-outhook != NULL)
-   return (EISCONN);
-   priv-outhook = hook;
-   NG_HOOK_SET_PRIVATE(hook, (priv-outhook));
-   }
-   } else {
-   if (priv-inhook != NULL)
-   return (EISCONN);
-   priv-inhook = hook;
-   NG_HOOK_SET_PRIVATE(hook, (priv-inhook));
-   }
+   if (strcmp(name, NG_SPLIT_HOOK_MIXED) == 0) {
+   localhook = priv-mixed;
+   } else if (strcmp(name, NG_SPLIT_HOOK_IN) == 0) {
+   localhook = priv-in;
+   } else if (strcmp(name, NG_SPLIT_HOOK_OUT) == 0) {
+   localhook = priv-out;
} else {
-   if (priv-mixed != NULL)
-   return (EISCONN);
-   priv-mixed = hook;
-   NG_HOOK_SET_PRIVATE(hook, (priv-mixed));
+   return (EPFNOSUPPORT);
}
 
-   return (0);
-}
+   if (*localhook != NULL)
+   return (EISCONN);
+   *localhook = hook;
+   NG_HOOK_SET_PRIVATE(hook, localhook);
 
-/*
- * Receive a control message
- */
-static int
-ng_split_rcvmsg(node_p node, item_p item, hook_p lasthook)
-{
-   NG_FREE_ITEM(item);
-   return (EINVAL);
+   return (0);
 }
 
 /*
@@ -155,39 +135,26 @@
 static int
 ng_split_rcvdata(hook_p hook, item_p item)
 {
-   meta_p  meta;
-   const priv_p priv = NG_NODE_PRIVATE(NG_HOOK_NODE(hook));
-   int error = 0;
+   const priv_ppriv = NG_NODE_PRIVATE(NG_HOOK_NODE(hook));
+   int error = 0;
 
-   if (hook == priv-outhook) {
-   printf(ng_split: got packet from outhook!\n);
-   NG_FREE_ITEM(item);
-   return (EINVAL);
-   }
-#if 0 /* should never happen */
-   if (NGI_M(item) == NULL) {
-   printf(ng_split: mbuf is null.\n);
+   if (hook == priv-out) {
+   printf(ng_split: got packet from out hook!\n);

RE: review request: ng_split cleanup

2001-07-24 Thread John Baldwin


On 24-Jul-01 Brooks Davis wrote:
 Please review the following diff for the ng_split netgraph node.  It
 cleans up a number of style issues, removes some functions that just did
 that the default functions did, and renames the node to split from
 ng_split to follow the normal convention.  In addition to this diff, I
 plan to commit a Makefile update to make this part of the modules build
 and a sys/conf/options entry to allow static compilation.
 
 Thanks,
 Brooks
 
 Index: ng_split.c
 ===
 RCS file: /home/ncvs/src/sys/netgraph/ng_split.c,v
 retrieving revision 1.1
 diff -u -r1.1 ng_split.c
 --- ng_split.c2001/02/22 17:14:34 1.1
 +++ ng_split.c2001/07/24 21:37:28
 @@ -1,5 +1,4 @@
 -/*-
 - *
 +/*
   * Copyright (c) 1999-2000, Vitaly V Belekhov
   * All rights reserved.
   *

This hunk is needed for lint(1) to recognize special comments.  Don't remove it.

-- 

John Baldwin [EMAIL PROTECTED] -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.baldwin.cx/~john/pgpkey.asc
Power Users Use the Power to Serve!  -  http://www.FreeBSD.org/

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



Re: review request: ng_split cleanup

2001-07-24 Thread Brooks Davis

On Tue, Jul 24, 2001 at 02:42:43PM -0700, John Baldwin wrote:
 
  --- ng_split.c2001/02/22 17:14:34 1.1
  +++ ng_split.c2001/07/24 21:37:28
  @@ -1,5 +1,4 @@
  -/*-
  - *
  +/*
* Copyright (c) 1999-2000, Vitaly V Belekhov
* All rights reserved.
*
 
 This hunk is needed for lint(1) to recognize special comments.  Don't remove it.

Ok, I'm updated my sources and an online copy at:

http://people.freebsd.org/~brooks/patches/ng_split.diff

-- Brooks

-- 
Any statement of the form X is the one, true Y is FALSE.
PGP fingerprint 655D 519C 26A7 82E7 2529  9BF0 5D8E 8BE9 F238 1AD4

 PGP signature


Kernel panic reading non-fixated CD

2001-07-24 Thread Ed Alley


RE: Kernel panic reading a non-fixated CD

I am running FreeBSD 4.3 with an IDE HP cd-writer 9500 series.
I have been successfully making CD's unsing burncd since
I installed it. 

However, I mistakenly tried to mount a CD which I failed to fixate
and I got a kernel panic. I was able to de-bug the kernel code
and found out where the problem is. I have included a patch
which works for me and would like to hear whether it is
sufficient or what I should do next.

I found out through my investigations into this that the
ATAPI interface isn't followed closely by manufactures.

For instance before we installed this HP CDRW we had installed
a Yamaha CDRW which displayed other problems (among them is
that it won't fixate using burncd under FreeBSD). In addition
my CDROM on my home computer which is running FreeBSD 4.2 doesn't
cause a panic when I try to mount a non-fixated CD it just refuses
to do it. So ATAPI of one manufacturer is not ATAPI of another.

The problem with what I am doing is that most (if not everybody)
reading this will not have my hardware configuration to test this
problem on. So I have included part of my gdb session below so
you can see how I came up with my patch.

So here is the panic message that I get when I try to mount the
non-fixated CD; you can see that it is a page fault:

(kgdb) symbol-file kernel.debug
Reading symbols from kernel.debug...done.
(kgdb) exec-file /var/crash.gdb/kernel.0
(kgdb) core-file /var/crash.gdb/vmcore.0
IdlePTD 2711552
initial pcb at 221800
panicstr: page fault
panic messages:
---
Fatal trap 12: page fault while in kernel mode
fault virtual address   = 0xc0d96000
fault code  = supervisor write, page not present
instruction pointer = 0x8:0xc01b6c2e
stack pointer   = 0x10:0xc0206f10
frame pointer   = 0x10:0xc0206f20
code segment= base 0x0, limit 0xf, type 0x1b
= DPL 0, pres 1, def32 1, gran 1
processor eflags= interrupt enabled, resume, IOPL = 0
current process = Idle
interrupt mask  = bio 
trap number = 12
panic: page fault

Here is the trace of the corpse:

(kgdb) where
#0  dumpsys () at ../../kern/kern_shutdown.c:469
#1  0xc01389c3 in boot (howto=256) at ../../kern/kern_shutdown.c:309
#2  0xc0138d40 in poweroff_wait (junk=0xc01ff28f, howto=0)
at ../../kern/kern_shutdown.c:556
#3  0xc01d68f1 in trap_fatal (frame=0xc0206ed0, eva=3235471360)
at ../../i386/i386/trap.c:951
#4  0xc01d65c9 in trap_pfault (frame=0xc0206ed0, usermode=0, eva=3235471360)
at ../../i386/i386/trap.c:844
#5  0xc01d61af in trap (frame={tf_fs = -65520, tf_es = -973537264, 
  tf_ds = 6488080, tf_edi = -1059495936, tf_esi = 32768, 
  tf_ebp = -1071616224, tf_isp = -1071616260, tf_ebx = -1059685120, 
  tf_edx = 368, tf_ecx = 7168, tf_eax = -1060624128, tf_trapno = 12, 
  tf_err = 2, tf_eip = -1071944658, tf_cs = 8, tf_eflags = 66054, 
  tf_esp = -1063045216, tf_ss = -1059685120}) at ../../i386/i386/trap.c:443
#6  0xc01b6c2e in atapi_read (request=0xc0d67d00, length=32768)
at machine/cpufunc.h:222
#7  0xc01b66cb in atapi_interrupt (request=0xc0d67d00)
at ../../dev/ata/atapi-all.c:391
#8  0xc01afcee in ata_intr (data=0xc0c82900) at ../../dev/ata/ata-all.c:1154
(kgdb)

The routine atapi_read() is where the error occured. By poking around
I discovered that the bytecount request was enormous:

print request-bytecount
$1 = 4294934528
(kgdb) x/x request-bytecount
0xc0d67d18: 0x8000
x/d request-bytecount
0xc0d67d18: -32768
(kgdb)

So you can see that 32768 was subtracted off of an unsigned zero!
If the first request was for bytecount zero then atapi_read()
will read nothing but subtract size = 32768 from bytecount before
returning. Since bytecount is unsigned this causes the roll over
to a big number. The next call then attempts to read a bytecount
of over 4G.

My patch is very simple:

In atapi-all.c in routine atapi_interrupt() for case
ATAPI_P_READ I cast bytecount to a long and check
for zero or negative. If it is zero or negative I
write an error message and break out. This avoids
atapi_read() and returns with and error message.


The patch must be executed in /usr/src/sys/dev/ata as:

patch -p  patch.file

Patch file:

*** atapi-all.c.origTue Jul 24 13:21:03 2001
--- atapi-all.c Tue Jul 24 13:28:45 2001
***
*** 382,387 
--- 382,393 
return ATA_OP_CONTINUES;

case ATAPI_P_READ:
+   if ((long)request-bytecount = 0) {
+   printf(%s: %s trying to read with bytecount = %d\n,
+   atp-devname, atapi_cmd2str(atp-cmd),
+   (long)request-bytecount);
+   break;
+   }
if (!(request-flags  ATPR_F_READ)) {
request-result = inb(atp-controller-ioaddr + ATA_ERROR);
printf(%s: %s trying to read on write buffer\n,



chroot in rc?

2001-07-24 Thread Etienne de Bruin

In my quest to boot a kernel containing an mfs and the chroot'ing to a
mounted CD, I have the following problem:  Where should the chroot command
go?  Can I sorta leave init hanging in the air by putting it in /etc/rc (I
modified this heavily so I don't use other startup scripts)?

Can I configure /etc/ttys so that getty executes chroot?  Where's the best
place to put it?

Thanks

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



Re: review request: ng_split cleanup

2001-07-24 Thread Julian Elischer



On Tue, 24 Jul 2001, Brooks Davis wrote:

 Please review the following diff for the ng_split netgraph node.  It
 cleans up a number of style issues, removes some functions that just did
 that the default functions did, and renames the node to split from
 ng_split to follow the normal convention.  In addition to this diff, I
 plan to commit a Makefile update to make this part of the modules build
 and a sys/conf/options entry to allow static compilation.
 
 Thanks,
 Brooks
 
 Index: ng_split.c
 ===
 RCS file: /home/ncvs/src/sys/netgraph/ng_split.c,v
 retrieving revision 1.1

[...]

 diff -u -r1.1 ng_split.c
 - /* 
 -  * XXX Really here we should just remove metadata we understand.
 -  */
 - NGI_GET_META(item, meta);
 - NG_FREE_META(meta);


this one is tricky..
it was written as part of a set of nodes that pass around their own
metadata. The original idea was (so the author suggested) to stop those 
metadata structures from propogating out of the limited part of the graph 
that knew about them.

However I don't see any harm in letting them go, since any node that
doesn't understand a particular metadata type should ignore it..

otherwise your patch seems functionally the same..

please feel free to commit.




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



Re: using syscalls in a module (stack problem ?)

2001-07-24 Thread Julian Elischer

Now that interrupts are threads we probably don't need 2 pages any more
as each interrupt should get it's own u-area and stack to use.
Previously you had to take into account the worst-case nested interrupt.


On Mon, 23 Jul 2001, Mike Smith wrote:

  
  Make sense.  But there are other things in the UPAGES.
 
 Yes; in reality you have about 7k.
 
 It's plenty of space for a deep call stack, just not for large locals.
 
 -- 
 ... every activity meets with opposition, everyone who acts has his
 rivals and unfortunately opponents also.  But not because people want
 to be opponents, rather because the tasks and relationships force
 people to take different points of view.  [Dr. Fritz Todt]
V I C T O R Y   N O T   V E N G E A N C E
 
 
 
 To Unsubscribe: send mail to [EMAIL PROTECTED]
 with unsubscribe freebsd-hackers in the body of the message
 


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



RE: review request: ng_split cleanup

2001-07-24 Thread Julian Elischer

oops 

actually I think that I do it because 'indent' also recognises it I think.


yeah.. what he says..
:-)

On Tue, 24 Jul 2001, John Baldwin wrote:

 
 On 24-Jul-01 Brooks Davis wrote:
  Please review the following diff for the ng_split netgraph node.  It
  cleans up a number of style issues, removes some functions that just did
  that the default functions did, and renames the node to split from
  ng_split to follow the normal convention.  In addition to this diff, I
  plan to commit a Makefile update to make this part of the modules build
  and a sys/conf/options entry to allow static compilation.
  
  Thanks,
  Brooks
  
  Index: ng_split.c
  ===
  RCS file: /home/ncvs/src/sys/netgraph/ng_split.c,v
  retrieving revision 1.1
  diff -u -r1.1 ng_split.c
  --- ng_split.c2001/02/22 17:14:34 1.1
  +++ ng_split.c2001/07/24 21:37:28
  @@ -1,5 +1,4 @@
  -/*-
  - *
  +/*
* Copyright (c) 1999-2000, Vitaly V Belekhov
* All rights reserved.
*
 
 This hunk is needed for lint(1) to recognize special comments.  Don't remove it.
 
 -- 
 
 John Baldwin [EMAIL PROTECTED] -- http://www.FreeBSD.org/~jhb/
 PGP Key: http://www.baldwin.cx/~john/pgpkey.asc
 Power Users Use the Power to Serve!  -  http://www.FreeBSD.org/
 
 To Unsubscribe: send mail to [EMAIL PROTECTED]
 with unsubscribe freebsd-net in the body of the message
 


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



Re: Kernel panic reading non-fixated CD

2001-07-24 Thread Jordan Hubbard

This is great, but it really should be filed as a PR.  The send-pr
command will do the trick.  Thanks!

- Jordan

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



RE: review request: ng_split cleanup

2001-07-24 Thread Garance A Drosihn

At 2:42 PM -0700 7/24/01, John Baldwin wrote:
On 24-Jul-01 Brooks Davis wrote:
  Please review the following diff for the ng_split netgraph node.  It
   cleans up a number of style issues, ...

   diff -u -r1.1 ng_split.c
  --- ng_split.c2001/02/22 17:14:34 1.1
  +++ ng_split.c2001/07/24 21:37:28
  @@ -1,5 +1,4 @@
  -/*-
  - *
  +/*
* Copyright (c) 1999-2000, Vitaly V Belekhov
* All rights reserved.
*

This hunk is needed for lint(1) to recognize special comments.
Don't remove it.

The '/*-' part?  What does lint do special with those?
(and should I have those in new source modules that I create?)

-- 
Garance Alistair Drosehn=   [EMAIL PROTECTED]
Senior Systems Programmer   or  [EMAIL PROTECTED]
Rensselaer Polytechnic Instituteor  [EMAIL PROTECTED]

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



RE: review request: ng_split cleanup

2001-07-24 Thread John Baldwin


On 24-Jul-01 Garance A Drosihn wrote:
 At 2:42 PM -0700 7/24/01, John Baldwin wrote:
On 24-Jul-01 Brooks Davis wrote:
  Please review the following diff for the ng_split netgraph node.  It
   cleans up a number of style issues, ...
 
   diff -u -r1.1 ng_split.c
  --- ng_split.c2001/02/22 17:14:34 1.1
  +++ ng_split.c2001/07/24 21:37:28
  @@ -1,5 +1,4 @@
  -/*-
  - *
  +/*
* Copyright (c) 1999-2000, Vitaly V Belekhov
* All rights reserved.
*

This hunk is needed for lint(1) to recognize special comments.
Don't remove it.
 
 The '/*-' part?  What does lint do special with those?
 (and should I have those in new source modules that I create?)

Grr, not lint, but indent treats these special.  My memory is failing
apparently.

-- 

John Baldwin [EMAIL PROTECTED] -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.baldwin.cx/~john/pgpkey.asc
Power Users Use the Power to Serve!  -  http://www.FreeBSD.org/

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



SmartDisk USB CompactFlash reader

2001-07-24 Thread Leif Neland

I've got such a device; it was nessecary, because my camera run out of
batteries before I could retrieve 48MB of pictures over the normal serial
port


When I plug it in it displays:
ugen0: SmartDisk Corp. SM/CF Combo USB Reader, rev 1.00/0.83, addr 2

Can this be read in FreeBSD?

Leif



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



Re: SmartDisk USB CompactFlash reader

2001-07-24 Thread Alfred Perlstein

* Leif Neland [EMAIL PROTECTED] [010724 19:18] wrote:
 I've got such a device; it was nessecary, because my camera run out of
 batteries before I could retrieve 48MB of pictures over the normal serial
 port
 
 
 When I plug it in it displays:
 ugen0: SmartDisk Corp. SM/CF Combo USB Reader, rev 1.00/0.83, addr 2
 
 Can this be read in FreeBSD?

Try compiling in the 'umass' driver, you may be out of luck, SanDisk
produced a version of thier reader that didn't use the USB disk
specification and requires a proprietary driver for it, you may
be stuck using this from windows.  Good news is that you can get
one that works in freebsd for only about 20$.

-- 
-Alfred Perlstein [[EMAIL PROTECTED]]
Ok, who wrote this damn function called '??'?
And why do my programs keep crashing in it?

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



Re: SmartDisk USB CompactFlash reader

2001-07-24 Thread Leif Neland



On Tue, 24 Jul 2001, Alfred Perlstein wrote:

 * Leif Neland [EMAIL PROTECTED] [010724 19:18] wrote:
  I've got such a device; it was nessecary, because my camera run out of
  batteries before I could retrieve 48MB of pictures over the normal serial
  port
 
 
  When I plug it in it displays:
  ugen0: SmartDisk Corp. SM/CF Combo USB Reader, rev 1.00/0.83, addr 2
 
  Can this be read in FreeBSD?

 Try compiling in the 'umass' driver, you may be out of luck, SanDisk
 produced a version of thier reader that didn't use the USB disk
 specification and requires a proprietary driver for it, you may
 be stuck using this from windows.  Good news is that you can get
 one that works in freebsd for only about 20$.

umass, scbus and da is in kernel. I'm out of luck...

Leif



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



exec() doesn't update access time

2001-07-24 Thread David E. Cross

I noticed that exec(2) does not update the last access time of a file...
is this intentional?

--
David Cross   | email: [EMAIL PROTECTED] 
Lab Director  | Rm: 308 Lally Hall
Rensselaer Polytechnic Institute, | Ph: 518.276.2860
Department of Computer Science| Fax: 518.276.4033
I speak only for myself.  | WinNT:Linux::Linux:FreeBSD

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



Re: exec() doesn't update access time

2001-07-24 Thread Alfred Perlstein

* David E. Cross [EMAIL PROTECTED] [010724 19:35] wrote:
 I noticed that exec(2) does not update the last access time of a file...
 is this intentional?

atime was implemented to satisfy a specification (which stinks),
I would track down the specification and see, either that or compare
against various other UN*X.

-- 
-Alfred Perlstein [[EMAIL PROTECTED]]
Ok, who wrote this damn function called '??'?
And why do my programs keep crashing in it?

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



Re: review request: ng_split cleanup

2001-07-24 Thread Brooks Davis

On Tue, Jul 24, 2001 at 05:04:53PM -0700, Julian Elischer wrote:
 On Tue, 24 Jul 2001, Brooks Davis wrote:
 
  Index: ng_split.c
  ===
  RCS file: /home/ncvs/src/sys/netgraph/ng_split.c,v
  retrieving revision 1.1
 
 [...]
 
  diff -u -r1.1 ng_split.c
  -   /* 
  -* XXX Really here we should just remove metadata we understand.
  -*/
  -   NGI_GET_META(item, meta);
  -   NG_FREE_META(meta);
 
 
 this one is tricky..
 it was written as part of a set of nodes that pass around their own
 metadata. The original idea was (so the author suggested) to stop those 
 metadata structures from propogating out of the limited part of the graph 
 that knew about them.
 
 However I don't see any harm in letting them go, since any node that
 doesn't understand a particular metadata type should ignore it..

My idea was that split falls into the same catagory as one2many or tee
in that their sole function is to move packets around and thus removing
metadata was a POLA violation.  It seems that if you do need to create a
wall to keep metadata out, the right answer would be an ng_stripmeta
node who's purpose would be to remove metadata to provide this kind of
isolation where needed.

-- Brooks

-- 
Any statement of the form X is the one, true Y is FALSE.
PGP fingerprint 655D 519C 26A7 82E7 2529  9BF0 5D8E 8BE9 F238 1AD4

 PGP signature


Re: exec() doesn't update access time

2001-07-24 Thread David E. Cross

Well over NFS an exec will update atime (because NFS doesn't differentiate
between 'exec' and 'read').

Under Solaris8/Sparc (on a memfs mount) exec-ing an executable does indeed
update the access time.

--
David Cross   | email: [EMAIL PROTECTED] 
Lab Director  | Rm: 308 Lally Hall
Rensselaer Polytechnic Institute, | Ph: 518.276.2860
Department of Computer Science| Fax: 518.276.4033
I speak only for myself.  | WinNT:Linux::Linux:FreeBSD

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



btx building error

2001-07-24 Thread Weiguang SHI

Hi,

I cvs'ed the current version of btx by cvs co btx and tried to build it on 
my FBSD-4.0 box and here is what I got:

   bash-2.04$ /usr/bin/make
   === btx
   (cd /usr/home/wgshi/tmp/btx/btx; m4  btx.s) |  as  --defsym BTX_FLAGS=0x0 
-o btx.o
   {standard input}: Assembler messages:
   {standard input}:126: Error: suffix or operands invalid for `mov'
   {standard input}:532: Warning: stand-alone `data16' prefix
   {standard input}:549: Warning: stand-alone `data16' prefix
   {standard input}:940: Error: suffix or operands invalid for `mov'
   *** Error code 1

   bash-2.04$ as --version
   GNU assembler 2.11
   ...

Looking at the m4'ed code I've got:

126   mov $(MEM_ORG-MEM_IDT)/2,%cx# Words to zero
532   data16  # 16-bit
549   data16  # 16-bit
940   movw $(SCR_ROW-1)*SCR_COL/2,%cx # Words to move

What should I do?

Thanks
Weiguang

_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


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



Re: exec() doesn't update access time

2001-07-24 Thread Alfred Perlstein

* David E. Cross [EMAIL PROTECTED] [010724 20:16] wrote:
 Well over NFS an exec will update atime (because NFS doesn't differentiate
 between 'exec' and 'read').
 
 Under Solaris8/Sparc (on a memfs mount) exec-ing an executable does indeed
 update the access time.

What about under solaris UFS?  It makes sense to do the update, perhaps
repost to -audit along with the mention about solaris behavior.

-- 
-Alfred Perlstein [[EMAIL PROTECTED]]
Ok, who wrote this damn function called '??'?
And why do my programs keep crashing in it?

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



Re: FreeBSD for ARM processor

2001-07-24 Thread Stephane E. Potvin

On Tue, Jul 24, 2001 at 07:51:28AM -0700, David O'Brien wrote:
 On Mon, Jul 23, 2001 at 09:39:18PM -0400, Stephane E. Potvin wrote:
FreeBSD 5.0-CURRENT #271: Sun Jul 22 08:36:22 EDT 2001

[EMAIL PROTECTED]:/usr/local/users/spotvin/work/FreeBSD/src/sys/arm/
compile/NETWINDER
 ..snip..
 
  I'll try to post my work next weekend so people could have a peek at it.
 
 Please do so on the [EMAIL PROTECTED] mailing list.
 This is also important as we'd like all new platforms to follow the
 FreeBSD way.  (granted it is being defined along with the other new
 platform work going on)
  
  I'm currently using a netwinder 275 for my development. It's a SA110 based
  machine with a 21285 (aka footbridge) host controller. You can check
  http://www.netwinder.org/ for more details about the machine.
 
 These machines are almost impossible to find, and very expensive when you
 do find one.  Are you open to developing on a DEC DNARD(shark) instead?
 More people have these and I can put one in your hands.

I have no problems whatsoever developing on a DEC DNARD or a CATS board. I'm
currently working on a netwinder for no better reason that it's the only one
I have available right now. I tried in the past to get hold of something else
but so far all my attemps failed.

Steph

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



Re: exec() doesn't update access time

2001-07-24 Thread Assar Westerlund

Alfred Perlstein [EMAIL PROTECTED] writes:
 What about under solaris UFS?

Yes, it does update the atime.

And most Unixes seem to do the same thing.

/assar

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



Re: review request: ng_split cleanup

2001-07-24 Thread Julian Elischer

I agree and see that you committed it already :-)


On Tue, 24 Jul 2001, Brooks Davis wrote:

 On Tue, Jul 24, 2001 at 05:04:53PM -0700, Julian Elischer wrote:
  On Tue, 24 Jul 2001, Brooks Davis wrote:
  
   Index: ng_split.c
   ===
   RCS file: /home/ncvs/src/sys/netgraph/ng_split.c,v
   retrieving revision 1.1
  
  [...]
  
   diff -u -r1.1 ng_split.c
   - /* 
   -  * XXX Really here we should just remove metadata we understand.
   -  */
   - NGI_GET_META(item, meta);
   - NG_FREE_META(meta);
  
  
  this one is tricky..
  it was written as part of a set of nodes that pass around their own
  metadata. The original idea was (so the author suggested) to stop those 
  metadata structures from propogating out of the limited part of the graph 
  that knew about them.
  
  However I don't see any harm in letting them go, since any node that
  doesn't understand a particular metadata type should ignore it..
 
 My idea was that split falls into the same catagory as one2many or tee
 in that their sole function is to move packets around and thus removing
 metadata was a POLA violation.  It seems that if you do need to create a
 wall to keep metadata out, the right answer would be an ng_stripmeta
 node who's purpose would be to remove metadata to provide this kind of
 isolation where needed.
 
 -- Brooks
 
 -- 
 Any statement of the form X is the one, true Y is FALSE.
 PGP fingerprint 655D 519C 26A7 82E7 2529  9BF0 5D8E 8BE9 F238 1AD4
 


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



RE: btx building error

2001-07-24 Thread John Baldwin


On 25-Jul-01 Weiguang SHI wrote:
 Hi,
 
 I cvs'ed the current version of btx by cvs co btx and tried to build it on 
 my FBSD-4.0 box and here is what I got:

The -current and 4.x-stable versions of BTX need the binutils (including
assembler) in 4.1 or later.

-- 

John Baldwin [EMAIL PROTECTED] -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.baldwin.cx/~john/pgpkey.asc
Power Users Use the Power to Serve!  -  http://www.FreeBSD.org/

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



RE: btx building error

2001-07-24 Thread Weiguang SHI

Wait a minute. I've got binutils 2.11, including as, which was the
most recent version that can be found at ftp.gnu.org.

Thanks
Weiguang

From: John Baldwin [EMAIL PROTECTED]
To: Weiguang SHI [EMAIL PROTECTED]
CC: [EMAIL PROTECTED]
Subject: RE: btx building error
Date: Tue, 24 Jul 2001 19:20:07 -0700 (PDT)


On 25-Jul-01 Weiguang SHI wrote:
  Hi,
 
  I cvs'ed the current version of btx by cvs co btx and tried to build 
it on
  my FBSD-4.0 box and here is what I got:

The -current and 4.x-stable versions of BTX need the binutils (including
assembler) in 4.1 or later.

--

John Baldwin [EMAIL PROTECTED] -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.baldwin.cx/~john/pgpkey.asc
Power Users Use the Power to Serve!  -  http://www.FreeBSD.org/

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


_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


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



Re: FreeBSD for ARM processor

2001-07-24 Thread David O'Brien

On Tue, Jul 24, 2001 at 11:49:16AM -0500, Dave Feustel wrote:
 Strongarm-based pcs designed by Chalice Technologies http://www.chaltech.com
 are available from  Simtek http://www.simtec.co.uk/

This brings up the issue of reference platform for the StrongARM port.
There is no one clear choice as there is for the PowerPC.  Realistically,
we probably need to pick an easily obtainable consumer StrongARM product.
The Compaq iPaq comes to mind.  However, it is not development-friendly
at the moment as it does not have peripherals such as built-in NIC, hard
drive, or serial console capabilities.

Of all the products I know of, I like the CATS board the best.  However,
the last time I investigated the CATS board, they were very expensive and
hard to find in the USA.  For some reason $600 stands out in my mind.  I
know of 10+ DNARDs in the BSD community, thus my preference for that
machine as the reference platform.
 
-- 
-- David  ([EMAIL PROTECTED])

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



Re: FreeBSD for ARM processor

2001-07-24 Thread David O'Brien

On Tue, Jul 24, 2001 at 05:55:11PM +0200, Karsten W. Rohrbach wrote:
 where can i get those platforms in europe (germany)?

No clue.

 have you got a contact at dec?

Dried up.
 
-- 
-- David  ([EMAIL PROTECTED])

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



Re: FreeBSD for ARM processor

2001-07-24 Thread Warner Losh

In message [EMAIL PROTECTED] David O'Brien writes:
: The Compaq iPaq comes to mind.  However, it is not development-friendly
: at the moment as it does not have peripherals such as built-in NIC, hard
: drive, or serial console capabilities.

I thought it did have a serial port...  All of the PocketPC machines
I've looked at do, but I haven't looked that close at the iPaq.  All
of them have some funky connector for their serial port, but that
comes with the units.

However, the iPaq is a little hard to develop on...

There are a number of other StrongARM based Windows CE machines that
would make a much better platform.  They even have NetBSD/hpcarm on
them, which would allow one to host the FreeSBD development on them if
you really wanted to do so.  The HP Journada is likely the best known
of this series and the NetBSD folks have already figured out all the
hair for things like boot loader and the like.

Failing that, the DNARD certainly is a cool machine and might make a
good reference platform.

Warner

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



Re: FreeBSD for ARM processor

2001-07-24 Thread Warner Losh

In message [EMAIL PROTECTED] Warner Losh writes:
: There are a number of other StrongARM based Windows CE machines that
: would make a much better platform.  They even have NetBSD/hpcarm on
: them, which would allow one to host the FreeSBD development on them if
: you really wanted to do so.  The HP Journada is likely the best known
: of this series and the NetBSD folks have already figured out all the
: hair for things like boot loader and the like.

Also forgot to mention that the Journada also is readily available on
Ebay for a few hundred. :-)

Warner

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



kept on appearing on my console.

2001-07-24 Thread Jett Tayer

any ideas about this?

/kernel: arp: unknown hardware address format
(0x800)


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



not showing in ps

2001-07-24 Thread Jett Tayer

im running freebsd 3.5-stable 
when i did netstat -an | grep LISTEN
 
here's the result
 
bash-2.04$ netstat -an | grep LISTEN
tcp0  0 *.80  *.*   LISTEN
tcp0  0 *.443 *.*   LISTEN
tcp0  0 *.31341   *.*   LISTEN
tcp0  0 *.22  *.*   LISTEN

noticed the 31341 port that is listening
then i did 
 
bash-2.04$ telnet localhost 31341
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
SSH-1.5-1.2.27

then on port 22
bash-2.04$ telnet localhost 22
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
SSH-1.5-OpenSSH_2.9p2

how i may kill that 31341 port coz ps isnt showing it.





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



Re: FreeBSD for ARM processor

2001-07-24 Thread Warner Losh

In message [EMAIL PROTECTED] David O'Brien writes:
: On Tue, Jul 24, 2001 at 09:05:44PM -0600, Warner Losh wrote:
:  There are a number of other StrongARM based Windows CE machines that
:  would make a much better platform.  They even have NetBSD/hpcarm on
: 
: These sound hard to develop for as you'll probably have to launch them
: from Windows CE.

Yes, you would, but that's trivial to do.  It isn't hard at all.
WinCE boots very quickly, and you can set things up so that the boot
loader runs before the touch screen calibration.  The boot loader you
pick either the netbsk kernel or the FreeBSD kernel (there's a
pulldown of the recent ones, iirc) and hit OK.  If you aren't hacking
PBSDBOOT.EXE, it is a piece of cake.

Having done a fair amount of that while getting NetBSD/hpcmips going
on my machine...

:  Failing that, the DNARD certainly is a cool machine and might make a
:  good reference platform.
: 
: Especially since their firmware is just like any Real Unix hardware in
: that it does serial console when the keyboard is not plugged in and does
: net booting trivially.

True.  But the DNARDs may be harder to get than these boxes.  Then
again, maybe not.

Just offering the Wince boxes as an option, because they also have a
high coolness factor in addition to being easy to come by.

Warner


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



Re: not showing in ps

2001-07-24 Thread Mike Silbersack


On Wed, 25 Jul 2001, Jett Tayer wrote:

 im running freebsd 3.5-stable
 when i did netstat -an | grep LISTEN

 here's the result

To find out which programs are associated with which connections, use
sockstat.

Mike Silby Silbersack


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



Re: not showing in ps

2001-07-24 Thread Daniel C. Sobral

Jett Tayer wrote:
 
 im running freebsd 3.5-stable
 when i did netstat -an | grep LISTEN
 
 here's the result
 
 bash-2.04$ netstat -an | grep LISTEN
 tcp0  0 *.80  *.*   LISTEN
 tcp0  0 *.443 *.*   LISTEN
 tcp0  0 *.31341   *.*   LISTEN
 tcp0  0 *.22  *.*   LISTEN
 
 noticed the 31341 port that is listening
 then i did
 
 bash-2.04$ telnet localhost 31341
 Trying 127.0.0.1...
 Connected to localhost.
 Escape character is '^]'.
 SSH-1.5-1.2.27
 
 then on port 22
 bash-2.04$ telnet localhost 22
 Trying 127.0.0.1...
 Connected to localhost.
 Escape character is '^]'.
 SSH-1.5-OpenSSH_2.9p2
 
 how i may kill that 31341 port coz ps isnt showing it.

Install lsof and try lsof -i :31341. But, frankly, it looks like you
have been hacked.

31337 = Elite. 31341 is too close to that.

-- 
Daniel C. Sobral(8-DCS)
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]

wow regex humor... I'm a geek

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



Re: SmartDisk USB CompactFlash reader

2001-07-24 Thread Jim Bryant

Alfred Perlstein wrote:
 
 * Leif Neland [EMAIL PROTECTED] [010724 19:18] wrote:
  I've got such a device; it was nessecary, because my camera run out of
  batteries before I could retrieve 48MB of pictures over the normal serial
  port
 
 
  When I plug it in it displays:
  ugen0: SmartDisk Corp. SM/CF Combo USB Reader, rev 1.00/0.83, addr 2
 
  Can this be read in FreeBSD?
 
 Try compiling in the 'umass' driver, you may be out of luck, SanDisk
 produced a version of thier reader that didn't use the USB disk
 specification and requires a proprietary driver for it, you may
 be stuck using this from windows.  Good news is that you can get
 one that works in freebsd for only about 20$.

I've been interested in this too...

Which one is known to work under FreeBSD?

jim
-- 
ET has one helluva sense of humor!
He's always anal-probing right-wing schizos!

_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


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



Re: SmartDisk USB CompactFlash reader

2001-07-24 Thread Devin Butterfield

On Tuesday 24 July 2001  9:37, Jim Bryant wrote:
 Alfred Perlstein wrote:
  * Leif Neland [EMAIL PROTECTED] [010724 19:18] wrote:
   I've got such a device; it was nessecary, because my camera run out of
   batteries before I could retrieve 48MB of pictures over the normal
   serial port
  
  
   When I plug it in it displays:
   ugen0: SmartDisk Corp. SM/CF Combo USB Reader, rev 1.00/0.83, addr 2
  
   Can this be read in FreeBSD?
 
  Try compiling in the 'umass' driver, you may be out of luck, SanDisk
  produced a version of thier reader that didn't use the USB disk
  specification and requires a proprietary driver for it, you may
  be stuck using this from windows.  Good news is that you can get
  one that works in freebsd for only about 20$.

 I've been interested in this too...

 Which one is known to work under FreeBSD?

I'm using the Sandisk Imagemate SDDR-31. Works fine here.
--
Regards, Devin.

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



Re: FreeBSD for ARM processor

2001-07-24 Thread Devin Butterfield

On Tuesday 24 July 2001  7:59, David O'Brien wrote:
 On Tue, Jul 24, 2001 at 11:49:16AM -0500, Dave Feustel wrote:
  Strongarm-based pcs designed by Chalice Technologies
  http://www.chaltech.com are available from  Simtek
  http://www.simtec.co.uk/

 This brings up the issue of reference platform for the StrongARM port.
 There is no one clear choice as there is for the PowerPC.  Realistically,
 we probably need to pick an easily obtainable consumer StrongARM product.
 The Compaq iPaq comes to mind.  However, it is not development-friendly
 at the moment as it does not have peripherals such as built-in NIC, hard
 drive, or serial console capabilities.

The ipaqs do have a serial port. I've been playing with linux on mine for a 
while now and I frequently use the serial console.

Some good points about the ipaq are that it is readily available, most all 
the hardware specs are available from the CRL (Compaq's Cambridge Research 
Lab) folks at handhelds.org, and of course the coolness factor. :)
--
Regards, Devin.

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



RE: btx building error

2001-07-24 Thread John Baldwin


On 25-Jul-01 Weiguang SHI wrote:
 Wait a minute. I've got binutils 2.11, including as, which was the
 most recent version that can be found at ftp.gnu.org.

That is not the binutils on a 4.0-relesae box.

-- 

John Baldwin [EMAIL PROTECTED] -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.baldwin.cx/~john/pgpkey.asc
Power Users Use the Power to Serve!  -  http://www.FreeBSD.org/

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



Re: SmartDisk USB CompactFlash reader

2001-07-24 Thread Alfred Perlstein

* Alfred Perlstein [EMAIL PROTECTED] [010724 19:20] wrote:
 * Leif Neland [EMAIL PROTECTED] [010724 19:18] wrote:
  I've got such a device; it was nessecary, because my camera run out of
  batteries before I could retrieve 48MB of pictures over the normal serial
  port
  
  
  When I plug it in it displays:
  ugen0: SmartDisk Corp. SM/CF Combo USB Reader, rev 1.00/0.83, addr 2
  
  Can this be read in FreeBSD?
 
 Try compiling in the 'umass' driver, you may be out of luck, SanDisk
 produced a version of thier reader that didn't use the USB disk
 specification and requires a proprietary driver for it, you may
 be stuck using this from windows.  Good news is that you can get
 one that works in freebsd for only about 20$.

here ya go (i think)

http://www.esend.com/sandisk/product.asp?sku=SDDR-31mscssid=E91K8VP9QUHK8NB60TWX92UQQJALCDD1


-- 
-Alfred Perlstein [[EMAIL PROTECTED]]
Ok, who wrote this damn function called '??'?
And why do my programs keep crashing in it?

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



libc.a(err.o)

2001-07-24 Thread Hal Snyder

I am wondering if there is a problem with err, warn, etc. in libc.

All these functions are in the same module, err.o. If you redefine
some of the err.o functions, and call a libc function that depends on
another (not redefined) one of the functions, then link statically,
you end up with a multiply-defined symbol.


I ran into this building a cvs snap of sfs (www.fs.net) on
FreeBSD-current. Have reviewed it with the author of that package, who
contributed the code snippet below.

A toy example of the problem follows using endpwent().


Note endpwent() indirectly depends on err.o:

Archive member included   because of file (symbol)
...
/usr/lib/libc.a(err.o)/usr/lib/libc.a(stringlist.o) (err)
/usr/lib/libc.a(stringlist.o)
  /usr/lib/libc.a(getusershell.o) (sl_add)
/usr/lib/libc.a(getusershell.o)
  /usr/lib/libc.a(pw_scan.o) (getusershell)
/usr/lib/libc.a(pw_scan.o)/usr/lib/libc.a(getpwent.o) (__pw_scan)
/usr/lib/libc.a(getpwent.o)   ../sfsmisc/.libs/libsfsmisc.a(sfsconst.o) (endpwent)


Here is the code:

#include stdio.h
#include unistd.h
#include pwd.h

void
warn (const char *msg)
{
  fprintf (stderr, WARNING: %s\n, msg);
}

int
main (int argc, char **argv)
{
  endpwent ();
  warn (exiting);
  return 0;
}


Static linking produces the following:

cc -Wl,-Bstatic -o dms dm.c
/usr/lib/libc.a(err.o): In function `warn':
err.o(.text+0x1e0): multiple definition of `warn'
/tmp/cchk0Ydc.o(.text+0x0): first defined here
/usr/libexec/elf/ld: Warning: size of symbol `warn' changed from 33 to 30 in err.o


Bug? Feature?
Do we want separate modules? Weak symbols?

Note on FreeBSD we have

/usr/lib/libc.a:err.o:0030 T err
/usr/lib/libc.a:err.o:0020 T err_set_exit
/usr/lib/libc.a:err.o: T err_set_file
/usr/lib/libc.a:err.o:0070 T errc
/usr/lib/libc.a:err.o:0138 T errx
/usr/lib/libc.a:err.o:0050 T verr
/usr/lib/libc.a:err.o:0088 T verrc
/usr/lib/libc.a:err.o:0150 T verrx
/usr/lib/libc.a:err.o:0200 T vwarn
/usr/lib/libc.a:err.o:023c T vwarnc
/usr/lib/libc.a:err.o:02e0 T vwarnx
/usr/lib/libc.a:err.o:01e0 T warn
/usr/lib/libc.a:err.o:0220 T warnc
/usr/lib/libc.a:err.o:02c8 T warnx

while NetBSD has

/usr/lib/libc.a:warn.o: T _warn
/usr/lib/libc.a:warn.o: W warn
/usr/lib/libc.a:vwarn.o: T _vwarn
/usr/lib/libc.a:vwarn.o: W vwarn
/usr/lib/libc.a:warnx.o: T _warnx
/usr/lib/libc.a:warnx.o: W warnx
/usr/lib/libc.a:vwarnx.o: T _vwarnx
/usr/lib/libc.a:vwarnx.o: W vwarnx


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