c - how to access the kernel memory from user program in rt linux? -


client , server communication in rt linux. client sending data , server receiver.udp used communication between client , server. when server(rt linux) receives data client kernel should stop doing , start executing newly arrived data. want calculate time when interrupt occurs in kernel (timestamp). in rt-linux operating system operation takes place in kernel. calculating interrupt time in kernel source code. modified kernel source code in location /usr/src/linux-version/net/core/dev.c shown below : calculating time , storing in buffer skb.

//this code @ network device driver level.

int netif_rx(struct sk_buff *skb)  {     __net_timestamp(skb);//i modify code in kernel timestamp , store in buffer } 

// after storing data buffer. kernel send upper layers ip, udp, inet , socket of kernel space.

but want read timestamp packet kernel space user space. i.e. program .

i using recvfrom api read data kernel spacce (which in kernel memory)

question : tell me how access kernel memory contains timestamp data user program ??

you can't access kernel memory userspace directly - have use sort of api.

you can:

  • export timestamp through sysfs or debugfs , read regular file
  • add syscall kernel return current timestamp value
  • bunch of other crazy variants netlink socket or shared memory

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -