function of major/minor device number

2012-02-12 Thread hz hanks
Hi, all I have a question about major/minor device number. I know that one can use int register_chrdev_region(dev_t from, unsigned count, const char *name); to register a driver with a unique pair of major/minor device number. But what's the difference between two drivers: in one case they have sa

Re: function of major/minor device number

2012-02-12 Thread Alexandru Juncu
2012/2/12 hz hanks : > Hi, all > > I have a question about major/minor device number. I know that one can > use int register_chrdev_region(dev_t from, unsigned count, const char > *name); to register a driver with a unique pair of major/minor device > number. But what's the difference between two d

Re: function of major/minor device number

2012-02-12 Thread Robert P. J. Day
On Sun, 12 Feb 2012, Alexandru Juncu wrote: > 2012/2/12 hz hanks : > > Hi, all > > > > I have a question about major/minor device number. I know that one can > > use int register_chrdev_region(dev_t from, unsigned count, const char > > *name); to register a driver with a unique pair of major/minor

Re: cross compile linux

2012-02-12 Thread Mulyadi Santosa
On Sat, Feb 11, 2012 at 14:05, chromaticwt zac wrote: > what is the proper way to cross compile the linux kernel from one arch to > another? specifically, > i386 -> ppc. Just adding to what others had said, you might also consider ptxdist or scratchbox to automate such cross compiling things. Of

Re: Confusing in Address

2012-02-12 Thread Mulyadi Santosa
Hi :) Let me try to help ... On Sat, Feb 11, 2012 at 16:52, hz hanks wrote: > Hi, all > > I'm confused with different addresses in Linux, such as virtual > address and hardware address. very very likely you will deal with virtual address, because you're in protected mode and MMU (Memory Managem

Re: How to measure performance inside Kernel?

2012-02-12 Thread Mulyadi Santosa
Hi Peter... On Sat, Feb 11, 2012 at 20:57, Peter Senna Tschudin wrote: > Graeme, > > I found a problem on my code. I was calling kmalloc() only once for > both portions of code. The result is that the first loop that accessed > the memory was finding some penalty. Now I'm calling independent > km

Re: function of major/minor device number

2012-02-12 Thread Alexandru Juncu
2012/2/12 hz hanks : > Hey Alexandru Juncu > > Thank you so much! You are so helpful for me. > > As far as I'm concerned, the point that confuses me is the definition > of ONE device driver. For example, I would consider a file of some > source codes, that manipulate the GPIO and use  misc_register

Writing module in kernel 3.1.6

2012-02-12 Thread Swapnil Gaikwad
Hi, I am new to kernel programming, I have written one module to get vfs inode using path_lookup function in kernel 2.6.35. Now I am trying to compile same module under kernel 3.1.6 then i got some errors like ioctl undefined, path_lookup not present i.e error: implicit declaration of function ‘p

Re: function of major/minor device number

2012-02-12 Thread hz hanks
Hey Alexandru Juncu Thank you for your help again. Sorry about that mistake, I just didn't notice the forward address when using quick reply. It won't happen again. Best. 2012/2/12 Alexandru Juncu : > 2012/2/12 hz hanks : >> Hey Alexandru Juncu >> >> Thank you so much! You are so helpful for me

Re: function of major/minor device number

2012-02-12 Thread hz hanks
Hi, rday Thank you for your help. Yes! You did point out my question. I will do read drivers/char/misc.c for a better understanding. Best, 2012/2/12 Robert P. J. Day : > On Sun, 12 Feb 2012, Alexandru Juncu wrote: > >> 2012/2/12 hz hanks : >> > Hi, all >> > >> > I have a question about major/mi

Re: function of major/minor device number

2012-02-12 Thread Robert P. J. Day
On Sun, 12 Feb 2012, hz hanks wrote: > Hi, rday > > Thank you for your help. Yes! You did point out my question. I will do > read drivers/char/misc.c for a better understanding. as part of my kernel programming course, i show how to allocate and register a simple char misc device: = start

Re: cross compile linux

2012-02-12 Thread Anuz Pratap Singh Tomar
On Sun, Feb 12, 2012 at 11:17 AM, Mulyadi Santosa wrote: > On Sat, Feb 11, 2012 at 14:05, chromaticwt zac > wrote: > > what is the proper way to cross compile the linux kernel from one arch to > > another? specifically, > > i386 -> ppc. > Try this tutorial http://free-electrons.com/docs/toolchai

Re: cross compile linux

2012-02-12 Thread Anuz Pratap Singh Tomar
On Sun, Feb 12, 2012 at 11:38 PM, Anuz Pratap Singh Tomar < chambilketha...@gmail.com> wrote: > > > On Sun, Feb 12, 2012 at 11:17 AM, Mulyadi Santosa < > mulyadi.sant...@gmail.com> wrote: > >> On Sat, Feb 11, 2012 at 14:05, chromaticwt zac >> wrote: >> > what is the proper way to cross compile th

Does the mq_timedreceive() fully implement the POSIX specification?

2012-02-12 Thread K K
Hi All, I am doing POSIX test on linux. And for mq_timedreceive() in POSIX spec 2008 Issue 7, Line 43787: The validity of the abstime parameter need not be checked if a message can be removed from the message queue immediately. But when I run test case mq_timedreceive/10-2 of POSIX suite (ca

some questions about container_of and user_struct

2012-02-12 Thread loody
hi all: I add below function in free_uid to get which task try to free user_struct struct task_struct *p; struct cred *c; c = container_of(up,struct cred, user); p = container_of(c,struct task_struct,real_cred); printk("%s user %p, cred->user = %p p->pid = %d\n",__func__,up, c->user,p->pid); but

Recompile the Library of the Linux Kernel

2012-02-12 Thread LI LEI
Hello, everyone, I am a beginner to learn about the linux kernel. I met the following problem today: I created a C file called "drv_event.c", and put it into the location "/lib", since I want to link it to the library of the kernel, i.e., *lib.a*. I also put the header file "drv_event.h" into the