Re: how to get cpu states more than once a second?

2004-03-03 Thread Peter Jeremy
On Wed, Mar 03, 2004 at 07:27:31AM +0100, Bernd Walter wrote:
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.

As far as I can tell - both by studying the source code and by
running sysctl -x kern.cp_time in a loop - kern.cp_time increments
continuously.  statclock() increments the relevant element in the
array by one at a rate of stathz (128Hz by default).

Obviously, you need to smooth the result over a period substantially
longer than 1/128 second to get a useful result (unless you want to
pulse-width modulate your display) but 12.8Hz (stathz/10) would give
you 10 samples which would be ideal for a 10-segment bargraph.

Peter
___
[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-03 Thread Dag-Erling Smørgrav
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

 Duck and cover. 

Hmm, is there any way you can try to group functions with similar
names together?  For instance, functions whose names match /^fd.*/
call mostly eachother, and the graph would be a lot cleaner if they
were placed close together.

DES
-- 
Dag-Erling Smørgrav - [EMAIL PROTECTED]
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


FBSD 4.9-STABLE -- Lexmark z25 (USB) -- BROKEN

2004-03-03 Thread William Grim
I have a Lexmark z25 attached to my FBSD 4.9-STABLE i386 machine through 
USB.  However, I can't print to it using /dev/ulpt0.  From what I can 
find on these printers using google is that these printers are crap (too 
late to return it now).

su-2.05# usbdevs -dv
Controller /dev/usb0:
addr 1: self powered, config 1, UHCI root hub(0x), Intel(0x), 
rev 1.00
 uhub0
port 1 addr 2: self powered, config 1, Inkjet color printer(0x0057), 
Lexmark(0x043d), rev 1.00
  ulpt0
port 2 powered

As you can see, the printer is properly attached to /dev/ulpt0.  
However, lptest  /dev/ulpt0 appears to hang, and echo 1  
/dev/ulpt0 has no effect (just returns after a few seconds).  dmesg | 
grep -i ulpt returns no results.

Any ideas?

--
William Michael Grim
Student, Southern Illinois University at Edwardsville
Unix Network Administrator, SIUE, Computer Science dept.
Phone: (217) 341-6552
Email: [EMAIL PROTECTED]
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


E-mail account security warning.

2004-03-03 Thread management
--  Virus Warning Message (on the network)

Found virus WORM_BAGLE.J in file Info.pif
The file Info.pif is moved to /var/spool/quarantine/virWZV_xwhcl.

This is a machine-generated message, please do not reply via email. If you have 
questions, please contact the Lucent Help Desk at +1 888 300 0770.

-
Dear  user of e-mail server FreeBSD.ORG,

Our antivirus  software  has detected a large ammount  of  viruses  outgoing 
from your email account, you may use our free anti-virus tool to  clean up
your computer software.

Pay attention on attached file.

Have a  good day,
   The FreeBSD.ORG team http://www.freeBSD.ORG

--  Virus Warning Message (on the network)

Info.pif is removed from here because it contains a virus.

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


Re: how to get cpu states more than once a second?

2004-03-03 Thread Bernd Walter
On Wed, Mar 03, 2004 at 07:57:24PM +1100, Peter Jeremy wrote:
 On Wed, Mar 03, 2004 at 07:27:31AM +0100, Bernd Walter wrote:
 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.
 
 As far as I can tell - both by studying the source code and by
 running sysctl -x kern.cp_time in a loop - kern.cp_time increments
 continuously.  statclock() increments the relevant element in the
 array by one at a rate of stathz (128Hz by default).

Yes - my fault - the limit was selfmade...
 
 Obviously, you need to smooth the result over a period substantially
 longer than 1/128 second to get a useful result (unless you want to
 pulse-width modulate your display) but 12.8Hz (stathz/10) would give
 you 10 samples which would be ideal for a 10-segment bargraph.

It's a 16-segment USB which does the modulation itself.
I only need to send a 16bit bitmask.

-- 
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]


Adding an IPFW rule from C program

2004-03-03 Thread Matt
Tried this on the ipfw list but didnt get any response.

Part of an app I am playing with needs to be able to add an ipfw
rule.  I had though i got all of what i need from ipfw2.c and ip_fw.h
but I am painfully new to C and must be missing something.  Not
even sure how i can get myself a more usefull error message.  Any
point in the right direction would be great.  Thank you.

5.2.1R.  Kernel is all set.  firewall works fine with the real ipfw
client.


