Discussion:
how to create a interrupt service function in c for QNX operating system?
(too old to reply)
Hemanth Venkatappa
2014-03-26 08:44:59 UTC
Permalink
Scenario : Client is sending a data and the server is receving the data from client via ethernet layer (udp). When the server receives a data from the client on the ip layer (kernel). It interrupts the kernel and kernel as to execute the data by the client, so I want to create a interrupt service function to catch the interrupt from the network service card.

could someone help me how to go about it ?
Nicolas
2014-03-27 07:57:25 UTC
Permalink
Post by Hemanth Venkatappa
Scenario : Client is sending a data and the server is receving the data from client via ethernet layer (udp). When the server receives a data from the client on the ip layer (kernel). It interrupts the kernel and kernel as to execute the data by the client, so I want to create a interrupt service function to catch the interrupt from the network service card.
could someone help me how to go about it ?
With QNX, you don't write code in the kernel.
What are you doing ? Write a network card driver ?
Hemanth Venkatappa
2014-04-01 08:52:41 UTC
Permalink
Post by Nicolas
Post by Hemanth Venkatappa
Scenario : Client is sending a data and the server is receving the data from client via ethernet layer (udp). When the server receives a data from the client on the ip layer (kernel). It interrupts the kernel and kernel as to execute the data by the client, so I want to create a interrupt service function to catch the interrupt from the network service card.
could someone help me how to go about it ?
With QNX, you don't write code in the kernel.
What are you doing ? Write a network card driver ?
I am writing a interrupt service routine in user space to handle the interrupts (when the data received from the client) and calculate the timestamp of it. Could you please give me a example to handle the interrupts ??
Nicolas
2014-04-01 12:33:00 UTC
Permalink
Post by Hemanth Venkatappa
Post by Nicolas
Post by Hemanth Venkatappa
Scenario : Client is sending a data and the server is receving the data from client via ethernet layer (udp). When the server receives a data from the client on the ip layer (kernel). It interrupts the kernel and kernel as to execute the data by the client, so I want to create a interrupt service function to catch the interrupt from the network service card.
could someone help me how to go about it ?
With QNX, you don't write code in the kernel.
What are you doing ? Write a network card driver ?
I am writing a interrupt service routine in user space to handle the interrupts (when the data received from the client) and calculate the timestamp of it. Could you please give me a example to handle the interrupts ??
Do you use sockets to receive data from client ?
Hemanth Venkatappa
2014-04-02 05:17:46 UTC
Permalink
Post by Nicolas
Post by Hemanth Venkatappa
Post by Nicolas
Post by Hemanth Venkatappa
Scenario : Client is sending a data and the server is receving the data from client via ethernet layer (udp). When the server receives a data from the client on the ip layer (kernel). It interrupts the kernel and kernel as to execute the data by the client, so I want to create a interrupt service function to catch the interrupt from the network service card.
could someone help me how to go about it ?
With QNX, you don't write code in the kernel.
What are you doing ? Write a network card driver ?
I am writing a interrupt service routine in user space to handle the interrupts (when the data received from the client) and calculate the timestamp of it. Could you please give me a example to handle the interrupts ??
Do you use sockets to receive data from client ?
Yes. I am receiving the data via socket.

Scenario : client- server communication - client is sender and server is receiver. when the server receives the data on the ethernet interface(UDP) the kernel in the server is triggered. I am using QNX on the server side. server(i.e embedded pc target) is handling interrupts to trigger the embedded pc target (conatining qnx) to gain the attention to execute the newly arrived data. but how to create a ISR to handle this ?? could you please help me ??
Nicolas
2014-04-02 06:51:25 UTC
Permalink
Post by Hemanth Venkatappa
Post by Nicolas
Do you use sockets to receive data from client ?
Yes. I am receiving the data via socket.
Scenario : client- server communication - client is sender and server is receiver. when the server receives the data on the ethernet interface(UDP) the kernel in the server is triggered. I am using QNX on the server side. server(i.e embedded pc target) is handling interrupts to trigger the embedded pc target (conatining qnx) to gain the attention to execute the newly arrived data. but how to create a ISR to handle this ?? could you please help me ??
Why do you want to use interrupts to "execute" data from client ?

1) Server blocked (waiting for data from client)
2) Incoming data from client -> server unblocked.
3) Server "executes" data
4) goto 1)
Hemanth Venkatappa
2014-04-02 12:31:19 UTC
Permalink
Post by Nicolas
Post by Hemanth Venkatappa
Post by Nicolas
Do you use sockets to receive data from client ?
Yes. I am receiving the data via socket.
Scenario : client- server communication - client is sender and server is receiver. when the server receives the data on the ethernet interface(UDP) the kernel in the server is triggered. I am using QNX on the server side. server(i.e embedded pc target) is handling interrupts to trigger the embedded pc target (conatining qnx) to gain the attention to execute the newly arrived data. but how to create a ISR to handle this ?? could you please help me ??
Why do you want to use interrupts to "execute" data from client ?
1) Server blocked (waiting for data from client)
2) Incoming data from client -> server unblocked.
3) Server "executes" data
4) goto 1)
When ever the data is received on the Ethernet interface from the client then the interface card will make the hardware interrupt to the microprocessor ( embedded PC target is the server ) . Then microprocessor will make a software interrupt to the kernel to start execute the newly arrived data . The user as to handle the software interrupt .
So i configure the ISR to handle the interrupt and code is shown below:
const struct sigevent *handler1(void *area, int id1)
{
volatile double KernelStartExecutionTime;
struct sigevent *event = (struct sigevent *)area;
KernelStartExecutionTime = GetTimeStamp(); // calculating the time when the kernel starts executing
measurements[18] = KernelStartExecutionTime ;
//return (NULL);
return event;

}



