How to choice the Open source project about kernel?

2012-12-19 Thread lx
hi:
  How to choice the Open source project about kernel?
I'm a new one, and I want to practice the technology about kernel.
Please list some simple projects, thank you
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


misc device question

2012-12-19 Thread Kevin Wilson
Hello,kernelnewbies

I am trying to develop a misc driver in 3.7.0 kernel.

As a basis I copy and paste this code, *without any change*,

http://virtlog.com/2008/03/25/linux-miscdevice-sample/

And build it.
after insmod I have :
[root@n miscDevice]\ls -al /dev/mymisc
crw--- 1 root root 10, 59 Dec 19 10:24 /dev/mymisc


However, when trying to open this file I get:
open: No such file or directory

Any ideas why ?

The program with which I try to open the device is simple, a few lines
following here:
int main()
{
  int fd;

  fd = open(/dev/mymodule, O_RDONLY);
if (fd == -1) {
perror(open);
exit(1);
}
  printf(open succeeded\n);   

}

Any ideas why this error ?

rgs,
Kevin

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: misc device question

2012-12-19 Thread Daniel Baluta
On Wed, Dec 19, 2012 at 10:36 AM, Kevin Wilson wkev...@gmail.com wrote:

 Hello,kernelnewbies

 I am trying to develop a misc driver in 3.7.0 kernel.

 As a basis I copy and paste this code, *without any change*,

 http://virtlog.com/2008/03/25/linux-miscdevice-sample/

 And build it.
 after insmod I have :
 [root@n miscDevice]\ls -al /dev/mymisc
 crw--- 1 root root 10, 59 Dec 19 10:24 /dev/mymisc


 However, when trying to open this file I get:
 open: No such file or directory

 Any ideas why ?


You should implement open. Check this out [1]


 The program with which I try to open the device is simple, a few lines
 following here:
 int main()
 {
   int fd;

   fd = open(/dev/mymodule, O_RDONLY);

Isn't this supposed to be called /dev/mymisc ?

 if (fd == -1) {
 perror(open);
 exit(1);
 }
   printf(open succeeded\n);

 }


thanks,
Daniel.

[1] http://lxr.linux.no/#linux+v3.7.1/drivers/char/efirtc.c#L282
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Question regarding patches

2012-12-19 Thread Shraddha Kamat
Sorry if this is not relevant to kernel. But since I am 
patching the kernel - Please consider this as a uber beginner
question to ask on this mailing list - forgive me for that.

Now my question is - 

What @@ -321,7 +321,8 @@ mean in this snippet from the patch -  

diff --git a/exec.h b/exec.h
index 722c620..6abb687 100644
--- a/exec.h
+++ b/exec.h
@@ -321,7 +321,8 @@ static void acct_arg_size(struct linux_binprm *bprm,
unsigned long pages);

-- Shraddha 



___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: misc device question

2012-12-19 Thread Kevin Wilson
Hi,
Thanks.
 Isn't this supposed to be called /dev/mymisc ?
Well, your are right ! and with  /dev/mymisc it worked!
sorry for the noise.

BTW, it worked also without  implementing the open() method


rgs
K.

On Wed, Dec 19, 2012 at 10:51 AM, Daniel Baluta daniel.bal...@gmail.com wrote:


 On Wed, Dec 19, 2012 at 10:36 AM, Kevin Wilson wkev...@gmail.com wrote:

 Hello,kernelnewbies

 I am trying to develop a misc driver in 3.7.0 kernel.

 As a basis I copy and paste this code, *without any change*,

 http://virtlog.com/2008/03/25/linux-miscdevice-sample/

 And build it.
 after insmod I have :
 [root@n miscDevice]\ls -al /dev/mymisc
 crw--- 1 root root 10, 59 Dec 19 10:24 /dev/mymisc


 However, when trying to open this file I get:
 open: No such file or directory

 Any ideas why ?


 You should implement open. Check this out [1]


 The program with which I try to open the device is simple, a few lines
 following here:
 int main()
 {
   int fd;

   fd = open(/dev/mymodule, O_RDONLY);

 Isn't this supposed to be called /dev/mymisc ?

 if (fd == -1) {
 perror(open);
 exit(1);
 }
   printf(open succeeded\n);

 }


 thanks,
 Daniel.

 [1] http://lxr.linux.no/#linux+v3.7.1/drivers/char/efirtc.c#L282

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Question regarding patches

2012-12-19 Thread Avinash Patil
I think those are git commit IDs.

-Avinash


