RE: [rtl] Virus emails
This is ridiculous. Can't attachments be blocked until a better way of dealing with them is worked out. cheers, Stuart -Original Message- From: Stephane Ouellette [mailto:[EMAIL PROTECTED]] Sent: Thursday, 5 April 2001 6:45 To: RT-Linux Group Subject: Re: [rtl] Virus emails David Olofson wrote: On Tuesday 03 April 2001 20:07, Heinz Haeberle wrote: I agree Yeah, these virus warnings and crap I'm getting start to get annoying. Now, if the "solution" is to disable attachments, is there some backup solution to use for communicating small files closely related to posts? "Private" FTP space for list members only, or something... As I can see, these virus e-mails always come from the same e-mail address. I know that Sendmail supports an anti-spam black list, couldn't we use it to stop these e-mails ??? That way, we wouldn't need to disable attachments. Regards, Stephane Ouellette -- [rtl] --- To unsubscribe: echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR echo "unsubscribe rtl Your_email" | mail [EMAIL PROTECTED] -- For more information on Real-Time Linux see: http://www.rtlinux.org/rtlinux/ -- [rtl] --- To unsubscribe: echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR echo "unsubscribe rtl Your_email" | mail [EMAIL PROTECTED] -- For more information on Real-Time Linux see: http://www.rtlinux.org/rtlinux/
[rtl] Virus and spam emails
We are working on solving the problem. We have denied email submission from several of the originating sites but there are a lot of them. We do use DNS RBL blacklist rejection of open-relays and reject email from known spam sites with explicit rules. Spam email is not as simple as it was 6 months ago. Blocking solutions are slow to keep up and sendmail is even slower. The problem will be solved. In the meantime, I ask for patience while we work on it. -- [rtl] --- To unsubscribe: echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR echo "unsubscribe rtl Your_email" | mail [EMAIL PROTECTED] -- For more information on Real-Time Linux see: http://www.rtlinux.org/rtlinux/
[rtl] PROBLEM WITH HAUPPAGE BOARD AND RTLINUX
Prof. Barabanov, I have a problem about RTLinux that I asked by maillist but nobody one has been able to help me to solve it. You are my last possibiliy. I have a PC with two kernel, the first the 2.2.17 , the default RedHat distribution , and the last compiled for RTLinux ( 2.2.18 + RTL3.0 ) . I have a real time application for the control a magnetic levitator . This application is a remote application . In order to allow the user to watch "as life" through his own computer I installed an Haupage board ( Bt878 ) that by the VIC ( videoconference ) application allows the vision When I use the board with the 2.2.17 kernel the video conference is possible, but when I use the same board ( I try with two Bt878 board ) something is wrong and the vision is impossible. I tried to change the interrupt, to verify the possible I/O conflits, I even tried to change the board but until now nothing t o do. ! Are you able to help me to understand what is happening, why the Hauppage board does not work under RTLinux ? Thank you for your help . Alessandro Coppelli -- [rtl] --- To unsubscribe: echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR echo "unsubscribe rtl Your_email" | mail [EMAIL PROTECTED] -- For more information on Real-Time Linux see: http://www.rtlinux.org/rtlinux/
[rtl] RTLinux+PHP
Hi everyone! Help me please. I need my Rtl Task started from PHP. How this do? The Commands of type EXEC() do not work. Sorry for my english. -- [rtl] --- To unsubscribe: echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR echo "unsubscribe rtl Your_email" | mail [EMAIL PROTECTED] -- For more information on Real-Time Linux see: http://www.rtlinux.org/rtlinux/
Re: [rtl] ??? RTLinux on Linux v2.4.2 available for PPC
What machine and chip is this? } Just use rtlinux-3.0 final release, or you can change the Makefile in /usr/src/linux manually. } change this line , at the top of Makefile: } } EXTRAVERSION = -rtl } } There's nothing to do with the ppc kernel code in linux2.4.2, I think. } } Now i use not patched 2.4.2,and oryginal final rtlinux-3.0, but it still hangs : } } sh-2.03# uname -a } Linux 192.168.6.204 2.4.2 #3 Thu Apr 5 08:43:16 CEST 2001 ppc unknown } sh-2.03# cd /rt } sh-2.03# insmod rtl } Oops: kernel access of bad area, sig: 11 } NIP: C000BB58 XER: 80009F7F LR: C30002B8 SP: C1CB3D80 REGS: c1cb3cd0 TRAP: 0300 } MSR: 9032 EE: 1 PR: 0 FP: 0 ME: 1 IR/DR: 11 } DAR: C000, DSISR: 8200 } TASK = c1cb2000[22] 'insmod' Last syscall: 128 } last math last altivec } GPR00: C1CB3D80 C1CB2000 C000 C1CB3D8C 001C BFFC 7FE802A6 } GPR08: 3FC0C300 63DE0DEC 0DEC C000BB34 93F35F93 1001F0E0 100B8650 } GPR16: 100B8530 007FFEC0 9032 01CB3E80 C1CB3DE8 C1FEB680 } GPR24: 0003 C1CB3E4C 100328B8 C3000DEC FFEA C1C45000 C300 } Call backtrace: } 0001 C3001360 C0010DB8 C00025DC 1001 10003344 100039D8 } 0FF094F8 } Segmentation fault } sh-2.03# } } } -- } * * * * * * * * * * * * } * per pedes ad astra! * } * * * * * * * * * * * *mailto:[EMAIL PROTECTED] } } } -- [rtl] --- } To unsubscribe: } echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR } echo "unsubscribe rtl Your_email" | mail [EMAIL PROTECTED] } -- } For more information on Real-Time Linux see: } http://www.rtlinux.org/rtlinux/ -- [rtl] --- To unsubscribe: echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR echo "unsubscribe rtl Your_email" | mail [EMAIL PROTECTED] -- For more information on Real-Time Linux see: http://www.rtlinux.org/rtlinux/
Re: [rtl] ??? RTLinux on Linux v2.4.2 available for PPC
Just use rtlinux-3.0 final release, or you can change the Makefile in /usr/src/linux manually. change this line , at the top of Makefile: EXTRAVERSION = -rtl There's nothing to do with the ppc kernel code in linux2.4.2, I think. Now i use not patched 2.4.2,and oryginal final rtlinux-3.0, but it still hangs : sh-2.03# uname -a Linux 192.168.6.204 2.4.2 #3 Thu Apr 5 08:43:16 CEST 2001 ppc unknown sh-2.03# cd /rt sh-2.03# insmod rtl Oops: kernel access of bad area, sig: 11 NIP: C000BB58 XER: 80009F7F LR: C30002B8 SP: C1CB3D80 REGS: c1cb3cd0 TRAP: 0300 MSR: 9032 EE: 1 PR: 0 FP: 0 ME: 1 IR/DR: 11 DAR: C000, DSISR: 8200 TASK = c1cb2000[22] 'insmod' Last syscall: 128 last math last altivec GPR00: C1CB3D80 C1CB2000 C000 C1CB3D8C 001C BFFC 7FE802A6 GPR08: 3FC0C300 63DE0DEC 0DEC C000BB34 93F35F93 1001F0E0 100B8650 GPR16: 100B8530 007FFEC0 9032 01CB3E80 C1CB3DE8 C1FEB680 GPR24: 0003 C1CB3E4C 100328B8 C3000DEC FFEA C1C45000 C300 Call backtrace: 0001 C3001360 C0010DB8 C00025DC 1001 10003344 100039D8 0FF094F8 Segmentation fault sh-2.03# -- * * * * * * * * * * * * * per pedes ad astra! * * * * * * * * * * * * *mailto:[EMAIL PROTECTED] -- [rtl] --- To unsubscribe: echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR echo "unsubscribe rtl Your_email" | mail [EMAIL PROTECTED] -- For more information on Real-Time Linux see: http://www.rtlinux.org/rtlinux/
Re: [rtl] ??? RTLinux on Linux v2.4.2 available for PPC
Cort Dougan wrote: What machine and chip is this? == CPU (by ppcboot): ppcboot 0.8.3 (Apr 2 2001 - 10:36:26) Initializing... CPU: XPC860xxZPnnD3 at 50 MHz: 4 kB I-Cache 4 kB D-Cache FEC present sh-2.03# cat /proc/cpuinfo processor : 0 cpu : 8xx clock : 50MHz bus clock : 50MHz revision: 0.0 bogomips: 50.26 zero pages : total: 0 (0Kb) current: 0 (0Kb) hits: 0/0 (0%) == BOARD It's our custom board. Console is on SMC1, ETH on SCC2, 4*8MB RAM, 8MB FLASH. -- * * * * * * * * * * * * * per pedes ad astra! * * * * * * * * * * * * *mailto:[EMAIL PROTECTED] -- [rtl] --- To unsubscribe: echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR echo "unsubscribe rtl Your_email" | mail [EMAIL PROTECTED] -- For more information on Real-Time Linux see: http://www.rtlinux.org/rtlinux/
No Subject
OGJFAFOG.EXE
Re: [rtl] ??? RTLinux on Linux v2.4.2 available for PPC
} sh-2.03# uname -a } Linux 192.168.6.204 2.4.2 #3 Thu Apr 5 08:43:16 CEST 2001 ppc unknown } sh-2.03# cd /rt } sh-2.03# insmod rtl } Oops: kernel access of bad area, sig: 11 } NIP: C000BB58 XER: 80009F7F LR: C30002B8 SP: C1CB3D80 REGS: c1cb3cd0 TRAP: 0300 } MSR: 9032 EE: 1 PR: 0 FP: 0 ME: 1 IR/DR: 11 } DAR: C000, DSISR: 8200 } TASK = c1cb2000[22] 'insmod' Last syscall: 128 } last math last altivec } GPR00: C1CB3D80 C1CB2000 C000 C1CB3D8C 001C BFFC 7FE802A6 } GPR08: 3FC0C300 63DE0DEC 0DEC C000BB34 93F35F93 1001F0E0 100B8650 } GPR16: 100B8530 007FFEC0 9032 01CB3E80 C1CB3DE8 C1FEB680 } GPR24: 0003 C1CB3E4C 100328B8 C3000DEC FFEA C1C45000 C300 } Call backtrace: } 0001 C3001360 C0010DB8 C00025DC 1001 10003344 100039D8 } 0FF094F8 } Segmentation fault } sh-2.03# } } arch_takeover .. { unsigned long block[7] = { 0x7fe802a6, /* mflr 31 */ 0x3fc0dead, /* lis 0xdeadbeef@h */ 0x63debeef, /* ori r30,r30,0xdeadbeef@l */ 0x7fc803a6, /* mtlr r30 */ 0x4e800021, /* blrl */ 0x7fe803a6, /* mtlr r31 */ 0x4e800020 /* blr */ }; block[1] = (block[1]0x) | (((ulong)rtl_soft_sti16)0xf block[2] = (block[2]0x) | ((ulong)rtl_soft_sti0x); memcpy( (ulong *)KERNELBASE, block, sizeof(ulong)*7 ); ^^^ it craches here (memcpy is not allowed to kernel code) -- * * * * * * * * * * * * * per pedes ad astra! * * * * * * * * * * * * *mailto:[EMAIL PROTECTED] -- * * * * * * * * * * * * * per pedes ad astra! * * * * * * * * * * * * *mailto:[EMAIL PROTECTED] -- [rtl] --- To unsubscribe: echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR echo "unsubscribe rtl Your_email" | mail [EMAIL PROTECTED] -- For more information on Real-Time Linux see: http://www.rtlinux.org/rtlinux/
Re: [rtl] RTLinux+PHP
On Thursday 05 April 2001 09:51, Igor Bogolyubov wrote: Hi everyone! Help me please. I need my Rtl Task started from PHP. How this do? The Commands of type EXEC() do not work. Sorry for my english. (I'm assuming the problem is that you can't run 'insmod' directly from the PHP server, as that would require the latter to have root permissions - which would not be a very good idea...) How about executing 'modprobe rtl_app_modules' or something like that? You'd have to edit the modules.conf for modprobe to define which actual modules 'rtl_app_modules' should represent. Other possibilities might be running a shell script with su root, or start it via sudo. The advantages of these methods is that you have a lot more control than if you'd trust PHP with permission to use insmod directly. //David .- M A I A -. | Multimedia Application Integration Architecture | | A Free/Open Source Plugin API for Professional Multimedia | `-- http://www.linuxaudiodev.com/maia -' .- David Olofson ---. | Audio Hacker - Open Source Advocate - Singer - Songwriter | `-- [EMAIL PROTECTED] -' -- [rtl] --- To unsubscribe: echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR echo "unsubscribe rtl Your_email" | mail [EMAIL PROTECTED] -- For more information on Real-Time Linux see: http://www.rtlinux.org/rtlinux/
Re: [rtl] ??? RTLinux on Linux v2.4.2 available for PPC
On Thursday 05 April 2001 14:48, Wojciech Kromer wrote: } sh-2.03# uname -a } Linux 192.168.6.204 2.4.2 #3 Thu Apr 5 08:43:16 CEST 2001 ppc unknown } sh-2.03# cd /rt } sh-2.03# insmod rtl } Oops: kernel access of bad area, sig: 11 Hmm... . arch_takeover ... What are you trying to do here? (Looks like a virus... ;-) { unsigned long block[7] = { 0x7fe802a6, /* mflr 31 */ 0x3fc0dead, /* lis 0xdeadbeef@h */ 0x63debeef, /* ori r30,r30,0xdeadbeef@l */ 0x7fc803a6, /* mtlr r30 */ 0x4e800021, /* blrl */ 0x7fe803a6, /* mtlr r31 */ 0x4e800020 /* blr */ }; block[1] = (block[1]0x) | (((ulong)rtl_soft_sti16)0xf block[2] = (block[2]0x) | ((ulong)rtl_soft_sti0x); memcpy( (ulong *)KERNELBASE, block, sizeof(ulong)*7 ); ^^^ it craches here (memcpy is not allowed to kernel code) Since when? It's worked fine for me so far... :-) You're just not going to get away with writing to write protected memory areas, not even from within kernel space. //David .- M A I A -. | Multimedia Application Integration Architecture | | A Free/Open Source Plugin API for Professional Multimedia | `-- http://www.linuxaudiodev.com/maia -' .- David Olofson ---. | Audio Hacker - Open Source Advocate - Singer - Songwriter | `-- [EMAIL PROTECTED] -' -- [rtl] --- To unsubscribe: echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR echo "unsubscribe rtl Your_email" | mail [EMAIL PROTECTED] -- For more information on Real-Time Linux see: http://www.rtlinux.org/rtlinux/
RE: [rtl] print_rtl during remote login
I borrowed a piece of code a while back and here is one thing that I saw. printk("0my message here\n"); I changed it to rtl_printf("0my message here\n:); and in both cases the message was broadcast to all open windows and also logged to be viewed by dmesg. I do not know how this performs when remotely logged in. I don't know why this works this way but it could be useful. Rich -- From: [EMAIL PROTECTED][SMTP:[EMAIL PROTECTED]] Sent: Friday, March 30, 2001 10:50 AM To: Kalyanaraman, Sivakumar (CTS) Cc: [EMAIL PROTECTED] Subject: RE: [rtl] print_rtl during remote login File: InterScan_Disclaimer.txt Hi Siva, Typing dmesg at the remote terminal does allow viewing of the kernel ring buffer on the other machine. It does what I want, although it would be nice if you didn't have to type dmesg all the time. Probably the only other way to get the print messages out of the rtl module is through a fifo? Thanks very much Ollie "Kalyanaraman, Sivakumar (CTS)" [EMAIL PROTECTED] on 03/29/2001 10:59:45 PM To: "'[EMAIL PROTECTED]'" [EMAIL PROTECTED] cc: 'rtl' [EMAIL PROTECTED] Subject: RE: [rtl] print_rtl during remote login Hi, if my understanding is correct, rtl_printf messages go directly to the console of the system. to view these messages, you can use dmesg so that all the logged messages can be seen from the remote terminal. regards, siva -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 29, 2001 10:47 PM To: [EMAIL PROTECTED] Subject: [rtl] print_rtl during remote login When I operate my rtlinux machine remotely using rlogin from another machine, the printf_rtl output from within my program goes to the screen of the rtlinux machine instead of to the remote machine. This behavior applies not just to my output but also to other rtl messages such as "RTLinux Extensions Loaded (http://www.fsmlabs.com/)". But regular operating system messages, including the gdb debugger messages, do go over to the remote machine as expected. Is there a mechanism for redirecting the standard output? This seems like an important capability that probably has an easy answer. Thanks Ollie -- [rtl] --- To unsubscribe: echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR echo "unsubscribe rtl Your_email" | mail [EMAIL PROTECTED] -- For more information on Real-Time Linux see: http://www.rtlinux.org/rtlinux/ (See attached file: InterScan_Disclaimer.txt) -- [rtl] --- To unsubscribe: echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR echo "unsubscribe rtl Your_email" | mail [EMAIL PROTECTED] -- For more information on Real-Time Linux see: http://www.rtlinux.org/rtlinux/
RE: [rtl] print_rtl during remote login
Yes, "0my message here\n" really works. It gets printed on the remote terminal as well. However, it does have a side effect. The speaker beeps with each line of output and inserts another line "Message from syslog@mymachine at Thu Apr 5 01:04:30 2001 ..." between each line of output. It looks (and sounds) like one of those broadcast messages that operators send to users before shutting down. Nevertheless, it does work, and I might just disable my speaker. I have not yet tried Eric Peterson's suggestion (man klogd(8)). I am indeed grateful for all the responses on this question. Ollie Enders "Basham, Richard R" [EMAIL PROTECTED] on 04/05/2001 08:55:14 AM To: "Kalyanaraman, Sivakumar (CTS)" [EMAIL PROTECTED], "'[EMAIL PROTECTED]'" [EMAIL PROTECTED] cc: [EMAIL PROTECTED] Subject: RE: [rtl] print_rtl during remote login I borrowed a piece of code a while back and here is one thing that I saw. printk("0my message here\n"); I changed it to rtl_printf("0my message here\n:); and in both cases the message was broadcast to all open windows and also logged to be viewed by dmesg. I do not know how this performs when remotely logged in. I don't know why this works this way but it could be useful. Rich -- From: [EMAIL PROTECTED][SMTP:[EMAIL PROTECTED]] Sent: Friday, March 30, 2001 10:50 AM To: Kalyanaraman, Sivakumar (CTS) Cc: [EMAIL PROTECTED] Subject: RE: [rtl] print_rtl during remote login File: InterScan_Disclaimer.txt Hi Siva, Typing dmesg at the remote terminal does allow viewing of the kernel ring buffer on the other machine. It does what I want, although it would be nice if you didn't have to type dmesg all the time. Probably the only other way to get the print messages out of the rtl module is through a fifo? Thanks very much Ollie "Kalyanaraman, Sivakumar (CTS)" [EMAIL PROTECTED] on 03/29/2001 10:59:45 PM To: "'[EMAIL PROTECTED]'" [EMAIL PROTECTED] cc: 'rtl' [EMAIL PROTECTED] Subject: RE: [rtl] print_rtl during remote login Hi, if my understanding is correct, rtl_printf messages go directly to the console of the system. to view these messages, you can use dmesg so that all the logged messages can be seen from the remote terminal. regards, siva -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 29, 2001 10:47 PM To: [EMAIL PROTECTED] Subject: [rtl] print_rtl during remote login When I operate my rtlinux machine remotely using rlogin from another machine, the printf_rtl output from within my program goes to the screen of the rtlinux machine instead of to the remote machine. This behavior applies not just to my output but also to other rtl messages such as "RTLinux Extensions Loaded (http://www.fsmlabs.com/)". But regular operating system messages, including the gdb debugger messages, do go over to the remote machine as expected. Is there a mechanism for redirecting the standard output? This seems like an important capability that probably has an easy answer. Thanks Ollie -- [rtl] --- To unsubscribe: echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR echo "unsubscribe rtl Your_email" | mail [EMAIL PROTECTED] -- For more information on Real-Time Linux see: http://www.rtlinux.org/rtlinux/ (See attached file: InterScan_Disclaimer.txt) -- [rtl] --- To unsubscribe: echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR echo "unsubscribe rtl Your_email" | mail [EMAIL PROTECTED] -- For more information on Real-Time Linux see: http://www.rtlinux.org/rtlinux/
Re[2]: [rtl] ??? RTLinux on Linux v2.4.2 available for PPC
On Thu, 05 Apr 2001 14:48:14 +0200 Wojciech Kromer [EMAIL PROTECTED] wrote: memcpy( (ulong *)KERNELBASE, block, sizeof(ulong)*7 ); ^^^ it craches here (memcpy is not allowed to kernel code) Yes, it is allowed. It's in linux/arch/i386/lib/memcpy.c. +-+ | Masahiro Abe, Software Engineer | | AD Co., Ltd. of Tokyo, Japan | | mailto:[EMAIL PROTECTED]| +-+ |This is my opinion, not my employer's| +-+ -- [rtl] --- To unsubscribe: echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR echo "unsubscribe rtl Your_email" | mail [EMAIL PROTECTED] -- For more information on Real-Time Linux see: http://www.rtlinux.org/rtlinux/
Re: [rtl] ??? RTLinux on Linux v2.4.2 available for PPC
Also note that you're using rtlinux 3.0 with kernel 2.4.2 which won't work for any PPC's. You need the newer rtlinux that we dropped off at the ftp site for newer kernels. -- [rtl] --- To unsubscribe: echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR echo "unsubscribe rtl Your_email" | mail [EMAIL PROTECTED] -- For more information on Real-Time Linux see: http://www.rtlinux.org/rtlinux/
[rtl] Blocking read from FIFO in Linux app?
I installed RTLinux 3.0 on Kernel 2.2.18 on a dual processor PIII 500MHz. All I need is a 60Hz signal to a Linux app. I originally tried modifying the Kernel Hz from 100 to 960 but for some reason there were a tremendous amount of jitter whereas 100Hz was fairly stable. For my second attempt, I installed RTL 3.0 and cobbled up a pair of programs from the examples. In my test program everything is fine and the jitter is quite low no matter what I try to peturb it. When I try to use the read in a large Ada program it works for a while and then I start getting zero bytes back from the FIFO sometimes instead of blocking until the FIFO is non empty. I put in code to read the FIFO again if the read returns zero bytes but instead of blocking on the FIFO my CPU utilization is 100%. I like having the FIFO return a structure which is the tic count and the elapsed time from the RDTSC instruction because it allows me to detect frame overruns but I could use a semaphore if anyone has a reliable example. Jon Clifton all: rtlinux_mod.o linux_app include ../../rtl.mk linux_app: linux_app.c $(CC) ${USER_CFLAGS} ${INCLUDE} -Wall -O2 -o linux_app linux_app.c test: all @ -/sbin/rmmod rtlinux_mod (cd ../../; scripts/rmrtl) (cd ../../; scripts/insrtl) @/sbin/insmod -v rtlinux_mod.o @./linux_app stop_test: @ -/sbin/rmmod rtlinux_mod -/sbin/rmmod rtl_fifo -/sbin/rmmod rtl_sched -/sbin/rmmod rtl_time clean: rm -f *.o linux_app include $(RTL_DIR)/Rules.make #include unistd.h #include stdio.h #include fcntl.h #define NANOSECONDS_PER_TICK (double)((double)1000.00/(double)500.00) int main(){ int fd,count; int tics=0; struct { int count; unsigned int d;}D; double f; double sum=0.0; if( (fd = open("/dev/rtf0",O_RDONLY) ) 0 ){ perror("Can't open fifo"); exit(-1); } read(fd,D,sizeof(D)); count = D.count; while( (read(fd,D,sizeof(D)) == sizeof(D))){ f = (double)D.d; f = ((f) * NANOSECONDS_PER_TICK)/1000; sum+=f; tics++; printf("Delay was %f microseconds, avg=%f, D={%8d, %08x}\n", f,sum/(double)tics, D.count, D.d); if(count (count+1 != D.count)) printf("Dropped a packet at %d ",count); count = D.count; } return 0; } #include rtl.h #include rtl_fifo.h #include time.h #include rtl_sched.h #include rtl_sync.h #include pthread.h #include posix/unistd.h #define FRAME_INTERVAL 16695149LL /* fudged 16.67ms */ #define FIFO_SIZE 4000 pthread_t thread; int fd; int stop = 0; static void copy_device_data(unsigned int *); void *start_routine(void *arg){ struct sched_param p; struct {int i; unsigned int d; }D = {0,0}; p.sched_priority=1; pthread_setschedparam (pthread_self(), SCHED_FIFO, p); pthread_make_periodic_np (pthread_self(), clock_gethrtime(CLOCK_RTL_SCHED), FRAME_INTERVAL); copy_device_data(D.d); while(!stop){ pthread_wait_np(); copy_device_data(D.d); D.i++; /* ignore write fails, we just drop the data */ write(fd,D,sizeof(D)); } return 0; } int init_module(void){ rtf_destroy(0); rtf_create(0,FIFO_SIZE); if ( (fd = open("/dev/rtf0",O_WRONLY | O_NONBLOCK )) 0) { rtl_printf("rtlinux_mod cannot open fifo\n"); rtl_printf("Error number is %d\n",errno); return -1; } return( pthread_create(thread,NULL,start_routine,0)); } void cleanup_module(void){ stop = 1; close(fd); rtf_destroy(0); pthread_delete_np(thread); return; } static void copy_device_data(unsigned int *x) { static int last=0; int d; rdtscl(d); *x= (d - last); last = d; return; } #include fcntl.h #include stdio.h #include unistd.h #define CPU_MHz 500.00L #define NANOSECONDS_PER_TICK (double)((double)1000.00/(double)CPU_MHz) //#define DEBUG int rtl_wait(void) { //(int * tics, double * delta_t){ static int firstpass=1; static int fd; static int rtl_count; static int n=0; static int nbytes=0; static double sum; struct { int rtl_count; unsigned int d;}D; double f; if (firstpass) { if( (fd = open("/dev/rtf0",O_RDONLY) ) 0 ){ perror("Can't open fifo"); exit(-1); } firstpass=0; n=0; sum=0.0; read(fd,D,sizeof(D)); rtl_count = D.rtl_count; } while (0 ==(nbytes=