Programming :: Generating Timer Interrupts In C?

Jul 23, 2010

I'm trying to understand how interrupts work. Is there a way to generate timer interrupts in C. Also can we enter into the protected mode of the CPU. Does OS (specifically, linux) place any restrictions on user programs entering protected mode. If it does not, do we just have an assembly language program which changed the mode, followed by the C code... I'm just trying to understand how things work at the lowest level. So I'm trying to write few snippets to test my understanding.

View 3 Replies


ADVERTISEMENT

General :: Mask Local Timer Interrupts In User Space?

Oct 27, 2010

I am trying to figure out how to mask local timer interrupts on a specific core of a multicore system from within user space. The interrupts are causing latency spikes of 3-10u that we would like to remove. We are only running 1 thread on the core h everything shielded except for these timer interrupts. This thread makes no system calls and thus is never getting context switched out. I am not looking to turn them off entirely but rather turn them off, run my code, turn them on in a continuous loop. The thread runs in user space which we are hoping to maintain. We also have no desire to modify the kernel if possible. I've read about using spinlock_irqsave() but it appears (not positive) that it must be used within kernel space.

View 3 Replies View Related

Ubuntu :: When System Is "fresh" Booted There Are No Noticeable "Extra Timer Interrupts"?

Feb 25, 2010

See the following output from powertop:

Uptime 5 minutes
Wakeups-from-idle per second : 86,8interval: 15,0s
no ACPI power usage estimate available
Top causes for wakeups:
37,8% (129,7) <interrupt> : uhci_hcd:usb2, uhci_hcd:usb5, rr26xx
23,6% ( 81,0) <kernel core> : hrtimer_start_range_ns (tick_sched_timer)[code]....

As you can see, when system is "fresh" booted there are no noticeable "Extra timer interrupts". As time goes, this number seems to increase. I have tried to find out what causes this behaviour without any luck. I am not even sure if this is any practical problem, as performance seems to be more or less unaffected, but any explanation to this would be nice. Anyone else ever notice this?I am running Ubuntu 9.10 Server edition on a Dell Poweredge SC1420, 64-bit version. The server is used for web and file sharing mostly, with little load. (15 min avg. about 0,10).

View 4 Replies View Related

Programming :: Configure Cpu Interrupts Manually?

Dec 17, 2010

I was installing freebds for one of my friends and during the entire install the top never crossed 1.0. When I install linux top always shows a cpu load of more than 1.0.Also on the bsd when copying a huge file (4gb) it takes a long time but then the load never goes beyond 1.0. Linux will do it much faster but then there is a difference in the cpu load time.What I want to know is is there anyway I can interupt the processor so that the load does not go beyond 1.0.

View 11 Replies View Related

Programming :: Timer In Socket Programming - Wait For X Sec After Read() And Then Disconnect The Client Connection

Mar 8, 2011

I have a server listening on incoming client connections. Once the client establishes SSL connection with the server, the server waits on read() from the client. Only Client can disconnect the connection. I want to have a timer in the server program to wait for x secs after read() and then disconnect the Client connection.

View 3 Replies View Related

Programming :: Socket And Timer Programming - Server Doesn't Execute Any Msg Which Client Sent

May 16, 2011

i have a server program which accept multiple client connection and am using polling. like every 2 secs it will look to client whether any data is received after it binded. i have used setitimer but there is runtime error i got.. the server accept all client connection but doesn't execute any msg which client sent.

#include<stdio.h>
#include<stdlib.h>
#include<sys/socket.h>
#include<sys/types.h>
#include<netdb.h>
#include<unistd.h>
#include<pthread.h>
#include<string.h>
[Code]....

View 1 Replies View Related

Programming :: GNU C - Timer Not Executing

Mar 3, 2011

Why is the timer not executing?

Code: #include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <signal.h>
#include <time.h>
#include <pthread.h>
void func(union sigval sv)
[Code]....

View 1 Replies View Related

Programming :: 30 Minute Timer In Bash

Jun 8, 2011

I've recently started coding in bash and I'm making a diagnostic check CD for rackmounted computers to print out to an LCD screen. So far it works but what i want it to do is, when it checks what ethernet ports are unplugged, it stays there for 30 minutes or so and proceeds through the script. I've looked up cron and that seems to be useful for making timers on permanent systems but I just want the cd to boot, do the check and then eject it and let the real OS take over and I've also tried using:

while [ `sleep 30m` ];
do
<script>

with no luck. Is there any command I can use to do this? I've noticed a few examples where people have captured the time and then used a while less than/greater than statement but I'm not sure how to do this. Is it possible to do a concept like:

while [ %current time -lt %current time+30 min ];
do
<script>

View 8 Replies View Related

Programming :: Delay Calculation For LSB In Timer?

Sep 5, 2010

On the following link Following code is given

