truss -f, updated patch

2000-05-21 Thread Arun Sharma

Before I go to sleep, I've shortened the diff by about 50%. The new diff
is at:

http://sharmas.dhs.org/~adsharma/projects/freebsd/truss-diff.gz
http://sharmas.dhs.org/~adsharma/projects/freebsd/truss.tar.gz

To be applied as:

cd truss
gzcat -dc truss-diff.gz | patch -p1

The real 100 lines of changes are:

1. Line 306 in i386-fbsd.c (where all the action starts)
2. Last few lines of main
3. Some changes in syscalls.c:print_syscall

It now prints syscalls one per line, like linux and solaris equivalents.
The Makefile changes can be completely ignored. They are there so that
truss can be compiled in a directory other than /usr/src.

-Arun

$ truss -f -o foo sh -c ls 
$ cat foo
62898: getpid() = 62898 (0xf5b2)
62898: geteuid()= 500 (0x1f4)
62898: readlink("/etc/malloc.conf",0xbfbff79c,63)   = errno 2 'No such file or 
directory'
62898: mmap(0x0,4096,0x3,0x1002,-1,0x0) = 671793152 (0x280ac000)
62898: break(0x80bd000) = 0 (0x0)
62898: break(0x80be000) = 0 (0x0)
62898: getuid() = 500 (0x1f4)
62898: geteuid()= 500 (0x1f4)
62898: getgid() = 100 (0x64)
62898: getegid()= 100 (0x64)
62898: sigaction(SIGINT,0x0,0xbfbff7c4) = 0 (0x0)
62898: sigaction(SIGINT,0xbfbff7c4,0xbfbff7ac)  = 0 (0x0)
62898: sigaction(SIGINT,0x0,0xbfbff7c4) = 0 (0x0)
62898: sigaction(SIGINT,0xbfbff7c4,0x0) = 0 (0x0)
62898: sigaction(SIGQUIT,0x0,0xbfbff7b4)= 0 (0x0)
62898: sigaction(SIGQUIT,0xbfbff7b4,0xbfbff79c) = 0 (0x0)
62898: sigaction(SIGQUIT,0x0,0xbfbff7b4)= 0 (0x0)
62898: sigaction(SIGQUIT,0xbfbff7b4,0x0)= 0 (0x0)
62898: sigaction(SIGTERM,0x0,0xbfbff7c4)= 0 (0x0)
62898: sigaction(SIGTERM,0xbfbff7c4,0xbfbff7ac) = 0 (0x0)
62898: sigaction(SIGSYS,0xbfbff634,0xbfbff61c)  = 0 (0x0)
62898: __getcwd(0xbfbff79c,0x100)   = 0 (0x0)
62898: sigaction(SIGSYS,0xbfbff61c,0x0) = 0 (0x0)
62898: break(0x80bf000) = 0 (0x0)
62898: stat("/home/adsharma/kde/bin/ls",0xbfbff6fc) = errno 2 'No such file or 
directory'
62898: stat("/home/adsharma/bin/ls",0xbfbff6fc) = errno 2 'No such file or directory'
62898: stat("/home/adsharma/kde/bin/ls",0xbfbff6fc) = errno 2 'No such file or 
directory'
62898: stat("/bin/ls",0xbfbff6fc)   = 0 (0x0)
62898: break(0x80c) = 0 (0x0)
62898: fork()   = 62899 (0xf5b3)
62898: getpgrp()= 62897 (0xf5b1)
62899: ... Returning from fork ?()  = 0 (0x0)
62899: open(".",0,00)   = 5 (0x5)
62899: stat(".",0xbfbff798) = 0 (0x0)
62899: open(".",4,00)   = 6 (0x6)
62899: fstat(6,0xbfbff798)  = 0 (0x0)
62899: fcntl(0x6,0x2,0x1)   = 0 (0x0)
62899: __sysctl(0xbfbff650,0x2,0x807ad98,0xbfbff64c,0x0,0x0)= 0 (0x0)
62899: fstatfs(0x6,0xbfbff698)  = 0 (0x0)
62899: break(0x8083000) = 0 (0x0)
62899: getdirentries(0x6,0x8082000,0x1000,0x807e0b4)= 3072 (0xc00)
62899: break(0x8084000) = 0 (0x0)
62899: break(0x8085000) = 0 (0x0)
62899: break(0x8086000) = 0 (0x0)
62899: break(0x8087000) = 0 (0x0)
62899: getdirentries(0x6,0x8082000,0x1000,0x807e0b4)= 0 (0x0)
62899: lseek(6,0x0,0)   = 0 (0x0)
62899: close(6) = 0 (0x0)
62899: fchdir(0x5)  = 0 (0x0)
62899: close(5) = 0 (0x0)
62899: break(0x8088000) = 0 (0x0)
62899: fstat(1,0xbfbff3b8)  = 0 (0x0)
62899: ioctl(1,TIOCGETA,0xbfbff3ec) = 0 (0x0)
62899: write(1,0x8082400,31)= 31 (0x1f)
62899: write(1,0x8082400,23)= 23 (0x17)
62899: write(1,0x8082400,32)= 32 (0x20)
62899: write(1,0x8082400,33)= 33 (0x21)
62899: write(1,0x8082400,19)= 19 (0x13)
62899: write(1,0x8082400,29)= 29 (0x1d)
62899: write(1,0x8082400,20)= 20 (0x14)
62899: write(1,0x8082400,28)= 28 (0x1c)
62899: write(1,0x8082400,20)= 20 (0x14)
62899: write(1,0x8082400,25)= 25 (0x19)
62899: write(1,0x8082400,21)= 21 (0x15)
62899: write(1,0x8082400,22)= 22 (0x16)
62899: write(1,0x8082400,21)= 21 (0x15)
62899: write(1,0x8082400,29)= 29 (0x1d)
62899: write(1,0x8082400,27)= 27 (0x1b)
62899: write(1,0x8082400,26)= 26 (0x1a)
62899: write(1,0x8082400,25)= 25 (0x19)
62899: write(1,0x8082400,24)= 24 (0x18)
62899: write(1,0x8082400,30)= 30 (0x1e)
62899: write(1,0x8082400,24)= 24 (0x18)
62899: exit(0x0) = 0(8048e82)
SIGNAL 20
62898: wait4(0x,0xbfbff728,0x2,0x0) = 62899 (0xf5b3)
62898: exit(0x0) = 0(8048e82)


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



Re: further question to bus_alloc_resource

2000-05-21 Thread Alexander Langer

Thus spake Sergey Babkin ([EMAIL PROTECTED]):

> the old version somehow wedges the system. And upgrading drivers
> on a running production system is not something I personally would
> do. This is a dangerous operation and if it would cause any problems 

Heh. Of course.

But also the bktr-driver, the newbus stuff is completely borked.
I can't unload the module, as I'd like to. (work in progress...)

Alex
-- 
I need a new ~/.sig.


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



Re: enabling -DNAMEBLOCK breaks biosboot build (fwd)

2000-05-21 Thread Daniel C. Sobral

Steven Kehlet wrote:
> 
> With 3.4-STABLE code, cvsup'd on Tues May 9th, enabling -DNAMEBLOCK in
> /sys/i386/boot/biosboot/Makefile breaks the build:
  ^^^

We no longer use that. I'm surprised it is present at all in 3.4's
source code. Alas... maybe it is an old version that somehow was left
alone by cvsup? Well, anyway, no one is maintaining that code.

> I'd like the NAMEBLOCK feature so I can use nextboot.  Is there a new
> way to boot different kernels, or am I screwed?

Indeed, nextboot is not supported anymore, though one can easily write a
program to do what you want by changing /boot/loader.conf.

Please refer to loader(8), loader.conf(5) and loader.4th(8) man pages
for 3.x+ system bootstrapping.

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

"Sentience hurts."




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



Re: Post-shutdown hook for UPS shutdown?

2000-05-21 Thread Daniel O'Connor


On 19-May-00 Warner Losh wrote:
> Actually, forget what I said.  Mike smith's way is much cleaner.
> Assuming that the batteries have enough juice in them to do the
> reboot.

Doesn't matter if they do or not though..

If it powers down while you are starting up, so what? :)

---
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
  -- Andrew Tanenbaum


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



Re: truss -f, updated patch

2000-05-21 Thread Christian Weisgerber

Arun Sharma <[EMAIL PROTECTED]> wrote:

> http://sharmas.dhs.org/~adsharma/projects/freebsd/truss-diff.gz