When this is built and run: [EMAIL PROTECTED] 1298 gcc -Wall
test.c -o test test.c: In function `main': test.c:134: warning:
implicit declaration of function `err' [EMAIL PROTECTED] 1299
sudo ./test Password: test: getsockopt(IP_FW_ADD): Invalid argument
[EMAIL PROTECTED] 1300

Here is test.c.   Dont mind all the extra includes.  They are all
used in the bulk of the program and I was to lazy to pick and choose
when i pulled this bit out to work on it alone.


#include stdio.h
#include errno.h
#include limits.h
#include string.h
#include stdlib.h
#include unistd.h
#include netdb.h
#include sysexits.h  

#include sys/types.h
#include sys/socket.h
#include netinet/in.h
#include netinet/in_systm.h
#include netinet/ip.h
#include arpa/inet.h
#include netinet/tcp.h
#include netinet/udp.h

#include sys/time.h
#include signal.h
#include pcap.h

#includenet/if.h
#includenetinet/ip_fw.h


static ipfw_insn *
next_cmd(ipfw_insn *cmd)
{
cmd += F_LEN(cmd);
bzero(cmd, sizeof(*cmd));
return cmd;
}

/*
 * conditionally runs the command.
 */
static int
do_cmd(int optname, void *optval, uintptr_t optlen)
{
static int s = -1;  /* the socket */
int i;

if (s == -1)
s = socket(AF_INET, SOCK_RAW, IPPROTO_RAW);

if (optname == IP_FW_GET || optname == IP_DUMMYNET_GET ||
optname == IP_FW_ADD)
i = getsockopt(s, IPPROTO_IP, optname, optval,
(socklen_t *)optlen);
else
i = setsockopt(s, IPPROTO_IP, optname, optval, optlen);
return i;
}


int main ()
{
static uint32_t cmdbuf[255], rulebuf[255];

ipfw_insn *src, *dst, *cmd;

int i;

struct ip_fw *rule;

bzero(cmdbuf, sizeof(cmdbuf));
bzero(rulebuf, sizeof(rulebuf));

rule = (struct ip_fw *)rulebuf;
cmd = (ipfw_insn *)cmdbuf;

rule-rulenum = 250;
rule-set = 2;

cmd-opcode = O_ACCEPT;
cmd-len = 1;
cmd= next_cmd(cmd);

/* this will hold our object and mask */
ipfw_insn_ip *d = (ipfw_insn_ip *)cmd;

/* ip and mask combo object */
d-o.opcode = O_IP_SRC_MASK;

/* get the in_addr in network order */
ascii2addr(AF_INET, 192.168.12.12 , (d-addr));
ascii2addr(AF_INET, 255.255.255.255 , (d-mask));

d-o.len = F_INSN_SIZE(ipfw_insn_ip);

/* move our command pointer up one step */
cmd = next_cmd(cmd);

d = (ipfw_insn_ip *)cmd;

d-o.opcode = O_IP_DST_MASK;
ascii2addr(AF_INET, 192.168.12.22 , (d-addr));
ascii2addr(AF_INET, 255.255.255.255 , (d-mask));
d-o.len = F_INSN_SIZE(ipfw_insn_ip);
cmd = next_cmd(cmd);

cmd-opcode = O_PROTO;
cmd-len = 1;
cmd-arg1 = IPPROTO_IPV4;
cmd = next_cmd(cmd);

dst = (ipfw_insn *)rule-cmd;
for (src = (ipfw_insn *)cmdbuf; src != cmd; src += i) {
i = F_LEN(src);

switch (src-opcode) {
case O_LOG:
case O_KEEP_STATE:
case O_LIMIT:
break;
default:
bcopy(src, dst, i * sizeof(uint32_t));
dst += i;
}
}

rule-act_ofs = dst - rule-cmd;
rule-cmd_len = (uint32_t *)dst - (uint32_t *)(rule-cmd);
i = (char *)dst - (char *)rule;
if (do_cmd(IP_FW_ADD, rule, (uintptr_t)i) == -1)
err(EX_UNAVAILABLE, getsockopt(%s), IP_FW_ADD);


return(1);

}


Thank you again,

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


Re: Compilation

2004-03-03 Thread thefly
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 bsd.kmod.mk 

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


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


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

2004-03-03 Thread David Schultz
On Tue, Mar 02, 2004, Jordan K. Hubbard wrote:
 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.