Code:
loopbit = loops_per_jiffy;
/* Gradually work on the lower-order bits */
while (lps_precision-- && (loopbit >>= 1)) {
loops_per_jiffy |= loopbit;
ticks = jiffies;
while (ticks == jiffies); /* Wait until the start

[Code]...

View 2 Replies View Related

Programming :: Generating Excel Charts From C?

Feb 24, 2011

how to generate excel charts from C, or if it's possible at all? For example, if I had 2 arrays that I wanted to export to excel and graph against each other. I know how to export it to a csv file, that's no problem, but I have no idea where to start with generating a graph of the data. I can't seem to find any examples anywhere. Just a simple example to show you what I mean: Code:

char arr1[] = {'a','b','c'};
int arr2[] = {10,20,30};
int main ()

[code]....

View 5 Replies View Related

Programming :: Code For Generating A Pop-Up Window In C

Aug 4, 2010

Unfortunatelly since i have no background at all about GUI programming, i dont know even the keyword for that i want to generate a pop up window from my program (written in C) which show a message and an OK button. in my opinion, maybe i should use directly the Xlib library and not the GTK or QT library for example so the program can work almost on every linux system. A code snippet/hint for the pop-up window then?

View 2 Replies View Related

Programming :: Generating Grpah Form Rrd On The Fly?

May 9, 2010

Im strugling with script that wil generate graph on demad. I put it in cgi-bin directory but cannot get it to work. i googled for perl generating images and tried few examples but none worked.

When I execute perl script in command line it throws picture i a bunch of characters so it creates it but wont show when I access it through a web page.

[Code]...

View 3 Replies View Related

Programming :: Generating Prime Numbers In C?

Mar 9, 2011

I'm trying to write a program that generates a random number and then tells if it is prime or not. I have doe some research about how to calculate prime and random numbers but I'm still having trouble. I don't really get how to calculate a prime number. I know a prime number is a number that is divisible by 1 and and itself. how to calculate a prime number in C?

View 10 Replies View Related

Programming :: Timer Of 10 Ms For Read / Write A USB Device?

Apr 13, 2011

I need programmer a timer of 10 ms for read/write a USB device

View 4 Replies View Related

Programming :: Dynamic (kernel) Timer Never Is Started Again

Jan 26, 2010

My system: Ubuntu 2.6.31. Language C, compiler: gcc I am running dynamic timer as a kernel module and my issue is that the once the timer overflows, the program finishes. On the other hand i have forced to arm the timer again because of a while loop but the timer never is started again. i am targetting a periodic timer but it runs once and thats it.

[Code]...

View 1 Replies View Related

Programming :: Implement A Timer Expiry Function

Jan 17, 2010

I'm implementing a TCP protocol. TCP implementation requires to send packets continuously and if the receiver doesnt respond after a particular interval of time it should resend the packet again. I need some method to implement a timer expiry function. How can I implement it? Should i implement threads (If yes can you please give a sample)? or is there any better method? I'm implementing it in a Unix system.

View 3 Replies View Related

Programming :: Generating Series Of Numbers Of Sequence?

Mar 19, 2011

I am trying to generate sequence of number in the order of :

1
2
3
4

[Code]....

View 7 Replies View Related

Programming :: Generating Makefile Ans Configure Script ?

May 17, 2011

I know how to manually writing a makefile for my project, but I am new in using makefile & configure file generation tools like automake to generate a makefile and a configure script file.

I had done research on tutorials for generating makefile and configure script file.

I know that I need to manually write two files (makefile.am and configure.in).

I use wxWidgets GUI library, libconfig library, and libpcap library to do my project.

wx-config is a tool that can return the library files and include directory for wxWidgets library.

When using g++ to compile my files, I need to add in this line "`/wxlib/bin/wx-config --version=2.9 --static=yes --unicode=yes --debug=yes --libs`"

How to add that line to the makefile.am file?

View 1 Replies View Related

Programming :: Bash - Generating A Table With Aligned Fields

Apr 9, 2009

I want to write a function which calculates the space needed between fields, to generate a table with aligned fields, like when you type "ls -l", the operating system generates a table with beautifully aligned fields. I've got this code so far:

Code:

for line in $(cat tmpSearch)
do
line=`echo $line | tr ":" " "`

[code]....

View 2 Replies View Related

Programming :: AMD CPU Generating Way More System Load Than Intel Xeon CPU?

Oct 11, 2010

I am running some muti-threaded code that uses a lot of memory (~6GB). I have it compiled on a cluster that uses Xeon 5160 quad core CPUs with 4MB cache/core, 8GB of RAM and kernel 2.6.18 (x86_64) and I have also the same code compiled on another cluster that uses Opteron 2214 quad core CPUs with 1MB cache/core, 8GB of RAM and kernel 2.6.28 (x86_64). On the Intel cluster the code generates barely any system load when I look on top but on the AMD cluster it can generate over 50% of system load. On the intel machines my process can generate a constant load of 3, while the load generated by the process on the AMD machines is about 1.6.

Does anybody know what could cause this? Could it be the version of the kernel or the difference between the CPUs (for example, the much smaller cache of the AMD CPUS)? My software and all its dependencies are the same on both clusters. I am also using the exact same version of GCC to compile everything.

View 1 Replies View Related

Programming :: Bash: Generating A Random LETTERS Sequence?

May 12, 2011

I tried googling around but i cant find anything related to this: everyone seems just interested in random numbers, so when it comes to random letters there is a lack of informations. However, i am trying to figure out a wait to get a random letters string that matches a simple rule: it must be a sequence of consonant+vowel. So for example, these are some 6 letters strings i would like to obtain: wolupa, tafoke, zewevu, cupimo.

View 3 Replies View Related

Programming :: Generating Files With Different Names At Each Loop In Fortran?

Nov 7, 2010

I am trying to write a loop to open four main-data-files. At each open of the main-data-file, I want the loop to open another four sub-files and split the data from the mail-data-file according to the creteria and dump into the four files. When the loop goes to the second main-data-file, it shall generate another 4 sub-files with different file name. And the process goes on. That means I will have total of 16 sub files for the four main-data-files. Each four files from the 16 files shall have specific name on it. Based on the code which I given below, I would say when the file at UNIT=100 is opened, 4 new files needed to be opened as well. They are:

maximum_dist_001_064.dat
maximum_dist_065_128.dat
maximum_dist_129_192.dat
maximum_dist_193_256.dat

View 1 Replies View Related

Programming :: Generating Keyboard Events In Shell Script

Nov 23, 2010

Is it possible to generate keyboard event "Ctrl+c" from a shell script code.? I have written a shell script to compile my application and copy it to the server home directory, inorder to run my application I need to start the server (by running a shell script). But before that I need to stop the the currently running instance of my server. To do that I have to generate a keyboard event (Ctrl+c which I press it manually). I want to automate the entire process by writing a shell script I am able to run the server just by adding ./run.sh in my shell script. But before that to stop my server can I generate a keyboard by using a shell script event(ctrL+C) to stop server.?

View 2 Replies View Related

Programming :: Generating Avi Files For Movies Directly From Gfortran Programs ?

Mar 5, 2011

Generating avi files for movies directly from gfortran programs. I make movies from my Fortran codes using seismic unix - SU. Need to modernize this method to make avi movies or something similar. I am quite adept at generating "C" binary files from Fortran. Have not been able to find the documented definition of AVI file format.

View 1 Replies View Related

Programming :: Create Awk Sript For Generating Two Files From A File Checking A Condition ?

Mar 3, 2010

I have a csv file like, having HDR segment and multiple LIN01 segment in each line:like

Here i want to split file in two, one having LIN01 segment which have LR at end, and one which have LF at end in LIN01 segment.

Is it possible to created awk or shell script for this?

View 3 Replies View Related

General :: Getting Notified In User-space On Interrupts?

Jun 27, 2010

I hope this is the right place to post to because I haven't found any other related forums.I'm working on an AMD opteron running Linux 2.6.28.6 I want to preload a hardware performance counter (register) with a value to have it overflow after a number of a specific event counts. As I understand, when the counter in the register overflows, an interrupt will be generated and handled by the appropriate interrupt handler. How can my user-level application get notified whenever the interrupt occurs? I want to obtain information on the instruction that caused the overflow. Is this possible? I think this is different than responding to signals with sigaction().

View 1 Replies View Related

Networking :: FreeNAS Error With NIC - Missed TX Interrupts

Sep 6, 2010

So I've been researching this on my new NAS. I just tried to register the IP on the new system to have an issue pop up that says:
"msk0: watchdog timeout (missed Tx interrupts) -- recovering"
The error repeats then ends with no set IP. I tried the loader.conf fix but I cannot write to the system its installed on (embedded on a harddrive + data + swap) but it gives me a issue with write privileges which I thought would have been fixed by chmod +w /cf.

View 1 Replies View Related

CentOS 5 :: Kernel Parameter Available For Interrupts Handling?

Sep 16, 2010

Is there any Kernel parameter available for interrupts handling, In the case of busy server how we can tune the kernel to handle interrupts effectively.

View 4 Replies View Related

General :: Switch To VGA Graphics Mode Without BIOS Interrupts?

Feb 14, 2009

I am working on development of an TOS that runs in Protected Mode. I am required to switch it from text mode to graphics mode. Everywhere I google I get only one solution set AX to 0013h and call INT 10 and easily the VGA Graphics Mode is set.

I am working in protected mode and hence cannot use INT 10. Can someone please guide me? I came across a post where it was said that this can be done by setting the VGA registers, but I could not understand much from the link provided in the post on how to implement it.

View 1 Replies View Related

Fedora Security :: Spurious Interrupts And Kernel Seg Faults?

Jun 22, 2009

What does this means:

[6867450.202500] hpet1: lost 1 rtc interrupts
[6867450.548506] hpet1: lost 2 rtc interrupts
May 24 20:20:01 vms2 kernel: [6886829.451310] console-kit-dae[19655]: segfault at 198 ip 00007f4c31b7fe09 sp 000000004036c090 error 4 in libglib-2.0.so.0.1800.2[7f4c31b53000+c3000]"

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved