RE: Learning things

2015-04-06 Thread Jeff Haran
-Original Message-
From: kernelnewbies-boun...@kernelnewbies.org 
[mailto:kernelnewbies-boun...@kernelnewbies.org] On Behalf Of Joris Bolsens
Sent: Monday, April 06, 2015 10:07 AM
To: valdis.kletni...@vt.edu
Cc: kernelnewbies@kernelnewbies.org
Subject: Re: Learning things

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

In that case do you have any general recommendations? Or is there some sort of 
project that covers most of the basics? I learn best by doing and most stuff I 
found online goes pretty slow and is a bit boring :/

Thanks a ton

On 04/06/2015 10:02 AM, valdis.kletni...@vt.edu wrote:
 On Mon, 06 Apr 2015 10:43:46 -0700, Joris Bolsens said:
 
 I'm working on trying to teach myself C and was wondering if you had 
 any kernel specific recommendations.
 
 Don't bother trying until you have an actual good working knowledge of 
 C.
 
 Work in userspace where your screw-ups just take the process out, not 
 the entire system, until stuff like a SIGSEGV becomes a rarity.
 *THEN* start considering kernel work.
 

A google search on open source projects written in c yielded this:

http://www.quora.com/What-are-open-source-projects-that-are-written-in-C-C++-are-easy-to-contribute-to

Jeff Haran


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


Re: Learning things

2015-04-06 Thread Greg KH
On Mon, Apr 06, 2015 at 10:43:46AM -0700, Joris Bolsens wrote:
 Hey list,
 
 I'm working on trying to teach myself C and was wondering if you had any
 kernel specific recommendations. I started the eudyptula challenge but
 so far it seems to be mostly learning the standards and whatnot. Are
 there any kernel/C books or online tutorials you guys think would help?

Don't learn C with kernel code, please take a few years really learning
the language in userspace, with one of the other thousands of other
userspace programs that could use help that are written in C.

Good luck,

greg k-h

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


Re: Learning things

2015-04-06 Thread Mike Thompson
 I'm working on trying to teach myself C and was wondering if you had any
 kernel specific recommendations. I started the eudyptula challenge but
 so far it seems to be mostly learning the standards and whatnot. Are
 there any kernel/C books or online tutorials you guys think would help?

As others mention, using the Linux kernel to come up to speed with C is the
wrong approach.  If you have a strong desire to learn kernel programming
concepts while coming up to speed on C, I would suggest getting the latest
book on Xinu, buying an Intel Galileo board and working your way through
that book.  Xinu is what I cut my teeth on 25 years ago and I remember it
being a terrific learning environment.  Xinu is not Linux (or Unix), but
for starting at the ground level all the concepts will map over when you
are ready to tackle Linux kernel work.

Information for Xinu can be found here: http://www.xinu.cs.purdue.edu/

Good luck on your learning...

Mike Thompson


On Mon, Apr 6, 2015 at 10:17 AM, Greg KH g...@kroah.com wrote:

 On Mon, Apr 06, 2015 at 10:43:46AM -0700, Joris Bolsens wrote:
  Hey list,
 
  I'm working on trying to teach myself C and was wondering if you had any
  kernel specific recommendations. I started the eudyptula challenge but
  so far it seems to be mostly learning the standards and whatnot. Are
  there any kernel/C books or online tutorials you guys think would help?

 Don't learn C with kernel code, please take a few years really learning
 the language in userspace, with one of the other thousands of other
 userspace programs that could use help that are written in C.

 Good luck,

 greg k-h

 ___
 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


packet_mmap: How to kernel address from user-space address

2015-04-06 Thread selvamuthukumar v
I'm trying to accelerate snort with a hardware Pattern Matching Engine.
snort gets packets using libpcap which uses packet mmap. snort gets the
mmap-ed address, it does all header parsing, now I want to offload the
content detection to hardware. PME driver currently provides and ioctl
interface to pass the packet. Driver does copy_from_user to get packet data
to kernel and try to match it against pre-loaded contents. I'm trying to
avoid this copy. What is the best way to get the kernel address from user
address in this case?
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


cross-compiling kernel using a 32-bit toolchain on a 64-bit machine

2015-04-06 Thread Mandeep Sandhu
Hi All,

I'm having trouble compiling my kernel using a 32-bit toolchain (for
ARM) on a 64-bit host (Ubuntu 14.10). The kernel version is 3.14.17.

I understand that 32-bit binaries require ia32-libs (or equivalent)
for compiling on 64-bit hosts. I installed the required packages
(lib32z1 lib32ncurses5 lib32bz2-1.0 for Ubuntu 14.10), but still keep
getting errors:

$ make CROSS_COMPILE=arm-none-linux-gnueabi- all
Makefile:616: Cannot use CONFIG_CC_STACKPROTECTOR_REGULAR:
-fstack-protector not supported by compiler
make: arm-none-linux-gnueabi-gcc: Command not found
  CHK include/config/kernel.release
  CHK include/generated/uapi/linux/version.h
  CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
  CC  kernel/bounds.s
/bin/sh: 1: arm-none-linux-gnueabi-gcc: not found
make[1]: *** [kernel/bounds.s] Error 127
make: *** [prepare0] Error 2

I've ensured that the PATH to the toolchain binaries is correct.

If I try to export CROSS_COMPILE to my environment, then too I get an
error (although it's for a different reason):

$ make all
Makefile:616: Cannot use CONFIG_CC_STACKPROTECTOR_REGULAR:
-fstack-protector not supported by compiler
  CHK include/config/kernel.release
  CHK include/generated/uapi/linux/version.h
  CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
  CC  kernel/bounds.s
gcc: error: unrecognized argument in option ‘-mabi=aapcs-linux’
gcc: note: valid arguments to ‘-mabi=’ are: ms sysv
gcc: error: unrecognized command line option ‘-mlittle-endian’
gcc: error: unrecognized command line option ‘-mapcs’
gcc: error: unrecognized command line option ‘-mno-sched-prolog’
gcc: error: unrecognized command line option ‘-mno-thumb-interwork’
gcc: error: unrecognized command line option ‘-mfpu=vfp’
make[1]: *** [kernel/bounds.s] Error 1
make: *** [prepare0] Error 2

It looks like make is starting a new shell which does not have either
PATH (1st case) or  CROSS_COMPILE (2nd case) set.

Any hints on how to get make to use the toolchain?

Thanks,
-mandeep

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


Re: Learning things

2015-04-06 Thread Joris Bolsens
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Thanks for the suggestions,
I'll look into those, hopefully ill find something I can help out with
and learn at the same time xD

- -Joris
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQIcBAEBCAAGBQJVIxJCAAoJEORnMHMHY2Frq1IP/21ZJWUnTseYFnD1HOaDgGmo
MQSEqHdNKS07aWffsRNyndGo2ht7niM4K0g7yhUJMbPi9ek+tsU5sC1WOXvCXSFF
HrIlbZzbFWmhzHag3G5gD2QHZ93FslwhZrWzI/N+C0wQ11e1ekTtJ7ZLDHIdXXvz
GemFehrPw28OebyJChCnuNfBsqw8zP6O7r3TaWo2iWmcnI3hZDdZbtTSewypBuxd
mkKlvCkQ9HQM3VKeBbVzHtyS5ok0/3pIIh2GNHzORTqasKCz5dIlTCefzujOkaOp
E8ooy5v0i8nDIEmLogWm0xY4p/bu+df8OmAgjtpRLvv2d0+VrCZ7Eg6hUYpTTG6p
NP8ADVAljWYePnE9l+US6rEiA9CmXvqHQ1SB9xI2dVGlBckpGV0hSMGr5Q3WgOaC
UFWbWr//PU0Asx5AAcnYr7p8O/iBj/3hB6lWBAFVMikoBo/cOa8D9qkf9e4G6l16
obgwP0e7JtExJWP3FLFYft2uPKn0SLr1SCFfeB4soTjju+t0NqrWwxaZFSDUatMj
dZo64K4XPRgOZD64royXnh1UroDmEVyyJLob/4Q7jnL+PPw8+M0LgHQ9fDrIJt5O
J23b2Q+VQiF0Dnn1VDolYBaWLg53lb5VGW4iutwtr9NjKZQj93ujfNklyD8a6hUy
YWtFegGEjHZ5h7fwONjT
=cU/x
-END PGP SIGNATURE-

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


Re: cross-compiling kernel using a 32-bit toolchain on a 64-bit machine

2015-04-06 Thread John de la Garza
On Mon, Apr 06, 2015 at 03:50:41PM -0700, Mandeep Sandhu wrote:
 
 I'm having trouble compiling my kernel using a 32-bit toolchain (for
 ARM) on a 64-bit host (Ubuntu 14.10). The kernel version is 3.14.17.
 
 Any hints on how to get make to use the toolchain?
 

after you export CROSS_COMPILE export ARCH=arm





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


VFS/driver core overhead

2015-04-06 Thread nick
Greetings All,
After reading through the code for the usb and vfs core infrastructure, I was 
wondering if 
after reading it if I am correct in my notion of there being very little 
overhead or none
at all int these areas of the kernel. This is due to be noticing most drivers 
and file 
systems wrap around the core/vfs and therefore the overhead is very little and 
no need
to worry about it like the overhead of the kernel's process structures based 
off task_struct
.Honestly, I could benchmark this area of the kernel but it's hard to remove 
the file 
system/drivers interfering with my benchmarks due to me not knowing of any one 
way to do that.
If someone either points me to a benchmark for me to test this or answers it 
that would be
very helpful.
Thanks,
Nick

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


Re: Learning things

2015-04-06 Thread Anupam Kapoor

 [2015-04-07T00:08:10+0530]: Mike Thompson (mike-thompson):
,[ mike-thompson ]
| As others mention, using the Linux kernel to come up to speed with C is the
| wrong approach.  If you have a strong desire to learn kernel programming
| concepts while coming up to speed on C, I would suggest getting the latest
| book on Xinu, buying an Intel Galileo board and working your way through
| that book.  Xinu is what I cut my teeth on 25 years ago and I remember it
| being a terrific learning environment.  Xinu is not Linux (or Unix), but
| for starting at the ground level all the concepts will map over when you
| are ready to tackle Linux kernel work.
| 
| Information for Xinu can be found here: http://www.xinu.cs.purdue.edu/
`
or there is always xv6 (http://pdos.csail.mit.edu/6.828/2014/) which
might be useful...

-- 
kind regards
anupam

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


Re: cross-compiling kernel using a 32-bit toolchain on a 64-bit machine

2015-04-06 Thread Rock Lee


On 2015/4/7 6:50, Mandeep Sandhu wrote:
 Hi All,

 I'm having trouble compiling my kernel using a 32-bit toolchain (for
 ARM) on a 64-bit host (Ubuntu 14.10). The kernel version is 3.14.17.

 I understand that 32-bit binaries require ia32-libs (or equivalent)
 for compiling on 64-bit hosts. I installed the required packages
 (lib32z1 lib32ncurses5 lib32bz2-1.0 for Ubuntu 14.10), but still keep
 getting errors:

 $ make CROSS_COMPILE=arm-none-linux-gnueabi- all
 Makefile:616: Cannot use CONFIG_CC_STACKPROTECTOR_REGULAR:
 -fstack-protector not supported by compiler
 make: arm-none-linux-gnueabi-gcc: Command not found
CHK include/config/kernel.release
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
 make[1]: `include/generated/mach-types.h' is up to date.
CC  kernel/bounds.s
 /bin/sh: 1: arm-none-linux-gnueabi-gcc: not found
 make[1]: *** [kernel/bounds.s] Error 127
 make: *** [prepare0] Error 2

 I've ensured that the PATH to the toolchain binaries is correct.

 If I try to export CROSS_COMPILE to my environment, then too I get an
 error (although it's for a different reason):

 $ make all
 Makefile:616: Cannot use CONFIG_CC_STACKPROTECTOR_REGULAR:
 -fstack-protector not supported by compiler
CHK include/config/kernel.release
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
 make[1]: `include/generated/mach-types.h' is up to date.
CC  kernel/bounds.s
 gcc: error: unrecognized argument in option ‘-mabi=aapcs-linux’
 gcc: note: valid arguments to ‘-mabi=’ are: ms sysv
 gcc: error: unrecognized command line option ‘-mlittle-endian’
 gcc: error: unrecognized command line option ‘-mapcs’
 gcc: error: unrecognized command line option ‘-mno-sched-prolog’
 gcc: error: unrecognized command line option ‘-mno-thumb-interwork’
 gcc: error: unrecognized command line option ‘-mfpu=vfp’
 make[1]: *** [kernel/bounds.s] Error 1
 make: *** [prepare0] Error 2

 It looks like make is starting a new shell which does not have either
 PATH (1st case) or  CROSS_COMPILE (2nd case) set.

 Any hints on how to get make to use the toolchain?

 Thanks,
 -mandeep

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

Edit .config and set  CONFIG_CROSS_COMPILE to the path where your cross 
compiler is located.

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


Hurr durr I'ma sheep

2015-04-06 Thread Kaushal Shriyan
Hi,

what does Hurr durr I'ma sheep mean in context to kernel version Linux
4.0?

Regards,

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


Re: Hurr durr I'ma sheep

2015-04-06 Thread Kaushal Shriyan
Thanks Alan for the reply.

Regards,

Kaushal

On Mon, Apr 6, 2015 at 1:01 PM, Alan Braithwaite asbraithwa...@gmail.com
wrote:

 Linus put up a poll for the 4.0 code name on google+

 https://plus.google.com/+LinusTorvalds/posts/TvigQqA9m3w

 That was the result.

 - Alan

 On Mon, Apr 6, 2015 at 12:08 AM, Kaushal Shriyan kaushalshri...@gmail.com
  wrote:

 Hi,

 what does Hurr durr I'ma sheep mean in context to kernel version Linux
 4.0?

 Regards,

 Kaushal

 ___
 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


/sys/module/ info for pci driver

2015-04-06 Thread rahul b
Hi

After loading pci driver for proprietary ethernet card, i dont see the  few
module detail in in
/sys/module/module-name/drivers/pci:module-name/net  .

Can someone tell what APIs should be used to get the ethernet  interface
name , mac address details .

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


RE: /sys/module/ info for pci driver

2015-04-06 Thread Jeff Haran


From: kernelnewbies-bounces+jharan=bytemobile@kernelnewbies.org 
[mailto:kernelnewbies-bounces+jharan=bytemobile@kernelnewbies.org] On 
Behalf Of rahul b
Sent: Monday, April 06, 2015 4:37 AM
To: kernelnewbies@kernelnewbies.org
Subject: /sys/module/ info for pci driver

Hi

After loading pci driver for proprietary ethernet card, i dont see the  few 
module detail in in /sys/module/module-name/drivers/pci:module-name/net  .

Can someone tell what APIs should be used to get the ethernet  interface name , 
mac address details .

Thanks

You probably want to grep/google for rtnetlink. I am pretty sure the iproute2 
ip command uses it to generate output like this:

$ ip link show dev lo
1: lo: LOOPBACK,UP,LOWER_UP mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

Jeff Haran

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


Learning things

2015-04-06 Thread Joris Bolsens
Hey list,

I'm working on trying to teach myself C and was wondering if you had any
kernel specific recommendations. I started the eudyptula challenge but
so far it seems to be mostly learning the standards and whatnot. Are
there any kernel/C books or online tutorials you guys think would help?



signature.asc
Description: OpenPGP digital signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


RE: Learning things

2015-04-06 Thread Jeff Haran
-Original Message-
From: kernelnewbies-boun...@kernelnewbies.org 
[mailto:kernelnewbies-boun...@kernelnewbies.org] On Behalf Of Joris Bolsens
Sent: Monday, April 06, 2015 10:44 AM
To: kernelnewbies@kernelnewbies.org
Subject: Learning things

Hey list,

I'm working on trying to teach myself C and was wondering if you had any 
kernel specific recommendations.

I started the eudyptula challenge but so far it seems to be mostly learning 
the standards and whatnot. Are there any kernel/C books or online tutorials 
you guys think would help?

Well, I have to credit you for jumping into the deep end. 8^)

You might want to get familiar with C in user space first where if you get it 
wrong you have an OS and a memory manager on your side to generate a nice clean 
core file and debuggers like gdb to look at what happened when something goes 
bad. Bugs in the kernel are notorious for being difficult to track down.

Jeff Haran

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


Re: Learning things

2015-04-06 Thread Valdis . Kletnieks
On Mon, 06 Apr 2015 10:43:46 -0700, Joris Bolsens said:

 I'm working on trying to teach myself C and was wondering if you had any
 kernel specific recommendations.

Don't bother trying until you have an actual good working knowledge of C.

Work in userspace where your screw-ups just take the process out, not
the entire system, until stuff like a SIGSEGV becomes a rarity. *THEN*
start considering kernel work.


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


Re: Learning things

2015-04-06 Thread Joris Bolsens
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

In that case do you have any general recommendations? Or is there some
sort of project that covers most of the basics? I learn best by doing
and most stuff I found online goes pretty slow and is a bit boring :/

Thanks a ton

On 04/06/2015 10:02 AM, valdis.kletni...@vt.edu wrote:
 On Mon, 06 Apr 2015 10:43:46 -0700, Joris Bolsens said:
 
 I'm working on trying to teach myself C and was wondering if you
 had any kernel specific recommendations.
 
 Don't bother trying until you have an actual good working knowledge
 of C.
 
 Work in userspace where your screw-ups just take the process out,
 not the entire system, until stuff like a SIGSEGV becomes a rarity.
 *THEN* start considering kernel work.
 
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQIcBAEBCAAGBQJVIr1HAAoJEORnMHMHY2Frm+UP/0moBmxc1KWrMHrSRSkqGlOG
lmiNZh1KJBw51mm8Ye6ML6cQlUyiA4XBe7vBnt/zJ0exou0hTDgHBFfXddXjnPyr
687HYOxH8uKymXh3qHTRxI8tjbnOUHdwXtzjOBxms62FNKmkvdnvbkDF0PGiu4+c
eqi0eiFZ00DuNntzvkM375+swR1D/BnW44hWGaFv7sEjvREFSgmcYwmjZuFBNn8D
8FoYans5y4vM91+MnEE7A34niuqXgz3ZHUXyTz5ZfB/ZZWQKnaymfU4Yew7pD2og
aP/dwrjmPogg4n21WMJnBG1Aj0b/heXZWzVIknGeQEHzyKJNtoAz5P92EEdyIRTB
ZeGZm8333IpJcQ7VtG0VQMzs8xwJ889fo7Prp0c/pxDgsUqy2AaWSiKhMXhy5Yzy
6Dq4uYZWZehOf99tZxl21+eadMeYokBvyvpBQPZqeKw4V1J90tg9D7stXrszLlwZ
cxFxp/1xeHTcy45yJ8L9klVnIaZCqLu7DFej/fI5I0xhRokDz+ArmP7BqxgMCaAg
vYrBqDEdTSvyJZn+6tQ6KZFGJGhavbkbvSMgmzbv/NS1mzMZ17sM6xoyNeC/DHkZ
keeypFtW/u8b96cNDTqLl9wWI7wYudaeH9d5XnpAGmyUldApMAkmEyKXykSmdbwq
W0jRXuJpwmCxftmD/qBu
=TUgV
-END PGP SIGNATURE-

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