Those gratuitous whitespace and formatting changes are a pain...

Related question:
Currently, truss does very little parsing of syscall arguments.
That table in syscalls.c looks anemic. Is there any interest in
expanding this? I guess that's something I could take on, as it
appears to be mostly grunt work.

-- 
Christian "naddy" Weisgerber  [EMAIL PROTECTED]



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



bktr, unknown PCI device?

2000-05-21 Thread Wilko Bulte

I just upgraded one of my boxes to 4.0-stable. Now I seem to have
a 'unknown card' on the PCI, seems related to the bktr. I remember
there was a posting once with a WWW pointer to a PCI-ID database. Alas
I cannot find that pointer :-(

Any clue what I'm looking at? Fxtv works like a charm BTW

bktr0:  mem 0xe700-0xe7000fff irq 7 at device 10.0 on
pci0
iicbb0:  on bti2c0
iicbus0:  on iicbb0 master-only
smbus0:  on bti2c0
bktr0: Hauppauge Model 61204 AMA 
Hauppauge WinCast/TV, Philips PAL I tuner.
pci0:  (vendor=0x109e, dev=0x0878) at 10.1 irq 7


-- 
Wilko Bulte FreeBSD, 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: bktr, unknown PCI device?

2000-05-21 Thread Alexander Langer

Thus spake Wilko Bulte ([EMAIL PROTECTED]):

> I just upgraded one of my boxes to 4.0-stable. Now I seem to have
> a 'unknown card' on the PCI, seems related to the bktr. I remember

That is the Radio-chip of your TV-card:

> bktr0:  mem 0xe700-0xe7000fff irq 7 at device 10.0 on
   
> pci0:  (vendor=0x109e, dev=0x0878) at 10.1 irq 7
   ^

I have this, too.

Alex
PS: The Alpine works fine, I'm recompiling kernel for ed0 at the
moment :-)
-- 
I need a new ~/.sig.


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



Re: bktr, unknown PCI device?

2000-05-21 Thread Kenneth Wayne Culver

It's just another part of the card that doesn't need to have a driver for
it to function, take a look at my dmesg:

bktr0:  mem 0xe9002000-0xe9002fff irq 5 at device 17.0 on pci0
bktr0: Hauppauge Model 61291 D110
Hauppauge WinCast/TV, Philips NTSC tuner.
pci0:  (vendor=0x109e, dev=0x0878) at 17.1 irq 5


=
| Kenneth Culver  | FreeBSD: The best OS around.|
| Unix Systems Administrator  | ICQ #: 24767726 |
| and student at The  | AIM: muythaibxr |
| The University of Maryland, | Website: (Under Construction)   |
| College Park.   | http://www.wam.umd.edu/~culverk/|
=

On Sun, 21 May 2000, Wilko Bulte wrote:

> I just upgraded one of my boxes to 4.0-stable. Now I seem to have
> a 'unknown card' on the PCI, seems related to the bktr. I remember
> there was a posting once with a WWW pointer to a PCI-ID database. Alas
> I cannot find that pointer :-(
> 
> Any clue what I'm looking at? Fxtv works like a charm BTW
> 
> bktr0:  mem 0xe700-0xe7000fff irq 7 at device 10.0 on
> pci0
> iicbb0:  on bti2c0
> iicbus0:  on iicbb0 master-only
> smbus0:  on bti2c0
> bktr0: Hauppauge Model 61204 AMA 
> Hauppauge WinCast/TV, Philips PAL I tuner.
> pci0:  (vendor=0x109e, dev=0x0878) at 10.1 irq 7
> 
> 
> -- 
> Wilko Bulte   FreeBSD, 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
> 



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



Re: bktr, unknown PCI device?

2000-05-21 Thread Wilko Bulte

On Sun, May 21, 2000 at 06:35:55PM +0200, Alexander Langer wrote:
> Thus spake Wilko Bulte ([EMAIL PROTECTED]):
> 
> > I just upgraded one of my boxes to 4.0-stable. Now I seem to have
> > a 'unknown card' on the PCI, seems related to the bktr. I remember
> 
> That is the Radio-chip of your TV-card:

Which is interesting, because this is a WinTV Primio which is not supposed
to have a radio chip..

> > bktr0:  mem 0xe700-0xe7000fff irq 7 at device 10.0 on
>
> > pci0:  (vendor=0x109e, dev=0x0878) at 10.1 irq 7
>^
> 
> I have this, too.

Well, I can live with it, but I'm still curious ;-)


> PS: The Alpine works fine, I'm recompiling kernel for ed0 at the
> moment :-)

