FreeBSD 4.7R and SATA

2004-03-02 Thread Mark
Hello,

Does FreeBSD 4.7R support SATA drives? I was planning on using an ASUS
A7V600 motherboard, which has a serial ATA RAID configuration.

Thanks,

- Mark

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: HEADSUP.. USB MFC coming..

2004-03-02 Thread quetzal
On Sun, Feb 29, 2004 at 12:54:33AM +0300, Dmitry Morozovsky wrote:
>
> Well, my main headache (SONY Clie SJ20) is now in a bit different state; before
> (at 4.9p1) it failed to attach with
> 
> ucom0: Palm, Inc. Palm Handheld, rev 1.00/1.00, addr 2
> ucom0: Palm, Inc. Palm Handheld, rev 1.00/1.00, addr 2
> ucom0: init failed, STALLED
> device_probe_and_attach: ucom0 attach returned 6
> ugen0: Palm, Inc. Palm Handheld, rev 1.00/1.00, addr 2
> 
> now it is correctly identified (after HotSync activation)  as

Strange... On my Sony Clie SJ33 this patch seems does not take effect:
ucom0: Sony Palm Handheld, rev 1.10/1.00, addr 2
ucom0: Sony Palm Handheld, rev 1.10/1.00, addr 2
ucom0: init failed, IOERROR
device_probe_and_attach: ucom0 attach returned 6
uhub0: port 2, set config at addr 2 failed
uhub0: device problem, disabling port 2
uhub0: port error, restarting port 2
  
It is not a bug report about this patch it's just a vout for device.

Best regards, 
Nikolay Pavlov.
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: FreeBSD 4.7R and SATA

2004-03-02 Thread Duncan Barclay

From: "Mark" <[EMAIL PROTECTED]>
Subject: FreeBSD 4.7R and SATA


> Hello,
>
> Does FreeBSD 4.7R support SATA drives? I was planning on using an ASUS
> A7V600 motherboard, which has a serial ATA RAID configuration.

Check the archives for a couple of hacks to recognise the chipsets
correctly. I cannot remember if this is for the A7V600 board. But it is for
a recent Asus board. It should give you some pointers.
http://lists.freebsd.org/pipermail/freebsd-hackers/2003-December/004351.html

Duncan


___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: FreeBSD 4.7R and SATA

2004-03-02 Thread Mark
- Original Message - 
From: "Duncan Barclay" <[EMAIL PROTECTED]>
To: "Mark" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, March 02, 2004 9:39 AM
Subject: Re: FreeBSD 4.7R and SATA


> > Hello,
> >
> > Does FreeBSD 4.7R support SATA drives? I was planning on using an
> > ASUS A7V600 motherboard, which has a serial ATA RAID configuration.
>
> Check the archives for a couple of hacks to recognise the chipsets
> correctly.

Thanks for replying. I neglected to mention that the controller is the
VT8237.

I did indeed see some patches, for 5.2. But I am really needing it for 4.7R
as well (upgrading the system o 5.2 is, for various reasons, undoable).
Would such a patch work on 4.7 too?

Thanks,

- Mark

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: FreeBSD 4.7R and SATA

2004-03-02 Thread Duncan Barclay

> > > Hello,
> > >
> > > Does FreeBSD 4.7R support SATA drives? I was planning on using an
> > > ASUS A7V600 motherboard, which has a serial ATA RAID configuration.
> >
> > Check the archives for a couple of hacks to recognise the chipsets
> > correctly.
>
> Thanks for replying. I neglected to mention that the controller is the
> VT8237.
>
> I did indeed see some patches, for 5.2. But I am really needing it for
4.7R
> as well (upgrading the system o 5.2 is, for various reasons, undoable).
> Would such a patch work on 4.7 too?

These are for 4.9, but I think they will apply for 4.7R

> Thanks,
>
> - Mark
>
>
>

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Re: Sockets and the owner process

2004-03-02 Thread grinder
> The best you can hope for is to determine processes that are actually 
> using the socket, and that can vary during the socket's lifetime.  You 
> would have to scour the file descriptor tables in all process 
> structures to determine which processes had a handle on each socket you 
> have an interest in. 
I found that too your solution is the only way. But i have a problem with that. 
The proc structure has a variable: 
struct vnode *p_tracep; 
 
This is a pointer to the vnode list, so this is good for me, if i can walk through 
the opened vnode list for a process. But how can i find out which process 
opened that vnode and how can i walk through the opened vnode list (for one 
specified process)? 
 
As i see the vnode struct has multiple variables with vnode pointer type: 
struct vnode { 
... 
TAILQ_ENTRY(vnode) v_freelist;  /* vnode freelist */ 
TAILQ_ENTRY(vnode) v_nmntvnodes;/* vnodes for mount point */ 
LIST_ENTRY(vnode) v_synclist;   /* vnodes with dirty buffers */ 
... 
struct  vnode *v_dd;/* .. vnode */ 
... 
}; 
 
Which way is good for me if i would like to walk through the list (so which is a 
pointer to the next vnode item)? 
 
Thanks, 
Tibor Kiss 
 
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Another conformance question... This time fputs().

2004-03-02 Thread Jordan K. Hubbard
I submit for your consideration the following test program and the 
wonderful variety of test results it produces:

#include 
#include 
int main(int argc, char *argv[])
{
 int rc;
 FILE *fp=fopen("/dev/zero", "r");
 rc = fputs("Hello world\n", fp);
 printf("errno = %d, rc = %d\n", errno, rc);
 errno = 0;
 rc = fwrite("Hello world again\n", 1, 18, fp);
 printf("fwrite errno = %d, rc = %d\n", errno, rc);
 fclose(fp);
}
On Red Hat Linux 9.0, it outputs the following:

errno = 9, rc = -1
fwrite errno = 9, rc = 0
Just to save you the grepping, errno #9 is EBADF, "bad file number".  
Now we KNOW that the mode on that fopen is (a) on a device which 
doesn't allow writing and (b) of the wrong open mode ("r" rather than 
"w"), but this discussion concerns "the right thing to do" when faced 
with just these sorts of bogus situations and one could probably argue 
that Linux returns the wrong errno here, but it does set errno.

What does FreeBSD do?  It does this:

errno = 0, rc = -1
fwrite errno = 0, rc = 0
Given that it's just not kosher to write on a read-only fp and get no 
error back at all, I would argue (though not passionately) for the 
following diff to libc:

--- stdio/fvwrite.c 22 Mar 2002 21:53:04 -  1.15
+++ stdio/fvwrite.c 2 Mar 2004 08:40:25 -
@@ -43,6 +43,7 @@
 #include 
 #include 
 #include 
+#include 
 #include "local.h"
 #include "fvwrite.h"
@@ -67,8 +68,10 @@
if ((len = uio->uio_resid) == 0)
return (0);
/* make sure we can write */
-   if (cantwrite(fp))
+   if (cantwrite(fp)) {
+   errno = EACCES;
return (EOF);
+   }
 #defineMIN(a, b) ((a) < (b) ? (a) : (b))
 #defineCOPY(n)   (void)memcpy((void *)fp->_p, (void *)p, 
(size_t)(n))

That gives us this behavior for our little test program:

errno = 13, rc = -1
fwrite errno = 13, rc = 0
In both cases, we get EACCES for fputs() or fwrite() attempts on a 
read-only file pointer pointing to a read-only device, something we'd 
expect to get "permission denied" for I think.   In the case where we 
open the fp for write access, the FreeBSD behavior is unchanged:

errno = 19, rc = 0
fwrite errno = 0, rc = 18
Which gives us ENODEV for the fputs(3) and no error for the fwrite(3).  
I'm not sure why an error is returned at all in the fputs(3) case since 
it seems perfectly valid to write onto /dev/null and simply have the 
data be discarded, but that error is coming back from somewhere deeper 
of the bowels of stdio and has nothing to do with my proposed diff in 
any case.  Red Hat Linux, interestingly enough, returns errno 25 in 
this case (ENOTTY)!

This is your libc.  This is your libc on SUSv2*.  Any questions?

* References:
http://www.opengroup.org/onlinepubs/007908799/xsh/fwrite.html
http://www.opengroup.org/onlinepubs/007908799/xsh/fputs.html
--
Jordan K. Hubbard
Engineering Manager, BSD technology group
Apple Computer

Re: FreeBSD 4.7R and SATA

2004-03-02 Thread Søren Schmidt
Mark wrote:
Hello,

Does FreeBSD 4.7R support SATA drives? I was planning on using an ASUS
A7V600 motherboard, which has a serial ATA RAID configuration.
You need somthing much more up to date than 4.7R to get SATA support.
4.9 has limitted support for a few SATA controllers, but to get real
SATA support you need to go for 5.2.1
-Søren
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


[Driver WD1100] Compilation

2004-03-02 Thread thefly
hello, i've got a question about the driver compilation. I finally wrote
my driver, and i'm trying to compile it to test it. I tryed to use
/usr/share/examples/drivers/make_device_driver.sh to build the whole
stuff, but it doesn't work... Anyway I put the driver.c and the header i
built to /usr/src/sys/dev/wd/ and trying to compile it with gcc -I/sys
but it gives me a bunch of errors about definitions it doesn't find
(definitions of kernel functions and structures). I didn't find this
question in the FAQ so my question is: now that the .c is written, how
do i compile it and link it to the kernel image? My previous post was
about the use of the NewBus interface for accessing PCI devices, could
some of you please have a look at my driver (it's about 200 lines with
includes and comments and stuff)
http://chiakotay.acaro.org/acaro/wd1100/  . 

Thanks in advance, 

Claudio Martella
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


[Driver WD1100] Ooops URL error

2004-03-02 Thread thefly
hello, i'm sorry, i wrote the wrong URL in my last message, the right one is
http://chiakotay.nexlab.it/acaro/wd1100/ 

thanks 

Claudio Martella
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: [Driver WD1100] Compilation

2004-03-02 Thread Chuck Tuffli
On Tue, Mar 02, 2004 at 06:03:43AM -0500, [EMAIL PROTECTED] wrote:
> hello, i've got a question about the driver compilation. I finally wrote
> my driver, and i'm trying to compile it to test it. I tryed to use
> /usr/share/examples/drivers/make_device_driver.sh to build the whole
> stuff, but it doesn't work... Anyway I put the driver.c and the header i
[snip]

Try creating a Makefile similar to the other loadable modules. For
example,

MAINTAINER = [EMAIL PROTECTED]
KMOD   = mydriver

.PATH: ${.CURDIR}/../../dev/wd

SRCS   = driver.c

.include 

Then just type make. See src/sys/modules/*/Makefile for other
examples.

-- 
Chuck Tuffli
Agilent Technologies, Storage Area Networking
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Compilation

2004-03-02 Thread Chuck Tuffli
For the pci_* calls, you need to add the interface stuff.

In Makefile

SRC =   bus_if.h device_if.h pci_if.h device.c

In device.c

uncomment the #include  lines

---chuck

On Tue, Mar 02, 2004 at 10:54:03AM -0500, [EMAIL PROTECTED] wrote:
> I did that. I've got some #difine collisions with PCI and some system 
> defines not finding files like: 
> 
> @/sys/bus.h:320: device_if.h: No such file or directory
> @/sys/bus.h:321: bus_if.h: No such file or directory
> In file included from wd1100-lkm.c:28:
> @/pci/pcivar.h:176: pci_if.h: No such file or directory
> In file included from wd1100-lkm.c:28: 
> 
> or problems with functions not found like: 
> 
> @/pci/pcivar.h: In function `pci_enable_io':
> @/pci/pcivar.h:274: warning: implicit declaration of function 
> `PCI_ENABLE_IO'
> @/pci/pcivar.h: In function `pci_disable_io':
> @/pci/pcivar.h:280: warning: implicit declaration of function 
> `PCI_DISABLE_IO'
> @/pci/pcivar.h: In function `pci_set_powerstate':
> @/pci/pcivar.h:307: warning: implicit declaration of function 
> `PCI_SET_POWERSTATE' 
> 
> code is here: http://chiakotay.nexlab.it/acaro/wd1100/wd1100.c 
> 
>  
> 
> 
> Chuck Tuffli writes:
> > Try creating a Makefile similar to the other loadable modules. For
> > example, 
> > 
> > MAINTAINER = [EMAIL PROTECTED]
> > KMOD   = mydriver 
> > 
> > .PATH: ${.CURDIR}/../../dev/wd 
> > 
> > SRCS   = driver.c 
> > 
> > .include  
> > 
> > Then just type make. See src/sys/modules/*/Makefile for other
> > examples.
>  
> 

-- 
Chuck Tuffli
Agilent Technologies, Storage Area Networking
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Strange behaviour in assembly language program

2004-03-02 Thread Daniela
Hi!

I'm already a bit experienced with assembly, and started to enter my 
executables directly in the hexeditor (for educational purpose only; I know 
this is poor programming style).
I do not yet fully understand all aspects of the ELF header, but I managed to 
somehow write working ELF executables. I tried first a program that exits 
with status 1, and it works. But then I tried other values, and found out 
that it always exits with 1 no matter what I enter. I don't think I made a 
stupid mistake, because the Linux version (exit value given in EBX and 
ELF_OSABI = 03) runs perfectly in emulation mode. The first strange thing is, 
that it doesn't run on a real Linux system (tells me it doesn't have enough 
core memory for a 96 byte program).

Second strange thing:
Finally I came up with the simplest ASM program that reproduces the error.
Here it is:

.text
.global _start
_start:
pushl   $0
movl$1, %eax
int $0x80

I looked everywhere (Developer's handbook, Google, ...) to find the solution, 
but all resources I consulted tell me this is the right way to do it.
This program, however, always exits with 1 regardless of the value I push.

Please, can someone tell me that I made a really stupid error? I'm already 
pulling my hair out.

Thanks for your time.

Daniela


___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Strange behaviour in assembly language program

2004-03-02 Thread ari
[EMAIL PROTECTED] said this stuff:

> Finally I came up with the simplest ASM program that reproduces the error.
> Here it is:
> 
> .text
> .global _start
> _start:
>   pushl   $0
>   movl$1, %eax
>   int $0x80
> 
> I looked everywhere (Developer's handbook, Google, ...) to find the solution, 
> but all resources I consulted tell me this is the right way to do it.
> This program, however, always exits with 1 regardless of the value I push.

The kernel expects the interrupt to take place from within a function.
Try:

.text
.global _start
_start:
pushl   $8
movl$1, %eax
calldoint
doint:  int $0x80

Or, if you really want the program as simple as possible, you can push
0, eax, garbage, anything onto the stack in place of the return address:

.text
.global _start
_start:
pushl   $8
pushl   $0
movl$1, %eax
int $0x80


ari

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Strange behaviour in assembly language program

2004-03-02 Thread Daniela
On Tuesday 02 March 2004 20:15, ari wrote:
> [EMAIL PROTECTED] said this stuff:
> > Finally I came up with the simplest ASM program that reproduces the
> > error. Here it is:
> >
> > .text
> > .global _start
> > _start:
> > pushl   $0
> > movl$1, %eax
> > int $0x80
> >
> > I looked everywhere (Developer's handbook, Google, ...) to find the
> > solution, but all resources I consulted tell me this is the right way to
> > do it. This program, however, always exits with 1 regardless of the value
> > I push.
>
> .text
> .global _start
> _start:
> pushl   $8
> pushl   $0
> movl$1, %eax
> int $0x80

With this suggestion, it always returns 0 instead of 1.
Shouldn't pushl place 4 bytes on the stack? It translates into the instruction 
0x6A (pushes only one byte).
BTW, when I assemble it with as(1), there is always an extra instruction after 
my code, and it's a different one each time (and it's always one that 
effectively does nothing). Who ordered that? Is it because of alignment 
constraints in the ELF file?


___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Looking for static analysis tool to generate call graphs

2004-03-02 Thread Robert Watson
On Mon, 1 Mar 2004, Robert Watson wrote:

> I'd like to generate static call graphs from sections of src/sys/kern,
> src/sys/net, and src/sys/netinet, and ideally, get an output that looks
> pretty when printed to a (perhaps large) piece of paper.  It doesn't
> need to be able to handle function pointer magic in structures (vnode
> operations, socket operations, file descriptor operations, sysinits,
> etc); I just want a fairly high-level graph to get a feel for particular
> chunks of code spanning a couple of C files.  Anyone have any
> recommendations? Preferably something that can actually parse the
> variant of C we use in our kernel :-).

Well, using a scary combination of grep, awk, a long list of "omit this"
regexp's, and prcc from cflow, I got the following: 

http://www.watson.org/~robert/freebsd/20040302-sockets.ps

Duck and cover. 

Robert N M Watson FreeBSD Core Team, TrustedBSD Projects
[EMAIL PROTECTED]  Senior Research Scientist, McAfee Research


___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


how to get cpu states more than once a second?

2004-03-02 Thread Bernd Walter
Currently I get the states via kern.cp_time, but this only allows
a granularity of a single second and I need something around 50-100ms.
Application is a LED bargraph which doesn't have the intended effect
with just a single update per second.

-- 
B.Walter   BWCThttp://www.bwct.de
[EMAIL PROTECTED]  [EMAIL PROTECTED]

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Looking for static analysis tool to generate call graphs

2004-03-02 Thread Zajcev Evgeny
Robert Watson <[EMAIL PROTECTED]> writes:

> Well, using a scary combination of grep, awk, a long list of "omit this"
> regexp's, and prcc from cflow, I got the following: 
>
> http://www.watson.org/~robert/freebsd/20040302-sockets.ps

Actually it looks kind a mess.  Maybe use dot's clustering or ranking
to organize callgraph a little?

like this:

Clustering output:

digraph cg {
a -> b; b->c; a->c; c->d; a->d;

subgraph "cluster_one.c" { label="one.c"; a; b;};
subgraph "cluster_two.c" { label="two.c"; c; d;}
}

Layered output:

digraph cg {
a -> b; b->c; a->c; c->d; a->d;

{ rank = same; a; c; }
{ rank = same; b; d; }
}

So soXXX functions may be with same rank, also some high level
functions such as `accept', `listen', `send', etc may have same rank,
so callgraph will look like subroutine was designed on paper.

Unfortunately there is no way in dot to use clustering and ranking for
same node :(.

-- 
lg
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"