Re: Assembly interrupts and Developers handbook
On Sat, Aug 02, 2003 at 12:50:41PM -0700, pat bey wrote: First I would like to know where I can buy a copy of the FreeBSD Developer's Handbook. Nice to have a handbook that I can hold in my hand. Have you tried http://www.bsdmall.org ? -- Igor ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Using CVS diff to find out what has changed, including new files
Hi, first of all, I'd like to apologise. This may be a little off topic for this list, but as I figured here are probably the people who have the most experience with CVS and that may have the same problem, I thought you might be able to help me. I'm using cvsup for a while now to get a copy of the FreeBSD CVS repository and I have a (slightly modified) version of -STABLE checked out from there. Now there are certain areas where I'd like to see what changed before doing a cvs update. Currently I'm using cvs diff -u -N -r BASE -r RELENG_4 to do that. However this has one drawback that I'm hoping you'll be able to help me with: If files have been removed from the distribution, these files continue to show up as getting readded (even though they won't when doing an update). To see the problem, you can go to /usr/src/sbin/md5 and run the above cvs diff command. Now one possible workaround is to leave out the -N, but then I won't get a diff for files that really will be added. Did anyone else run into that problem? Any solutions that I'm overlooking? All suggestions welcome. Rolf ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Tuning HZ for semi-realtime applications
On Sun, 3 Aug 2003, Sean Hamilton wrote: SHGreetings, SH SHI have an application which has some task it must execute at some interval SH(approximately 1000 times per second.) This application calls select(2) in a SHloop, and uses its timeout parameter to try to keep the timing consistent. SH SHAt the end of a cycle, it sends out a large amount of network traffic. SHDuring the select loop, it expects to receive replies to all this traffic. SH SHShould I set HZ to 1000 (the frequency of my application) or should I set it SHto a much higher value? The CPU is running at around 2 GHz, and I set it as SHhigh as 50,000 with no problems. However, the granularity of my timeout SHappears to be restricted to 1/1000th of a second. I run almost all of my systems at HZ=1. 5 will break TCP as soon as you try to connect to systems that are a moderate round trip time away. The problem seems to be that the round trip time calculation is done in ticks and that overflows the variables at larger hertzes. You must also keep in mind that even on an otherwise idle system some processes can take longer than the 100usec when HZ=1. A typical problem are the MII status updates of several cards like the xl(4). The time they require has drastically been reduced but they still need around 900usec. harti SH SHI would like to use poll(2) instead of select, but it appears to take its SHtimeout parameter in milliseconds, which aren't precise enough to keep my SHtiming reasonable, especially if I ever need to increase my frequency. SH SHAnother option would be calling poll/select with no timeout, in a loop. SHHowever, this seems like a waste of CPU time. SH SHAlso, as I am doing large amounts of network traffic, which NIC (preferably SHgigabit) should I be using, to cause the least interference with my timing? SH SHI do not require realtime performance. I am just looking to have this run as SHsmoothly as possible. SH SHsh SH SH___ SH[EMAIL PROTECTED] mailing list SHhttp://lists.freebsd.org/mailman/listinfo/freebsd-hackers SHTo unsubscribe, send any mail to [EMAIL PROTECTED] SH -- harti brandt, http://www.fokus.fraunhofer.de/research/cc/cats/employees/hartmut.brandt/private [EMAIL PROTECTED], [EMAIL PROTECTED] ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Assembly interrupts and Developers handbook
On Sat, Aug 02, 2003 at 12:50:41PM -0700, pat bey wrote: First I would like to know where I can buy a copy of the FreeBSD Developer's Handbook. Nice to have a handbook that I can hold in my hand. Secondly, What can I find a list of other interrupts within FreeBSD like the int 80h. Or is this the only interrupt. Like example interrupt for video stuff, disk access etc. .etc FreeBSD doesn't use interrupt vectors for that sort of thing; it's not DOS. You should always use the system calls for manipulating shared resources. It is possible to call the video BIOS under certain circumstances from a user process, but this is done through a v86 monitor, whilst in v86 mode; but generally, you should use the syscons(4) driver or Xlib if you wish to use graphics. The Developer's Handbook covers most of these topics. BMS ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: libpcap
On Sun, Aug 03, 2003 at 12:13:43PM -0700, Andrew Konstantinov wrote: 1) Is there any way how I can specify in the filter description that it should match only incoming packets on some interface? inbound/outbound keywords work only for 'slip' (according to tcpdump man page). I could do that with 'not src host' and then put the local hostname after that, but is there a more general solution, without the need for local hostname or ip address? You need to call pcap_open_live() with the appropriate device argument, if you wish to monitor individual interfaces. Unfortunately the pcap interface doesn't support a means of passing the interface name to a callback handler function. So you'd have to rewrite pcap_loop() to call pcap_dispatch() for individual pcap_t's for each interface you pay specific attention to. Most pcap apps I've written that do anything elaborate require me to override pcap_loop() anyway. Perhaps there's a good candidate for extending the interface so that this sort of thing can be more easily done. 2) I can't figure out how to setup a filter so it could match several ports at once. For example, I want the filter to only match 21-25 and 113 ports for incoming traffic. How do I do that? Right know I can see only two solutions. I could simply sniff all the traffic, and then filter out the interesting ports by myself, or I could setup several filters each of which would be responsible for a specific port. But both solutions seem to be inefficient. Is there a better way to accomplish this? This is on PHK's kernel hacker TODO list! Patches gratefully accepted... http://people.freebsd.org/~phk/TODO/ BMS ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Installation and the 1024 cylinder boot problem
Recently I had to install 5.1-RELEASE at 60GB, and had a lot of troubles to start booting correctly. I hope that /stand/sysinstall have to handle 1024 cylinder booting. Otherwise I have to run 'boot0cfg' manually to fix this issue. MuTk0 ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Assembly interrupts and Developers handbook
On Sat, Aug 02, 2003, pat bey wrote: Secondly, What can I find a list of other interrupts within FreeBSD like the int 80h. Or is this the only interrupt. Like example interrupt for video stuff, disk access etc. .etc On x86, all system calls are made through int 80h with %eax set to the syscall number. See src/sys/kern/syscalls.master. In general, you don't access the hardware directly unless you're writing a device driver. ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Using CVS diff to find out what has changed, including newfiles
Rolf Grossmann [EMAIL PROTECTED] writes: I'm using cvsup for a while now to get a copy of the FreeBSD CVS repository and I have a (slightly modified) version of -STABLE checked out from there. Now there are certain areas where I'd like to see what changed before doing a cvs update. Currently I'm using cvs diff -u -N -r BASE -r RELENG_4 to do that. However this has one drawback that I'm hoping you'll be able to help me with: If files have been removed from the distribution, these files continue to show up as getting readded (even though they won't when doing an update). To see the problem, you can go to /usr/src/sbin/md5 and run the above cvs diff command. That's normal behaviour with CVS when using branches. The only workaround I know of is to specify the files explicitly. With zsh, you can do 'cvs diff -Nu -rBASE -rRELENG_4 **/*~*CVS*(.)' 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]
RE: Assembly Syscall Question
On 31-Jul-2003 Ryan Sommers wrote: When making a system call to the kernel why is it necessary to push the syscall value onto the stack when you don't call another function? Example: access.the.bsd.kernel: int 80h ret func: mov eax, 4; Write call access.the.bsd.kernel ; End Works. However: func: mov eax, 4; Write int 80h ; End Doesn't. Now, if you change it to: func: mov eax, 4; Write push eax int 80h ; End It does work. I was able to find, By default, the FreeBSD kernel uses the C calling convention. Further, although the kernel is accessed using int 80h, it is assumed the program will call a function that issues int 80h, rather than issuing int 80h directly, in the developer's handbook. But I can't figure out why the second example doesn't work. Is the call instruction pushing the value onto the stack in addition to pushing the instruction pointer on? Thank you in advance. PS I'm not on the list. First off, why are you using asm for userland stuff? Secondly, the kernel assumes that all the other arguments besides the syscall to execute (i.e. %eax) are passed on the user stack. Thus, it has to have a set location relative to the user stack pointer to find the arguments. It allows for a return IP from a call instruction to be at the top of the stack. You can tell this by looking at syscall() in sys/i386/i386/trap.c: params = (caddr_t)frame.tf_esp + sizeof(int); code = frame.tf_eax; orig_tf_eflags = frame.tf_eflags; params is a userland pointer to the function arguments. Adding the sizeof(int) skips over the saved return address, or in your 3rd case, the dummy %eax value. -- 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: Using CVS diff to find out what has changed, including new files
Dag-Erling Smørgrav wrote: Rolf Grossmann [EMAIL PROTECTED] writes: I'm using cvsup for a while now to get a copy of the FreeBSD CVS repository and I have a (slightly modified) version of -STABLE checked out from there. Now there are certain areas where I'd like to see what changed before doing a cvs update. Currently I'm using cvs diff -u -N -r BASE -r RELENG_4 to do that. However this has one drawback that I'm hoping you'll be able to help me with: If files have been removed from the distribution, these files continue to show up as getting readded (even though they won't when doing an update). To see the problem, you can go to /usr/src/sbin/md5 and run the above cvs diff command. That's normal behaviour with CVS when using branches. FWIW it also happens with HEAD (which of course is a branch aswell, but no way around). The only workaround I know of is to specify the files explicitly. With zsh, you can do 'cvs diff -Nu -rBASE -rRELENG_4 **/*~*CVS*(.)' Which, again, won't list the files I don't have yet. Wouldn't you consider it a bug listing files that are not really part of either revision? Maybe I should file a bug report with the CVS people? Anyway, thanks a lot for your reply. Rolf ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]