/*kernel calls attach the interrupt function handler to the hardware interrupt specified by intr(i.e irq) */
// InterruptAttach() : Attach an interrupt handler to an interrupt source
// interrupt source is handler1 for this example
void configureISR(void) //void *ISR (void *arg)
{
/* the software must tell the OS that it wishes to associate the ISR with a particular source of interrupts.
* On x86 platforms, there are generally 16 hardware Interrupt Request lines (IRQs) */
volatile int irq = 0; //0 : A clock that runs at the resolution set by ClockPeriod()
struct sigevent event;
event.sigev_notify = SIGEV_INTR;

ThreadCtl (_NTO_TCTL_IO, NULL); // enables the hardware interrupt
id1 = InterruptAttach(irq, &handler1, &event, sizeof(event), 0); // handler1 is the ISR


InterruptWait( 0, NULL );
InterruptUnmask(irq, id1);



InterruptDetach( id1);

}




int main(int argc, char *argv[])
{


CreateSocket(); // receiving the data from client

configureISR();

// pthread_create (NULL, NULL, ISR, NULL);
return 0;
}

Is the above code is the right way to handle interrupts in qnx??
Nicolas
2014-04-02 13:33:48 UTC
Permalink
Post by Hemanth Venkatappa
Post by Nicolas
Post by Hemanth Venkatappa
Post by Nicolas
Do you use sockets to receive data from client ?
Yes. I am receiving the data via socket.
Scenario : client- server communication - client is sender and server is receiver. when the server receives the data on the ethernet interface(UDP) the kernel in the server is triggered. I am using QNX on the server side. server(i.e embedded pc target) is handling interrupts to trigger the embedded pc target (conatining qnx) to gain the attention to execute the newly arrived data. but how to create a ISR to handle this ?? could you please help me ??
Why do you want to use interrupts to "execute" data from client ?
1) Server blocked (waiting for data from client)
2) Incoming data from client -> server unblocked.
3) Server "executes" data
4) goto 1)
When ever the data is received on the Ethernet interface from the client then the interface card will make the hardware interrupt to the microprocessor ( embedded PC target is the server ) . Then microprocessor will make a software interrupt to the kernel to start execute the newly arrived data . The user as to handle the software interrupt .
No.
When using sockets, you don't need interrupts.
Hemanth Venkatappa
2014-04-02 14:42:32 UTC
Permalink
Post by Nicolas
Post by Hemanth Venkatappa
Post by Nicolas
Post by Hemanth Venkatappa
Post by Nicolas
Do you use sockets to receive data from client ?
Yes. I am receiving the data via socket.
Scenario : client- server communication - client is sender and server is receiver. when the server receives the data on the ethernet interface(UDP) the kernel in the server is triggered. I am using QNX on the server side. server(i.e embedded pc target) is handling interrupts to trigger the embedded pc target (conatining qnx) to gain the attention to execute the newly arrived data. but how to create a ISR to handle this ?? could you please help me ??
Why do you want to use interrupts to "execute" data from client ?
1) Server blocked (waiting for data from client)
2) Incoming data from client -> server unblocked.
3) Server "executes" data
4) goto 1)
When ever the data is received on the Ethernet interface from the client then the interface card will make the hardware interrupt to the microprocessor ( embedded PC target is the server ) . Then microprocessor will make a software interrupt to the kernel to start execute the newly arrived data . The user as to handle the software interrupt .
No.
When using sockets, you don't need interrupts.
then could you please tell me how to handle interrupts as per my requirement ??
Hemanth Venkatappa
2014-04-02 14:44:18 UTC
Permalink
Post by Nicolas
Post by Hemanth Venkatappa
Post by Nicolas
Post by Hemanth Venkatappa
Post by Nicolas
Do you use sockets to receive data from client ?
Yes. I am receiving the data via socket.
Scenario : client- server communication - client is sender and server is receiver. when the server receives the data on the ethernet interface(UDP) the kernel in the server is triggered. I am using QNX on the server side. server(i.e embedded pc target) is handling interrupts to trigger the embedded pc target (conatining qnx) to gain the attention to execute the newly arrived data. but how to create a ISR to handle this ?? could you please help me ??
Why do you want to use interrupts to "execute" data from client ?
1) Server blocked (waiting for data from client)
2) Incoming data from client -> server unblocked.
3) Server "executes" data
4) goto 1)
When ever the data is received on the Ethernet interface from the client then the interface card will make the hardware interrupt to the microprocessor ( embedded PC target is the server ) . Then microprocessor will make a software interrupt to the kernel to start execute the newly arrived data . The user as to handle the software interrupt .
No.
When using sockets, you don't need interrupts.
then could you please tell me how to handle interrupts as per my requirement ??
How to interrupt the kernel when the new data as arrived on the ethernet layer ?? how kernel can start execute the newly arrived data ?
Nicolas
2014-04-02 15:07:36 UTC
Permalink
Post by Hemanth Venkatappa
then could you please tell me how to handle interrupts as per my requirement ??
How to interrupt the kernel when the new data as arrived on the ethernet layer ?? how kernel can start execute the newly arrived data ?
It looks like you need to learn how sockets work.
http://en.wikipedia.org/wiki/Berkeley_sockets

Loading...