On Wed, Dec 19, 2012 at 3:43 PM, Shraddha Kamat sh200...@gmail.com wrote:

 On Wed, 2012-12-19 at 13:58 +0400, Lijo Antony wrote:
  On 12/19/2012 12:47 PM, Shraddha Kamat wrote:
   Sorry if this is not relevant to kernel. But since I am
   patching the kernel - Please consider this as a uber beginner
   question to ask on this mailing list - forgive me for that.
  
   Now my question is -
  
   What @@ -321,7 +321,8 @@ mean in this snippet from the patch -
  
   diff --git a/exec.h b/exec.h
   index 722c620..6abb687 100644
   --- a/exec.h
   +++ b/exec.h
   @@ -321,7 +321,8 @@ static void acct_arg_size(struct linux_binprm
 *bprm,
   unsigned long pages);
  
 
 
 http://www.gnu.org/software/diffutils/manual/html_node/Detailed-Unified.html
  http://www.artima.com/weblogs/viewpost.jsp?thread=164293
 
  -lijo
 
 But I don't see any mention of the index field here //
 see line index 722c620..6abb687 100644. What does this mean ?

   -- Shraddha
  
  
  
   ___
   Kernelnewbies mailing list
   Kernelnewbies@kernelnewbies.org
   http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
  
 
 
  ___
  Kernelnewbies mailing list
  Kernelnewbies@kernelnewbies.org
  http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

 -- Shraddha


 ___
 Kernelnewbies mailing list
 Kernelnewbies@kernelnewbies.org
 http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Question regarding patches

2012-12-19 Thread Tobias Boege
On Wed, 19 Dec 2012, Shraddha Kamat wrote:
 On Wed, 2012-12-19 at 13:58 +0400, Lijo Antony wrote:
  On 12/19/2012 12:47 PM, Shraddha Kamat wrote:
   Sorry if this is not relevant to kernel. But since I am
   patching the kernel - Please consider this as a uber beginner
   question to ask on this mailing list - forgive me for that.
  
   Now my question is -
  
   What @@ -321,7 +321,8 @@ mean in this snippet from the patch -
  
   diff --git a/exec.h b/exec.h
   index 722c620..6abb687 100644
   --- a/exec.h
   +++ b/exec.h
   @@ -321,7 +321,8 @@ static void acct_arg_size(struct linux_binprm *bprm,
   unsigned long pages);
  
  
  http://www.gnu.org/software/diffutils/manual/html_node/Detailed-Unified.html
  http://www.artima.com/weblogs/viewpost.jsp?thread=164293
  
  -lijo
  
 But I don't see any mention of the index field here // 
 see line index 722c620..6abb687 100644. What does this mean ?

See man git-diff (GENERATING PATCHES WITH -P) for the information.

Regards,
Tobi


___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


gcc 2.95.3 compile failure

2012-12-19 Thread horse_rivers
hi:

  I am trying to  compile gcc2.95.3 ,after I patch  source code , and configure 
, make 

  fail with this :gcc-2.95.3/libio/streambuf.h:37: parse error before `}'

  I find this line is     35  extern C {
                               36    #include libio.h
                              37 }

how can I fix this error?


thanks!

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: gcc 2.95.3 compile failure

2012-12-19 Thread Anuz Pratap Singh Tomar
On Wed, Dec 19, 2012 at 2:10 PM, horse_rivers horse_riv...@126.com wrote:

 hi:

   I am trying to  compile gcc2.95.3 ,after I patch  source code , and
 configure , make

   fail with this :gcc-2.95.3/libio/streambuf.h:37: parse error before `}'

   I find this line is 35  extern C {
36#include libio.h
   37 }

 how can I fix this error?

 Try this list, you may get a better answer:
 http://gcc.gnu.org/ml/gcc-help/


 thanks!

 ___
 Kernelnewbies mailing list
 Kernelnewbies@kernelnewbies.org
 http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies




-- 
Thank you
Warm Regards
Anuz
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: gcc 2.95.3 compile failure

2012-12-19 Thread Thomas Petazzoni
Dear horse_rivers,

On Wed, 19 Dec 2012 22:10:07 +0800 (CST), horse_rivers wrote:

   I am trying to  compile gcc2.95.3 ,after I patch  source code , and 
 configure , make 

Do you know we are in 2012 ?

Some people are even saying that the end of the world will be in two
days. So what do you risk at trying with a sane, recent, version of
gcc, instead of the prehistoric 2.95 version?

Best regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: gcc 2.95.3 compile failure

2012-12-19 Thread Yann Droneaud
Le mercredi 19 décembre 2012 à 15:54 +0100, Thomas Petazzoni a écrit :
 Dear horse_rivers,
 
 On Wed, 19 Dec 2012 22:10:07 +0800 (CST), horse_rivers wrote:
 
