Re: user-space resource information...
"Kenneth D. Merry" wrote: > ... > > That's vmstat's problem, not a feature. :-) ... > > If it's not vm-related, it shouldn't be listed by vmstat. > > Interrupts aren't vm-related either, yet vmstat displays them. And it shouldn't do so. See my first comment. :-) -- Daniel C. Sobral(8-DCS) [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] He has been convicted of criminal possession of a clue with intent to distribute. To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: gdb & threaded application
On 5 Nov 2000, Jason Evans wrote: > the first thing I'd do if I were you would be to link statically. Yep that fixed it. Thanks for your time, Andrew To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: gdb & threaded application
On Mon, Nov 06, 2000 at 01:33:21AM +1000, [EMAIL PROTECTED] wrote: > Hi, > > I have a program compiled with -pthread and I'm trying to use gdb to debug > it. I run the program in one window and then try to attach to it from > another. I have put a sleep 10 in the program so I can catch it before it > enters the section I want to debug. This is what I get: > > Attaching to program: /usr/home/andrew/work/msgs2/msgs, process 10063 > Reading symbols from /usr/lib/libc_r.so.4...done. > Reading symbols from /usr/libexec/ld-elf.so.1...done. > 0x280b7368 in _thread_sys_poll () from /usr/lib/libc_r.so.4 ^^^ For reasons that I don't entirely understand, using gdb with dynamically linked applications usually produces very undesireable (often totally incorrect) results on FreeBSD. I don't know that this is the problem, but the first thing I'd do if I were you would be to link statically. Jason To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: isp1100 serial console problem
> the doc mentions that using hypertermial on win you can access the bios > via F2, but if i use kermit on freebsd, this does not work. Use an xterm and cu. It's expecting ansi function key codes. > can i setup kermit that it submit function keys to the device the same way > hyerterminal does, if it is set to ansi mode. Probably, but I wouldn't be able to tell you how. > by the way, does anybody know anything about the console redirection to > lan, which is also supported by the server? Yes. It's broken and doesn't work as of the latest BIOS from Intel. In fact, enabling it will cause the machine to lock up so hard you need to default the CMOS to get it back. -- ... 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: KLD's on ISA bus: how?
In message <[EMAIL PROTECTED]> Rink Springer VII writes: : Yes... is that bad? It was the only way to get BSD to probe it. You should do this only if you haven't done it already. : On the sidenote, my BSD box totally CRASHES after I attach the device using the : ether_attach call... any idea why? I've had this problem in the past. Usually it is due to not giving the softc the right size in the device declaration because I copied it from somewhere that didn't use a softc and specified a '1'. Warner To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: KLD's on ISA bus: how?
On Sun, 05 Nov 2000, Warner Losh wrote: > In message <[EMAIL PROTECTED]> Rink Springer writes: > : I've got a probe, attach and a dummy identify procedure for my driver > : now. When I load the KLD, my identify procedure gets triggered, but the > : probe procedure doesn't! Why? Can someone help me? I've tightly used > : aha_isa.c as a help... for some reason, FreeBSD doesn't appear even to > : CALL the probe thing! > > Are you actually adding a child device in the identify routine? > > Warner Yes... is that bad? It was the only way to get BSD to probe it. I'll make the source availabletomorrow. too late now. On the sidenote, my BSD box totally CRASHES after I attach the device using the ether_attach call... any idea why? Thanks! --Rink > > > 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: KLD's on ISA bus: how?
In message <[EMAIL PROTECTED]> Sergey Babkin writes: : Hints file is only in -current (AKA 5.0). In 4.x the kernel config : file contains this information (which I guess is of no use for : KLD drivers). Probably you can do a likewise thing in 4.x with : sysctl variables. I've ported the meat of the 5.x hints stuff to 4.x for Timing Solution's embedded products. It works great there so I sometimes forget that it isn't in stable. Maybe I should MFC after 4.2 release. All that I merge does is if there are hints in the boot environment, it sets them. It doesn't do all the rest of the stuff Peter did to -current. Warner To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: KLD's on ISA: another problem
In message <[EMAIL PROTECTED]> Rink Springer VII writes: : static void : dl_identify (driver_t* driver,device_t parent) { : device_t t; : : printf ("DL: IDENTIFY\n"); : t = BUS_ADD_CHILD (parent, 0, "dl", 0); : bus_set_resource (t, SYS_RES_IOPORT, 0, 0x378, 3); : bus_set_resource (t, SYS_RES_IRQ, 0, 7, 1); : } You need to check to see if the child is already there or not before adding it. : But upon loading, it *CRASHES* (!) FreeBSD after the dl0: DONE thing... You shouldn't hold any resources after your probe routine. You must free them. It is also generally a bad idea to store things in softc in probe as the device framework is free to destroy the softc iirc. Make sure that your softc size is specified properly, otherwise you may crash. Warner To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: KLD's on ISA bus: how?
In message <[EMAIL PROTECTED]> Rink Springer writes: : I'd like to point out that I'm writing a KLD driver, so the problem : shouldn't be in the kernel, correct? Yes : Why is this? Aha.c does an ISA auto-detect, which I want to do too... : why does it work for AHA and not for me? I'll need some code to look at. Warner To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: KLD's on ISA bus: how?
In message <[EMAIL PROTECTED]> Rink Springer writes: : I've got a probe, attach and a dummy identify procedure for my driver : now. When I load the KLD, my identify procedure gets triggered, but the : probe procedure doesn't! Why? Can someone help me? I've tightly used : aha_isa.c as a help... for some reason, FreeBSD doesn't appear even to : CALL the probe thing! Are you actually adding a child device in the identify routine? Warner To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
isp1100 serial console problem
hi there, i just got a intel isp1100 server, which supports redirection of the console to serial ports. the doc mentions that using hypertermial on win you can access the bios via F2, but if i use kermit on freebsd, this does not work. can i setup kermit that it submit function keys to the device the same way hyerterminal does, if it is set to ansi mode. by the way, does anybody know anything about the console redirection to lan, which is also supported by the server? thanks sven To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: user-space resource information...
On Sun, Nov 05, 2000 at 17:32:16 +0900, Daniel C. Sobral wrote: > "Kenneth D. Merry" wrote: > > > > I think vmstat(8) might be a better fit than iostat. vmstat already > > displays kernel memory usage (-m), interrupt usage (-i), paging stats (-s), > > and zone allocator stats (-z). > > That's vmstat's problem, not a feature. :-) > > That kind of thinking is what led to Linux /proc. > > > Since vmstat already has "kitchen sink" type functionality (i.e. a wide > > variety of uses), I think it would probably work better to put this new > > functionality there. > > If it's not vm-related, it shouldn't be listed by vmstat. Interrupts aren't vm-related either, yet vmstat displays them. > > iostat is also designed primarily for continuous output use -- displaying a > > line of stats every N seconds. vmstat is also designed for that in its > > That's the objection I raised to Mike. :-) I suggested systat, though > that has it's problems too. Well, perhaps this stuff should go in its own utility, since it doesn't really seem to fit anywhere else. Ken -- Kenneth Merry [EMAIL PROTECTED] To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: KLD's on ISA bus: how?
Rink Springer wrote: > > PS. I couldn't find a hints file or something, as someone pointed out... Hints file is only in -current (AKA 5.0). In 4.x the kernel config file contains this information (which I guess is of no use for KLD drivers). Probably you can do a likewise thing in 4.x with sysctl variables. -SB To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: KLD's on ISA bus: how?
Rink Springer wrote: > > Sergey Babkin wrote: > > Hi, > > I've got a probe, attach and a dummy identify procedure for my driver > now. When I load the KLD, my identify procedure gets triggered, but the > probe procedure doesn't! Why? Can someone help me? I've tightly used > aha_isa.c as a help... for some reason, FreeBSD doesn't appear even to > CALL the probe thing! Does your identify() routine add the devices to be probed ? BTW, did you look at my article in DaemonNews from June 2000 (www.daemonnnews.org) ? It has a general description of how these things work in 4.x. Though it does not consider specifically the KLD drivers, things should be the same for them. I think this article should be somewhere in the Handbook too or at least the guys from the docs project were going to include it. -SB To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
gdb & threaded application
Hi, I have a program compiled with -pthread and I'm trying to use gdb to debug it. I run the program in one window and then try to attach to it from another. I have put a sleep 10 in the program so I can catch it before it enters the section I want to debug. This is what I get: Attaching to program: /usr/home/andrew/work/msgs2/msgs, process 10063 Reading symbols from /usr/lib/libc_r.so.4...done. Reading symbols from /usr/libexec/ld-elf.so.1...done. 0x280b7368 in _thread_sys_poll () from /usr/lib/libc_r.so.4 (gdb) n Single stepping until exit from function _thread_sys_poll, which has no line number information. 0x280b674f in _thread_kern_sched_state_unlock () from /usr/lib/libc_r.so.4 (gdb) n Single stepping until exit from function _thread_kern_sched_state_unlock, which has no line number information. 0x280b5f99 in _thread_kern_sched () from /usr/lib/libc_r.so.4 (gdb) n Single stepping until exit from function _thread_kern_sched, which has no line number information. 0x28078a70 in _init () from /usr/lib/libc_r.so.4 (gdb) n Single stepping until exit from function _init, which has no line number information. Error accessing memory address 0x158: Bad address. (gdb) n Single stepping until exit from function _thread_kern_sched, which has no line number information. Program received signal SIGSEGV, Segmentation fault. 0x280b591f in _thread_kern_sched () from /usr/lib/libc_r.so.4 (gdb) q The program is running. Quit anyway (and detach it)? (y or n) y Detaching from program: /usr/home/andrew/work/msgs2/msgs, process 10063, thread 1 ptrace: No such process. (gdb) To get out of gdb I need to suspend and kill it. Now this certainly isn't the behaviour I get when running it without the debuger. I haven't spawned any threads at this point. Any ideas what I'm doing wrong? Thanks, Andrew To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
KLD's on ISA: another problem
Hi guys, It works nicer now... the IDENTIFY code will now happily tell FreeBSD the device is at 0x378, IRQ 7. The code I used for this is: static void dl_identify (driver_t* driver,device_t parent) { device_t t; printf ("DL: IDENTIFY\n"); t = BUS_ADD_CHILD (parent, 0, "dl", 0); bus_set_resource (t, SYS_RES_IOPORT, 0, 0x378, 3); bus_set_resource (t, SYS_RES_IRQ, 0, 7, 1); } static int dl_probe (device_t dev) { struct dl_softc* sc = device_get_softc (dev); int rid = 0; sc->ioaddr = bus_get_resource_start (dev, SYS_RES_IOPORT, 0); sc->iobase = bus_alloc_resource (dev, SYS_RES_IOPORT, &rid, 0ul, ~0ul, 3, RF_ACTIVE); /* [error check code] */ sc->ioaddr = rman_get_start (sc->iobase); /* [probe stuff] */ return 0; } static int dl_attach (device_t dev) { int rid; struct dl_softc* sc = device_getr_softc(dev); void *ih; printf ("dl0: grab IRQ\n"); sc->irqbase = bus_alloc_resource (dev, SYS_RES_IRQ, &rid, 0ul, ~0ul, 1, RF_ACTIVE); /* [ error check ] */ printf ("dl0: set IRQ handkler\n"); if (bus_setup_intr (dev, sc->irqbase, INTR_TYPE_NET, dl_intr, (void*)sc, &ih)) { /* [error check] */ } printf ("dl0: DONE!\n"); } But upon loading, it *CRASHES* (!) FreeBSD after the dl0: DONE thing... HELP! Anyone know how I can fix this? Sorry for all those messages lately, but I really want this to work! Thanks! --Rink To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
sppp driver bug?
Hi I am trying to use the sppp driver of the 4.1FreeBSD to establish ip connection over ppp between two pc's. It usually works, but in a small percentage of the cases one of the interfaces gets stack in the following state: lcp is in state closed and ipcp is in state closed (I know that for sure from debug prints I added). The real problem is that nothing seems to get the interface out of its "problematic" state. (I tried putting it down and up, transferring it to hdlc and back and more...) I think the following change in sppp_lcp_tld will enable the interface to recover using ifconfig down and up. original lines: for (i = 0, mask = 1; i < IDX_COUNT; i++, mask <<= 1) if (sp->lcp.protos & mask && ((cps[i])->flags & CP_LCP) == 0) { My suggested lines: for (i = 0; i < IDX_COUNT; i++) if (((cps[i])->flags & CP_LCP) == 0) { The idea here is that since the ipcp is in closed state, its bit in the lcp.protos is not set, so it never receives the down and close event (inside the if). It also does not put the bit on when getting open event (since it is in the stopped state), so it never receives up event in sppp_lcp_tlu. If anyone has an idea why the interface gets stack in the first place, I'll be very glad to hear. I also want to know if my code change seems reasonable. Thanks, Ido
Re: KLD's on ISA bus: how?
> [snip] > There is two way. > > 1.Write device_identify method and put auto-probe scheme to this.and ,if found, > use BUS_ADD_CHILD to add your driver as ISA driver and > use BUS_SET_RESOURCE to set resource you found. What are the prototypes of these? Can't find them... vpo.c has it for BUS_ADD_CHILD, which FINALLY causes FreeBSD to probe my neat device (yay!), but the SET_RESOURCE thing, what's the syntax? Thanks! --Rink To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
pxe
hi all, I'm trying to figure out why in pxe.c (sys/boot/i386/libi386) the ip in ip:path is quietly ignored. there must be a reason, but it escapes me. the problem im having, is that since my nfs-root server is not the dhcpd-server, the only way to give it the root nfs ip, is via the option swap-server. tia, danny To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: KLD's on ISA bus: how?
Hi, I'd like to point out that I'm writing a KLD driver, so the problem shouldn't be in the kernel, correct? For some reason, FreeBSD refuses to call my probe() thing. It does identify() it, though. Why is this? Aha.c does an ISA auto-detect, which I want to do too... why does it work for AHA and not for me? Help! PS. I couldn't find a hints file or something, as someone pointed out... Thanks! --Rink > > Warner Losh wrote: > > > > > > In message <[EMAIL PROTECTED]> Sergey Babkin writes: > > > > > : In 4.x if you say in config file > > > : > > > : foo at isa > > > : > > > : and provide the identify routine in the driver the result should be > > > : the same. The "ep" driver does that using a proprietary probe > > > : procedure. > > > > > > Most cards don't have that backdoor. They are either full plug and > > > play, or they are rock stupid. Come to think of it, there are some > > > that are both :-). The foo at isa might not work even in 4.x. It > > > will attach a child with no hints at all, so the probe routine won't > > > know where to look. The identify routine is the only way to deal. In > > > 4.x, you say > > > device ep > > > not > > > device ep at isa > > > iirc. > > > > Ah, right. I confused it with another case, where the probe routine > > tries to look for all possible ports. If I remember correctly, > > "aha" is an example of such device. > > > > -SB > > > > > > > To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: dhcp boot was: Re: diskless workstation
In message <[EMAIL PROTECTED]>, Doug Ambrisko writes: >| to the kernel's output. I had a look at the pxe code in >| /sys/boot/i386/libi386/pxe.c where pxeboot is built from and in >| /sys/i386/i386/autoconf.c which is the kernel side and it looks like >| they don't do anything about swap. There is a /* XXX set up swap? */ >| placeholder though. :-) > >Yep looks like you're right, I just tried it on 4.2-BETA it worked in >4.1.1. Swap is now broken ... sigh this is going to be a problem. I >guess the only thing you might be able to do in the interim is to do a >vnconfig of a file and then mount that as swap. I think the vnconfig >man pages describes this. Hopefully it works over NFS. The diskless setup we use here is based on a compiled-in MFS root rather than an NFS root, so we couldn't use the bootp code to enable NFS swap. Our solution was a modification to swapon() to enable direct swapping to NFS regular files. This results in the same swaponvp() call that the bootp code would use (at the time we implemented this, swapping over NFS via vnconfig was extremely unreliable; I think things are much better now). The patch we use is below. Ian Index: vm_swap.c === RCS file: /FreeBSD/FreeBSD-CVS/src/sys/vm/vm_swap.c,v retrieving revision 1.96 diff -u -r1.96 vm_swap.c --- vm_swap.c 2000/01/25 17:49:12 1.96 +++ vm_swap.c 2000/11/05 11:04:34 @@ -202,10 +202,14 @@ NDFREE(&nd, NDF_ONLY_PNBUF); vp = nd.ni_vp; - vn_isdisk(vp, &error); - - if (!error) + if (vn_isdisk(vp, &error)) error = swaponvp(p, vp, vp->v_rdev, 0); + else if (vp->v_type == VREG && vp->v_tag == VT_NFS) { + struct vattr attr; + error = VOP_GETATTR(vp, &attr, p->p_ucred, p); + if (!error) + error = swaponvp(p, vp, NODEV, attr.va_size/DEV_BSIZE); + } if (error) vrele(vp); To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: KLD's on ISA bus: how?
Sergey Babkin wrote: Hi, I've got a probe, attach and a dummy identify procedure for my driver now. When I load the KLD, my identify procedure gets triggered, but the probe procedure doesn't! Why? Can someone help me? I've tightly used aha_isa.c as a help... for some reason, FreeBSD doesn't appear even to CALL the probe thing! Please help me! Thanks! --Rink > > Warner Losh wrote: > > > > > > In message <[EMAIL PROTECTED]> Sergey Babkin writes: > > > > > : In 4.x if you say in config file > > > : > > > : foo at isa > > > : > > > : and provide the identify routine in the driver the result should be > > > : the same. The "ep" driver does that using a proprietary probe > > > : procedure. > > > > > > Most cards don't have that backdoor. They are either full plug and > > > play, or they are rock stupid. Come to think of it, there are some > > > that are both :-). The foo at isa might not work even in 4.x. It > > > will attach a child with no hints at all, so the probe routine won't > > > know where to look. The identify routine is the only way to deal. In > > > 4.x, you say > > > device ep > > > not > > > device ep at isa > > > iirc. > > > > Ah, right. I confused it with another case, where the probe routine > > tries to look for all possible ports. If I remember correctly, > > "aha" is an example of such device. > > > > -SB > > > > > > > To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Bogus filename error with pkg_add
Hi! I'm working on a port which tries to install some files containing a "'" character in the filename. The ports system works well but when I create the package and try to install it with pkg_add it bombs with a "Bogus filename" message. The code in /usr/src/usr.sbin/pkg_install/add/extract.c looks like this: if (strrchr(p->name,'\'')) { cleanup(0); errx(2, __FUNCTION__ ": Bogus filename \"%s\"", p->name); } I know that "'" might not be the best character for filenames but what exactly is the reason for pkg_add not allowing those characters? After all the installation as a port works fine. Stefan To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: user-space resource information...
"Kenneth D. Merry" wrote: > > I think vmstat(8) might be a better fit than iostat. vmstat already > displays kernel memory usage (-m), interrupt usage (-i), paging stats (-s), > and zone allocator stats (-z). That's vmstat's problem, not a feature. :-) That kind of thinking is what led to Linux /proc. > Since vmstat already has "kitchen sink" type functionality (i.e. a wide > variety of uses), I think it would probably work better to put this new > functionality there. If it's not vm-related, it shouldn't be listed by vmstat. > iostat is also designed primarily for continuous output use -- displaying a > line of stats every N seconds. vmstat is also designed for that in its That's the objection I raised to Mike. :-) I suggested systat, though that has it's problems too. -- Daniel C. Sobral(8-DCS) [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] He has been convicted of criminal possession of a clue with intent to distribute. To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message