Re: Problem with a UDP server implements

2011-10-19 Thread Bernd Petrovitsch
Hi! On Die, 2011-10-18 at 22:48 +0800, tao jiang wrote: [...] Thanks for your guide. But there is still a question if recvfrom() used, how to figure out the client's dest ip for reply ? i.e. on which ip the server receieved the request when construct the IP header, i don't know which saddr

print contents of runqueue

2011-10-19 Thread kashish bhatia
Hi, I want to print contents of runqueue of my current processor. I got the pointer to current task_struct. To get runqueue, I called task_rq(). When compiled the module, it gave an error. Actually struct runqueue and task_rq() is not in any header file. It is present in kernel/sched.c Is

Trouble removing character device

2011-10-19 Thread Kai Meyer
I can't seem to get my character device to remove itself from the /proc/devices list. I'm calling all of the following functions like so: alloc_chrdev_region(dev, 0, 5, my_char); cdev_init(my_cdev, my_ops); cdev_add(my_cdev, MKDEV(my_major, my_minor), 1); cdev_del(my_cdev);

Re: mmap local APIC address

2011-10-19 Thread Vaibhav Jain
On Fri, Oct 14, 2011 at 9:10 PM, Mulyadi Santosa mulyadi.sant...@gmail.comwrote: hi... On Sat, Oct 15, 2011 at 07:22, Vaibhav Jain vjoss...@gmail.com wrote: Hi, I am trying to map local APIC on an intel system (physical address 0xfee0) in a user level program using mmap but my

Re: mmap local APIC address

2011-10-19 Thread Vaibhav Jain
Hi, Please ignore the email below. I am sorry I made a very silly mistake. Thanks Vaibhav Jain On Wed, Oct 19, 2011 at 10:12 AM, Vaibhav Jain vjoss...@gmail.com wrote: On Fri, Oct 14, 2011 at 9:10 PM, Mulyadi Santosa mulyadi.sant...@gmail.com wrote: hi... On Sat, Oct 15, 2011 at 07:22,

Re: mmap local APIC address

2011-10-19 Thread Vaibhav Jain
On Wed, Oct 19, 2011 at 10:57 AM, bob ilikepie...@live.com wrote: It would be nice to share your solution in case someone else comes into the same problem. Hi, It was stupid mistake. I forgot to initialize the file descriptor which was passed to mmap and therefore it was throwing Bad file

Re: Trouble removing character device

2011-10-19 Thread Daniel Baluta
On Wed, Oct 19, 2011 at 7:04 PM, Kai Meyer k...@gnukai.com wrote: I can't seem to get my character device to remove itself from the /proc/devices list. I'm calling all of the following functions like so: alloc_chrdev_region(dev, 0, 5, my_char); cdev_init(my_cdev, my_ops); cdev_add(my_cdev,

Understanding memcpy

2011-10-19 Thread Kai Meyer
I'm trying to poke around an ext4 file system. I can submit a bio for the correct block, and read in what seems to be the correct information, but when I try to memcpy my char *buffer to a reference to a struct I've made, it just doesn't seem to work. The relevant code looks like this: typedef

Re: Trouble removing character device

2011-10-19 Thread rohan puri
On Thu, Oct 20, 2011 at 2:25 AM, Kai Meyer k...@gnukai.com wrote: Unfortunately I can't share the source code, it belongs to the company I work for. All of cdev_init, cdev_del, and unregister_chrdev_region are void functions, so they have no return value. I check the return value of

Re: Understanding memcpy

2011-10-19 Thread rohan puri
On Thu, Oct 20, 2011 at 3:04 AM, Kai Meyer k...@gnukai.com wrote: I'm trying to poke around an ext4 file system. I can submit a bio for the correct block, and read in what seems to be the correct information, but when I try to memcpy my char *buffer to a reference to a struct I've made, it

Re: Getting 'bad file number' error writing to device driver

2011-10-19 Thread Mandeep Sandhu
Thanks for the link; but this bit has to be set on the original executable. Is there any way a program in user mode can get around this or set the bit himself? Ummm...now that would be a security violation, don't you think? If a program can elevate it's own privileges, then whats the point of