I am trying to  compile gcc2.95.3 ,after I patch  source code , and 
  configure , make 
 
 Do you know we are in 2012 ?
 
 Some people are even saying that the end of the world will be in two
 days.

This is already the end of the world:

Zombie programs are coming back to live !
Blue screen of the death and such.

(hey, just kidding ;)

-- 
Yann Droneaud
OPTEYA



___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Question regarding patches

2012-12-19 Thread Anand Arumugam
On Wed, Dec 19, 2012 at 2:13 AM, Shraddha Kamat sh200...@gmail.com wrote:

 On Wed, 2012-12-19 at 13:58 +0400, Lijo Antony wrote:
  On 12/19/2012 12:47 PM, Shraddha Kamat wrote:
   Sorry if this is not relevant to kernel. But since I am
   patching the kernel - Please consider this as a uber beginner
   question to ask on this mailing list - forgive me for that.
  
   Now my question is -
  
   What @@ -321,7 +321,8 @@ mean in this snippet from the patch -
  
   diff --git a/exec.h b/exec.h
   index 722c620..6abb687 100644
   --- a/exec.h
   +++ b/exec.h
   @@ -321,7 +321,8 @@ static void acct_arg_size(struct linux_binprm
 *bprm,
   unsigned long pages);
  
 
 
 http://www.gnu.org/software/diffutils/manual/html_node/Detailed-Unified.html
  http://www.artima.com/weblogs/viewpost.jsp?thread=164293
 
  -lijo
 
 But I don't see any mention of the index field here //
 see line index 722c620..6abb687 100644. What does this mean ?


'722c620' is the commit id in which a/exec.h is part of and
'6abb687' is the commit id in which b/exec.h is part of. 'a' and 'b' are
not folders. Its just a notation that diff uses for left and right side.

to know more on git look here: http://git-scm.com/book
and git diff in particular look at the man page or search for git diff
and you get a lot of links that explains it...
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: sysfs: pass function pointers to kernel (not just a value through attribute)

2012-12-19 Thread Jonathan Neuschäfer
On Mon, Dec 17, 2012 at 10:11:46AM -0500, Terry Hsu wrote:
 Hello everyone,
 
 I am looking for some mechanism for userspace tasks to pass certain
 functions to kernel and let the kernel execute these functions on behalf of
 userspace tasks. I know that sysfs can be used with kobject embedded into
 internal kernel structure to access kernel variables. But is there anyway
 for userspace tasks to pass a function to kernel to execute through sysfs?
 
 PS: adding syscall in the kernel can certainly satisfy my needs but it is
 less favorable because the new kernel service I want to add is not that
 general to be added as a new syscall.
 
 Thanks in advance!
 T

You might want to use plain old kernel modules, after all.

Greetings,
Jonathan Neuschäfer

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: How to choice the Open source project about kernel?

2012-12-19 Thread Jonathan Neuschäfer
On Wed, Dec 19, 2012 at 04:05:57PM +0800, lx wrote:
 hi:
   How to choice the Open source project about kernel?
 I'm a new one, and I want to practice the technology about kernel.
 Please list some simple projects, thank you

Read, understand.  Test, find a bug, and try to fix it.

There's also several websites (and a few books) that are dedicated to
Linux kernel programming out there, such as http://crashcourse.ca/.

HTH,
Jonathan Neuschäfer

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: How to choice the Open source project about kernel?

2012-12-19 Thread Zhouping Liu
2012/12/19 lx lxlenovos...@gmail.com

 hi:
   How to choice the Open source project about kernel?
 I'm a new one, and I want to practice the technology about kernel.
 Please list some simple projects, thank you


Linux Test Project: http://ltp.sourceforge.net/
git repo: git://ltp.git.sourceforge.net/gitroot/ltp/ltp
it's appropriate  for kernel newbies.

Thanks,
Zhouping


 ___
 Kernelnewbies mailing list
 Kernelnewbies@kernelnewbies.org
 http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re:Re: gcc 2.95.3 compile failure

2012-12-19 Thread horse_rivers
At 2012-12-19 22:54:30,Thomas Petazzoni thomas.petazz...@free-electrons.com wrote:
Dear horse_rivers,

On Wed, 19 Dec 2012 22:10:07 +0800 (CST), horse_rivers wrote:

   I am trying to  compile gcc2.95.3 ,after I patch  source code , and configure , make 

Do you know we are in 2012 ?

Some people are even saying that the end of the world will be in two
days. So what do you risk at trying with a sane, recent, version of
gcc, instead of the prehistoric 2.95 version?

becasue i want to compile linux 2.6 version  kernel ,which require  gcc2.95.3

Best regards


Best regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies