Re: [patch] extending/completing brandelf's OS knowledge
Kostik Belousov wrote: On Sat, Jan 23, 2010 at 01:07:44PM +0100, Alexander Best wrote: patch is pretty self explanatory i guess. brandelf should now be able to handle all OSes defined in the current SCO elf specs (26.10.2009). [...] #defineELFOSABI_STANDALONE 255 /* Standalone (embedded) application */ This does not make a sense. brandelf(1) is (was) used as a way to specify hint for the FreeBSD kernel under which ABI emulation the binary should be activated. We do not support, and I believe never will, ABIs added in the patch. but it might be useful in a cross development environment. ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Re: [patch] extending/completing brandelf's OS knowledge
On Sat, 23 Jan 2010, Kostik Belousov wrote: I do not see a need for such rudimentary ELF editor in the base at all. So, perhaps it's time to move brandelf out of the base? And if so, perhaps Alexander's contribution could be incorporated into a port for it? After the work of dchagin@/bz@, brandelf is needed only for the corner cases, if at all. Hmm, I was fooling around with some linux'y stuff the other day and needed to brandelf it (don't remember what, obviously wasn't that important). :) If this happens again in the future, is it worth reporting somewhere? (-emulation@ ?) Doug -- Improve the effectiveness of your Internet presence with a domain name makeover!http://SupersetSolutions.com/ Computers are useless. They can only give you answers. -- Pablo Picasso ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Re: Unique process id (not pid) and accounting daemon
* cronfy [100124 15:59] wrote: > Hello. > > Sorry for the crosspost, I intended to post this to freebsd-hackers@, but > sent first copy to freebsd-questions@ by mistake. > > > I am trying to create an accounting daemon that would be more precise > than usual BSD system accounting. It should read the whole process > tree from time to time (say, every 10 seconds) and log changes in > usage of CPU, I/O operations and memory per process. After daemon > notices process exit, it should read /var/account/acct to get a last > portion of accounting data and make a last entry for the process. Also > daemon should read /var/account/acct to find information about > processes that had been running between taking process tree snapshots. > > There is a problem: it is not always possible to link a process in a > process tree against matching process in an accounting file. Only > command name, user/group id and start time will match, but: > > * start time may change (i. e. after ntpdate); > * command name saved in /var/account/acct is 15 characters max > (AC_COMM_LEN in sys/sys/acct.h), while command name in the process > tree is 19 characters max (MAXCOMLEN in sys/sys/param.h). > > To ensure that process in the process tree and process in the > accounting file are the same, I want to add unique process identifier > (uint64_t) to 'proc' struct in sys/sys/proc.h and increment it for > every process fork. I see it is possible to do this just before > sx_sunlock() in fork1() in sys/kern/kern_fork.c. I'll have to add > saving of this identifier in kern_acct.c, of course. > > This way I will be extremely easy to remember a process in the process > tree and find a matching one in the accounting file after it finishes. > > Am I looking in a right direction or should I try some other way? > Thanks in advance. I've thought of this a few times, specifically how to ensure not sending a signal to a process by accident, specifically adding a version of kill(2) that took process start time. It's interesting that you bring up that start time can change, I did not know this. Now that I know this, I would suggest simply recording the start time as the serial number, then using pid+recorded_start_time as your serial number. Just an idea. -- - Alfred Perlstein .- AMA, VMOA #5191, 03 vmax, 92 gs500, 85 ch250 .- FreeBSD committer ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Re: ethernet SiS(190/191) problem driver
On Mon, Jan 25, 2010 at 01:26:46AM +0200, Nikolay Denev wrote: > On 24 Jan, 2010, at 22:17 , Pyun YongHyeon wrote: > > > On Sun, Jan 24, 2010 at 01:01:53AM +0700, zloidemon wrote: > >> Hi all! > >> > >> zlobook# uname -a > >> FreeBSD zlobook.local 8.0-STABLE FreeBSD 8.0-STABLE #22: Sun Jan 3 > >> 12:17:19 > >> KRAT 2010 r...@zlobook.local:/usr/obj/usr/src/sys/zlobook i386 > >> > >> no...@pci0:0:4:0: class=0x02 card=0x08021558 chip=0x01911039 > >> rev=0x02 hdr=0x00 > >>vendor = 'Silicon Integrated Systems (SiS)' > >>device = 'SIS190 (SIS190)' > >>class = network > >>subclass = ethernet > >> > >> this is chip=0x01911039 real SiS191 ethernet card > >> > > > > I'm not sure but SiS191 is gigabit controller so I guess you have a > > variant of SiS190. > > > >> i downloaded this is driver for sis 190 from > >> http://pohoyda.gmxhome.de/sis190- > >> freebsd-7.tar.gz > >> > >> a problem when compiling > >> > >> zlobook# make > >> Warning: Object directory not changed from original > >> /root/123/sis190-FreeBSD-7 > >> @ -> /usr/src/sys > >> machine -> /usr/src/sys/i386/include > >> awk -f @/tools/makeobjops.awk @/kern/device_if.m -h > >> awk -f @/tools/makeobjops.awk @/kern/bus_if.m -h > >> awk -f @/tools/makeobjops.awk @/dev/pci/pci_if.m -h > >> awk -f @/tools/makeobjops.awk @/dev/mii/miibus_if.m -h > >> cc -O2 -pipe -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc > >> - > >> I. -I@ -I@/contrib/altq -finline-limit=8000 --param inline-unit-growth=100 > >> -- > >> param large-function-growth=1000 -fno-common -mno-align-long-strings - > >> mpreferred-stack-boundary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 > >> -mno-sse3 > >> -ffreestanding -fstack-protector -std=iso9899:1999 -fstack-protector -Wall > >> - > >> Wredundant-decls -Wnested-externs -Wstrict-prototypes > >> -Wmissing-prototypes - > >> Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat- > >> extensions -c if_sis19x.c > >> cc1: warnings being treated as errors > >> if_sis19x.c:148: warning: pointer type mismatch in conditional expression > >> *** Error code 1 > >> > >> Stop in /root/sis190-FreeBSD-7. > >> > >> I made a patch for the driver. Now support SiS 191 and SiS 190. Tested > >> only > >> SiS 191 > >> > > > > [...] > > > >> i see a problem every 10-30 seconds > >> > >> sis19x0: error_bits=0x40020001 > >> sis19x0: watchdog timeout > >> sis19x0: watchdog timeout > >> sis19x0: watchdog timeout > >> sis19x0: watchdog timeout > >> sis19x0: watchdog timeout > >> sis19x0: watchdog timeout > >> sis19x0: error_bits=0x40020001 > >> sis19x0: watchdog timeout > >> > >> 64 bytes from 192.168.3.100: icmp_seq=52 ttl=128 time=0.256 ms > >> 64 bytes from 192.168.3.100: icmp_seq=53 ttl=128 time=0.272 ms > >> 64 bytes from 192.168.3.100: icmp_seq=54 ttl=128 time=0.294 ms > >> 64 bytes from 192.168.3.100: icmp_seq=55 ttl=128 time=4148.943 ms > >> 64 bytes from 192.168.3.100: icmp_seq=56 ttl=128 time=3150.245 ms > >> 64 bytes from 192.168.3.100: icmp_seq=57 ttl=128 time=2148.678 ms > >> 64 bytes from 192.168.3.100: icmp_seq=58 ttl=128 time=1148.346 ms > >> 64 bytes from 192.168.3.100: icmp_seq=59 ttl=128 time=147.464 ms > >> 64 bytes from 192.168.3.100: icmp_seq=60 ttl=128 time=0.111 ms > >> > >> somehow fix this possible? > > > > Because I'm not familiar with the code, I'm not sure whether this > > change is enough or not. If I remember correctly there were a > > couple of request for SiS190/SiS191 support and Alexander Pohoyda > > already wrote the driver for FreeBSD. The problem is I have no way > > to test his driver because there seems to be no way to buy > > stand-alone PCI/PCIe SiS190/SiS191 controller in market. All I can > > find was LOM implementation. > > Linux also has driver for SiS190/SiS191 and it has minimal support > > code as SiS didn't release datasheet to open source developers. But > > the code is relatively simple except using some magic values so I > > guess Alexander Pohoyda can help you. > > ___ > > freebsd-hackers@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > > To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org" > > I have a hacked up sis191 driver[*] based on Alexander Pohoyda's work and > with some other additions from > Open Solaris and Linux. > It has many ugly hacks right now, but It works (sort of) on my HP EX470 > (there are hardcoded values for gbit speed right now). > One of the problems I have is with the MTU, and I think this was fixed in > Linux so there may be hope. > But unfortunately the whole driver is full of magic values and the lack of > documentation really doesn't help. > I don't know what you're suffering from MTU but I wouldn't care much about supporting jumbo frame unless controller hangs on receiving jumbo frames. Last time I checked Alexander's driver, there were some locking issues. If
Unique process id (not pid) and accounting daemon
Hello. Sorry for the crosspost, I intended to post this to freebsd-hackers@, but sent first copy to freebsd-questions@ by mistake. I am trying to create an accounting daemon that would be more precise than usual BSD system accounting. It should read the whole process tree from time to time (say, every 10 seconds) and log changes in usage of CPU, I/O operations and memory per process. After daemon notices process exit, it should read /var/account/acct to get a last portion of accounting data and make a last entry for the process. Also daemon should read /var/account/acct to find information about processes that had been running between taking process tree snapshots. There is a problem: it is not always possible to link a process in a process tree against matching process in an accounting file. Only command name, user/group id and start time will match, but: * start time may change (i. e. after ntpdate); * command name saved in /var/account/acct is 15 characters max (AC_COMM_LEN in sys/sys/acct.h), while command name in the process tree is 19 characters max (MAXCOMLEN in sys/sys/param.h). To ensure that process in the process tree and process in the accounting file are the same, I want to add unique process identifier (uint64_t) to 'proc' struct in sys/sys/proc.h and increment it for every process fork. I see it is possible to do this just before sx_sunlock() in fork1() in sys/kern/kern_fork.c. I'll have to add saving of this identifier in kern_acct.c, of course. This way I will be extremely easy to remember a process in the process tree and find a matching one in the accounting file after it finishes. Am I looking in a right direction or should I try some other way? Thanks in advance. -- // cronfy ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Re: ethernet SiS(190/191) problem driver
On Sun, Jan 24, 2010 at 01:01:53AM +0700, zloidemon wrote: > Hi all! > > zlobook# uname -a > FreeBSD zlobook.local 8.0-STABLE FreeBSD 8.0-STABLE #22: Sun Jan 3 12:17:19 > KRAT 2010 r...@zlobook.local:/usr/obj/usr/src/sys/zlobook i386 > > no...@pci0:0:4:0: class=0x02 card=0x08021558 chip=0x01911039 > rev=0x02 hdr=0x00 > vendor = 'Silicon Integrated Systems (SiS)' > device = 'SIS190 (SIS190)' > class = network > subclass = ethernet > > this is chip=0x01911039 real SiS191 ethernet card > I'm not sure but SiS191 is gigabit controller so I guess you have a variant of SiS190. > i downloaded this is driver for sis 190 from http://pohoyda.gmxhome.de/sis190- > freebsd-7.tar.gz > > a problem when compiling > > zlobook# make > Warning: Object directory not changed from original /root/123/sis190-FreeBSD-7 > @ -> /usr/src/sys > machine -> /usr/src/sys/i386/include > awk -f @/tools/makeobjops.awk @/kern/device_if.m -h > awk -f @/tools/makeobjops.awk @/kern/bus_if.m -h > awk -f @/tools/makeobjops.awk @/dev/pci/pci_if.m -h > awk -f @/tools/makeobjops.awk @/dev/mii/miibus_if.m -h > cc -O2 -pipe -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc - > I. -I@ -I@/contrib/altq -finline-limit=8000 --param inline-unit-growth=100 -- > param large-function-growth=1000 -fno-common -mno-align-long-strings - > mpreferred-stack-boundary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 > -ffreestanding -fstack-protector -std=iso9899:1999 -fstack-protector -Wall - > Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes - > Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat- > extensions -c if_sis19x.c > cc1: warnings being treated as errors > if_sis19x.c:148: warning: pointer type mismatch in conditional expression > *** Error code 1 > > Stop in /root/sis190-FreeBSD-7. > > I made a patch for the driver. Now support SiS 191 and SiS 190. Tested only > SiS 191 > [...] > i see a problem every 10-30 seconds > > sis19x0: error_bits=0x40020001 > sis19x0: watchdog timeout > sis19x0: watchdog timeout > sis19x0: watchdog timeout > sis19x0: watchdog timeout > sis19x0: watchdog timeout > sis19x0: watchdog timeout > sis19x0: error_bits=0x40020001 > sis19x0: watchdog timeout > > 64 bytes from 192.168.3.100: icmp_seq=52 ttl=128 time=0.256 ms > 64 bytes from 192.168.3.100: icmp_seq=53 ttl=128 time=0.272 ms > 64 bytes from 192.168.3.100: icmp_seq=54 ttl=128 time=0.294 ms > 64 bytes from 192.168.3.100: icmp_seq=55 ttl=128 time=4148.943 ms > 64 bytes from 192.168.3.100: icmp_seq=56 ttl=128 time=3150.245 ms > 64 bytes from 192.168.3.100: icmp_seq=57 ttl=128 time=2148.678 ms > 64 bytes from 192.168.3.100: icmp_seq=58 ttl=128 time=1148.346 ms > 64 bytes from 192.168.3.100: icmp_seq=59 ttl=128 time=147.464 ms > 64 bytes from 192.168.3.100: icmp_seq=60 ttl=128 time=0.111 ms > > somehow fix this possible? Because I'm not familiar with the code, I'm not sure whether this change is enough or not. If I remember correctly there were a couple of request for SiS190/SiS191 support and Alexander Pohoyda already wrote the driver for FreeBSD. The problem is I have no way to test his driver because there seems to be no way to buy stand-alone PCI/PCIe SiS190/SiS191 controller in market. All I can find was LOM implementation. Linux also has driver for SiS190/SiS191 and it has minimal support code as SiS didn't release datasheet to open source developers. But the code is relatively simple except using some magic values so I guess Alexander Pohoyda can help you. ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"