Excellent!

-- 
Wilko Bulte FreeBSD, 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: truss -f, updated patch

2000-05-21 Thread Dan Nelson

In the last episode (May 21), Christian Weisgerber said:
> Arun Sharma <[EMAIL PROTECTED]> wrote:
> 
> > http://sharmas.dhs.org/~adsharma/projects/freebsd/truss-diff.gz
> 
> Those gratuitous whitespace and formatting changes are a pain...
> 
> Related question:
> Currently, truss does very little parsing of syscall arguments.
> That table in syscalls.c looks anemic. Is there any interest in
> expanding this? I guess that's something I could take on, as it
> appears to be mostly grunt work.

I had worked on this a little, but had too much trouble keeping the
binary compatible with our emulation code.  Also printing syscall args
can get pretty hairy if you want to do it *right*.  Here's a snippet of
an email I sent to another guy that was interested in rewriting truss,
about 6 months ago:

Specifiers are nice for the simple types, like int, float, and
string, but how do you specify that a sycall takes a pointer to a
struct timeval, without actually writing "struct timeval *"?  You
end up rewriting the contents of syscalls.master :)

Although you *do* need to specify somewhere which arguments are
IN/OUT/BOTH.  Like stat().  You only want to print the "struct
stat" contents after the syscall has returned.  The opposite is the
case for utimes().  You want to print the "struct timeval" before
the call. Then you have functions like poll() or select(), that
modify a structure, so you need to print it before and after.

I had patterened my code after a free version of truss for Digital
Unix.

-- 
Dan Nelson
[EMAIL PROTECTED]


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



Re: bktr, unknown PCI device?

2000-05-21 Thread Peter Wemm

Alexander Langer wrote:
> Thus spake Wilko Bulte ([EMAIL PROTECTED]):
> 
> > I just upgraded one of my boxes to 4.0-stable. Now I seem to have
> > a 'unknown card' on the PCI, seems related to the bktr. I remember
> 
> That is the Radio-chip of your TV-card:
> 
> > bktr0:  mem 0xe700-0xe7000fff irq 7 at device 10.0 on
>
> > pci0:  (vendor=0x109e, dev=0x0878) at 10.1 irq 7
>^

It's not the radio chip.  
bktr0:  mem 0xf43fe000-0xf43fefff irq 11 at device 10.0 on pci2
pci2:  (vendor=0x109e, dev=0x0878) at 10.1 irq 11

This card does not have a PCI radio chip.  The TV tuner can be put into FM
mode.  (TV audio is transmitted as FM, and the FM band is right in the middle
of the VHF TV band).

I actually looked at the Bt878 specs.  pci function 0 is the digital video
busmaster interface.  pci function 1 is the digital audio busmaster
interface.  It appears that we can have the audio subsystem send the data
via busmastering as well as via the line out plug.

Cheers,
-Peter
--
Peter Wemm - [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
"All of this is for nothing if we don't go to the stars" - JMS/B5



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



Re: NFS problems on 4.0-stable.

2000-05-21 Thread Doug Barton

Jaye Mathisen wrote:
> 
> UDP v2 mounts, Netapp Filer.
> 
> Getting a fair # of:
> got bad cookie vp 0xd24bf1c0 bp 0xc9090500
> got bad cookie vp 0xd24bfda0 bp 0xc906ceb0
> 
> on the console, and it seems to lock the machine up for several minutes
> when it does.  Then it comes back to life, and cranks for a while...
> 
> Not sure where to even start.

Start with not using nfs v2. :) I use the following options in
/etc/fstab to mount my netapp stuff from FreeBSD 4.0-Stable clients. If
you're not already using 4.0, fix that first. 

netapp:/blah /local/mountpoint nfs
rw,bg,soft,intr,nfsv3,rdirplus,mntudp,noconn

I've never seen the errors above, and the options I'm using are the
result of lots of performance testing. 

HTH,

Doug
-- 
"Live free or die"
- State motto of my ancestral homeland, New Hampshire

Do YOU Yahoo!?


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