Re: Linux kernel environment setup in VSCode

2022-04-30 Thread Kwanghoon Son
On Mon, Apr 04, 2022 at 09:31:46PM +0300, Jasper Surmont wrote:
> Hey,
> 
> I'm new to the Linux kernel development, and I wanted to set up a VSCode
> environment for navigating the code (I know, even though people tell me Vim
> is better but currently I'm really not comfortable with it yet).
> My main goal is just navigating and understanding. I've been able to make a
> lot work, and using the C/C++ extension from Microsoft I have good
> IntelliSense.
> 
> However, some things are getting flagged by the extension as errors (which
> of course shouldn't, since I've been able to compile the kernel).
> These are things like: identifiers being undefined (for example, in
> kernel/sched/cpudeadline.c u64 is undefined) and errors like: function
> returning array is not allowed (for example, in drivers/md/dm-zero.c on the
> bottom).
vscode use clang and needs clangd.
you can generate from ./scripts/clang-tools/gen_compile_commands.py
which makes you navigate source code!
> I'm wondering if I'm forgetting things such that all these things get
> resolved. Any tips are appreciated.
> 
> 
> Thanks!
> 
> 
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Linux kernel environment setup in VSCode

2022-04-14 Thread Pavel Skripkin

Hi Jasper,

On 4/4/22 21:31, Jasper Surmont wrote:

Hey,

I'm new to the Linux kernel development, and I wanted to set up a VSCode
environment for navigating the code (I know, even though people tell me
Vim is better but currently I'm really not comfortable with it yet).
My main goal is just navigating and understanding. I've been able to
make a lot work, and using the C/C++ extension from Microsoft I have
good IntelliSense.



Just don't install stock C/C++ extension. This extension can't handle 
the kernel, so every time you press 'go to definition' button you will 
get "hey, there are 20 references, one of them is 100% definition, so go 
ahead and find it yourself".


That's why I moved to vim + ctags. It saves my time a lot.

I saw, that there are other c extensions and people say they are a way 
better, but I didn't give them a try



Good luck!


With regards,
Pavel Skripkin

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


Re: Linux kernel environment setup in VSCode

2022-04-07 Thread Minh Dang
Hi,

C/C++ IntelliSense in conjunction with Makefile Tools extension could
solve the problem
Indeed, any projects built with makefile (such as Linux kernel) should use
this combination in VSCode
Here is an introduction of Makefile Tools
https://devblogs.microsoft.com/cppblog/now-announcing-makefile-support-in-visual-studio-code/

I hope it helps

Best,
Dang
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Linux Kernel build dpkg-buildpackage error

2021-08-15 Thread Adverg Ebashinskii

>   can't see it not working  unless there is another error before this you are 
> not giving us.
 
Thank you for the reply. Actually the root cause of the error was much earlier 
in the output. Running scripts/config --disable SYSTEM_TRUSTED_KEYS makes the 
kernel compiles successfully.
--
Regards,
Adverg Ebashinskii
 
 ___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Linux Kernel build dpkg-buildpackage error

2021-08-15 Thread Ewan Marshall

Try `make -j $(getconf _NPROCESSORS_ONLN) bindeb-pkg LOCALVERSION=-custom`

Line 77 of scripts/Makefile.Package is:
`$ mv $(KDEB_SOURCENAME).tar.gz 
../$(KDEB_SOURCENAME)_$${origversion}.orig.tar.gz`


which suggests it is not finding the file $(KDEB_SOURCENAME).tar.gz 
debians instructions tell one to use the bindeb-pkg build target instead 
of deb-pkg build target for some reason. I can't see it not working 
unless there is another error before this you are not giving us.


Regards,
Ewan

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


Re: Linux kernel BSP

2021-04-14 Thread Greg KH
On Wed, Apr 14, 2021 at 08:03:10AM +, Pankaj  Vinodrao Joshi wrote:
> Hi Saket,
> Thanks for response. I would like to tell saket in AOSP there is no support 
> for my device but yes i do have complete support for linux-mainline.
> 
> For me to work android perfectly on my device what do you think where i 
> should change in AOSP , do you have any idea about like where some arch 
> specific changes needs to be done in AOSP??

What failed when you booted AOSP on your hardware?

What failed when you built AOSP for your hardware?

Again, try it and see...

good luck!

greg k-h

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


Re: Linux kernel BSP

2021-04-14 Thread Pankaj Vinodrao Joshi
Hi Saket,
Thanks for response. I would like to tell saket in AOSP there is no support for 
my device but yes i do have complete support for linux-mainline.

For me to work android perfectly on my device what do you think where i should 
change in AOSP , do you have any idea about like where some arch specific 
changes needs to be done in AOSP??

Kindly share the references as well if you have

Thanks

From: Saket Sinha 
Sent: Wednesday, April 14, 2021 1:20 PM
To: Pankaj Vinodrao Joshi 
Cc: kernelnewbies@kernelnewbies.org 
Subject: Re: Linux kernel BSP

Hi Pankaj,

Like Greg mentioned there has been a lot of effort in getting android kernel 
mainlined so most probably you will not find any issues there.

Most of the Boards(SOCs) are supported in kernel via device tree, configs etc.

For android userspace and libraries refer - https://source.android.com/


Regards,
Saket Sinha


On Wed, Apr 14, 2021 at 9:25 AM Pankaj Vinodrao Joshi 
mailto:pankaj...@exaleapsemi.com>> wrote:
Ok, Exactly i was looking for any changes are there w.r.t BSP in linux-mainline 
kernel and android kernel but you made me clear with like there will be no 
changes in linux kernel source code including drivers,dtsi  right ??

Yes i do agree i am paying for BSP to the board vendors but i was trying to get 
the things which needs to changes as my vendor doesnt provide support for 
android and i want to make android up with my device which have support for 
linux only.


Thanks




From: Greg KH mailto:g...@kroah.com>>
Sent: Wednesday, April 14, 2021 12:35 PM
To: Pankaj Vinodrao Joshi 
mailto:pankaj...@exaleapsemi.com>>
Cc: kernelnewbies@kernelnewbies.org<mailto:kernelnewbies@kernelnewbies.org> 
mailto:kernelnewbies@kernelnewbies.org>>
Subject: Re: Linux kernel BSP

On Wed, Apr 14, 2021 at 06:54:49AM +, Pankaj  Vinodrao Joshi wrote:
> Hi Greg KH,
>
> i understood BSP (Board support packages ) contains u-boot , drivers
> ,dts  apart from this what are the elements of BSP i am not able to
> understand.

It all depends on who you got this "BSP" from.  You are paying for
support from the vendor whose chip you bought, why not consult their
documentation and ask them for help?

> Scenario is, i want to port linux BSP to the android BSP and for that
> i am trying to gather the information about the BSP, what exectly it
> is, where i should change all kind of stuff

At the kernel level, there is no difference between "linux bsp" and
"android bsp", it's all just Linux down there.

And again, ask your vendor for this help, you are paying for it already.

> Hope i made you clear with what i am looking for

Not really, sorry. Please be specific as to what you have tried and what
did not work.

thanks,

greg k-h
[EXT]
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org<mailto:Kernelnewbies@kernelnewbies.org>
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
[EXT]
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Linux kernel BSP

2021-04-14 Thread Saket Sinha
Hi Pankaj,

Like Greg mentioned there has been a lot of effort in getting android
kernel mainlined so most probably you will not find any issues there.

Most of the Boards(SOCs) are supported in kernel via device tree, configs
etc.

For android userspace and libraries refer - https://source.android.com/


Regards,
Saket Sinha


On Wed, Apr 14, 2021 at 9:25 AM Pankaj Vinodrao Joshi <
pankaj...@exaleapsemi.com> wrote:

> Ok, Exactly i was looking for any changes are there w.r.t BSP in
> linux-mainline kernel and android kernel but you made me clear with like
> there will be no changes in linux kernel source code including
> drivers,dtsi  right ??
>
> Yes i do agree i am paying for BSP to the board vendors but i was trying
> to get the things which needs to changes as my vendor doesnt provide
> support for android and i want to make android up with my device which have
> support for linux only.
>
>
> Thanks
>
>
>
> --
> *From:* Greg KH 
> *Sent:* Wednesday, April 14, 2021 12:35 PM
> *To:* Pankaj Vinodrao Joshi 
> *Cc:* kernelnewbies@kernelnewbies.org 
> *Subject:* Re: Linux kernel BSP
>
> On Wed, Apr 14, 2021 at 06:54:49AM +, Pankaj  Vinodrao Joshi wrote:
> > Hi Greg KH,
> >
> > i understood BSP (Board support packages ) contains u-boot , drivers
> > ,dts  apart from this what are the elements of BSP i am not able to
> > understand.
>
> It all depends on who you got this "BSP" from.  You are paying for
> support from the vendor whose chip you bought, why not consult their
> documentation and ask them for help?
>
> > Scenario is, i want to port linux BSP to the android BSP and for that
> > i am trying to gather the information about the BSP, what exectly it
> > is, where i should change all kind of stuff
>
> At the kernel level, there is no difference between "linux bsp" and
> "android bsp", it's all just Linux down there.
>
> And again, ask your vendor for this help, you are paying for it already.
>
> > Hope i made you clear with what i am looking for
>
> Not really, sorry. Please be specific as to what you have tried and what
> did not work.
>
> thanks,
>
> greg k-h
> [EXT]
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Linux kernel BSP

2021-04-14 Thread Greg KH
On Wed, Apr 14, 2021 at 07:24:29AM +, Pankaj  Vinodrao Joshi wrote:
> Ok, Exactly i was looking for any changes are there w.r.t BSP in
> linux-mainline kernel and android kernel but you made me clear with
> like there will be no changes in linux kernel source code including
> drivers,dtsi  right ??

No idea, it depends on your hardware.

> Yes i do agree i am paying for BSP to the board vendors but i was
> trying to get the things which needs to changes as my vendor doesnt
> provide support for android and i want to make android up with my
> device which have support for linux only.

Again "linux" is the kernel, and Android is only the userspace stuff on
top of that.  They are independent, you can run "Android" on a desktop
just fine.

Take look at the Android documentation for how to set this all up, there
are loads of resources online for this.

good luck!

greg k-h

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


Re: Linux kernel BSP

2021-04-14 Thread Pankaj Vinodrao Joshi
Ok, Exactly i was looking for any changes are there w.r.t BSP in linux-mainline 
kernel and android kernel but you made me clear with like there will be no 
changes in linux kernel source code including drivers,dtsi  right ??

Yes i do agree i am paying for BSP to the board vendors but i was trying to get 
the things which needs to changes as my vendor doesnt provide support for 
android and i want to make android up with my device which have support for 
linux only.


Thanks




From: Greg KH 
Sent: Wednesday, April 14, 2021 12:35 PM
To: Pankaj Vinodrao Joshi 
Cc: kernelnewbies@kernelnewbies.org 
Subject: Re: Linux kernel BSP

On Wed, Apr 14, 2021 at 06:54:49AM +, Pankaj  Vinodrao Joshi wrote:
> Hi Greg KH,
>
> i understood BSP (Board support packages ) contains u-boot , drivers
> ,dts  apart from this what are the elements of BSP i am not able to
> understand.

It all depends on who you got this "BSP" from.  You are paying for
support from the vendor whose chip you bought, why not consult their
documentation and ask them for help?

> Scenario is, i want to port linux BSP to the android BSP and for that
> i am trying to gather the information about the BSP, what exectly it
> is, where i should change all kind of stuff

At the kernel level, there is no difference between "linux bsp" and
"android bsp", it's all just Linux down there.

And again, ask your vendor for this help, you are paying for it already.

> Hope i made you clear with what i am looking for

Not really, sorry. Please be specific as to what you have tried and what
did not work.

thanks,

greg k-h
[EXT]
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Linux kernel BSP

2021-04-14 Thread Greg KH
On Wed, Apr 14, 2021 at 06:54:49AM +, Pankaj  Vinodrao Joshi wrote:
> Hi Greg KH,
> 
> i understood BSP (Board support packages ) contains u-boot , drivers
> ,dts  apart from this what are the elements of BSP i am not able to
> understand.

It all depends on who you got this "BSP" from.  You are paying for
support from the vendor whose chip you bought, why not consult their
documentation and ask them for help?

> Scenario is, i want to port linux BSP to the android BSP and for that
> i am trying to gather the information about the BSP, what exectly it
> is, where i should change all kind of stuff

At the kernel level, there is no difference between "linux bsp" and
"android bsp", it's all just Linux down there.

And again, ask your vendor for this help, you are paying for it already.

> Hope i made you clear with what i am looking for

Not really, sorry. Please be specific as to what you have tried and what
did not work.

thanks,

greg k-h

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


Re: Linux kernel BSP

2021-04-14 Thread Pankaj Vinodrao Joshi
Hi Greg KH,

i understood BSP (Board support packages ) contains u-boot , drivers ,dts  
apart from this what are the elements of BSP i am not able to understand.

Scenario is, i want to port linux BSP to the android BSP and for that i am 
trying to gather the information about the BSP, what exectly it is, where i 
should change all kind of stuff

Hope i made you clear with what i am looking for

Warm regards


From: Greg KH 
Sent: Wednesday, April 14, 2021 12:17 PM
To: Pankaj Vinodrao Joshi 
Cc: kernelnewbies@kernelnewbies.org 
Subject: Re: Linux kernel BSP

On Wed, Apr 14, 2021 at 06:38:36AM +, Pankaj  Vinodrao Joshi wrote:
> Hi,
> i am newbie to linux BSP and i want to get some hand on with BSP. Can someone 
> kindly suggest what all the components of BSP also i need to port BSP from 
> one arch to other what and all things i should consider to get it ported ??

What have you tried and looked at that was not enough information?

And what do you mean exactly by "BSP"?

What exactly are you trying to do?  Specific questions are best.

good luck!

greg k-h
[EXT]
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Linux kernel BSP

2021-04-14 Thread Greg KH
On Wed, Apr 14, 2021 at 06:38:36AM +, Pankaj  Vinodrao Joshi wrote:
> Hi,
> i am newbie to linux BSP and i want to get some hand on with BSP. Can someone 
> kindly suggest what all the components of BSP also i need to port BSP from 
> one arch to other what and all things i should consider to get it ported ??

What have you tried and looked at that was not enough information?

And what do you mean exactly by "BSP"?

What exactly are you trying to do?  Specific questions are best.

good luck!

greg k-h

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


Re: linux-kernel janitorial RFP: Mark static arrays as const

2021-03-07 Thread Julia Lawall


On Sun, 7 Mar 2021, Joe Perches wrote:

> On Sun, 2021-03-07 at 20:14 +0100, Julia Lawall wrote:
> >
> > On Wed, 3 Mar 2021, Joe Perches wrote:
> >
> > > On Wed, 2021-03-03 at 10:41 +0100, Rasmus Villemoes wrote:
> > > > On 02/03/2021 18.42, Joe Perches wrote:
> > > > > Here is a possible opportunity to reduce data usage in the kernel.
> > > > >
> > > > > $ git grep -P -n 
> > > > > '^static\s+(?!const|struct)(?:\w+\s+){1,3}\w+\s*\[\s*\]' drivers/ | \
> > > > >   grep -v __initdata | \
> > > > >   wc -l
> > > > > 3250
> > > > >
> > > > > Meaning there are ~3000 declarations of arrays with what appears to be
> > > > > file static const content that are not marked const.
> > > > >
> > > > > So there are many static arrays that could be marked const to move the
> > > > > compiled object code from data to text minimizing the total amount of
> > > > > exposed r/w data.
> > > >
> > > > You can add const if you like, but it will rarely change the generated
> > > > code. gcc is already smart enough to take a static array whose contents
> > > > are provably never modified within the TU and put it in .rodata:
> > >
> > > At least some or perhaps even most of the time, true, but the gcc compiler
> > > from v5 through at least v10 seems inconsistent about when it does the
> > > appropriate conversion.
> > >
> > > See the example I posted:
> > > https://lore.kernel.org/lkml/6b8b250a06a98ce42120a14824531a8641f5e8aa.ca...@perches.com/
> > >
> > > It was a randomly chosen source file conversion btw, I had no prior
> > > knowledge of whether the text/data use would change.
> > >
> > > I'm unsure about clang consistently moving static but provably const 
> > > arrays
> > > from data to text.  I rarely use clang.  At least for v11 it seems to be
> > > better though.  I didn't try 10.1.
> >
> > I tried the relevnt drivers in drivers/input/joystick.  I got only one
> > driver that changed with gcc 9.3, which was
> > drivers/input/joystick/analog.c.  It actually got larger:
> >
> > original:
> >
> >    textdata bss dec hex filename
> >   22607   10560 320   3348782cf drivers/input/joystick/analog.o
> >
> > after adding const:
> >
> >    textdata bss dec hex filename
> >   22728   10816 320   338648448 drivers/input/joystick/analog.o
> >
> > This was the only case where bss was not 0, but I don't know if there is a
> > connection.
>
> You really need consider using defconfig so whatever object code
> does not have tracing/debugging support.
>
> For instance, this code with defconfig and analog joystick:
>
> Original:
>
> $ size drivers/input/joystick/analog.o
>text  data bss dec hex filename
>8115   261 22486002198 drivers/input/joystick/analog.o
>
> with const:
>
> $ size drivers/input/joystick/analog.o
>text  data bss dec hex filename
>8179   201 2248604219c drivers/input/joystick/analog.o

Thanks for the suggestion.  It occurred to me that in one case my
transformation was wrong, because the array was multi-level, and a sub
array was being stored in a structure field that was not declared as
const.  So the argument that the compiler would figure out to put the
array in .rodata didn't make sense.  But I still go the same sizes for
that file.  So I'll try the whole thing again.

thanks,
julia___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: linux-kernel janitorial RFP: Mark static arrays as const

2021-03-07 Thread Joe Perches
On Sun, 2021-03-07 at 20:14 +0100, Julia Lawall wrote:
> 
> On Wed, 3 Mar 2021, Joe Perches wrote:
> 
> > On Wed, 2021-03-03 at 10:41 +0100, Rasmus Villemoes wrote:
> > > On 02/03/2021 18.42, Joe Perches wrote:
> > > > Here is a possible opportunity to reduce data usage in the kernel.
> > > > 
> > > > $ git grep -P -n 
> > > > '^static\s+(?!const|struct)(?:\w+\s+){1,3}\w+\s*\[\s*\]' drivers/ | \
> > > >   grep -v __initdata | \
> > > >   wc -l
> > > > 3250
> > > > 
> > > > Meaning there are ~3000 declarations of arrays with what appears to be
> > > > file static const content that are not marked const.
> > > > 
> > > > So there are many static arrays that could be marked const to move the
> > > > compiled object code from data to text minimizing the total amount of
> > > > exposed r/w data.
> > > 
> > > You can add const if you like, but it will rarely change the generated
> > > code. gcc is already smart enough to take a static array whose contents
> > > are provably never modified within the TU and put it in .rodata:
> > 
> > At least some or perhaps even most of the time, true, but the gcc compiler
> > from v5 through at least v10 seems inconsistent about when it does the
> > appropriate conversion.
> > 
> > See the example I posted:
> > https://lore.kernel.org/lkml/6b8b250a06a98ce42120a14824531a8641f5e8aa.ca...@perches.com/
> > 
> > It was a randomly chosen source file conversion btw, I had no prior
> > knowledge of whether the text/data use would change.
> > 
> > I'm unsure about clang consistently moving static but provably const arrays
> > from data to text.  I rarely use clang.  At least for v11 it seems to be
> > better though.  I didn't try 10.1.
> 
> I tried the relevnt drivers in drivers/input/joystick.  I got only one
> driver that changed with gcc 9.3, which was
> drivers/input/joystick/analog.c.  It actually got larger:
> 
> original:
> 
>    textdata bss dec hex filename
>   22607   10560 320   3348782cf drivers/input/joystick/analog.o
> 
> after adding const:
> 
>    textdata bss dec hex filename
>   22728   10816 320   338648448 drivers/input/joystick/analog.o
> 
> This was the only case where bss was not 0, but I don't know if there is a
> connection.

You really need consider using defconfig so whatever object code
does not have tracing/debugging support.

For instance, this code with defconfig and analog joystick:

Original:

$ size drivers/input/joystick/analog.o
   textdata bss dec hex filename
   8115 261 22486002198 drivers/input/joystick/analog.o

with const:

$ size drivers/input/joystick/analog.o
   textdata bss dec hex filename
   8179 201 2248604219c drivers/input/joystick/analog.o



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


Re: linux-kernel janitorial RFP: Mark static arrays as const

2021-03-07 Thread Julia Lawall


On Wed, 3 Mar 2021, Joe Perches wrote:

> On Wed, 2021-03-03 at 10:41 +0100, Rasmus Villemoes wrote:
> > On 02/03/2021 18.42, Joe Perches wrote:
> > > Here is a possible opportunity to reduce data usage in the kernel.
> > >
> > > $ git grep -P -n '^static\s+(?!const|struct)(?:\w+\s+){1,3}\w+\s*\[\s*\]' 
> > > drivers/ | \
> > >   grep -v __initdata | \
> > >   wc -l
> > > 3250
> > >
> > > Meaning there are ~3000 declarations of arrays with what appears to be
> > > file static const content that are not marked const.
> > >
> > > So there are many static arrays that could be marked const to move the
> > > compiled object code from data to text minimizing the total amount of
> > > exposed r/w data.
> >
> > You can add const if you like, but it will rarely change the generated
> > code. gcc is already smart enough to take a static array whose contents
> > are provably never modified within the TU and put it in .rodata:
>
> At least some or perhaps even most of the time, true, but the gcc compiler
> from v5 through at least v10 seems inconsistent about when it does the
> appropriate conversion.
>
> See the example I posted:
> https://lore.kernel.org/lkml/6b8b250a06a98ce42120a14824531a8641f5e8aa.ca...@perches.com/
>
> It was a randomly chosen source file conversion btw, I had no prior
> knowledge of whether the text/data use would change.
>
> I'm unsure about clang consistently moving static but provably const arrays
> from data to text.  I rarely use clang.  At least for v11 it seems to be
> better though.  I didn't try 10.1.

I tried the relevnt drivers in drivers/input/joystick.  I got only one
driver that changed with gcc 9.3, which was
drivers/input/joystick/analog.c.  It actually got larger:

original:

   textdata bss dec hex filename
  22607   10560 320   3348782cf drivers/input/joystick/analog.o

after adding const:

   textdata bss dec hex filename
  22728   10816 320   338648448 drivers/input/joystick/analog.o

This was the only case where bss was not 0, but I don't know if there is a
connection.

julia___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: linux-kernel janitorial RFP: Mark static arrays as const

2021-03-03 Thread Joe Perches
On Wed, 2021-03-03 at 10:41 +0100, Rasmus Villemoes wrote:
> On 02/03/2021 18.42, Joe Perches wrote:
> > Here is a possible opportunity to reduce data usage in the kernel.
> > 
> > $ git grep -P -n '^static\s+(?!const|struct)(?:\w+\s+){1,3}\w+\s*\[\s*\]' 
> > drivers/ | \
> >   grep -v __initdata | \
> >   wc -l
> > 3250
> > 
> > Meaning there are ~3000 declarations of arrays with what appears to be
> > file static const content that are not marked const.
> > 
> > So there are many static arrays that could be marked const to move the
> > compiled object code from data to text minimizing the total amount of
> > exposed r/w data.
> 
> You can add const if you like, but it will rarely change the generated
> code. gcc is already smart enough to take a static array whose contents
> are provably never modified within the TU and put it in .rodata:

At least some or perhaps even most of the time, true, but the gcc compiler
from v5 through at least v10 seems inconsistent about when it does the
appropriate conversion.

See the example I posted:
https://lore.kernel.org/lkml/6b8b250a06a98ce42120a14824531a8641f5e8aa.ca...@perches.com/

It was a randomly chosen source file conversion btw, I had no prior
knowledge of whether the text/data use would change.

I'm unsure about clang consistently moving static but provably const arrays
from data to text.  I rarely use clang.  At least for v11 it seems to be
better though.  I didn't try 10.1.



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


Re: linux kernel coding style and checkpatch.pl script

2020-03-26 Thread Greg KH
On Thu, Mar 26, 2020 at 04:01:18PM +0300, Konstantin Andreev wrote:
> Valdis Klētnieks, 26 Mar 2020 07:13 MSK:
> > Don't split literal strings, it means that grepping the source tree for 
> > "already registered" fails. Making grep for a string work is more important 
> > than shutting up checkpatch.
> 
> On Thu, Mar 26, 2020 at 02:36:23PM +0300, Konstantin Andreev wrote:
> > Sic! Grepping is important. Given that, why are kernel functions coded in a
> > 
> > | static int __init loglevel(char *str)
> > | {
> > 
> > way, but not old decent unix way:
> > 
> > | static int __init
> > | loglevel(char *str)
> > | {
> 
> Greg KH, 26 Mar 2020 15:06 MSK:
> > Documentation/process/coding-style.rst
> 
> This document does not answer my question. It does not even require
> 
> | static int __init loglevel(char *str)
> | {
> 
> style. Here is a relevant part of document: "separate functions with one 
> blank line... EXPORT macro should follow closing function brace ... In 
> function prototypes, include parameter names ... E.g.:"
> 
> | int system_is_up(void)
> | {
> | return system_state == SYSTEM_RUNNING;
> | }
> | EXPORT_SYMBOL(system_is_up);
> 
> That's all. Have I overlooked something? Could you, please, share your own 
> point of view?

If it's not a specific rule in there, then that means you could do
someething crazy like:
static int __init
loglevel(char *str)
{
if you were so loony to do so.

But, it turns out that when you write your code like that, it's harder
to actually find where the function is defined vs. where it is called
when greping a codebase.

That's why those of us who have been at this for a long time prefer:
static int __init loglevel(char *str)
{
instead.

much easier to pick out of a list of "where is this defined" output of
'git grep'.

And yes, I know all about ctags and the like, but sometimes you don't
have access to that, or don't want to fire it up and have it pre-process
things just to look at a specific git tree at the moment.

Also, big shoutout to 'vgrep' https://github.com/vrothberg/vgrep which
makes using 'git grep' a zillion times easier and is what I rely on all
the time.

tldr;
either way is fine, but putting the return value on the function
name line usually makes it easier for others to find your code.

Hope this helps,

greg k-h

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


Re: linux kernel coding style and checkpatch.pl script

2020-03-26 Thread Konstantin Andreev

Valdis Klētnieks, 26 Mar 2020 07:13 MSK:

Don't split literal strings, it means that grepping the source tree for "already 
registered" fails. Making grep for a string work is more important than shutting up 
checkpatch.


On Thu, Mar 26, 2020 at 02:36:23PM +0300, Konstantin Andreev wrote:

Sic! Grepping is important. Given that, why are kernel functions coded in a

| static int __init loglevel(char *str)
| {

way, but not old decent unix way:

| static int __init
| loglevel(char *str)
| {


Greg KH, 26 Mar 2020 15:06 MSK:

Documentation/process/coding-style.rst


This document does not answer my question. It does not even require

| static int __init loglevel(char *str)
| {

style. Here is a relevant part of document: "separate functions with one blank 
line... EXPORT macro should follow closing function brace ... In function prototypes, 
include parameter names ... E.g.:"

| int system_is_up(void)
| {
| return system_state == SYSTEM_RUNNING;
| }
| EXPORT_SYMBOL(system_is_up);

That's all. Have I overlooked something? Could you, please, share your own 
point of view?

--
Regards, Konstantin

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


Re: linux kernel coding style and checkpatch.pl script

2020-03-26 Thread Greg KH
On Thu, Mar 26, 2020 at 02:36:23PM +0300, Konstantin Andreev wrote:
> Valdis Klētnieks, 26 Mar 2020 07:13 MSK:
> > 
> > To borrow from Pirates of the Carribean, "They're not exactly rules, 
> > they're more like... suggestions..."
> > 
> > Don't split literal strings, it means that grepping the source tree for 
> > "already registered" fails. Making grep for a string work is more important 
> > than shutting up checkpatch.
> 
> Sic! Grepping is important. Given that, why are kernel functions coded in a
> 
> | static int __init loglevel(char *str)
> | {
> 
> way, but not old decent
> 
> | static int __init
> | loglevel(char *str)
> | {
> 
> unix way?

Documentation/process/coding-style.rst

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


Re: linux kernel coding style and checkpatch.pl script

2020-03-26 Thread Konstantin Andreev

Valdis Klētnieks, 26 Mar 2020 07:13 MSK:


To borrow from Pirates of the Carribean, "They're not exactly rules, they're more 
like... suggestions..."

Don't split literal strings, it means that grepping the source tree for "already 
registered" fails. Making grep for a string work is more important than shutting up 
checkpatch.


Sic! Grepping is important. Given that, why are kernel functions coded in a

| static int __init loglevel(char *str)
| {

way, but not old decent

| static int __init
| loglevel(char *str)
| {

unix way?

--
Regards, Konstantin

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


Re: linux kernel coding style and checkpatch.pl script

2020-03-26 Thread Anuz Pratap Singh Tomar
On Wed, Mar 25, 2020 at 9:38 AM Tomek The Messenger <
tomekthemessen...@gmail.com> wrote:

> Hi
> There is checkpatch.pl script where You can check if You wrote code in
> your kernel module according to linux kernel style.
> However can I ignore warning message?
> WARNING: quoted string split across lines
> #974: FILE: fpgax67-core.c:974:
> +   dev_err(>dev, "registration not done, driver is
> already "
> +   "registered\n");
>
> If I don't split line I will have another warning that 80 characters is
> exceeded.
>
> you can put the whole string on next line and/or use "\" for splitting
long string.

For sure I can ignore warnings about:
> WARNING: struct  should normally be const
> #998: FILE: fpgax67-core.c :998:
> +int fpgax67_unregister(struct platform_device *pdev)
>
> For sure all errors must be fixed like:
> const char* tmp -> change to -> const char *tmp;
> if(  => if (   #insert space
>
> Generally I don't know how much warnings should I correct. If it is
> mandatory or only good practise and I can omit some if it doesn't make
> sense.
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>


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


Re: linux kernel coding style and checkpatch.pl script

2020-03-25 Thread Valdis Klētnieks
On Wed, 25 Mar 2020 10:36:08 +0100, Tomek The Messenger said:

> There is checkpatch.pl script

To borrow from Pirates of the Carribean, "They're not exactly rules, they're
more like... suggestions..."

Checkpatch flags *possible* code style problems, but it's not perfect. There's
often good reason to ignore them.   For example:

> However can I ignore warning message?
> WARNING: quoted string split across lines
> #974: FILE: fpgax67-core.c:974:
> +   dev_err(>dev, "registration not done, driver is already 
> "
> +   "registered\n");
>
> If I don't split line I will have another warning that 80 characters is
> exceeded.

Blech. Ick. 

Don't split literal strings, it means that grepping the source tree for
"already registered" fails. Making grep for a string work is more important
than shutting up checkpatch.

> For sure I can ignore warnings about:
> WARNING: struct  should normally be const
> #998: FILE: fpgax67-core.c :998:

This one you actually need to look at what the routine says.  The object is
*usually* a const - but might not be.  Figure out what it actually does.

Always keep in mind that it's a perl script, and just doing regex matching. It
has no clue what the code actually does. Hopefully you have more understanding
of the code than the perl script does...

> For sure all errors must be fixed like:
> const char* tmp -> change to -> const char *tmp;
> if(� => if (� �#insert space

If this is new code you're writing, you should fix it before you submit the
patch adding the code. (Unless of course, checkpatch is wrong about a
variable needing to be a const, or similar)

If you're doing major changes to existing code anyhow, a cleanup patch first is
often appropriate.

If you're just fixing checkpatch warnings for the sake of fixing checkpatch
warnings, keep in mind that many maintainers won't accept patches that just
clean up checkpatch, for several reasons:

First, if it's code that's been static for a while (years, sometimes), there's
always a danger that a patch breaks something.  No reason to touch stable code.

If it's code that somebody else is working on, your patch can cause merge
errors with the other person's (which is why only the person doing the other
work should do cleanup patches - they won't conflict with their own work).

Also, it messes up the git history -  consider a patch that changes
an 'if( foo && !bar) {'  to 'if( foo && !baz){'  to fix a bug where the wrong
variable was being tested.  You then submit a patch to fix the space.
Now a 'git blame' on the file shows your patch rather than the one that
fixes the bug.

However, I have it on good authority that Greg KH will cheerfully accept
checkpatch fixes for anything under 'drivers/staging', because that code
is usually in such bad shape that fixups are needed. :)

Personally, I do kernel builds with sparse and extra gcc warnings, and submit
patches only after applying some thought and concluding things like "Yes,
sparse and/or gcc were correct, the variable *should* be static so it can't be
accessed from another module due to a namespace collision".

In other words, the patch should *never* be "Fix a checkpatch/sparse/gcc
complaint". It should always be "Make an objective improvement to the code
that happened to be pointed out by static analysis tools".



pgpTgKdzF3KBZ.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: linux kernel coding style and checkpatch.pl script

2020-03-25 Thread Greg KH
On Wed, Mar 25, 2020 at 10:36:08AM +0100, Tomek The Messenger wrote:
> Hi
> There is checkpatch.pl script where You can check if You wrote code in your
> kernel module according to linux kernel style.
> However can I ignore warning message?
> WARNING: quoted string split across lines
> #974: FILE: fpgax67-core.c:974:
> +   dev_err(>dev, "registration not done, driver is
> already "
> +   "registered\n");
> 
> If I don't split line I will have another warning that 80 characters is
> exceeded.

No you should not.

> For sure I can ignore warnings about:
> WARNING: struct  should normally be const
> #998: FILE: fpgax67-core.c :998:
> +int fpgax67_unregister(struct platform_device *pdev)

No, please do not.

> For sure all errors must be fixed like:
> const char* tmp -> change to -> const char *tmp;
> if(  => if (   #insert space

Yes.

> Generally I don't know how much warnings should I correct. If it is
> mandatory or only good practise and I can omit some if it doesn't make
> sense.

If you want your code merged properly, and reviewed, just fix them all,
should not take more than a few hours.

good luck!

greg k-h

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


Re: Linux Kernel Tester's Guide is still valid?

2018-10-21 Thread Manuel Quintero Fonseca
Thanks!
El vie., 19 oct. 2018 a las 19:31, Ozgur () escribió:
>
>
>
> 19.10.2018, 05:07, "Manuel Quintero Fonseca" :
> > Hi, Linux Kernel Tester's Guide is still valid?
> >
>
> Hello,
>
> no this is not valid. please follow the kernel version.
> this document was used v2.6 kernel and 2.6 is an old version.
>
> The methods in the document may be similar because syslog and git parts have 
> not changed.
>
> Regards
>
> Ozgur
>
> > http://www.unixy.pl/maciek/doc/lktg/handbook-en.pdf
> >
> > ___
> > Kernelnewbies mailing list
> > Kernelnewbies@kernelnewbies.org
> > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

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


Re: Linux Kernel Tester's Guide is still valid?

2018-10-19 Thread Ozgur



19.10.2018, 05:07, "Manuel Quintero Fonseca" :
> Hi, Linux Kernel Tester's Guide is still valid?
>

Hello,

no this is not valid. please follow the kernel version.
this document was used v2.6 kernel and 2.6 is an old version.

The methods in the document may be similar because syslog and git parts have 
not changed.

Regards

Ozgur

> http://www.unixy.pl/maciek/doc/lktg/handbook-en.pdf
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

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


Re: Linux Kernel Tester's Guide is still valid?

2018-10-19 Thread Manuel Quintero Fonseca
Hello thank you for responding, I am new, and I want to learn, and
looking at the https://kernelnewbies.org page, one of the things we
could do to start is to report bug, which according to a link leads to
that previously shared manual. said guide was not in the league
https://lwn.net/Articles/238838/, but I searched for it by google and
that was the one I found.

as new I thought the best way would be to look for the errors of my
kernel and report them, then look for the solutions.

Now if someone has a better guide to do the search for kernel errors
and report them, I would be very grateful
El vie., 19 oct. 2018 a las 1:39,  escribió:
>
> On Thu, 18 Oct 2018 19:05:35 -0600, Manuel Quintero Fonseca said:
> > Hi, Linux Kernel Tester's Guide is still valid?
> >
> > http://www.unixy.pl/maciek/doc/lktg/handbook-en.pdf
>
> Depends.  Are you insisting on "type this command" validity, or general 
> concepts?
>
> Much of section 1 (from 1.2 to 1.5) has been rendered totally obsolete by the 
> linux-next
> development tree.
>
> Most of the basic concepts remain the same - a binary search using git hasn't 
> changed
> much, and their explanation of things that can go wrong still applies to most 
> uses
> of 'git bisect'.   However, they refer to 'git-this', 'git-that', 
> 'git-whatever', while most
> more recent documentation uses 'git this', 'git that' etc.
>
> And of course, the details of what testing *you* should be doing will depend 
> on
> *why* you're doing testing in the first place - see the recent discussion 
> about
> performance testing for examples.

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


Re: Linux kernel mailing list filtering issues

2018-07-20 Thread Alexander Kapshuk
On Fri, Jul 20, 2018 at 3:43 PM  wrote:
>
> On 2018-07-19 23:55, Alexander Kapshuk wrote:
> > On Thu, Jul 19, 2018 at 10:25 PM  wrote:
> >>
> >> Hi all, I've been trying to post a bug report to the linux-usb mailing
> >> list but keep getting trapped in the filters despite ensuring I'm
> >> using
> >> plaintext.
> >> Heres what I get in the bounce back:
> >>
> >> The mail system
> >>
> >> : host vger.kernel.org[209.132.180.67]
> >> said:
> >> 550
> >>  5.7.1 Content-Policy accept-into-freezer-1 msg: Bayes Statistical
> >>  Bogofilter considers this message SPAM.  BF:  In case you
> >> disagree,
> >>  send the ENTIRE message plus this error message to
> >>  ;
> >>
> >> I've sent the message to the postmaster but haven't heard anything. My
> >> message got through to the maintainer, who has requested I fix my
> >> message and get it on the mailing list proper but nothing I've tried
> >> is
> >> working.
> >>
> >> Heres part of the header from the source of my most recent message:
> >>
> >> MIME-Version: 1.0
> >> Content-Type: text/plain; charset=UTF-8;
> >>   format=flowed
> >> Content-Transfer-Encoding: 8bit
> >>
> >> Any suggestions? Thanks
> >>
> >> ___
> >> Kernelnewbies mailing list
> >> Kernelnewbies@kernelnewbies.org
> >> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
> >
> > What email client did you use to send in your patch?
>
> I used thuderbird to post to the list. My issue seemed to be not having
> the usb: dwc2: tags in the subject line, and my subject being too long.
> Both apparently heavily weight the filter towards treating the message
> as spam. I also removed anything in the debug information that resembled
> a url or email address, which didn't help immediately but might have
> helped weight  it towards not spam after I did the above things. It
> might be a good idea to have a list of suggestions like these on the
> wiki.

You will find kernel documentation [1] on preferred email clients and
formats of interest.
Among other things, the advise on the format of email messages is:
Don't send patches with ``format=flowed``.  This can cause unexpected
and unwanted line breaks.

My personal preference is the use of 'git send-email'. I've also found
mutt to be compliant with the guidelines laid out in the reference
doc.
Hope this helps.

[1] 
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/plain/Documentation/process/email-clients.rst?h=v4.17.8

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


Re: Linux kernel mailing list filtering issues

2018-07-19 Thread Alexander Kapshuk
On Thu, Jul 19, 2018 at 10:25 PM  wrote:
>
> Hi all, I've been trying to post a bug report to the linux-usb mailing
> list but keep getting trapped in the filters despite ensuring I'm using
> plaintext.
> Heres what I get in the bounce back:
>
> The mail system
>
> : host vger.kernel.org[209.132.180.67] said:
> 550
>  5.7.1 Content-Policy accept-into-freezer-1 msg: Bayes Statistical
>  Bogofilter considers this message SPAM.  BF:  In case you
> disagree,
>  send the ENTIRE message plus this error message to
>  ;
>
> I've sent the message to the postmaster but haven't heard anything. My
> message got through to the maintainer, who has requested I fix my
> message and get it on the mailing list proper but nothing I've tried is
> working.
>
> Heres part of the header from the source of my most recent message:
>
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8;
>   format=flowed
> Content-Transfer-Encoding: 8bit
>
> Any suggestions? Thanks
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

What email client did you use to send in your patch?

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


Re: Linux kernel Books

2018-03-24 Thread Augusto Mecking Caringi
On Fri, Mar 23, 2018 at 10:00 AM, Milad Kahsari  wrote:
> This book illustrates virtual memory space in a reasonably clear way, easy
> to follow with lots of diagrams, which I did not find in other books.
> Although it states IA-64, the concept is pretty much the same if you are
> looking for IA-32, excellent book, definitely recommend it! :)

It's worth to note that IA-64 [1] is not x86-64 [2].

IA-64 is the Itanium ISA. Is there still anyone using this? :)

Best regards,

[1] https://en.wikipedia.org/wiki/IA-64
[2] https://en.wikipedia.org/wiki/X86-64

-- 
Augusto Mecking Caringi

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


Re: Linux kernel Books

2018-03-23 Thread Milad Kahsari
This book illustrates virtual memory space in a reasonably clear way, easy
to follow with lots of diagrams, which I did not find in other books.
Although it states IA-64, the concept is pretty much the same if you are
looking for IA-32, excellent book, definitely recommend it! :)

On Fri, Mar 23, 2018 at 5:11 PM, vish chopra  wrote:

> Hi,
>
>
> IA-64 Linux Kernel: Design and Implementation (Hewlett-Packard
> Professional Books)is a good book to learn linux internal or not?
>
> Regards,
> Vishal Chopra
>
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Linux Kernel contains only C code?

2018-02-02 Thread Daniel.
Oh, thank you so much!

I see dtc, the device tree compiler I guess. Parsing is a cool programming
subject but I didn't expect to see parsers in the kernel level, cool, cool!

Regards,

2018-02-02 8:27 GMT-02:00 Augusto Mecking Caringi 
:

> On Fri, Feb 2, 2018 at 11:11 AM, Daniel.  wrote:
> > I'm just curious. What problems in kernel involves parsing?
>
> $ find -name *.[yl]
> ./drivers/scsi/aic7xxx/aicasm/aicasm_scan.l
> ./drivers/scsi/aic7xxx/aicasm/aicasm_gram.y
> ./drivers/scsi/aic7xxx/aicasm/aicasm_macro_scan.l
> ./drivers/scsi/aic7xxx/aicasm/aicasm_macro_gram.y
> ./tools/perf/util/pmu.l
> ./tools/perf/util/expr.y
> ./tools/perf/util/parse-events.y
> ./tools/perf/util/parse-events.l
> ./tools/perf/util/pmu.y
> ./tools/bpf/bpf_exp.y
> ./tools/bpf/bpf_exp.l
> ./scripts/genksyms/parse.y
> ./scripts/genksyms/lex.l
> ./scripts/dtc/dtc-lexer.l
> ./scripts/dtc/dtc-parser.y
> ./scripts/kconfig/zconf.l
> ./scripts/kconfig/zconf.y
>
> So, really in the kernel just a SCSI driver that needs to parse a
> "Host adapter sequencer assembler"...
>
> The others *[yl] files are in tools or scripts directories (userspace
> tools like perf or build support scripts).
>
> --
> Augusto Mecking Caringi
>



-- 
“If you're going to try, go all the way. Otherwise, don't even start. ..."
  Charles Bukowski
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Linux Kernel contains only C code?

2018-02-02 Thread Augusto Mecking Caringi
On Fri, Feb 2, 2018 at 11:11 AM, Daniel.  wrote:
> I'm just curious. What problems in kernel involves parsing?

$ find -name *.[yl]
./drivers/scsi/aic7xxx/aicasm/aicasm_scan.l
./drivers/scsi/aic7xxx/aicasm/aicasm_gram.y
./drivers/scsi/aic7xxx/aicasm/aicasm_macro_scan.l
./drivers/scsi/aic7xxx/aicasm/aicasm_macro_gram.y
./tools/perf/util/pmu.l
./tools/perf/util/expr.y
./tools/perf/util/parse-events.y
./tools/perf/util/parse-events.l
./tools/perf/util/pmu.y
./tools/bpf/bpf_exp.y
./tools/bpf/bpf_exp.l
./scripts/genksyms/parse.y
./scripts/genksyms/lex.l
./scripts/dtc/dtc-lexer.l
./scripts/dtc/dtc-parser.y
./scripts/kconfig/zconf.l
./scripts/kconfig/zconf.y

So, really in the kernel just a SCSI driver that needs to parse a
"Host adapter sequencer assembler"...

The others *[yl] files are in tools or scripts directories (userspace
tools like perf or build support scripts).

-- 
Augusto Mecking Caringi

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


Re: Linux Kernel contains only C code?

2018-02-02 Thread Daniel.
I'm just curious. What problems in kernel involves parsing?

On Feb 2, 2018 5:01 AM,  wrote:

> On Thu, 01 Feb 2018 11:37:26 -0500, Aruna Hewapathirane said:
>
> > Somethings are not so obvious like what could possibly be a *.y file or
> > *.tc file ? If you type in find -name "*.y" in my case i see:
> >
> > aruna@debian:~/linux-4.15$ find -name "*.y"
>
> > Now if I pass that to the 'file' command ...
> >
> > aruna@debian:~/linux-4.15$ file `find -name "*.y"` // yes you need those
> > back ticks :)
> >
> > ./drivers/scsi/aic7xxx/aicasm/aicasm_macro_gram.y: C source, ASCII text
>
> > So 'file' tells us these are C program files ? Lets verify ? If you 'cat'
> > any of these files you will see it is actual C code. Why does it have a
> > file extension of .y ?
>
> Actually, if you look more closely at it, it's *not* actually C code.  The
> 'file'
> command makes its best guess, triggered off things like '#include', etc.
>
> The 'tl;dr' answer is "The *.y are input files for bison, and the *.l are
> input files for flex".
>
> The more detailed explanation, with 50 years of computer history
>
> [/usr/src/linux-next] head -20 tools/perf/util/expr.y
> /* Simple expression parser */
> %{
> #include "util.h"
> #include "util/debug.h"
> #define IN_EXPR_Y 1
> #include "expr.h"
> #include "smt.h"
> #include 
>
> #define MAXIDLEN 256
> %}
>
> %pure-parser
> %parse-param { double *final_val }
> %parse-param { struct parse_ctx *ctx }
> %parse-param { const char **pp }
> %lex-param { const char **pp }
>
> %union {
> double num;
>
> That's got a bunch of % in unusual places for C, doesn't it? :)
>
> Let's hit the rewind button back 5 decades or so, when tools for building
> programs were just becoming created.  And everybody who wanted to write a
> compiler for a language, or parsing data that wasn't strict 'ID is in
> columns
> 5-12' formatting, or a whole bunch of other stuff, had to write a parser
> to do
> the parsing.
>
> For those who have never done it, writing lexical scanners and parsers by
> hand
> is a thankless job. I know from experience that the parse table for an LALR
> parser for Pascal ends up being essentially a spreadsheet with some 300
> rows
> and 400 columns that you get to fill in by hand one at a time - and
> getting one
> entry wrong means you have a buggy compiler (I took Compiler Design in
> college
> the last year we had to do it by hand)
>
> The first few compiled languages (COBOL, FORTRAN, and a few others) also
> had to
> make do with hand-coded parsers.  And then in 1958, Algol happened, and it
> spawned all sorts of languages - everything from C to PL/I to Pascal and
> probably 200+ others (pretty much every language that allows nested
> declarations and has begin/end tokens of some sort owes it to Algol).  And
> the
> other thing about Algol was that it was a much "bigger" language than
> previous
> ones, so John Backus invented a meta-language called BNF to provide a
> formal
> specification of the syntax.
>
> (For those who are curious, a EBNF specification for Pascal syntax is here:
> http://www.fit.vutbr.cz/study/courses/APR/public/ebnf.html
>
> The interesting thing about BNF is that it has these things called
> "production
> rules" which define what legal programs look like - and the test for
> "legal"
> can be done with a parser using a software/mathematical construct called a
> "finite state machine" (and the 3 of you who understand the difference
> between
> a context-sensitive grammar and a context-free grammar can stop giggling
> right
> now.. ;)
>
> So somebody had the bright idea that if you had a formal BNF
> specification, you
> could write a program that would read the BNF, and spit out the C source
> for a
> parser skeleton based on a finite state machine.  And thus were born two
> programs called 'lex' (a lexical scanner - something that reads the
> source, and
> outputs code that says "Hey, that's the word 'struct'" or "we just saw a
> 'for"). and another called 'yacc' (Yet Another Compiler Compiler) which
> did the
> higher level "this is a legal function, but *that* right there is a
> messed-up
> 'if' statement that has a syntax error" stuff.  Oh, and generate output
> code, too.
>
> Of course, that was decades ago, and eventually somebody wrote a faster
> 'lex' -
> and thus was born /usr/bin/flex.  And yacc needed work, so the improved
> version
> was, of course, called bison (think about it for a bit..)
>
>
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Linux Kernel contains only C code?

2018-02-01 Thread valdis . kletnieks
On Thu, 01 Feb 2018 11:37:26 -0500, Aruna Hewapathirane said:

> Somethings are not so obvious like what could possibly be a *.y file or
> *.tc file ? If you type in find -name "*.y" in my case i see:
>
> aruna@debian:~/linux-4.15$ find -name "*.y"

> Now if I pass that to the 'file' command ...
>
> aruna@debian:~/linux-4.15$ file `find -name "*.y"` // yes you need those
> back ticks :)
>
> ./drivers/scsi/aic7xxx/aicasm/aicasm_macro_gram.y: C source, ASCII text

> So 'file' tells us these are C program files ? Lets verify ? If you 'cat'
> any of these files you will see it is actual C code. Why does it have a
> file extension of .y ?

Actually, if you look more closely at it, it's *not* actually C code.  The 
'file'
command makes its best guess, triggered off things like '#include', etc.

The 'tl;dr' answer is "The *.y are input files for bison, and the *.l are
input files for flex".

The more detailed explanation, with 50 years of computer history

[/usr/src/linux-next] head -20 tools/perf/util/expr.y
/* Simple expression parser */
%{
#include "util.h"
#include "util/debug.h"
#define IN_EXPR_Y 1
#include "expr.h"
#include "smt.h"
#include 

#define MAXIDLEN 256
%}

%pure-parser
%parse-param { double *final_val }
%parse-param { struct parse_ctx *ctx }
%parse-param { const char **pp }
%lex-param { const char **pp }

%union {
double num;

That's got a bunch of % in unusual places for C, doesn't it? :)

Let's hit the rewind button back 5 decades or so, when tools for building
programs were just becoming created.  And everybody who wanted to write a
compiler for a language, or parsing data that wasn't strict 'ID is in columns
5-12' formatting, or a whole bunch of other stuff, had to write a parser to do
the parsing.

For those who have never done it, writing lexical scanners and parsers by hand
is a thankless job. I know from experience that the parse table for an LALR
parser for Pascal ends up being essentially a spreadsheet with some 300 rows
and 400 columns that you get to fill in by hand one at a time - and getting one
entry wrong means you have a buggy compiler (I took Compiler Design in college
the last year we had to do it by hand)

The first few compiled languages (COBOL, FORTRAN, and a few others) also had to
make do with hand-coded parsers.  And then in 1958, Algol happened, and it
spawned all sorts of languages - everything from C to PL/I to Pascal and
probably 200+ others (pretty much every language that allows nested
declarations and has begin/end tokens of some sort owes it to Algol).  And the
other thing about Algol was that it was a much "bigger" language than previous
ones, so John Backus invented a meta-language called BNF to provide a formal
specification of the syntax.

(For those who are curious, a EBNF specification for Pascal syntax is here:
http://www.fit.vutbr.cz/study/courses/APR/public/ebnf.html

The interesting thing about BNF is that it has these things called "production
rules" which define what legal programs look like - and the test for "legal"
can be done with a parser using a software/mathematical construct called a
"finite state machine" (and the 3 of you who understand the difference between
a context-sensitive grammar and a context-free grammar can stop giggling right
now.. ;)

So somebody had the bright idea that if you had a formal BNF specification, you
could write a program that would read the BNF, and spit out the C source for a
parser skeleton based on a finite state machine.  And thus were born two
programs called 'lex' (a lexical scanner - something that reads the source, and
outputs code that says "Hey, that's the word 'struct'" or "we just saw a
'for"). and another called 'yacc' (Yet Another Compiler Compiler) which did the
higher level "this is a legal function, but *that* right there is a messed-up
'if' statement that has a syntax error" stuff.  Oh, and generate output code, 
too.

Of course, that was decades ago, and eventually somebody wrote a faster 'lex' -
and thus was born /usr/bin/flex.  And yacc needed work, so the improved version
was, of course, called bison (think about it for a bit..)




pgp3i0Q9XGBon.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Linux Kernel contains only C code?

2018-02-01 Thread Greg KH
On Thu, Feb 01, 2018 at 05:49:13PM +0100, Augusto Mecking Caringi wrote:
> On Thu, Feb 1, 2018 at 5:37 PM, Aruna Hewapathirane
>  wrote:
> >> On Fri, Jan 26, 2018 at 1:58 AM, inventsekar 
> >> wrote:
> >> Hi all, ...
> >
> >> 1. May i know, other than C language, is there any other programming
> >> language is/are used inside Linux Kernel?!?!
> >> is there any c++, Perl, python programs are used for peculiar tasks inside
> >> Linux Kernel?!?!
> >
> > Well, let's find out ? If you open up a shell/terminal and change into the
> > top level directory of your Linux kernel source and run the command below:
> >
> > find . -type f -and -printf "%f\n" | grep -io '\.[^.]*$' | sort | uniq -c |
> > sort -rn ( Breaking this down, find all files+get the filename+pull out the
> > file extension+sort+only keep unique ext+sort with a stats count)
> 
> For that I recommend a tool called sloccount [1]...
> 
> BTW, running it now against Linux Kernel source I got:
> 
> Totals grouped by language (dominant language first):
> ansic: 16675070 (97.83%)
> asm: 294179 (1.73%)
> perl: 26346 (0.15%)
> sh:   18781 (0.11%)
> python:   15642 (0.09%)
> cpp:   6512 (0.04%)
> yacc:  4586 (0.03%)
> lex:   2479 (0.01%)
> awk:   1387 (0.01%)
> pascal: 231 (0.00%)
> sed:  5 (0.00%)
> Total Physical Source Lines of Code (SLOC)= 17,045,218
> 
> 
> [1] https://www.dwheeler.com/sloccount/

'tokei' is _much_ faster when dealing with large code bases than
sloccount.  And gives a bit different view of the tree as well, I'd
recommend it over sloccount these days.

thanks,

greg k-h

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


Re: Linux Kernel contains only C code?

2018-02-01 Thread Augusto Mecking Caringi
On Thu, Feb 1, 2018 at 5:37 PM, Aruna Hewapathirane
 wrote:
>> On Fri, Jan 26, 2018 at 1:58 AM, inventsekar 
>> wrote:
>> Hi all, ...
>
>> 1. May i know, other than C language, is there any other programming
>> language is/are used inside Linux Kernel?!?!
>> is there any c++, Perl, python programs are used for peculiar tasks inside
>> Linux Kernel?!?!
>
> Well, let's find out ? If you open up a shell/terminal and change into the
> top level directory of your Linux kernel source and run the command below:
>
> find . -type f -and -printf "%f\n" | grep -io '\.[^.]*$' | sort | uniq -c |
> sort -rn ( Breaking this down, find all files+get the filename+pull out the
> file extension+sort+only keep unique ext+sort with a stats count)

For that I recommend a tool called sloccount [1]...

BTW, running it now against Linux Kernel source I got:

Totals grouped by language (dominant language first):
ansic: 16675070 (97.83%)
asm: 294179 (1.73%)
perl: 26346 (0.15%)
sh:   18781 (0.11%)
python:   15642 (0.09%)
cpp:   6512 (0.04%)
yacc:  4586 (0.03%)
lex:   2479 (0.01%)
awk:   1387 (0.01%)
pascal: 231 (0.00%)
sed:  5 (0.00%)
Total Physical Source Lines of Code (SLOC)= 17,045,218


[1] https://www.dwheeler.com/sloccount/

-- 
Augusto Mecking Caringi

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


Re: Linux Kernel contains only C code?

2018-02-01 Thread Aruna Hewapathirane
> On Fri, Jan 26, 2018 at 1:58 AM, inventsekar 
wrote:
> Hi all, ...

> 1. May i know, other than C language, is there any other programming
language is/are used inside Linux Kernel?!?!
> is there any c++, Perl, python programs are used for peculiar tasks
inside Linux Kernel?!?!

Well, let's find out ? If you open up a shell/terminal and change into the
top level directory of your Linux kernel source and run the command below:

find . -type f -and -printf "%f\n" | grep -io '\.[^.]*$' | sort | uniq -c |
sort -rn ( Breaking this down, find all files+get the filename+pull out the
file extension+sort+only keep unique ext+sort with a stats count)

On my system with the kernel source for Linux-4.15 it shows me what's
below... keep in mind this is the number of 'unique' file extension types
in the kernel source tree. It's long but please keep scrolling all the way
there is useful stuff at the bottom.
25965 .c
 20363 .h
   4074 .txt
   1470 .S
   1437 .dts
   1098 .dtsi
827 .rst
211 .gitignore
207 .json
200 .sh
 75 .py
 59 .cocci
 57 .svg
 49 .boot
 42 .tc
 39 .pl
 36 .config
 31 .debug
 19 .lds
 15 .conf
 14 .ppm
 14 .fuc
 12 .fuc3
 10 .exceptions
  9 .y
  9 .h_shipped
  9 .c_shipped
  9 .awk
  8 .scr
  8 .l
  8 .html
  8 .dot
  8 .8
  8 .1
  7 .sa
  7 .in
  6 .cpp
  6 .asn1
  5 .xsl
  5 .uc
  5 .po
  5 .inc
  5 .fuc5
  5 .cpu
  4 .tbl
  4 .S_shipped
  4 .map
  4 .ld
  4 .include
  4 .fail
  4 .doc
  3 .smp_defconfig
  3 .pm
  3 .mk
  3 .gdbinit
  3 .csv
  3 .am
  2 .up_defconfig
  2 .um
  2 .ubsan
  2 .seq
  2 .rules
  2 .reg
  2 .powerpc
  2 .postlink
  2 .platforms
  2 .platform
  2 .pbm
  2 .nommu
  2 .megaraid
  2 .kasan
  2 .inl
  2 .inf
  2 .ids
  2 .fax
  2 .FAQ
  2 .build
  2 .arm
  1 .xs
  1 .x86
  1 .x25
  1 .wimax
  1 .WARNING
  1 .vringh
  1 .vim
  1 .vdec2_defconfig
  1 .vdec2
  1 .uni
  1 .txtd
  1 .tex
  1 .syncppp
  1 .sym53c8xx_2
  1 .sym53c8xx
  1 .SRC
  1 .soc
  1 .smp
  1 .select-break
  1 .sed
  1 .script
  1 .sb1000
  1 .rest
  1 .recursion-issue-02
  1 .recursion-issue-01
  1 .readme
  1 .README
  1 .qlge
  1 .qlcnic
  1 .qla4xxx
  1 .qla3xxx
  1 .qla2xxx
  1 .preempt
  1 .PL
  1 .perf
  1 .pass
  1 .ore
  1 .opsp_defconfig
  1 .normal
  1 .nommu_defconfig
  1 .netlink
  1 .net
  1 .ncr53c8xx
  1 .modsign
  1 .modpost
  1 .modinst
  1 .modes
  1 .modbuiltin
  1 .mm
  1 .mISDN
  1 .mips
  1 .megaraid_sas
  1 .md
  1 .mak
  1 .mailmap
  1 .machine
  1 .lpfc
  1 .loopback
  1 .locks
  1 .Locking
  1 .libfdt
  1 .lib
  1 .LIB
  1 .kgdb
  1 .kcov
  1 .ipw2200
  1 .ipw2100
  1 .ips
  1 .iosched
  1 .inc_shipped
  1 .ignore
  1 .i2400m
  1 .hz
  1 .hysdn
  1 .hp300
  1 .host
  1 .HiSax
  1 .hfc-pci
  1 .hex
  1 .headersinst
  1 .glade
  1 .gitattributes
  1 .gigaset
  1 .gif
  1 .generic
  1 .gdbinit_400MHz_32MB
  1 .gdbinit_300MHz_32MB
  1 .gdbinit_200MHz_16MB
  1 .gcc-plugins
  1 .gate
  1 .fuc4
  1 .fuc0s
  1 .freezer
  1 .FPE
  1 .FlashPoint
  1 .feature
  1 .extrawarn
  1 .example
  1 .dtc
  1 .dtbinst
  1 .DOC
  1 .diversion
  1 .dino
  1 .devices
  1 .default
  1 .def
  1 .DAC960
  1 .cycladesZ
  1 .css
  1 .cputype
  1 .copyright
  1 .concap
  1 .common
  1 .cocciconfig
  1 .clean
  1 .checkpatch
  1 .char
  1 .ChangeLog
  1 .cfg
  1 .cert
  1 .cc
  1 .CAPI
  1 .cache
  1 .bus
  1 .buddha
  1 .binfmt
  1 .bc
  1 .avmb1
  1 .audio
  1 .asm-generic
  1 .asm
  1 .arcmsr
  1 .arch
  1 .aic7xxx
  1 .aic79xx
  1 .agh
  1 .ac
  1 .1996-2002
  1 .1995-2002
  1 .1994-2004
  1 .1992-1997
  1 .

Somethings are obvious like we have :

25965 .c files
20363 .h files
4074 .txt files and
1470 .S files.

Somethings are not so obvious like what could possibly be a *.y file or
*.tc file ? If you type in find -name "*.y" in my case i see:

aruna@debian:~/linux-4.15$ find -name "*.y"
./drivers/scsi/aic7xxx/aicasm/aicasm_macro_gram.y
./drivers/scsi/aic7xxx/aicasm/aicasm_gram.y
./tools/perf/util/expr.y
./tools/perf/util/pmu.y
./tools/perf/util/parse-events.y
./tools/bpf/bpf_exp.y
./scripts/dtc/dtc-parser.y
./scripts/genksyms/parse.y
./scripts/kconfig/zconf.y

Now if I pass that to the 'file' command ...

aruna@debian:~/linux-4.15$ file `find -name 

Re: Linux Kernel contains only C code?

2018-01-29 Thread Greg KH
On Mon, Jan 29, 2018 at 01:00:10PM -0500, Jeffrey Walton wrote:
> On Mon, Jan 29, 2018 at 12:33 PM, Greg KH  wrote:
> > On Mon, Jan 29, 2018 at 12:16:19PM -0500, Jeffrey Walton wrote:
> >> ...
> >> It would be nice if they moved away from UB and implementation defined
> >> behvior, but sometimes the political problems are heavier than the
> >> technical solutions.
> >
> > What do you mean by this?  What "UB" does the kernel rely on that
> > prevents compilers from properly building it?  We do have some pretty
> > strict requirements in the kernel for a compiler, but anything "odd" is
> > usually just a bug and we are always willing to take patches to fix
> > them.
> 
> https://groups.google.com/forum/#!topic/linux.kernel/-VzG6FWZiy8 and
> https://www.spinics.net/lists/linux-crypto/msg19466.html .
> 
> I found the first one from 2013 amusing:
> 
>   JW >> According to Section 5.8, "Shift Operators" of
>   JW >> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2798.pdf:
>   JW >>  "The operands shall be of integral or enumeration type ...
>   CL > The kernel doesn't try to be fully standard conformant.
> 
> The second one from 2016 was disappointing. It suggested a standards
> compliant rotate that was constant time for the linux-crypto folks.
> That was rejected by some:
> 
>   PA >> So you are actually saying outright that we should sacrifice *actual*
>   PA >> portability in favor of *theoretical* portability?  What kind of
>   PA >> twilight zone did we just step into?!

Well, let's not get into the crazy crypto code in the kernel, it's not a
good example of much these days :)

> Its kind of like I said... the political problems are harder than the
> technical solutions.

Those should now all be gone, thanks to some persistent developers.
clang builds the kernel just fine as I mentioned, and if you look close,
people are working to get something other than 'ld' to link it as well
:)

thanks,

greg k-h

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


Re: Linux Kernel contains only C code?

2018-01-29 Thread Jeffrey Walton
On Mon, Jan 29, 2018 at 12:33 PM, Greg KH  wrote:
> On Mon, Jan 29, 2018 at 12:16:19PM -0500, Jeffrey Walton wrote:
>> ...
>> It would be nice if they moved away from UB and implementation defined
>> behvior, but sometimes the political problems are heavier than the
>> technical solutions.
>
> What do you mean by this?  What "UB" does the kernel rely on that
> prevents compilers from properly building it?  We do have some pretty
> strict requirements in the kernel for a compiler, but anything "odd" is
> usually just a bug and we are always willing to take patches to fix
> them.

https://groups.google.com/forum/#!topic/linux.kernel/-VzG6FWZiy8 and
https://www.spinics.net/lists/linux-crypto/msg19466.html .

I found the first one from 2013 amusing:

  JW >> According to Section 5.8, "Shift Operators" of
  JW >> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2798.pdf:
  JW >>  "The operands shall be of integral or enumeration type ...
  CL > The kernel doesn't try to be fully standard conformant.

The second one from 2016 was disappointing. It suggested a standards
compliant rotate that was constant time for the linux-crypto folks.
That was rejected by some:

  PA >> So you are actually saying outright that we should sacrifice *actual*
  PA >> portability in favor of *theoretical* portability?  What kind of
  PA >> twilight zone did we just step into?!

Its kind of like I said... the political problems are harder than the
technical solutions.

Jeff

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


Re: Linux Kernel contains only C code?

2018-01-29 Thread Greg KH
On Mon, Jan 29, 2018 at 12:16:19PM -0500, Jeffrey Walton wrote:
> On Mon, Jan 29, 2018 at 10:41 AM, Augusto Mecking Caringi
>  wrote:
> > On Fri, Jan 26, 2018 at 2:12 PM,   wrote:
> >> On Fri, 26 Jan 2018 05:53:20 -0500, Ruben Safir said:
> >>> Its not even really C, at least not as a normal application developer
> >>> thinks of it.  This is systems programming with a lot of kernel specific
> >>> libraries.
> >>
> >> It's C.  The fact that things like stdio aren't available inside the kernel
> >> doesn't mean it's not C.
> >
> > I would say that is C with GNU extensions [1]... Not plain/pure (ANSI/ISO) 
> > C.
> >
> > That's why it's not so easy to build the Linux Kernel with any other C 
> > compiler.
> >
> > There is a ongoing effort to build it with Clang [2].
> >
> > I'm not sure how is the current status regarding the Intel C Compiler.
> 
> Yeah, the kernel has too much undefined behavior and implementation
> defined behavior to build with other compilers at the moment.

What other compilers do you suggest we use?

Clang works great with the kernel, a few million phones are shipping
with kernels built with it.  icc has worked with the kernel for over a
decade now, for anyone still stuck using that beast.

What else is there?

> It would be nice if they moved away from UB and implementation defined
> behvior, but sometimes the political problems are heavier than the
> technical solutions.

What do you mean by this?  What "UB" does the kernel rely on that
prevents compilers from properly building it?  We do have some pretty
strict requirements in the kernel for a compiler, but anything "odd" is
usually just a bug and we are always willing to take patches to fix
them.

thanks,

greg k-h

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


Re: Linux Kernel contains only C code?

2018-01-29 Thread Jeffrey Walton
On Mon, Jan 29, 2018 at 10:41 AM, Augusto Mecking Caringi
 wrote:
> On Fri, Jan 26, 2018 at 2:12 PM,   wrote:
>> On Fri, 26 Jan 2018 05:53:20 -0500, Ruben Safir said:
>>> Its not even really C, at least not as a normal application developer
>>> thinks of it.  This is systems programming with a lot of kernel specific
>>> libraries.
>>
>> It's C.  The fact that things like stdio aren't available inside the kernel
>> doesn't mean it's not C.
>
> I would say that is C with GNU extensions [1]... Not plain/pure (ANSI/ISO) C.
>
> That's why it's not so easy to build the Linux Kernel with any other C 
> compiler.
>
> There is a ongoing effort to build it with Clang [2].
>
> I'm not sure how is the current status regarding the Intel C Compiler.

Yeah, the kernel has too much undefined behavior and implementation
defined behavior to build with other compilers at the moment.

It would be nice if they moved away from UB and implementation defined
behvior, but sometimes the political problems are heavier than the
technical solutions.

Jeff

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


Re: Linux Kernel contains only C code?

2018-01-29 Thread Augusto Mecking Caringi
On Fri, Jan 26, 2018 at 2:12 PM,   wrote:
> On Fri, 26 Jan 2018 05:53:20 -0500, Ruben Safir said:
>> Its not even really C, at least not as a normal application developer
>> thinks of it.  This is systems programming with a lot of kernel specific
>> libraries.
>
> It's C.  The fact that things like stdio aren't available inside the kernel
> doesn't mean it's not C.

I would say that is C with GNU extensions [1]... Not plain/pure (ANSI/ISO) C.

That's why it's not so easy to build the Linux Kernel with any other C compiler.

There is a ongoing effort to build it with Clang [2].

I'm not sure how is the current status regarding the Intel C Compiler.

> (I've worked on large userspace code bases where you could go for several
> hundred thousand lines without seeing anything from /usr/include, and nobody
> would argue that code wasn't C.)

Best regards,

[1] https://www.ibm.com/developerworks/linux/library/l-gcc-hacks/
[2] https://lwn.net/Articles/734071/

-- 
Augusto Mecking Caringi

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


Re: Linux Kernel contains only C code?

2018-01-26 Thread valdis . kletnieks
On Fri, 26 Jan 2018 05:53:20 -0500, Ruben Safir said:
> On 01/26/2018 02:20 AM, Larry Chen wrote:
> > I have never seen c++, perl or python code in kernel source tree.
> > Imagine that, if kernel relies on perl, python or other 3rd-party code,
> > will it cause nested or mutual dependency issues? 3rd-party code bugs
> > may also cause problems that make the kernel unstable.
>
>
> Its not even really C, at least not as a normal application developer
> thinks of it.  This is systems programming with a lot of kernel specific
> libraries.

It's C.  The fact that things like stdio aren't available inside the kernel
doesn't mean it's not C.

(I've worked on large userspace code bases where you could go for several
hundred thousand lines without seeing anything from /usr/include, and nobody
would argue that code wasn't C.)



pgpddSNclCp0H.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Linux Kernel contains only C code?

2018-01-26 Thread Ruben Safir
On 01/26/2018 02:20 AM, Larry Chen wrote:
> I have never seen c++, perl or python code in kernel source tree.
> Imagine that, if kernel relies on perl, python or other 3rd-party code,
> will it cause nested or mutual dependency issues? 3rd-party code bugs
> may also cause problems that make the kernel unstable.


Its not even really C, at least not as a normal application developer
thinks of it.  This is systems programming with a lot of kernel specific
libraries.

-- 
So many immigrant groups have swept through our town
that Brooklyn, like Atlantis, reaches mythological
proportions in the mind of the world - RI Safir 1998
http://www.mrbrklyn.com

DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002
http://www.nylxs.com - Leadership Development in Free Software
http://www2.mrbrklyn.com/resources - Unpublished Archive
http://www.coinhangout.com - coins!
http://www.brooklyn-living.com

Being so tracked is for FARM ANIMALS and and extermination camps,
but incompatible with living as a free human being. -RI Safir 2013

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


Re: Linux Kernel contains only C code?

2018-01-25 Thread Larry Chen

Hi Sekar,

Hi all, ...
1. May i know, other than C language, is there any other programming 
language is/are used inside Linux Kernel?!?!
is there any c++, Perl, python programs are used for peculiar tasks 
inside Linux Kernel?!?!


I have never seen c++, perl or python code in kernel source tree.
Imagine that, if kernel relies on perl, python or other 3rd-party code,
will it cause nested or mutual dependency issues? 3rd-party code bugs
may also cause problems that make the kernel unstable.

2. I believe some assembly language and shell scripting also used.. 
how can I check them? Can you point me which part of the source code 
contains the assembly and shell scripting




Sorry, I do not know what do you mean by "check them".
Assembly code are mostly put within the arch directory. They are used to 
interact

with your various arch CPUs.
In addition to arch directory, there are also some embedded assembly 
code that

could be found in C source code.
Shell scripts are always within tools and script directory.

By the way pure assembly codes files ends with ".S" extension, and shell 
scriptes with ".sh" extension.

You could find them by
find ${kernel_source_dir} -name "*.S"
and
find ${kernel_source_dir} -name "*.sh"

Regards
Larry

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


Re: Linux Kernel contains only C code?

2018-01-25 Thread Alice Ferrazzi
Hello Sekar,

On Fri, Jan 26, 2018 at 3:58 PM, inventsekar  wrote:
> Hi all, ...
>
> 1. May i know, other than C language, is there any other programming
> language is/are used inside Linux Kernel?!?!
> is there any c++, Perl, python programs are used for peculiar tasks inside
> Linux Kernel?!?!
>

Yes, there are some scripts made in Perl, Python and other languages.
Most of them are under tools/ or scripts/ or documentation/

> 2. I believe some assembly language and shell scripting also used.. how can
> I check them? Can you point me which part of the source code contains the
> assembly and shell scripting

https://github.com/torvalds/linux/search?l=assembly
https://github.com/torvalds/linux/search?l=Shell

I think you can see in the left down menu bar also other languages.
Still, some language doesn't come out, but you can change assembly with Perl.
You can also just find the file extensions with the find command or
using git ls-files.

find . -type f -name "*.pl"
find . -type f -name "*.py"

or

git ls-files "*.pl"
git ls-files "*.py"

thanks,
Alice


-- 
Thanks,
Alice Ferrazzi

Gentoo Kernel Project Leader
Gentoo Foundation Board Member
Mail: Alice Ferrazzi 
PGP: 2E4E 0856 461C 0585 1336 F496 5621 A6B2 8638 781A

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


Re: Linux Kernel contains only C code?

2018-01-25 Thread valdis . kletnieks
On Fri, 26 Jan 2018 12:28:38 +0530, inventsekar said:

> 1. May i know, other than C language, is there any other programming
> language is/are used inside Linux Kernel?!?!
> is there any c++, Perl, python programs are used for peculiar tasks inside
> Linux Kernel?!?!

Some of the userspace utilities are written in other languages, but the kernel
itself is written in C and assembler.

> 2. I believe some assembly language and shell scripting also used.. how can
> I check them? Can you point me which part of the source code contains the
> assembly and shell scripting

C files have an extension .c, with possible short pieces of inline assembler
with the gcc extension asm().  There's also C include files, which have names
that end in .h

Assembler files have an extension .s

There's some shell scripting used for utilities and as part of the build
process. In general, looking at the first few lines of code will tell you what
language a file is, if the name doesn't end in .c or .s.



pgpcO1PC35GPl.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Linux Kernel Based Research Projects

2016-10-04 Thread Daniel Baluta
On Tue, Oct 4, 2016 at 4:08 AM, Robert P. J. Day  wrote:
> On Sun, 2 Oct 2016, Daniel Baluta wrote:
>
>> On Sun, Oct 2, 2016 at 2:54 PM, Shyam Saini  wrote:
>> > Hi everyone,
>> >
>> > I'm final year computer science undergraduate student. I want to do my
>> > major project based on linux kernel.
>> >
>> > Would you please suggest me some areas in the kernel which have some
>> > projects. To be more specific, I want know on going research areas in
>> > kernel. Or some ideas which are not yet implemented.
>>
>> Would you be interested in taking a look at lguest? [1]
>>
>> I will be having a presentation about lguest and how one learn
>> linux kernel internals by studying lguest code
>> this week at LinuxCon Europe [2]
>>
>> Porting it on x86_64 or any other architecture will be a very cool project
>> but I warn you it won't be trivial :).
>>
>> thanks,
>> Daniel.
>>
>> [1] http://lguest.ozlabs.org/
>> [2] http://sched.co/7o92
>
>   Reference [1] claims, "Those crazy guys at Red Hat have an
> experimental port of lguest to x86-64: you can grab their git tree."
> so why do you say porting to x86_64 wouldn't be trivial?

First of all because the linux kernel changed a lot since then.
Second, because I think their code wasn't upstream ready.

Daniel.

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


Re: Linux Kernel Based Research Projects

2016-10-03 Thread Robert P. J. Day
On Sun, 2 Oct 2016, Daniel Baluta wrote:

> On Sun, Oct 2, 2016 at 2:54 PM, Shyam Saini  wrote:
> > Hi everyone,
> >
> > I'm final year computer science undergraduate student. I want to do my
> > major project based on linux kernel.
> >
> > Would you please suggest me some areas in the kernel which have some
> > projects. To be more specific, I want know on going research areas in
> > kernel. Or some ideas which are not yet implemented.
>
> Would you be interested in taking a look at lguest? [1]
>
> I will be having a presentation about lguest and how one learn
> linux kernel internals by studying lguest code
> this week at LinuxCon Europe [2]
>
> Porting it on x86_64 or any other architecture will be a very cool project
> but I warn you it won't be trivial :).
>
> thanks,
> Daniel.
>
> [1] http://lguest.ozlabs.org/
> [2] http://sched.co/7o92

  Reference [1] claims, "Those crazy guys at Red Hat have an
experimental port of lguest to x86-64: you can grab their git tree."
so why do you say porting to x86_64 wouldn't be trivial?

rday

-- 


Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca

Twitter:   http://twitter.com/rpjday
LinkedIn:   http://ca.linkedin.com/in/rpjday



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


Re: Linux Kernel Based Research Projects

2016-10-03 Thread shyam
I agree and accept that it won't be trivial task and I'm  ready for that.

Even if it has only 1% chance for its successful completion, I'ld go for it.
The reason it's making me interested is the kind of learning I'm going to get 
in the whole process. 

I'ld be needing your support.


Thanks,
shyam



On 3 October 2016 10:50:22 PM IST, Daniel Baluta  
wrote:
>On Mon, Oct 3, 2016 at 12:48 PM, shyam  wrote:
>> Thanks a lot for your reply,
>> I'ld like attend your session but right now I'm in India. So,
>couldn't
>> manage everything so early to attend linuxCon Europe.
>>
>> Apart from this thing,
>> I'ld like to work on lguest to port it on x86_64 architecture.
>> May you please tell me why it is not been ported yet for x86_64
>architecture
>> and can we discuss it further and start work on its porting.
>
>It is not yet ported because lack of time and experience with
>x86_64 arch specifics in my case :).
>
>Also, note that this is not a trivial task :), but I think it
>worths the effort.
>
>See here the discussion with people who worked on
>porting it to x86_64.
>
>https://marc.info/?l=lguest=131810934128197=2
>
>thanks,
>Daniel.

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Linux Kernel Based Research Projects

2016-10-03 Thread Daniel Baluta
On Mon, Oct 3, 2016 at 12:48 PM, shyam  wrote:
> Thanks a lot for your reply,
> I'ld like attend your session but right now I'm in India. So, couldn't
> manage everything so early to attend linuxCon Europe.
>
> Apart from this thing,
> I'ld like to work on lguest to port it on x86_64 architecture.
> May you please tell me why it is not been ported yet for x86_64 architecture
> and can we discuss it further and start work on its porting.

It is not yet ported because lack of time and experience with
x86_64 arch specifics in my case :).

Also, note that this is not a trivial task :), but I think it
worths the effort.

See here the discussion with people who worked on
porting it to x86_64.

https://marc.info/?l=lguest=131810934128197=2

thanks,
Daniel.

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


Re: Linux Kernel Based Research Projects

2016-10-03 Thread shyam
Thanks for your reply
I've done researched on my query after that i posted it here.

Thanks,
shyam

On 2 October 2016 8:25:15 PM IST, "Robert P. J. Day"  
wrote:
>On Sun, 2 Oct 2016, Shyam Saini wrote:
>
>> Hi everyone,
>>
>> I'm final year computer science undergraduate student. I want to do
>> my major project based on linux kernel.
>>
>> Would you please suggest me some areas in the kernel which have some
>> projects. To be more specific, I want know on going research areas
>> in kernel. Or some ideas which are not yet implemented.
>
>  as someone on this list once suggested, saying you want to work on
>the linux kernel and want someone to suggest a subsystem is like
>saying you want to write a book and could someone suggest a topic for
>you to write about.
>
>  if you haven't even progressed to the point where you know what part
>of the kernel interests you, you shouldn't be asking for projects.
>it's not everyone else's responsibility to do your research for you.
>
>rday
>
>-- 
>
>
>Robert P. J. Day Ottawa, Ontario,
>CANADA
>http://crashcourse.ca
>
>Twitter:  
>http://twitter.com/rpjday
>LinkedIn:  
>http://ca.linkedin.com/in/rpjday
>

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Linux Kernel Based Research Projects

2016-10-03 Thread shyam
Thanks a lot for your reply,
I'ld like attend your session but right now I'm in India. So, couldn't manage 
everything so early to attend linuxCon  Europe.

Apart from this thing, 
I'ld like to work on lguest to port it on x86_64 architecture.
May you please tell me why it is not been ported yet for x86_64 architecture 
and can we discuss it further and start  work on its porting.

Thanks,
shyam


On 3 October 2016 1:21:21 AM IST, Daniel Baluta  wrote:
>On Sun, Oct 2, 2016 at 2:54 PM, Shyam Saini 
>wrote:
>> Hi everyone,
>>
>> I'm final year computer science undergraduate student. I want to do
>my
>> major project based on linux kernel.
>>
>> Would you please suggest me some areas in the kernel which have some
>> projects. To be more specific, I want know on going research areas in
>> kernel. Or some ideas which are not yet implemented.
>
>Would you be interested in taking a look at lguest? [1]
>
>I will be having a presentation about lguest and how one learn
>linux kernel internals by studying lguest code
>this week at LinuxCon Europe [2]
>
>Porting it on x86_64 or any other architecture will be a very cool
>project
>but I warn you it won't be trivial :).
>
>thanks,
>Daniel.
>
>[1] http://lguest.ozlabs.org/
>[2] http://sched.co/7o92

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Linux Kernel Based Research Projects

2016-10-02 Thread Daniel Baluta
On Sun, Oct 2, 2016 at 2:54 PM, Shyam Saini  wrote:
> Hi everyone,
>
> I'm final year computer science undergraduate student. I want to do my
> major project based on linux kernel.
>
> Would you please suggest me some areas in the kernel which have some
> projects. To be more specific, I want know on going research areas in
> kernel. Or some ideas which are not yet implemented.

Would you be interested in taking a look at lguest? [1]

I will be having a presentation about lguest and how one learn
linux kernel internals by studying lguest code
this week at LinuxCon Europe [2]

Porting it on x86_64 or any other architecture will be a very cool project
but I warn you it won't be trivial :).

thanks,
Daniel.

[1] http://lguest.ozlabs.org/
[2] http://sched.co/7o92

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


Re: Linux Kernel Based Research Projects

2016-10-02 Thread Robert P. J. Day
On Sun, 2 Oct 2016, Shyam Saini wrote:

> Hi everyone,
>
> I'm final year computer science undergraduate student. I want to do
> my major project based on linux kernel.
>
> Would you please suggest me some areas in the kernel which have some
> projects. To be more specific, I want know on going research areas
> in kernel. Or some ideas which are not yet implemented.

  as someone on this list once suggested, saying you want to work on
the linux kernel and want someone to suggest a subsystem is like
saying you want to write a book and could someone suggest a topic for
you to write about.

  if you haven't even progressed to the point where you know what part
of the kernel interests you, you shouldn't be asking for projects.
it's not everyone else's responsibility to do your research for you.

rday

-- 


Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca

Twitter:   http://twitter.com/rpjday
LinkedIn:   http://ca.linkedin.com/in/rpjday



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


Re: Linux Kernel | Process Open Files

2016-06-23 Thread Pranay Srivastava
On Thu, Jun 23, 2016 at 11:55 AM, Shahab Khalid  wrote:
> Hi all,
>
> I am trying to get process open files of active processes. I am reading
> linux dump. I am able to get actives process. I am trying to reach d_name in
> dentry structure but unfortunately the I am receiving the denrty ZERO (0).
>
> I am reaching the dentry as
>
> task_structure->files_struct->fdtable->file->path->dentry
>
> till struct path I am receiving some address but dentry is zero.

code listing would be more helpful.

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



-- 
---P.K.S

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


Re: Linux Kernel Group Scheduling Feature of CFS

2016-03-21 Thread Ruben Safir
On 03/21/2016 12:42 PM, SUNITA wrote:
> Hello,
> I want to test the properties of CFS scheduler on a beaglebone.
> 

This is extremely documented and a subject of nearly every graduate
school and undergrad OS class and thesis.  I don't think your
understanding how it works and I suggest you research this FIRST and
reviewing the source code PRIOR to coming to the mailing list and
begging for help.

Also, make sure you search usenet archives.

Then if you have a specific question, you can frame a good question.

Good luck

Reuvain Safir



-- 
So many immigrant groups have swept through our town
that Brooklyn, like Atlantis, reaches mythological
proportions in the mind of the world - RI Safir 1998
http://www.mrbrklyn.com

DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002
http://www.nylxs.com - Leadership Development in Free Software
http://www2.mrbrklyn.com/resources - Unpublished Archive
http://www.coinhangout.com - coins!
http://www.brooklyn-living.com

Being so tracked is for FARM ANIMALS and and extermination camps,
but incompatible with living as a free human being. -RI Safir 2013

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


Re: Linux Kernel readlink equivalent

2015-01-30 Thread David Legault
On Thu, Jan 29, 2015 at 2:37 PM, Greg KH g...@kroah.com wrote:

 On Thu, Jan 29, 2015 at 01:11:13PM -0500, David Legault wrote:
  Hello,
 
  I'm working on some linux kernel driver stuff and I have a fake path
 called /
  dev/blah/whatever that points to /dev/block/real_device.

 That's a userspace path, right?  Why would the kernel care about this?

  The issue is that lookup_bdev will fail to follow the symlink so I'd
 like to
  massage the path upfront by getting the real path
 (/dev/block/real_device) so I
  can hand that off to lookup_bdev so it returns successfully instead of an
  error.

 Why are you calling this from within the kernel?  You should have a bdev
 already directly within the kernel, no need to muck around in /dev/


The path used is generic in that it never changes, but the pointed block
device underneath changes based on the hardware/configuration in place. So
the idea was to load a module passing the path as a module argument so I
could access the underlying block device through the link without having to
worry about the real block device path.



 What exactly are you doing that you feel you need access to a block
 device node?

 thanks,

 greg k-h

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


Re: Linux Kernel readlink equivalent

2015-01-30 Thread Greg KH
On Fri, Jan 30, 2015 at 11:02:01AM -0500, David Legault wrote:
 The path used is generic in that it never changes, but the pointed block 
 device
 underneath changes based on the hardware/configuration in place. So the idea
 was to load a module passing the path as a module argument so I could access
 the underlying block device through the link without having to worry about the
 real block device path.

I don't understand at all.  What exactly are you trying to create here?

And don't use a module parameter for anything, you are limiting yourself
to only one device that way, as well as preventing any distro from
ever using your code.

What's wrong with just using the device mapper interface in the kernel
for whatever you are trying to do, instead of creating a new user api?

greg k-h

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


Re: Linux Kernel readlink equivalent

2015-01-29 Thread Valdis . Kletnieks
On Thu, 29 Jan 2015 13:11:13 -0500, David Legault said:

 I'm working on some linux kernel driver stuff and I have a fake path called
 /dev/blah/whatever that points to /dev/block/real_device.

And *why* is kernel code trying to follow a symlink, anyhow?

(Hint:  there's probably (a) data you want at the other end of the symlink
and (b) a better kernel API for getting at that data, which is why you can't
find examples of following symlinks. ;)


pgp5W6l6EnnG2.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Linux Kernel readlink equivalent

2015-01-29 Thread Greg KH
On Thu, Jan 29, 2015 at 01:11:13PM -0500, David Legault wrote:
 Hello,
 
 I'm working on some linux kernel driver stuff and I have a fake path called /
 dev/blah/whatever that points to /dev/block/real_device.

That's a userspace path, right?  Why would the kernel care about this?

 The issue is that lookup_bdev will fail to follow the symlink so I'd like to
 massage the path upfront by getting the real path (/dev/block/real_device) so 
 I
 can hand that off to lookup_bdev so it returns successfully instead of an
 error.

Why are you calling this from within the kernel?  You should have a bdev
already directly within the kernel, no need to muck around in /dev/

What exactly are you doing that you feel you need access to a block
device node?

thanks,

greg k-h

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


Re: Linux Kernel readlink equivalent

2015-01-29 Thread Aruna Hewapathirane


 Hello,

 I'm working on some linux kernel driver stuff and I have a fake path
 called /dev/blah/whatever that points to /dev/block/real_device.

 The issue is that lookup_bdev will fail to follow the symlink so I'd like
 to massage the path upfront by getting the real path
 (/dev/block/real_device) so I can hand that off to lookup_bdev so it
 returns successfully instead of an error.

 Or any other kernel call that would correctly retrieve the block_device
 information given the initial path which is a symlink.

 Note: I saw that the tomoyo module has something like that but I was
 looking for the generic implementation of the kernel if one exists.

 Thanks

 David

 David,

1 - Please read through: *man 2 readlink* ( yes please read it *all* very
carefully !

2 - There is a system call readlink study it...

 declared here: http://code.woboq.org/linux/include/unistd.h.html#809
 exported here:
http://code.woboq.org/linux/linux/arch/um/os-Linux/user_syms.c.html#83

3  grep through the kernel and see where and how readlink is used.

Try :   find . -name *.[ch] | xargs grep readlink

and :   find . -name *.[ch] | xargs grep  readlink(

and :   find . -name *.[ch] | xargs grep readlink

4 - This will help you figure how to work things out
http://www.informit.com/articles/article.aspx?p=23618seqNum=12 use at
your own risk :)

Good luck - Aruna
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Linux kernel Network Programing

2014-10-01 Thread John de la Garza
On Wed, Oct 01, 2014 at 03:07:46PM +0530, Mohit Varma wrote:
 
 I know a book ...linux kernel network programming which will help me get
 started.  Are there any more books which can help me.
there are some great reads here: http://haifux.org/rami_rosen.html
this guy also has a recent book on: http://ramirose.wix.com/ramirosen
 
 Secondly, how to look for problems to work on...more importantly how to
 ensure that hardware dependency doesn't come in my way...is there a
 simulated environment that I can use.

I use qemu or KVM and have a VM (virtual machine) that I run on my
laptop.  I have a small minimal kernel that I can quickly compile
and boot in the VM with out having to reboot my real hardware.  I
set up two tap devices, my VM has two nics, and I make it route
from my desktop to my gateway.

With this setup and can make changes in the kernel and quickly see
them running.

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


Re: Linux Kernel Module program to obtain domain name from IP

2014-07-08 Thread Sudip Mukherjee
On Tue, Jul 8, 2014 at 4:52 PM, shhuiw shh...@163.com wrote:
 Hi,

 I think you need refer to some open source DNS client utilities, e.g
 http://en.wikipedia.org/wiki/Nslookup.

 - shhuiw

just have a look at the source code of nslookup command ... it does
the same thing as what u want ...

but in many cases it will not work , as many domain names have shared
ip address .




 At 2014-07-08 06:26:23, Hettiarachchige Hasitha Shan hh_s...@live.com
 wrote:

 I have a requirement to obtain the domain name from the destination IP from
 an outgoing packet. I am successful in capturing and obtaining the
 destination IP  packets using the `netfilter` hook as shown below.

 unsigned int hook_func_out(unsigned int hooknum, struct sk_buff * skb,
 const struct net_device *in, const struct net_device *out, int
 (*okfn)(struct sk_buff*))
 {

 ofs = 20;// Set theoffset to skip over the IP header.

 {
 struct iphdr *ip_header = (struct iphdr
 *)skb_network_header(skb);
 struct udphdr *udp_header;
 struct tcphdr * tcp_header;

 //Ican obtain the destination IP address of the packet
 //like this
 unsigned int dest_ip = (unsigned int)ip_header-daddr;

 //or like this
 char pkt_tbuf[16];
 snprintf(pkt_tbuf, 16, %pI4, ip_header-daddr);

 //here I need to obtain the domain name of the obtained
 destination address
 }
 }

 However, I have no idea on how to use that IP to obtain the domain name of
 the obtained IP.

 I tried many sources
 (https://www.google.com/search?client=ubuntuchannel=fsq=linux+kernel+programming+domain+name+from+IP+ie=utf-8oe=utf-8)
 but did find any related information on the subject and will be really
 grateful if you experts would provide any sample code/ references to perform
 this task :)

 Thank you very much :)




 ___
 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: Linux Kernel Module program to obtain domain name from IP

2014-07-08 Thread Kristof Provost
On 2014-07-08 20:19:09 (+0800), shhuiw shh...@163.com wrote:
 DNS loopkup should use UDP packet, and you have to construct UDP request
 based on your captured IP addresses in your module.
DNS can actually use both TCP and UDP.

 And you have to use DNS server fallback lists and time-out control if some DNS
 server cannot work well.

Yeah. Doing DNS lookups (forward or reverse) is complicated. 
There's a dns_query function in the kernel (net/dns_resolver), which
apparently upcalls into user space, but I'd avoid dealing with DNS in
the kernel at all.

Just pass the IP address to user space and let it deal with it. There
are plenty of DNS libraries available. Odds are you need to pass the
resulting information to user space anyway, so you're not really losing
anything.

What are you trying to accomplish anyway?

Regards,
Kristof

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


Re: Re: Linux Kernel Module program to obtain domain name from IP

2014-07-08 Thread Kristofer Hallin
There's a research project called Name Based Sockets where this have been
done.

Take a look at: https://www.sics.se/projects/name-based-sockets

If you search for name based sockets on Google you will find a kernel
module and user space code doing this.
On 8 Jul 2014 15:07, Kristof Provost kris...@sigsegv.be wrote:

 On 2014-07-08 20:19:09 (+0800), shhuiw shh...@163.com wrote:
  DNS loopkup should use UDP packet, and you have to construct UDP request
  based on your captured IP addresses in your module.
 DNS can actually use both TCP and UDP.

  And you have to use DNS server fallback lists and time-out control if
 some DNS
  server cannot work well.

 Yeah. Doing DNS lookups (forward or reverse) is complicated.
 There's a dns_query function in the kernel (net/dns_resolver), which
 apparently upcalls into user space, but I'd avoid dealing with DNS in
 the kernel at all.

 Just pass the IP address to user space and let it deal with it. There
 are plenty of DNS libraries available. Odds are you need to pass the
 resulting information to user space anyway, so you're not really losing
 anything.

 What are you trying to accomplish anyway?

 Regards,
 Kristof

 ___
 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: Linux Kernel Module program to obtain domain name from IP

2014-07-08 Thread Hettiarachchige Hasitha Shan
Thank you for your responses sirs and the advice. My target is to,

1. Intercept SYN packet
2. Obtain the destination IP address
3. Resolve the TLD of that IP
4. then bind each packet to queues depending on the TLD

I will check on nslookup, open DNS client utilities and dns_resolver libraries 
as you experts suggested :)

Best Regards,
H. Hasitha Shan



Date: Tue, 8 Jul 2014 15:20:16 +0200
Subject: Re: Re: Linux Kernel Module program to obtain domain name from IP
From: kristofer.hal...@gmail.com
To: kris...@sigsegv.be
CC: kernelnewbies@kernelnewbies.org; shh...@163.com; 
sudipm.mukher...@gmail.com; hh_s...@live.com

There's a research project called Name Based Sockets where this have been done.
Take a look at: https://www.sics.se/projects/name-based-sockets
If you search for name based sockets on Google you will find a kernel module 
and user space code doing this.
On 8 Jul 2014 15:07, Kristof Provost kris...@sigsegv.be wrote:

On 2014-07-08 20:19:09 (+0800), shhuiw shh...@163.com wrote:

 DNS loopkup should use UDP packet, and you have to construct UDP request

 based on your captured IP addresses in your module.

DNS can actually use both TCP and UDP.



 And you have to use DNS server fallback lists and time-out control if some DNS

 server cannot work well.



Yeah. Doing DNS lookups (forward or reverse) is complicated.

There's a dns_query function in the kernel (net/dns_resolver), which

apparently upcalls into user space, but I'd avoid dealing with DNS in

the kernel at all.



Just pass the IP address to user space and let it deal with it. There

are plenty of DNS libraries available. Odds are you need to pass the

resulting information to user space anyway, so you're not really losing

anything.



What are you trying to accomplish anyway?



Regards,

Kristof



___

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: Linux kernel Booting

2014-06-04 Thread Valdis . Kletnieks
On Wed, 04 Jun 2014 11:59:54 +0530, Saurabh Jain said:

  Can anybody tell me the best way to trace Linux kernel Booting sequence ?

Depending what question you're trying to answer, booting with the
commandline parameter 'initcall_debug' may be the right answer.


pgp__KypJEycM.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Linux Kernel - Modifying a module_param variable from other drivers

2013-11-14 Thread Valdis . Kletnieks
On Thu, 14 Nov 2013 18:32:05 +0900, manty kuma said:

 I see that when we declare a variable as module_param from a driver, i can
 see it listed in /sys/module/xxx/parameters/

 Ex : /sys/module/usbcore/parameters/autosuspend

 we can modify and read it with echo and cat commands from terminal.

 But is there a way i can read this value from other drivers? Common sense
 says it should be there because if we are able to access them from user
 space, from kernel space we should definitely be able to do. Is it so? If
 yes, what are the API's?

It's just a variable.  Read the source and find out what it's name is.
You may need an EXPORT_SYMBOL() to make it available if it isn't already.
And depending on the variable and its use, you may need locking and/or
atomic operations to read it.

And *modifying* another module's variables is just asking for trouble,
mostly because very little code is written assuming that its variables may
be maliciously modified out from under it.  So consider code like:

int foo_size, i;
struct bar *stuff;

stuff = malloc(foo_size* sizeof(struct bar));

/* somebody raises the value of foo_size from outside */

for (i=0; i  foo_size; i++) do_something(stuff[i]);

You can see where that sort of stuff is heading


pgpWZOSEWDIZQ.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Linux Kernel - Modifying a module_param variable from other drivers

2013-11-14 Thread manty kuma
Ideally, it depends on the platform you are working. You need to discuss
with them for the correct approach. For Qualcomm they have some hardware
caled as RPU(Register protection unit). They have systems calls exposed for
using them. You can associtate it to the register you want protection. I
dont know if there is any way you could do it in Linux itself?

Regards,
Sandeep


On Fri, Nov 15, 2013 at 6:03 AM, valdis.kletni...@vt.edu wrote:

 On Thu, 14 Nov 2013 18:32:05 +0900, manty kuma said:

  I see that when we declare a variable as module_param from a driver, i
 can
  see it listed in /sys/module/xxx/parameters/
 
  Ex : /sys/module/usbcore/parameters/autosuspend
 
  we can modify and read it with echo and cat commands from terminal.
 
  But is there a way i can read this value from other drivers? Common sense
  says it should be there because if we are able to access them from user
  space, from kernel space we should definitely be able to do. Is it so? If
  yes, what are the API's?

 It's just a variable.  Read the source and find out what it's name is.
 You may need an EXPORT_SYMBOL() to make it available if it isn't already.
 And depending on the variable and its use, you may need locking and/or
 atomic operations to read it.

 And *modifying* another module's variables is just asking for trouble,
 mostly because very little code is written assuming that its variables may
 be maliciously modified out from under it.  So consider code like:

 int foo_size, i;
 struct bar *stuff;

 stuff = malloc(foo_size* sizeof(struct bar));

 /* somebody raises the value of foo_size from outside */

 for (i=0; i  foo_size; i++) do_something(stuff[i]);

 You can see where that sort of stuff is heading

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


Re: Linux Kernel - Modifying a module_param variable from other drivers

2013-11-14 Thread manty kuma
Hi Valdis,
Thank you for the reply.
I am not talking about all the variables. i am talking about variables
which are declared as module_param. These variables can anyways be changed
from shell prompt using echo and cat like i mentioned in the desciption. SO
i was hoping i can do it from drivers aswell.


Regards,
Sandeep


On Fri, Nov 15, 2013 at 10:30 AM, manty kuma mantyk...@gmail.com wrote:

 Sorry i was supposed to reply for another mail. Did it here by mistake.


 On Fri, Nov 15, 2013 at 10:29 AM, manty kuma mantyk...@gmail.com wrote:

 Ideally, it depends on the platform you are working. You need to discuss
 with them for the correct approach. For Qualcomm they have some hardware
 caled as RPU(Register protection unit). They have systems calls exposed for
 using them. You can associtate it to the register you want protection. I
 dont know if there is any way you could do it in Linux itself?

 Regards,
 Sandeep


 On Fri, Nov 15, 2013 at 6:03 AM, valdis.kletni...@vt.edu wrote:

 On Thu, 14 Nov 2013 18:32:05 +0900, manty kuma said:

  I see that when we declare a variable as module_param from a driver, i
 can
  see it listed in /sys/module/xxx/parameters/
 
  Ex : /sys/module/usbcore/parameters/autosuspend
 
  we can modify and read it with echo and cat commands from terminal.
 
  But is there a way i can read this value from other drivers? Common
 sense
  says it should be there because if we are able to access them from user
  space, from kernel space we should definitely be able to do. Is it so?
 If
  yes, what are the API's?

 It's just a variable.  Read the source and find out what it's name is.
 You may need an EXPORT_SYMBOL() to make it available if it isn't already.
 And depending on the variable and its use, you may need locking and/or
 atomic operations to read it.

 And *modifying* another module's variables is just asking for trouble,
 mostly because very little code is written assuming that its variables
 may
 be maliciously modified out from under it.  So consider code like:

 int foo_size, i;
 struct bar *stuff;

 stuff = malloc(foo_size* sizeof(struct bar));

 /* somebody raises the value of foo_size from outside */

 for (i=0; i  foo_size; i++) do_something(stuff[i]);

 You can see where that sort of stuff is heading




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


Re: Linux Kernel - Modifying a module_param variable from other drivers

2013-11-14 Thread manty kuma
Sorry i was supposed to reply for another mail. Did it here by mistake.


On Fri, Nov 15, 2013 at 10:29 AM, manty kuma mantyk...@gmail.com wrote:

 Ideally, it depends on the platform you are working. You need to discuss
 with them for the correct approach. For Qualcomm they have some hardware
 caled as RPU(Register protection unit). They have systems calls exposed for
 using them. You can associtate it to the register you want protection. I
 dont know if there is any way you could do it in Linux itself?

 Regards,
 Sandeep


 On Fri, Nov 15, 2013 at 6:03 AM, valdis.kletni...@vt.edu wrote:

 On Thu, 14 Nov 2013 18:32:05 +0900, manty kuma said:

  I see that when we declare a variable as module_param from a driver, i
 can
  see it listed in /sys/module/xxx/parameters/
 
  Ex : /sys/module/usbcore/parameters/autosuspend
 
  we can modify and read it with echo and cat commands from terminal.
 
  But is there a way i can read this value from other drivers? Common
 sense
  says it should be there because if we are able to access them from user
  space, from kernel space we should definitely be able to do. Is it so?
 If
  yes, what are the API's?

 It's just a variable.  Read the source and find out what it's name is.
 You may need an EXPORT_SYMBOL() to make it available if it isn't already.
 And depending on the variable and its use, you may need locking and/or
 atomic operations to read it.

 And *modifying* another module's variables is just asking for trouble,
 mostly because very little code is written assuming that its variables may
 be maliciously modified out from under it.  So consider code like:

 int foo_size, i;
 struct bar *stuff;

 stuff = malloc(foo_size* sizeof(struct bar));

 /* somebody raises the value of foo_size from outside */

 for (i=0; i  foo_size; i++) do_something(stuff[i]);

 You can see where that sort of stuff is heading



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


Re: Linux Kernel - Modifying a module_param variable from other drivers

2013-11-14 Thread Valdis . Kletnieks
On Fri, 15 Nov 2013 10:33:40 +0900, manty kuma said:

 I am not talking about all the variables. i am talking about variables
 which are declared as module_param. These variables can anyways be changed
 from shell prompt using echo and cat like i mentioned in the desciption.

If you actually chase through the code, you'll see that when you change a
module_param() variable, the module itself handles the parsing and then the
saving of the new value - which allows it to do any locking needed and
any cleanup of data that is required.

 SO i was hoping i can do it from drivers aswell.

The obvious first question is: Why are you trying to change a module's
variables from behind it's back, from another module?

There's no formal API for it, mostly because we don't usually create APIs
to support Usually Bad Ideas.


pgp9zfaAnkVc2.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Linux Kernel and Device Drivers

2013-07-18 Thread Srinivas Ganji
Yes. As said by Anish, I generally practice through a dummy hello world
module. Suppose, if I want to print all the processes currently running, I
do like this.

#include linux/module.h
#include linux/kernel.h
#include linux/sched.h

MODULE_LICENSE(Dual BSD/GPL);

static int hello_init(void)
{
struct task_struct *task;

printk(Hello World!\n);
 for_each_process(task) {
printk(%s %d\n, task-comm, task-pid);
}
 printk(\n\n\n);
 for(task = init_task; ((task=next_task(task)) != init_task) ; )
printk(%s %d\n, task-comm, task-pid);
 printk(\n\n\n);
 return 0;
}

static void hello_exit(void)
{
printk(Good bye!\n);
}

module_init(hello_init);
module_exit(hello_exit);

By the way, you can do as suggested by Valdis, too. I do search for a
particular code/strings using find, xargs, grep combination.

I hope this helps you.

Regards,
Srinivas



On Tue, Jul 16, 2013 at 12:42 PM, Satya Prakash Prasad 
unixkernel...@gmail.com wrote:

 Thanks .. I have another question. I was trying to practice some kernel
 process management APIs as in
 http://reiber.org/nxt/pub/Linux/LinuxKernelDevelopment/Linux.Kernel.Development.3rd.Edition.pdfhttp://www.linkedin.com/redirect?url=http%3A%2F%2Freiber%2Eorg%2Fnxt%2Fpub%2FLinux%2FLinuxKernelDevelopment%2FLinux%2EKernel%2EDevelopment%2E3rd%2EEdition%2Epdfurlhash=3MN8_t=tracking_disc(Linux
  Kernel Development by Robert Love, 3rd edition).

 I am not sure how to practice the code snippet given in the text book. I
 can understand the theory but do not find a way to practice. For example: I
 want to read a process 'struct task_struct' to find it parent's process
 identifier, how many tasks are in which state, creating kernel threads etc?

 Any idea?


 On Mon, Jul 15, 2013 at 2:32 PM, Srinivas Ganji 
 srinivasganji.ker...@gmail.com wrote:

 As per as I know, you can follow two text books.

 1. Linux Kernel Development by Robert Love, 3rd edition.
 2. Linux Device Drivers by Alessandro Rubini, Jonathan Corbet, Greh
 Kroah-Hartman. 3rd edition.

 At the same time, you can practice the exercises given in the text books
 - practice makes a man perfect. The other thing is Make your hands dirty
 by digging the kernel code whenever you have a doubt.

 Regards,
 Srinivas




 On Mon, Jul 15, 2013 at 2:06 PM, Satya Prakash Prasad 
 unixkernel...@gmail.com wrote:

 Please let me know how to study and get hands on experience on Linux
 Kernel and Device Drivers?

 Regards,
 Prakash

 ___
 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: Linux Kernel and Device Drivers

2013-07-18 Thread Satya Prakash Prasad
Thanks to Srinivas and others. I got a point to start from.

Regards,
Prakash


On Thu, Jul 18, 2013 at 12:01 PM, Srinivas Ganji 
srinivasganji.ker...@gmail.com wrote:

 Yes. As said by Anish, I generally practice through a dummy hello world
 module. Suppose, if I want to print all the processes currently running, I
 do like this.

 #include linux/module.h
 #include linux/kernel.h
 #include linux/sched.h

 MODULE_LICENSE(Dual BSD/GPL);

 static int hello_init(void)
 {
 struct task_struct *task;

 printk(Hello World!\n);
  for_each_process(task) {
  printk(%s %d\n, task-comm, task-pid);
 }
  printk(\n\n\n);
  for(task = init_task; ((task=next_task(task)) != init_task) ; )
  printk(%s %d\n, task-comm, task-pid);
  printk(\n\n\n);
  return 0;
 }

 static void hello_exit(void)
 {
 printk(Good bye!\n);
 }

 module_init(hello_init);
 module_exit(hello_exit);

 By the way, you can do as suggested by Valdis, too. I do search for a
 particular code/strings using find, xargs, grep combination.

 I hope this helps you.

 Regards,
 Srinivas



 On Tue, Jul 16, 2013 at 12:42 PM, Satya Prakash Prasad 
 unixkernel...@gmail.com wrote:

 Thanks .. I have another question. I was trying to practice some kernel
 process management APIs as in
 http://reiber.org/nxt/pub/Linux/LinuxKernelDevelopment/Linux.Kernel.Development.3rd.Edition.pdfhttp://www.linkedin.com/redirect?url=http%3A%2F%2Freiber%2Eorg%2Fnxt%2Fpub%2FLinux%2FLinuxKernelDevelopment%2FLinux%2EKernel%2EDevelopment%2E3rd%2EEdition%2Epdfurlhash=3MN8_t=tracking_disc(Linux
  Kernel Development by Robert Love, 3rd edition).

 I am not sure how to practice the code snippet given in the text book. I
 can understand the theory but do not find a way to practice. For example: I
 want to read a process 'struct task_struct' to find it parent's process
 identifier, how many tasks are in which state, creating kernel threads etc?

 Any idea?


 On Mon, Jul 15, 2013 at 2:32 PM, Srinivas Ganji 
 srinivasganji.ker...@gmail.com wrote:

 As per as I know, you can follow two text books.

 1. Linux Kernel Development by Robert Love, 3rd edition.
 2. Linux Device Drivers by Alessandro Rubini, Jonathan Corbet, Greh
 Kroah-Hartman. 3rd edition.

 At the same time, you can practice the exercises given in the text books
 - practice makes a man perfect. The other thing is Make your hands dirty
 by digging the kernel code whenever you have a doubt.

 Regards,
 Srinivas




 On Mon, Jul 15, 2013 at 2:06 PM, Satya Prakash Prasad 
 unixkernel...@gmail.com wrote:

 Please let me know how to study and get hands on experience on Linux
 Kernel and Device Drivers?

 Regards,
 Prakash

 ___
 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: Linux Kernel and Device Drivers

2013-07-16 Thread Satya Prakash Prasad
Thanks .. I have another question. I was trying to practice some kernel
process management APIs as in
http://reiber.org/nxt/pub/Linux/LinuxKernelDevelopment/Linux.Kernel.Development.3rd.Edition.pdfhttp://www.linkedin.com/redirect?url=http%3A%2F%2Freiber%2Eorg%2Fnxt%2Fpub%2FLinux%2FLinuxKernelDevelopment%2FLinux%2EKernel%2EDevelopment%2E3rd%2EEdition%2Epdfurlhash=3MN8_t=tracking_disc(Linux
Kernel Development by Robert Love, 3rd edition).

I am not sure how to practice the code snippet given in the text book. I
can understand the theory but do not find a way to practice. For example: I
want to read a process 'struct task_struct' to find it parent's process
identifier, how many tasks are in which state, creating kernel threads etc?

Any idea?


On Mon, Jul 15, 2013 at 2:32 PM, Srinivas Ganji 
srinivasganji.ker...@gmail.com wrote:

 As per as I know, you can follow two text books.

 1. Linux Kernel Development by Robert Love, 3rd edition.
 2. Linux Device Drivers by Alessandro Rubini, Jonathan Corbet, Greh
 Kroah-Hartman. 3rd edition.

 At the same time, you can practice the exercises given in the text books -
 practice makes a man perfect. The other thing is Make your hands dirty by
 digging the kernel code whenever you have a doubt.

 Regards,
 Srinivas




 On Mon, Jul 15, 2013 at 2:06 PM, Satya Prakash Prasad 
 unixkernel...@gmail.com wrote:

 Please let me know how to study and get hands on experience on Linux
 Kernel and Device Drivers?

 Regards,
 Prakash

 ___
 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: Linux Kernel

2013-02-18 Thread Valdis . Kletnieks
On Tue, 19 Feb 2013 10:50:26 +0530, kapil agrawal said:

 How the linux kernel runs in the system after spawning the init and
 mounting the root FS.
 Does it run as some background process ?

No.  You probably want to get some basic knowledge about operating
systems in general.

http://en.wikipedia.org/wiki/Operating_system

as you appear to be confused regarding the basic concepts of an
operating systems kernel.

 How it serves the system calls etc. ?

There's about 5 different answers to that, depending on how in-depth
you want the details, but I suspect that none of them will make any sense
to you until you get a better grasp on the basics


pgp4q_gcdem4X.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Linux Kernel

2013-02-18 Thread Sengottuvelan S
Kapil

It runs as Background process in the kernel memory (init-process). When
system calls is coming from User space/Land, there will be context switch
from user to kernel space happens. I think kernel main thread serving those
system calls.

On Mon, Feb 18, 2013 at 9:20 PM, kapil agrawal kapil.agrawa...@gmail.comwrote:

 Hi,

 How the linux kernel runs in the system after spawning the init and
 mounting the root FS.
 Does it run as some background process ?
 How it serves the system calls etc. ?

 Regards
 Kapil

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




-- 
Regards,
S. Sengottuvelan.
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Linux Kernel

2013-02-18 Thread kapil agrawal
Do you mean process with PID 0 is the one, which runs in the background and
serves the request from userland and goes to cpu_idle() if nothing to run.

-kapil


On Tue, Feb 19, 2013 at 11:23 AM, Sengottuvelan S sengottuvela...@gmail.com
 wrote:

 Kapil

 It runs as Background process in the kernel memory (init-process). When
 system calls is coming from User space/Land, there will be context switch
 from user to kernel space happens. I think kernel main thread serving those
 system calls.

 On Mon, Feb 18, 2013 at 9:20 PM, kapil agrawal 
 kapil.agrawa...@gmail.comwrote:

 Hi,

 How the linux kernel runs in the system after spawning the init and
 mounting the root FS.
 Does it run as some background process ?
 How it serves the system calls etc. ?

 Regards
 Kapil

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




 --
 Regards,
 S. Sengottuvelan.
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Linux Kernel

2013-02-18 Thread Valdis . Kletnieks
On Tue, 19 Feb 2013 12:01:55 +0530, kapil agrawal said:

 Do you mean process with PID 0 is the one, which runs in the background and
 serves the request from userland and goes to cpu_idle() if nothing to run.

No.  Large parts of the kernel run in kernel mode, but using the 'struct task'
of the related userspace process (in particular, most system calls work
this way).  Other large chunks borrow the 'struct task' and run under it
just so there's *a* process running.  And parts aren't in process context
at all, but interrupt context (so they aren't running as process code at all).


pgpN6fkyAc3yG.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Linux Kernel Networking document (free, 178 pages doc)

2013-02-04 Thread Greg Freemyer
(Why is this a top-posted message thread?  Please stop creating these.)

Only the first link says that the ext2 driver can mount a ext4 filesystem (if 
the journal is clean).  I'm confident that is wrong.  Ext4 has several on-disk 
features that are not backward compatible.  There is a binary set of flags 
which is set at mkfs time as to which of those features were enabled by 
mkfs.ext4.

A ext3 doc would only describe a ext4 filesystem with all of those flags off.

Thus a ext3 doc describing the on disk structure is not a waste of time, but it 
becomes a subset of a full ext4 doc describing the on disk structure.

I would recommend that documenting that set of flags be the first documentation 
effort.

Greg

Peter Teoh htmldevelo...@gmail.com wrote:

generally, anything u write for ext2, should still be valid for ext3,
and
ext4. in the sense that the features are backward compatible.   sizing
limits may have increased, but OLD working mechanism should still be
validexcept for some.

so ext2 fs should still be mountable as ext4, but not vice versa, once
some
flag is enabled (I think it is xattr).  and if the flag is not enabled,
and
the journal logs is clean, then ext4 fs is also mountable as ext2 fs:

http://superuser.com/questions/408822/ext4-converted-mounted-as-ext2

http://computer-forensics.sans.org/blog/2011/06/14/digital-forensics-mounting-dirty-ext4-filesystems

http://en.wikipedia.org/wiki/Extended_file_attributes

On Sun, Feb 3, 2013 at 12:26 AM, Rami Rosen roszenr...@gmail.com
wrote:

 Hi,
  ext2 and ext3 are kind of obsolete now.

 Indeed, ext4 was integrated into Linux kernel back in 2008.
 Amongs its known features which do not exist in ext3 are support for
 huge files (like   1 EB (exabyte or somtimes termed exbibyte); 1 EB
is
  1024 PB (petabyte) whereas
 1 PB is  1024 TB (terabyte).
 a directory can contain a maximum of 64,000 subdirectories (whereas
we
 have 32,000 in ext3)
 Amongst its other features are Journal checksumming, Multiblock
 allocator, Faster file system checking and more.


 If you prefer to start with simpler implementations, ext3 is of
course
 simpler, and of course ext2 is even simpler than ext3.

 But in case you intend to start with ext2/ext3, and later perform
 a pass on all your documentation to update it to ext4, take into
 consideration that this will take quite a time; depending on how deep
 you intend to delve into implementation details.

 Good luck!

 Regards,
 Rami Rosen
 http://ramirose.wix.com/ramirosen



 On Sat, Feb 2, 2013 at 11:43 AM, Shubham Sharma
 kernel.shub...@gmail.com wrote:
  Hi,
 
  I understand that ext2 and ext3 are kind of obsolete now. But
AFAIK,
 there
  is not much difference in ext3 and ext4.
 
  Moreover for a newbie , it is better to start with ext3. What you
think ?
 
  Regards
  Shubham
 
 
  On Fri, Feb 1, 2013 at 2:15 AM, Rami Rosen roszenr...@gmail.com
wrote:
 
  Hi,
  Have you considered to start with ext4?
  it seems that ext3, ext2 are a bit out of fashion,
 
  Regards,
  Rami Rosen
  http://ramirose.wix.com/ramirosen
 
 
  On Thu, Jan 31, 2013 at 8:58 PM, shubham
kernel.shub...@gmail.com
 wrote:
   Thanks Rami,
  
   I am also trying to understand ext3 and write some document for
the
   same.
  
   Regards
   Shubham
  
  
   On 31-Jan-13 12:51 AM, Rami Rosen wrote:
  
   HI,
   I will try to write something for Linux Filesystems  (and maybe
for
   other subsystems) but this will probably take a lot of time.
  
   Regards,
   Rami Rosen
   http://ramirose.wix.com/ramirosen
  
  
   On Wed, Jan 30, 2013 at 5:44 PM, shubham
kernel.shub...@gmail.com
   wrote:
  
   Thanks for sharing the document.
  
   I hope we could have such documents for other subsystems as
well.
  
   Regards
   Shubham
  
  
   On 28-Jan-13 10:23 PM, Rami Rosen wrote:
  
   Hi everyone,
   You can find here an up to date and detailed document in pdf
(178
   pages) about Linux Kernel Networking; going deep into design
and
   implementation details as well as the theory behind it:
  
 http://media.wix.com/ugd//295986_931b8bcf34d93419d46e05b5aa5d0216.pdf
  
   I believe that developers/sysadmins/researchers/students may
find
   help
   with it.
  
  
   regards,
   Rami Rosen
  
   http://ramirose.wix.com/ramirosen
  
   ___
   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


-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

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


Re: Linux Kernel Networking document (free, 178 pages doc)

2013-02-04 Thread Greg Freemyer
I took a minute to find the list of flags:

Look for s_feature_incompat and s_feature_ro_compat at

   https://ext4.wiki.kernel.org/index.php/Ext4_Disk_Layout

The incompat flags are of most interest for the discussion.  If any of
those are set, neither the ext2 nor the ext3 driver can mount the
filesystem unless they have been extended to support these features:

===
Incompatible feature set. If the kernel or fsck doesn't understand one
of these bits, it should stop.

Any of:
0x1 Compression (INCOMPAT_COMPRESSION).
0x2 Directory entries record the file type. See ext4_dir_entry_2 below
(INCOMPAT_FILETYPE).
0x4 Filesystem needs recovery (INCOMPAT_RECOVER).
0x8 Filesystem has a separate journal device (INCOMPAT_JOURNAL_DEV).
0x10Meta block groups. See the earlier discussion of this feature
(INCOMPAT_META_BG).
0x40Files in this filesystem use extents (INCOMPAT_EXTENTS).
0x80Enable a filesystem size of 2^64 blocks (INCOMPAT_64BIT).
0x100   Multiple mount protection. Not implemented (INCOMPAT_MMP).
0x200   Flexible block groups. See the earlier discussion of this
feature (INCOMPAT_FLEX_BG).
0x400   Inodes can be used for large extended attributes
(INCOMPAT_EA_INODE). (Not implemented?)
0x1000  Data in directory entry (INCOMPAT_DIRDATA). (Not implemented?)
0x2000  Never used (INCOMPAT_BG_USE_META_CSUM). Probably free.
0x4000  Large directory 2GB or 3-level htree (INCOMPAT_LARGEDIR).
0x8000  Data in inode (INCOMPAT_INLINE_DATA).

==

Greg

On Mon, Feb 4, 2013 at 8:49 AM, Greg Freemyer greg.freem...@gmail.com wrote:
 (Why is this a top-posted message thread?  Please stop creating these.)

 Only the first link says that the ext2 driver can mount a ext4 filesystem (if 
 the journal is clean).  I'm confident that is wrong.  Ext4 has several 
 on-disk features that are not backward compatible.  There is a binary set of 
 flags which is set at mkfs time as to which of those features were enabled by 
 mkfs.ext4.

 A ext3 doc would only describe a ext4 filesystem with all of those flags off.

 Thus a ext3 doc describing the on disk structure is not a waste of time, but 
 it becomes a subset of a full ext4 doc describing the on disk structure.

 I would recommend that documenting that set of flags be the first 
 documentation effort.

 Greg

 Peter Teoh htmldevelo...@gmail.com wrote:

generally, anything u write for ext2, should still be valid for ext3,
and
ext4. in the sense that the features are backward compatible.   sizing
limits may have increased, but OLD working mechanism should still be
validexcept for some.

so ext2 fs should still be mountable as ext4, but not vice versa, once
some
flag is enabled (I think it is xattr).  and if the flag is not enabled,
and
the journal logs is clean, then ext4 fs is also mountable as ext2 fs:

http://superuser.com/questions/408822/ext4-converted-mounted-as-ext2

http://computer-forensics.sans.org/blog/2011/06/14/digital-forensics-mounting-dirty-ext4-filesystems

http://en.wikipedia.org/wiki/Extended_file_attributes

On Sun, Feb 3, 2013 at 12:26 AM, Rami Rosen roszenr...@gmail.com
wrote:

 Hi,
  ext2 and ext3 are kind of obsolete now.

 Indeed, ext4 was integrated into Linux kernel back in 2008.
 Amongs its known features which do not exist in ext3 are support for
 huge files (like   1 EB (exabyte or somtimes termed exbibyte); 1 EB
is
  1024 PB (petabyte) whereas
 1 PB is  1024 TB (terabyte).
 a directory can contain a maximum of 64,000 subdirectories (whereas
we
 have 32,000 in ext3)
 Amongst its other features are Journal checksumming, Multiblock
 allocator, Faster file system checking and more.


 If you prefer to start with simpler implementations, ext3 is of
course
 simpler, and of course ext2 is even simpler than ext3.

 But in case you intend to start with ext2/ext3, and later perform
 a pass on all your documentation to update it to ext4, take into
 consideration that this will take quite a time; depending on how deep
 you intend to delve into implementation details.

 Good luck!

 Regards,
 Rami Rosen
 http://ramirose.wix.com/ramirosen



 On Sat, Feb 2, 2013 at 11:43 AM, Shubham Sharma
 kernel.shub...@gmail.com wrote:
  Hi,
 
  I understand that ext2 and ext3 are kind of obsolete now. But
AFAIK,
 there
  is not much difference in ext3 and ext4.
 
  Moreover for a newbie , it is better to start with ext3. What you
think ?
 
  Regards
  Shubham
 
 
  On Fri, Feb 1, 2013 at 2:15 AM, Rami Rosen roszenr...@gmail.com
wrote:
 
  Hi,
  Have you considered to start with ext4?
  it seems that ext3, ext2 are a bit out of fashion,
 
  Regards,
  Rami Rosen
  http://ramirose.wix.com/ramirosen
 
 
  On Thu, Jan 31, 2013 at 8:58 PM, shubham
kernel.shub...@gmail.com
 wrote:
   Thanks Rami,
  
   I am also trying to understand ext3 and write some document for
the
   same.
  
   Regards
   Shubham
  
  
   On 31-Jan-13 12:51 AM, Rami Rosen wrote:
  
   HI,
   I will try to write something for Linux Filesystems  (and maybe
for
   other subsystems) but this 

Re: Linux Kernel Networking document (free, 178 pages doc)

2013-02-03 Thread Peter Teoh
Good sharing and info.   I thought it is also useful to share your lectures
materials at:

http://www.haifux.org/rami_rosen.html

which I must highlight has lots of work done since 2007.   Keep up the good
work!!

On Tue, Jan 29, 2013 at 12:53 AM, Rami Rosen roszenr...@gmail.com wrote:

 Hi everyone,
 You can find here an up to date and detailed document in pdf (178
 pages) about Linux Kernel Networking; going deep into design and
 implementation details as well as the theory behind it:
 http://media.wix.com/ugd//295986_931b8bcf34d93419d46e05b5aa5d0216.pdf

 I believe that developers/sysadmins/researchers/students may find help
 with it.


 regards,
 Rami Rosen

 http://ramirose.wix.com/ramirosen

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




-- 
Regards,
Peter Teoh
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Linux Kernel Networking document (free, 178 pages doc)

2013-02-03 Thread Peter Teoh
generally, anything u write for ext2, should still be valid for ext3, and
ext4. in the sense that the features are backward compatible.   sizing
limits may have increased, but OLD working mechanism should still be
validexcept for some.

so ext2 fs should still be mountable as ext4, but not vice versa, once some
flag is enabled (I think it is xattr).  and if the flag is not enabled, and
the journal logs is clean, then ext4 fs is also mountable as ext2 fs:

http://superuser.com/questions/408822/ext4-converted-mounted-as-ext2

http://computer-forensics.sans.org/blog/2011/06/14/digital-forensics-mounting-dirty-ext4-filesystems

http://en.wikipedia.org/wiki/Extended_file_attributes

On Sun, Feb 3, 2013 at 12:26 AM, Rami Rosen roszenr...@gmail.com wrote:

 Hi,
  ext2 and ext3 are kind of obsolete now.

 Indeed, ext4 was integrated into Linux kernel back in 2008.
 Amongs its known features which do not exist in ext3 are support for
 huge files (like   1 EB (exabyte or somtimes termed exbibyte); 1 EB is
  1024 PB (petabyte) whereas
 1 PB is  1024 TB (terabyte).
 a directory can contain a maximum of 64,000 subdirectories (whereas we
 have 32,000 in ext3)
 Amongst its other features are Journal checksumming, Multiblock
 allocator, Faster file system checking and more.


 If you prefer to start with simpler implementations, ext3 is of course
 simpler, and of course ext2 is even simpler than ext3.

 But in case you intend to start with ext2/ext3, and later perform
 a pass on all your documentation to update it to ext4, take into
 consideration that this will take quite a time; depending on how deep
 you intend to delve into implementation details.

 Good luck!

 Regards,
 Rami Rosen
 http://ramirose.wix.com/ramirosen



 On Sat, Feb 2, 2013 at 11:43 AM, Shubham Sharma
 kernel.shub...@gmail.com wrote:
  Hi,
 
  I understand that ext2 and ext3 are kind of obsolete now. But AFAIK,
 there
  is not much difference in ext3 and ext4.
 
  Moreover for a newbie , it is better to start with ext3. What you think ?
 
  Regards
  Shubham
 
 
  On Fri, Feb 1, 2013 at 2:15 AM, Rami Rosen roszenr...@gmail.com wrote:
 
  Hi,
  Have you considered to start with ext4?
  it seems that ext3, ext2 are a bit out of fashion,
 
  Regards,
  Rami Rosen
  http://ramirose.wix.com/ramirosen
 
 
  On Thu, Jan 31, 2013 at 8:58 PM, shubham kernel.shub...@gmail.com
 wrote:
   Thanks Rami,
  
   I am also trying to understand ext3 and write some document for the
   same.
  
   Regards
   Shubham
  
  
   On 31-Jan-13 12:51 AM, Rami Rosen wrote:
  
   HI,
   I will try to write something for Linux Filesystems  (and maybe for
   other subsystems) but this will probably take a lot of time.
  
   Regards,
   Rami Rosen
   http://ramirose.wix.com/ramirosen
  
  
   On Wed, Jan 30, 2013 at 5:44 PM, shubham kernel.shub...@gmail.com
   wrote:
  
   Thanks for sharing the document.
  
   I hope we could have such documents for other subsystems as well.
  
   Regards
   Shubham
  
  
   On 28-Jan-13 10:23 PM, Rami Rosen wrote:
  
   Hi everyone,
   You can find here an up to date and detailed document in pdf (178
   pages) about Linux Kernel Networking; going deep into design and
   implementation details as well as the theory behind it:
  
 http://media.wix.com/ugd//295986_931b8bcf34d93419d46e05b5aa5d0216.pdf
  
   I believe that developers/sysadmins/researchers/students may find
   help
   with it.
  
  
   regards,
   Rami Rosen
  
   http://ramirose.wix.com/ramirosen
  
   ___
   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




-- 
Regards,
Peter Teoh
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Linux Kernel Networking document (free, 178 pages doc)

2013-02-03 Thread Peter Teoh
http://www.haifux.org/lectures.html

This link has even more lectures.

On Mon, Feb 4, 2013 at 11:55 AM, Peter Teoh htmldevelo...@gmail.com wrote:

 Good sharing and info.   I thought it is also useful to share your
 lectures materials at:

 http://www.haifux.org/rami_rosen.html

 which I must highlight has lots of work done since 2007.   Keep up the
 good work!!


 On Tue, Jan 29, 2013 at 12:53 AM, Rami Rosen roszenr...@gmail.com wrote:

 Hi everyone,
 You can find here an up to date and detailed document in pdf (178
 pages) about Linux Kernel Networking; going deep into design and
 implementation details as well as the theory behind it:
 http://media.wix.com/ugd//295986_931b8bcf34d93419d46e05b5aa5d0216.pdf

 I believe that developers/sysadmins/researchers/students may find help
 with it.


 regards,
 Rami Rosen

 http://ramirose.wix.com/ramirosen

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




 --
 Regards,
 Peter Teoh




-- 
Regards,
Peter Teoh
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Linux Kernel Networking document (free, 178 pages doc)

2013-02-02 Thread Shubham Sharma
Hi,

I understand that ext2 and ext3 are kind of obsolete now. But AFAIK, there
is not much difference in ext3 and ext4.

Moreover for a newbie , it is better to start with ext3. What you think ?

Regards
Shubham

On Fri, Feb 1, 2013 at 2:15 AM, Rami Rosen roszenr...@gmail.com wrote:

 Hi,
 Have you considered to start with ext4?
 it seems that ext3, ext2 are a bit out of fashion,

 Regards,
 Rami Rosen
 http://ramirose.wix.com/ramirosen


 On Thu, Jan 31, 2013 at 8:58 PM, shubham kernel.shub...@gmail.com wrote:
  Thanks Rami,
 
  I am also trying to understand ext3 and write some document for the same.
 
  Regards
  Shubham
 
 
  On 31-Jan-13 12:51 AM, Rami Rosen wrote:
 
  HI,
  I will try to write something for Linux Filesystems  (and maybe for
  other subsystems) but this will probably take a lot of time.
 
  Regards,
  Rami Rosen
  http://ramirose.wix.com/ramirosen
 
 
  On Wed, Jan 30, 2013 at 5:44 PM, shubham kernel.shub...@gmail.com
 wrote:
 
  Thanks for sharing the document.
 
  I hope we could have such documents for other subsystems as well.
 
  Regards
  Shubham
 
 
  On 28-Jan-13 10:23 PM, Rami Rosen wrote:
 
  Hi everyone,
  You can find here an up to date and detailed document in pdf (178
  pages) about Linux Kernel Networking; going deep into design and
  implementation details as well as the theory behind it:
  http://media.wix.com/ugd//295986_931b8bcf34d93419d46e05b5aa5d0216.pdf
 
  I believe that developers/sysadmins/researchers/students may find help
  with it.
 
 
  regards,
  Rami Rosen
 
  http://ramirose.wix.com/ramirosen
 
  ___
  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: Linux Kernel Networking document (free, 178 pages doc)

2013-02-01 Thread Kaushal Billore
Hey,
Thanks for such sharing document.

 Date: Thu, 31 Jan 2013 22:45:53 +0200
 Subject: Re: Linux Kernel Networking document (free, 178 pages doc)
 From: roszenr...@gmail.com
 To: kernel.shub...@gmail.com
 CC: kernelnewbies@kernelnewbies.org
 
 Hi,
 Have you considered to start with ext4?
 it seems that ext3, ext2 are a bit out of fashion,
 
 Regards,
 Rami Rosen
 http://ramirose.wix.com/ramirosen
 
 
 On Thu, Jan 31, 2013 at 8:58 PM, shubham kernel.shub...@gmail.com wrote:
  Thanks Rami,
 
  I am also trying to understand ext3 and write some document for the same.
 
  Regards
  Shubham
 
 
  On 31-Jan-13 12:51 AM, Rami Rosen wrote:
 
  HI,
  I will try to write something for Linux Filesystems  (and maybe for
  other subsystems) but this will probably take a lot of time.
 
  Regards,
  Rami Rosen
  http://ramirose.wix.com/ramirosen
 
 
  On Wed, Jan 30, 2013 at 5:44 PM, shubham kernel.shub...@gmail.com wrote:
 
  Thanks for sharing the document.
 
  I hope we could have such documents for other subsystems as well.
 
  Regards
  Shubham
 
 
  On 28-Jan-13 10:23 PM, Rami Rosen wrote:
 
  Hi everyone,
  You can find here an up to date and detailed document in pdf (178
  pages) about Linux Kernel Networking; going deep into design and
  implementation details as well as the theory behind it:
  http://media.wix.com/ugd//295986_931b8bcf34d93419d46e05b5aa5d0216.pdf
 
  I believe that developers/sysadmins/researchers/students may find help
  with it.
 
 
  regards,
  Rami Rosen
 
  http://ramirose.wix.com/ramirosen
 
  ___
  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
  ___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Linux Kernel Networking document (free, 178 pages doc)

2013-01-31 Thread shubham
Thanks Rami,

I am also trying to understand ext3 and write some document for the same.

Regards
Shubham

On 31-Jan-13 12:51 AM, Rami Rosen wrote:
 HI,
 I will try to write something for Linux Filesystems  (and maybe for
 other subsystems) but this will probably take a lot of time.

 Regards,
 Rami Rosen
 http://ramirose.wix.com/ramirosen


 On Wed, Jan 30, 2013 at 5:44 PM, shubham kernel.shub...@gmail.com wrote:
 Thanks for sharing the document.

 I hope we could have such documents for other subsystems as well.

 Regards
 Shubham


 On 28-Jan-13 10:23 PM, Rami Rosen wrote:
 Hi everyone,
 You can find here an up to date and detailed document in pdf (178
 pages) about Linux Kernel Networking; going deep into design and
 implementation details as well as the theory behind it:
 http://media.wix.com/ugd//295986_931b8bcf34d93419d46e05b5aa5d0216.pdf

 I believe that developers/sysadmins/researchers/students may find help
 with it.


 regards,
 Rami Rosen

 http://ramirose.wix.com/ramirosen

 ___
 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: Linux Kernel Networking document (free, 178 pages doc)

2013-01-31 Thread Rami Rosen
Hi,
Have you considered to start with ext4?
it seems that ext3, ext2 are a bit out of fashion,

Regards,
Rami Rosen
http://ramirose.wix.com/ramirosen


On Thu, Jan 31, 2013 at 8:58 PM, shubham kernel.shub...@gmail.com wrote:
 Thanks Rami,

 I am also trying to understand ext3 and write some document for the same.

 Regards
 Shubham


 On 31-Jan-13 12:51 AM, Rami Rosen wrote:

 HI,
 I will try to write something for Linux Filesystems  (and maybe for
 other subsystems) but this will probably take a lot of time.

 Regards,
 Rami Rosen
 http://ramirose.wix.com/ramirosen


 On Wed, Jan 30, 2013 at 5:44 PM, shubham kernel.shub...@gmail.com wrote:

 Thanks for sharing the document.

 I hope we could have such documents for other subsystems as well.

 Regards
 Shubham


 On 28-Jan-13 10:23 PM, Rami Rosen wrote:

 Hi everyone,
 You can find here an up to date and detailed document in pdf (178
 pages) about Linux Kernel Networking; going deep into design and
 implementation details as well as the theory behind it:
 http://media.wix.com/ugd//295986_931b8bcf34d93419d46e05b5aa5d0216.pdf

 I believe that developers/sysadmins/researchers/students may find help
 with it.


 regards,
 Rami Rosen

 http://ramirose.wix.com/ramirosen

 ___
 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: Linux Kernel Networking document (free, 178 pages doc)

2013-01-30 Thread 卜晖
Thank you for sharing!


2013/1/29 Rami Rosen roszenr...@gmail.com

 Hi everyone,
 You can find here an up to date and detailed document in pdf (178
 pages) about Linux Kernel Networking; going deep into design and
 implementation details as well as the theory behind it:
 http://media.wix.com/ugd//295986_931b8bcf34d93419d46e05b5aa5d0216.pdf

 I believe that developers/sysadmins/researchers/students may find help
 with it.


 regards,
 Rami Rosen

 http://ramirose.wix.com/ramirosen

 ___
 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: Linux Kernel Networking document (free, 178 pages doc)

2013-01-30 Thread shubham
Thanks for sharing the document.

I hope we could have such documents for other subsystems as well.

Regards
Shubham

On 28-Jan-13 10:23 PM, Rami Rosen wrote:
 Hi everyone,
 You can find here an up to date and detailed document in pdf (178
 pages) about Linux Kernel Networking; going deep into design and
 implementation details as well as the theory behind it:
 http://media.wix.com/ugd//295986_931b8bcf34d93419d46e05b5aa5d0216.pdf

 I believe that developers/sysadmins/researchers/students may find help with 
 it.


 regards,
 Rami Rosen

 http://ramirose.wix.com/ramirosen

 ___
 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: Linux Kernel Networking document (free, 178 pages doc)

2013-01-30 Thread Rami Rosen
HI,
I will try to write something for Linux Filesystems  (and maybe for
other subsystems) but this will probably take a lot of time.

Regards,
Rami Rosen
http://ramirose.wix.com/ramirosen


On Wed, Jan 30, 2013 at 5:44 PM, shubham kernel.shub...@gmail.com wrote:
 Thanks for sharing the document.

 I hope we could have such documents for other subsystems as well.

 Regards
 Shubham


 On 28-Jan-13 10:23 PM, Rami Rosen wrote:

 Hi everyone,
 You can find here an up to date and detailed document in pdf (178
 pages) about Linux Kernel Networking; going deep into design and
 implementation details as well as the theory behind it:
 http://media.wix.com/ugd//295986_931b8bcf34d93419d46e05b5aa5d0216.pdf

 I believe that developers/sysadmins/researchers/students may find help
 with it.


 regards,
 Rami Rosen

 http://ramirose.wix.com/ramirosen

 ___
 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: Linux kernel book

2013-01-30 Thread Sumeet pawnikar
On Thu, Jan 31, 2013 at 11:55 AM, Rahul Bedarkar rpal...@gmail.com wrote:

 Hi,

 Can you suggest book on Linux kernel and device drivers which covers
 kernel version 3.0 on words?


Linux kernel is changing fast in bits and pieces. I feel most of the books
published at least a year ago will be partly out of sync with the latest
kernel source code. Personally, I suggest two books which I find most
helpful:

[1] Understanding the Linux Kernel, 3rd Edition
[2] Essential Linux Device Drivers
[3] Linux Kernel Development, 3rd Edition

Also, Linux Cross Reference http://lxr.linux.no/ helps in tracking kernel
sources across most of the kernel versions.


 Thanks,
 Rahul B.

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


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


Re: Linux Kernel Networking document (free, 178 pages doc)

2013-01-28 Thread Román
El 28/01/13 17:53, Rami Rosen escribió:
 Hi everyone,
 You can find here an up to date and detailed document in pdf (178
 pages) about Linux Kernel Networking; going deep into design and
 implementation details as well as the theory behind it:
 http://media.wix.com/ugd//295986_931b8bcf34d93419d46e05b5aa5d0216.pdf

 I believe that developers/sysadmins/researchers/students may find help with 
 it.


 regards,
 Rami Rosen

 http://ramirose.wix.com/ramirosen

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

Thank you for share it. It seem very interesting.

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


Re: Linux Kernel Networking document (free, 178 pages doc)

2013-01-28 Thread Thiago Peixoto
Great! Thank you!

2013/1/28 Román ro...@mailoo.org

 El 28/01/13 17:53, Rami Rosen escribió:
  Hi everyone,
  You can find here an up to date and detailed document in pdf (178
  pages) about Linux Kernel Networking; going deep into design and
  implementation details as well as the theory behind it:
  http://media.wix.com/ugd//295986_931b8bcf34d93419d46e05b5aa5d0216.pdf
 
  I believe that developers/sysadmins/researchers/students may find help
 with it.
 
 
  regards,
  Rami Rosen
 
  http://ramirose.wix.com/ramirosen
 
  ___
  Kernelnewbies mailing list
  Kernelnewbies@kernelnewbies.org
  http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

 Thank you for share it. It seem very interesting.

 ___
 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: Linux Kernel Networking document (free, 178 pages doc)

2013-01-28 Thread Anuz Pratap Singh Tomar
On Mon, Jan 28, 2013 at 4:53 PM, Rami Rosen roszenr...@gmail.com wrote:

 Hi everyone,
 You can find here an up to date and detailed document in pdf (178
 pages) about Linux Kernel Networking; going deep into design and
 implementation details as well as the theory behind it:
 http://media.wix.com/ugd//295986_931b8bcf34d93419d46e05b5aa5d0216.pdf

 I believe that developers/sysadmins/researchers/students may find help
 with it.


 regards,
 Rami Rosen

 http://ramirose.wix.com/ramirosen

 __

very well done! thank you for sharing.

 _
 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: Linux Kernel Networking document (free, 178 pages doc)

2013-01-28 Thread Mandeep Sandhu
On Mon, Jan 28, 2013 at 10:23 PM, Rami Rosen roszenr...@gmail.com wrote:
 Hi everyone,
 You can find here an up to date and detailed document in pdf (178
 pages) about Linux Kernel Networking; going deep into design and
 implementation details as well as the theory behind it:
 http://media.wix.com/ugd//295986_931b8bcf34d93419d46e05b5aa5d0216.pdf

Thanks for your effort Rami. Really appreciate it.

Regards,
-mandeep



 I believe that developers/sysadmins/researchers/students may find help with 
 it.


 regards,
 Rami Rosen

 http://ramirose.wix.com/ramirosen

 ___
 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: Linux Kernel Networking document (free, 178 pages doc)

2013-01-28 Thread Mulyadi Santosa
On Mon, Jan 28, 2013 at 11:53 PM, Rami Rosen roszenr...@gmail.com wrote:
 Hi everyone,
 You can find here an up to date and detailed document in pdf (178
 pages) about Linux Kernel Networking; going deep into design and
 implementation details as well as the theory behind it:

Rami, I really appreciate your open publication. Thumbs up!

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com

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


Re: Linux Kernel Map

2013-01-09 Thread richard -rw- weinberger
On Wed, Jan 9, 2013 at 2:25 PM, Peter Teoh htmldevelo...@gmail.com wrote:
 http://www.makelinux.net/kernel_map/

This map is horrible outdated.
I see lock_kernel() for example...

-- 
Thanks,
//richard

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


  1   2   >