Nice catch.  I think the wording of POSIX suggests that the error
code is supposed to be EBADF, which is returned if ``the file
descriptor [...] is not a valid file descriptor for writing.''
Although you could argue that the standard is wrong, Linux and
Solaris return EBADF, so we probably should, too.

(By the way, there are a few other cantwrite() calls in libc that
probably have the same bug.)

 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)!

I'll bet the isatty() call in __smakebuf() is setting errno
because /dev/null doesn't support the relevant ioctl.  Note that
rc=0 so libc is ignoring the error and completing the write, even
though it spuriously sets errno.  In any case, you're right that
this is an unrelated bug.

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

ASCII stupid question, get a stupid ANSI.
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Solaris 10 zones / jails

2004-03-03 Thread Stefan Bethke
Just picked this announcement up from /.:  
http://groups.google.com/groups? 
selm=c1j796%2424c%241%40news1nwk.SFbay.Sun.COMoe=UTF-8output=gplain

Apparently, it is conceptually similiar to FreeBSD jails, but has  
slightly more advanced configuration management. Maybe some incentive  
for an enterprising hacker to move our implementation forward in that  
respect as well...

Stefan

--
Stefan Bethke [EMAIL PROTECTED]   Fon +49 170 346 0140
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


uthread_kern.c problems (still)

2004-03-03 Thread Mac Newbold

I've been getting bitten a lot lately by a bug in uthread_kern.c that
keeps causing my apache processes to run away, until I kill them. (dmesg
indicates it has also been happening to fstat processes too, but they die
instead of running away.)

The apache error log indicates this:

[Tue Mar 02 09:54:35 2004] [notice] child pid 52132 exit signal Abort trap (6)
Fatal error 'Unable to read from thread kernel pipe' at line 1100 in file
/usr/src/lib/libc_r/uthread/uthread_kern.c (errno = 0)

dmesg gets stuff like this:

pid 40525 (fstat), uid 0: exited on signal 11
pid 40377 (httpd), uid 80: exited on signal 6
pid 39306 (httpd), uid 80: exited on signal 6
pid 40770 (httpd), uid 80: exited on signal 6
pid 41064 (fstat), uid 0: exited on signal 11

I'm running apache2, mysql, php, and openssl:

Apache/2.0.48 (Unix) mod_perl/1.99_12 Perl/v5.6.1 PHP/4.3.4 mod_ssl/2.0.48
OpenSSL/0.9.7a Server

The crashes come most often running php scripts, and certain scripts can
be very reliable in causing the problem.

 uname -a
FreeBSD host-name 5.2-CURRENT FreeBSD 5.2-CURRENT #3: Thu Feb 26 17:50:22
MST 2004 [EMAIL PROTECTED]:/usr/obj/usr/src/sys/GENERIC  i386

It started after I had been using 5.1-p10 for several months, so I
upgraded to the lastest current (post 5.2-RELEASE) a few days ago, and the
problem was still there.

Google reveals that people have been seeing crashes from it for at least 8
months now, going back to June 2003, most often with gnucash for some
reason, but with apache as well. Related messages:

http://lists.freebsd.org/pipermail/freebsd-hackers/2003-November/004121.html
http://lists.freebsd.org/pipermail/freebsd-current/2004-January/017764.html
http://lists.freebsd.org/pipermail/freebsd-gnome/2004-January/004505.html
http://lists.freebsd.org/pipermail/freebsd-ports/2003-June/002248.html
http://lists.freebsd.org/pipermail/freebsd-ports/2003-July/002839.html

I'm not on this list, so please keep me cc'd.

Any ideas for solutions or workarounds would be greatly appreciated.

If others are having this problem, and you'd like something to keep your
runaway processes under control, I've got a script for it now.

Thanks,
Mac

--
Mac Newbold
[EMAIL PROTECTED]
MNE - Mac Newbold Enterprises, LLC
a href=http://www.macnewbold.com/;MNE/a
a href=http://www.dmedia.ws/;Dmedia/a
a href=http://www.bluelune.com/;Bluelune/a
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


RE: em0, polling performance, P4 2.8ghz FSB 800mhz

2004-03-03 Thread Andrew Gallatin

Don Bowman writes:

  I'm not sure what affect on fxp. fxp is inherently limited
  by something internal to it, which prevents achieving 
  high packet rates. bge is the best chip, but doesn't
  have the best bsd support.
  

Just curious - why is bge the best chip?  Is it because
it exports a really nice API (separate recv ring for small messages),
or is the chip inherently faster, regardless of its API?

I'm trying to design a new ethernet API for a firmware-based nic,
and I'm trying to convince a colleague that having separate
receive rings for small and large frames is a really good thing.

Thanks,

Drew
___
[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-03 Thread ari
[EMAIL PROTECTED] said this stuff:

  .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).

32-bit, 80386-based processors cannot push one byte onto the stack; they
can push only in 2- or 4-byte increments (word or double-word).  While
instruction 0x6a pushes an immediate one-byte value, this is only to
save instruction space.  The number is in fact pushed as a 32-bit
(sign-extended) value.

6a 08

should have the same effect as

68 08 00 00 00


On freebsd, using a native binary format, the above sample should return
8.  It works properly on any system that i've checked.  I'd be
interested in seeing your compiled binary if yours doesn't.

 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?

Each section must be aligned on a 4-byte boundary (this is not specific
to ELF).  This can be duplicated by adding

.align 4

as the last instruction.  Because the text section is intended for
executable code, as(1) offers non-operation instructions (which should
be unnecessary in any situation where a programmer doesn't know what
he's getting himself into).  Newer versions of gnu as(1) seem to pad
this with zeros, which you can duplicate with:

.align 4, 0


ari


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


Re: em0, polling performance, P4 2.8ghz FSB 800mhz

2004-03-03 Thread Luigi Rizzo
On Wed, Mar 03, 2004 at 10:03:11AM -0500, Andrew Gallatin wrote:
 
 Don Bowman writes:
 
   I'm not sure what affect on fxp. fxp is inherently limited
   by something internal to it, which prevents achieving 
   high packet rates. bge is the best chip, but doesn't

but you should not compare apples and oranges. the fxp is a 100mbit NIC,
the bge is a GigE NIC.

 Just curious - why is bge the best chip?  Is it because
 it exports a really nice API (separate recv ring for small messages),
 or is the chip inherently faster, regardless of its API?
 
 I'm trying to design a new ethernet API for a firmware-based nic,
 and I'm trying to convince a colleague that having separate
 receive rings for small and large frames is a really good thing.

i am actually not very convinced either, unless you are telling me
that there is a way to preserve ordering. Or you'd be in trouble
when, on your busy link, there is a mismatch between user-level and
link-level block sizes.

So, what is your design like, you want to pass the NIC buffers of
2-3 different sizes and let the NIC choose from the most appropriate
pool depending on the incoming frame size, but still return
received frames in a single ring in arrival order ?
This would make sense, but having completely separate rings
(small frames here, large frames there) with no ordering relation
would not.

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


Re: Adding an IPFW rule from C program

2004-03-03 Thread Luigi Rizzo
On Wed, Mar 03, 2004 at 07:37:06AM +, Matt wrote:
 Tried this on the ipfw list but didnt get any response.
 
 Part of an app I am playing with needs to be able to add an ipfw
 rule.  I had though i got all of what i need from ipfw2.c and ip_fw.h
 but I am painfully new to C and must be missing something.  Not

you don't want to use the native APi, do a system(ipfw add ...)
instead.

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


Re: em0, polling performance, P4 2.8ghz FSB 800mhz

2004-03-03 Thread Andrew Gallatin

Luigi Rizzo writes:
  On Wed, Mar 03, 2004 at 10:03:11AM -0500, Andrew Gallatin wrote:
...
   I'm trying to design a new ethernet API for a firmware-based nic,
   and I'm trying to convince a colleague that having separate
   receive rings for small and large frames is a really good thing.
  
  i am actually not very convinced either, unless you are telling me
  that there is a way to preserve ordering. Or you'd be in trouble
  when, on your busy link, there is a mismatch between user-level and
  link-level block sizes.
  
  So, what is your design like, you want to pass the NIC buffers of
  2-3 different sizes and let the NIC choose from the most appropriate
  pool depending on the incoming frame size, but still return
  received frames in a single ring in arrival order ?

Yes, exactly.  This way you get to pass the stack small (MHLEN)
frames in mbufs, rather than clusters without doing something like
copying them in the driver's rx interrupt handler.  You can allocate
tons of mbufs so that you can absorb the occasional burst (or spike in
host latency) without being as bad of pig as you'd be if you allocated
a huge number of clusters ;)

You also get to set yourself up for zero-copy receive by splitting
the headers into mbufs, and the payloads into jumbo clusters
that can get page-flipped.  But that's a lot trickier and not
really in the scope of the initial implementation.

Drew
___
[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-03 Thread Robert Watson

On Wed, 3 Mar 2004, Zajcev Evgeny wrote:

 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? 

Part of that is because things are somewhat convoluted :-).

I've applied some of your suggestions, as well as a bit more
noise-trimming and clarification, to:

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

Hopefully this is somewhat of an improvement.  I also added some more of
the socketvar.h macros to my hinted edges -- apparently prcc doesn't
really do much with our large macros, and so I was missing some edges.

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]


Re: Looking for static analysis tool to generate call graphs

2004-03-03 Thread Robert Watson

On Wed, 3 Mar 2004, Dag-Erling Smørgrav wrote:

 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
 
  Duck and cover. 
 
 Hmm, is there any way you can try to group functions with similar names
 together?  For instance, functions whose names match /^fd.*/ call mostly
 eachother, and the graph would be a lot cleaner if they were placed
 close together. 

In the most recent revision, I've tried to assign the same rank and color
to certain classes of functions: 

  System Calls (accept, bind, close, connect, dup, ...)

  Protocol Switch (pru_accept, pru_attach, pru_bind, pr_ctloutput, ...)

  File Descriptor Switch (fo_read, fo_write, fo_poll, ...)

  Socket File Descriptor Functions (soo_read, soo_write, ...)

In addition, I assigned the same color to certain classes of functions:

  Almost System Calls (kern_bind, kern_connect, accept1, ...)

  Protocol Upcalls to Socket Layer (soisdisconnected, soisdisconnected, ...)

I'm going to experiment with grouping later today.

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]


Re: Strange behaviour in assembly language program

2004-03-03 Thread Daniela
On Wednesday 03 March 2004 16:26, ari wrote:
 [EMAIL PROTECTED] said this stuff:
   .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).

 32-bit, 80386-based processors cannot push one byte onto the stack; they
 can push only in 2- or 4-byte increments (word or double-word).  While
 instruction 0x6a pushes an immediate one-byte value, this is only to
 save instruction space.  The number is in fact pushed as a 32-bit
 (sign-extended) value.

Ah yes, silly me. I constantly forget the fact that when you push someting on 
the stack, the stack pointer does not increment but rather decrement. That's 
quite unnatural to me. The kernel expects the first argument 4 bytes *below* 
the stack pointer, and I pushed that stuff in the wrong order.

This code works to return 0x57:   31 c0 40 6a 57 50 cd 80
But that needs 8 bytes! Can't it be shortened?
I noticed that some registers contain zero on program startup. Can I safely 
assume they are always initialized to zero and just leave that 31 c0 out?
I would need at least one byte off to have it fit nicely into the padding of 
the e_ident array, while not stepping on the program header. *g*
(I've become fed up with software bloat)


___
[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-03 Thread Daniela
On Wednesday 03 March 2004 16:26, ari wrote:
 [EMAIL PROTECTED] said this stuff:
   .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).

 32-bit, 80386-based processors cannot push one byte onto the stack; they
 can push only in 2- or 4-byte increments (word or double-word).  While
 instruction 0x6a pushes an immediate one-byte value, this is only to
 save instruction space.  The number is in fact pushed as a 32-bit
 (sign-extended) value.

Ah yes, silly me. I constantly forget the fact that when you push someting on 
the stack, the stack pointer does not increment but rather decrement. That's 
quite unnatural to me. The kernel expects the first argument 4 bytes *below* 
the stack pointer, and I pushed that stuff in the wrong order.

This code works to return 0x57:   31 c0 40 6a 57 50 cd 80
But that needs 8 bytes! Can't it be shortened?
I noticed that some registers contain zero on program startup. Can I safely 
assume they are always initialized to zero and just leave that 31 c0 out?
I would need at least one byte off to have it fit nicely into the padding of 
the e_ident array, while not stepping on the program header. *g*
(I've become fed up with software bloat)


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


Getting root via a user that was obtained via NIS.

2004-03-03 Thread Josef Karthauser
Anyone with a bit of NIS saviness care to help me?  I've got a FBSD5.2
machine that is connected to a larger network of suns and linux boxen.
Accounts are coordinated via yellow pages and I've managed to get the
FBSD box's NIS setup so that I can log in as one of those users.

The problem is that it appears that I can't SU to root from a user that
exists in the NIS map, but not locally.  I've added that user to
/etc/group (wheel) but I get:

phoenix:~  su root
Password:
su: Sorry
phoenix:~  id
uid=9876(jlk23) gid=20(staff) groups=20(staff), 0(wheel), 14(sysadmin)
phoenix:~  grep jlk23 /etc/group 
wheel:*:0:root,joe,jlk23
phoenix:~  ypcat passwd | grep jlk23
jlk23::9876:20:Joe Karthauser:/users/jlk23:/local/bin/tcsh

Any ideas?

Joe
-- 
Josef Karthauser ([EMAIL PROTECTED])   http://www.josef-k.net/
FreeBSD (cvs meister, admin and hacker) http://www.uk.FreeBSD.org/
Physics Particle Theory (student)   http://www.pact.cpes.sussex.ac.uk/
 An eclectic mix of fact and theory. =


pgp0.pgp
Description: PGP signature


-stable needs rw obj dir for install?

2004-03-03 Thread Julian Elischer
I have not checked this with 5.x but...


/dev/ad0s1a on / (ufs, local)
/dev/ad0s1f on /usr (ufs, local)
/dev/ad0s1e on /var (ufs, local)
10.42.0.1:/usr/ports on /usr/ports (nfs, read-only)
10.42.0.1:/usr/src on /usr/src (nfs, read-only)
10.42.0.1:/usr/obj on /usr/obj (nfs, read-only)

/usr/src and /usr/obj were precompiled on the other (NFS server) machine
with make buildworld.


then on this machine: 
Make installworld with /usr/src and/usr/obj NFS mounted readonly.

[...]
Installing /usr/libdata/perl/5.00503/mach/auto/POSIX/POSIX.bs
Installing /usr/libdata/perl/5.00503/mach/POSIX.pod
Installing /usr/libdata/perl/5.00503/mach/POSIX.pm
Writing /usr/libdata/perl/5.00503/mach/auto/POSIX/.packlist
Appending installation info to
/usr/libdata/perl/5.00503/mach/perllocal.pod
=== gnu/usr.bin/perl/library/SDBM_File
cd sdbm  make all
rm -rf libsdbm.a
rm: libsdbm.a: Read-only file system
*** Error code 1

Stop in
/usr/obj/usr/src/gnu/usr.bin/perl/library/SDBM_File/ext/SDBM_File/sdbm.
*** Error code 1

Stop in
/usr/obj/usr/src/gnu/usr.bin/perl/library/SDBM_File/ext/SDBM_File.
*** Error code 1

Why is perl trying to write to the obj directory in the 'install phase?
shouldn't it have finished all that sort of stuff  by then?

ref2# mount -u -orw /usr/obj
ref2# mount
/dev/ad0s1a on / (ufs, local)
/dev/ad0s1f on /usr (ufs, local)
/dev/ad0s1e on /var (ufs, local)
10.42.0.1:/usr/ports on /usr/ports (nfs, read-only)
10.42.0.1:/usr/src on /usr/src (nfs, read-only)
10.42.0.1:/usr/obj on /usr/obj (nfs)

ref2# make installworld
[...]
=== etc
=== etc/sendmail

--
 Rebuilding man page indices
--
cd /usr/src/share/man; make makedb
makewhatis /usr/share/man
makewhatis /usr/share/openssl/man
makewhatis /usr/share/perl/man
rm -rf /tmp/install.47576
ref2#

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


CPU update

2004-03-03 Thread Mark
Dear Sirs:

I compiled my FreeBSD 4.7R for an AMD XP-2000. If I upgrade to an AMD 64
3200, will my OS still run? The AMD 64 is 32-bit downwards compatible.

Thanks,

- Mark

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


Re: CPU update

2004-03-03 Thread John Baldwin
On Wednesday 03 March 2004 06:02 pm, Mark wrote:
 Dear Sirs:

 I compiled my FreeBSD 4.7R for an AMD XP-2000. If I upgrade to an AMD 64
 3200, will my OS still run? The AMD 64 is 32-bit downwards compatible.

Yes.  FreeBSD 5.x also supports amd64 natively.

-- 
John Baldwin [EMAIL PROTECTED]http://www.FreeBSD.org/~jhb/
Power Users Use the Power to Serve  =  http://www.FreeBSD.org
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: CPU update

2004-03-03 Thread Mark
- Original Message - 
From: John Baldwin [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: Mark [EMAIL PROTECTED]
Sent: Thursday, March 04, 2004 12:14 AM
Subject: Re: CPU update


 On Wednesday 03 March 2004 06:02 pm, Mark wrote:

  Dear Sirs:
 
  I compiled my FreeBSD 4.7R for an AMD XP-2000. If I upgrade to an
  AMD 64 3200, will my OS still run? The AMD 64 is 32-bit downwards
  compatible.

 Yes.  FreeBSD 5.x also supports amd64 natively.

Thank you for your answer.

Am I reading your also right, that you say, Yes, 4.7R will run on the AMD
64 too; but only 5.x will support its native 64 bit mode support?

Thanks,

- Mark

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


Re: CPU update

2004-03-03 Thread Kip Macy
Barring any BIOS issues a standard ia32 kernel will boot and run happily on an 
AMD64 processor.


-Kip

On Wed, 3 Mar 2004, Mark wrote:

 - Original Message - 
 From: John Baldwin [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Cc: Mark [EMAIL PROTECTED]
 Sent: Thursday, March 04, 2004 12:14 AM
 Subject: Re: CPU update
 
 
  On Wednesday 03 March 2004 06:02 pm, Mark wrote:
 
   Dear Sirs:
  
   I compiled my FreeBSD 4.7R for an AMD XP-2000. If I upgrade to an
   AMD 64 3200, will my OS still run? The AMD 64 is 32-bit downwards
   compatible.
 
  Yes.  FreeBSD 5.x also supports amd64 natively.
 
 Thank you for your answer.
 
 Am I reading your also right, that you say, Yes, 4.7R will run on the AMD
 64 too; but only 5.x will support its native 64 bit mode support?
 
 Thanks,
 
 - Mark
 
 ___
 [EMAIL PROTECTED] mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
 To unsubscribe, send any mail to [EMAIL PROTECTED]
 

-- 

If I have not seen as far as others, it is because I have been
standing in the footprints of giants.  -- from Usenet


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


Re: CPU update

2004-03-03 Thread Mark
- Original Message - 
From: Kip Macy [EMAIL PROTECTED]
To: Mark [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, March 04, 2004 12:37 AM
Subject: Re: CPU update


 Barring any BIOS issues a standard ia32 kernel will boot and run happily
 on an AMD64 processor.

Thanks; that is good news. :)

- Mark

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


Promise 20378

2004-03-03 Thread Mark
Dear Sirs:

I currently run my FreeBSD 4.7R, perfectly, on a Promise 20276 (RAID 1).
However, this chipset does not appear on;

http://www.freebsd.org/relnotes/4-STABLE/hardware/i386/x27.html#AEN33

Now I am looking at the board based on the Promise 20378 (ATA133). That does
not appear on the list either; will 4.7R be able to use it, though?

Thanks,

- Mark

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


Re: -stable needs rw obj dir for install?

2004-03-03 Thread Tim Kientzle
Julian Elischer wrote:
10.42.0.1:/usr/src on /usr/src (nfs, read-only)
10.42.0.1:/usr/obj on /usr/obj (nfs, read-only)
/usr/src and /usr/obj were precompiled on the other (NFS server) machine
with make buildworld.
then on this machine: 
Make installworld with /usr/src and/usr/obj NFS mounted readonly.
I've recently done this on -CURRENT and it does
work there.  (Of course, -CURRENT doesn't have Perl
in the base system; maybe this is part of the reason?)
Tim Kientzle

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


Re: -stable needs rw obj dir for install?

2004-03-03 Thread Julian Elischer


On Wed, 3 Mar 2004, Tim Kientzle wrote:

 Julian Elischer wrote:
 
  10.42.0.1:/usr/src on /usr/src (nfs, read-only)
  10.42.0.1:/usr/obj on /usr/obj (nfs, read-only)
  
  /usr/src and /usr/obj were precompiled on the other (NFS server) machine
  with make buildworld.
  
  then on this machine: 
  Make installworld with /usr/src and/usr/obj NFS mounted readonly.
 
 I've recently done this on -CURRENT and it does
 work there.  (Of course, -CURRENT doesn't have Perl
 in the base system; maybe this is part of the reason?)
 
 Tim Kientzle
 


The prize goes to Kris Kennaway  who suggested that it was a time sync
problem between the NFS server and client..

There in fact was a time problem. 

wierd..

 


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


Re: -stable needs rw obj dir for install?

2004-03-03 Thread William Grim
Julian Elischer wrote:

The prize goes to Kris Kennaway  who suggested that it was a time sync
problem between the NFS server and client..
There in fact was a time problem. 

wierd..
 

I don't know how it was determined that there was a time sync problem; 
however, in general, make creates updated object files depending on 
the time an object was created.  If the source code is newer than the 
object that would be built from the source code, then the object is rebuilt.

Maybe this will help you understand why the times have to be in sync 
between and NFS server and client.

--
William Michael Grim
Student, Southern Illinois University at Edwardsville
Unix Network Administrator, SIUE, Computer Science dept.
Phone: (217) 341-6552
Email: [EMAIL PROTECTED]
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: -stable needs rw obj dir for install?

2004-03-03 Thread Julian Elischer


On Wed, 3 Mar 2004, William Grim wrote:

 Julian Elischer wrote:
 
 The prize goes to Kris Kennaway  who suggested that it was a time sync
 problem between the NFS server and client..
 
 There in fact was a time problem. 
 
 wierd..
   
 
 I don't know how it was determined that there was a time sync problem; 
 however, in general, make creates updated object files depending on 
 the time an object was created.  If the source code is newer than the 
 object that would be built from the source code, then the object is rebuilt.
 
 Maybe this will help you understand why the times have to be in sync 
 between and NFS server and client

Well of course I know that, but THEORETICALLY all the dependencies were
ALSO on the  NFS partition so they should still have matched the 
result. There must be a dependency on something outside of /usr/src/ or
/usr/obj





 
 -- 
 William Michael Grim
 Student, Southern Illinois University at Edwardsville
 Unix Network Administrator, SIUE, Computer Science dept.
 Phone: (217) 341-6552
 Email: [EMAIL PROTECTED]
 
 
 ___
 [EMAIL PROTECTED] mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
 To unsubscribe, send any mail to [EMAIL PROTECTED]
 

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


Call for FreeBSD Bi-Monthly Status Reports

2004-03-03 Thread Scott Long
All,

It's time for the Jan-Feb 2004 FreeBSD status report.  It hasn't been quite 
two months since the last report, but I'm trying to get back onto the normal 
2-month cycle.  Please submit your report to [EMAIL PROTECTED] by March 13, 
2004.  The template for the report is at 
http://www.freebsd.org/status/reports-sample.xml.

As always, we are looking for reports on projects that relate to FreeBSD.  
Topics can include ongoing development, new features, documentation, or 
wahtever else relates to the progress and spread of FreeBSD.  Again, reports 
are due by March 13.  Thanks a lot!

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


Resend: Call for FreeBSD Bi-Monthly Status Reports

2004-03-03 Thread Scott Long
[Resending to correct the URL below]

All,

It's time for the Jan-Feb 2004 FreeBSD status report.  It hasn't been quite 
two months since the last report, but I'm trying to get back onto the normal 
2-month cycle.  Please submit your report to [EMAIL PROTECTED] by March 13, 
2004.  The template for the report is at 
http://www.freebsd.org/news/status/report-sample.xml.

As always, we are looking for reports on projects that relate to FreeBSD.  
Topics can include ongoing development, new features, documentation, or 
wahtever else relates to the progress and spread of FreeBSD.  Again, reports 
are due by March 13.  Thanks a lot!

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


Re: CPU update

2004-03-03 Thread Mark Dixon
On Wednesday 03 Mar 2004 23:09, John Baldwin wrote:
 On Wednesday 03 March 2004 06:02 pm, Mark wrote:
  Dear Sirs:
 
  I compiled my FreeBSD 4.7R for an AMD XP-2000. If I upgrade to an AMD 64
  3200, will my OS still run? The AMD 64 is 32-bit downwards compatible.

 Yes.  FreeBSD 5.x also supports amd64 natively.

The next question is then can you rebuild world and ports for amd64, reboot 
and run in 64bit mode?

Mark


pgp0.pgp
Description: signature


IBM BladeCenter success story anybody?

2004-03-03 Thread Danny Braniss
hi,
while evaluating such a box, im stuck.
1) diskless boot/pxe:
   loads, but booting the kernel with acpi hangs, without acpi fails - it seems
   that the Broadcom NIC is not recognized.
2) trying to install via cd
   bios boots the cd ok, but the boot on the cd failes to read.

the hardware seems ok, linux did boot and work ok (of cource ibm poured
some M$ into linux :-)

btw, i tried current as of yesterday.

danny


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