kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* Need Suggestions
@ 2018-07-14 16:04 Athul Joy
  2018-07-14 16:27 ` ozgur at goosey.org
                   ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: Athul Joy @ 2018-07-14 16:04 UTC (permalink / raw)
  To: kernelnewbies

Dear friends, I am new to the Linux kernel development.
Can anyone help me how to start my journey in order to build my own kernel?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20180714/6c0102f2/attachment.html>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Need Suggestions
  2018-07-14 16:04 Need Suggestions Athul Joy
@ 2018-07-14 16:27 ` ozgur at goosey.org
  2018-07-14 17:31   ` Cindy-Sue Causey
  2018-07-18  0:35 ` Richard Siegfried
  2018-07-18  4:39 ` inventsekar
  2 siblings, 1 reply; 21+ messages in thread
From: ozgur at goosey.org @ 2018-07-14 16:27 UTC (permalink / raw)
  To: kernelnewbies

An HTML attachment was scrubbed...
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20180714/fe1f9c6c/attachment.html>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Need Suggestions
  2018-07-14 16:27 ` ozgur at goosey.org
@ 2018-07-14 17:31   ` Cindy-Sue Causey
  2018-07-14 18:07     ` ozgur at goosey.org
  0 siblings, 1 reply; 21+ messages in thread
From: Cindy-Sue Causey @ 2018-07-14 17:31 UTC (permalink / raw)
  To: kernelnewbies

On 7/14/18, ozgur at goosey.org <ozgur@goosey.org> wrote:
> 14.07.2018, 20:07, "Athul Joy" <aathuljjoy333@gmail.com>:
>>
>> Dear friends, I am new to the Linux kernel development.
>> Can anyone help me how to start my journey in order to build my own
>> kernel?
>
>
> Hello,
>
> if you want to build a your own kernel then the best way is to be use
> Google. Perhaps you can find thousands of kernel build documents and you can
> ask here if you have an build errors.
>
> So, it's very simple and I share for short information, the kernel is
> written in C code and all code is open source and all C based code can be
> compiled using the appropriated compiler. GCC is good compilers.
>
> Which distro you use?
>
> Downloaded to latest stable kernel to /usr/src directory.
> Un-compressed the linux kernel.
> Copy default .config file to directory.
>
> cp /boot/config-`uname -r`* .config
>
> Note: You may need to ncurses library.
>
> Run make menuconfig and check kernel parameters.
>
> Run make -j 4 and make modules and make modules_install and make install
> command.
>
> Please check to /boot directory:
>
> vmlinuz - this is a kernel
> System.map - this is a kernel symbols file
> initramfs - initrd image
> Config - Kernel config file
>
> Please read: https://kernelnewbies.org/KernelBuild


I (also) learned about "Linux From Scratch" (LFS) from KernelNewbies:

https://kernelnewbies.org/RelatedSites

I've been playing with computers since ~1994, but I have degenerating
cognitive issues that keep me functioning as a perpetual, capable
newbie. Linux From Scratch is written in such a way that I've been
able to follow along those times I've... remembered to stop and play
with it. I thank its author(s) for that! :)

Cindy :)
-- 
Cindy-Sue Causey
Talking Rock, Pickens County, Georgia, USA

* runs with duct tape *

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Need Suggestions
  2018-07-14 17:31   ` Cindy-Sue Causey
@ 2018-07-14 18:07     ` ozgur at goosey.org
  2018-07-15 13:39       ` valdis.kletnieks at vt.edu
  0 siblings, 1 reply; 21+ messages in thread
From: ozgur at goosey.org @ 2018-07-14 18:07 UTC (permalink / raw)
  To: kernelnewbies

An HTML attachment was scrubbed...
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20180714/1043c837/attachment.html>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Need Suggestions
  2018-07-14 18:07     ` ozgur at goosey.org
@ 2018-07-15 13:39       ` valdis.kletnieks at vt.edu
  0 siblings, 0 replies; 21+ messages in thread
From: valdis.kletnieks at vt.edu @ 2018-07-15 13:39 UTC (permalink / raw)
  To: kernelnewbies

On Sat, 14 Jul 2018 22:07:12 +0400, ozgur at goosey.org said:

> LFS is a good places to prepare a new linux distribution and have fun as you
> talk about :)

Note that *building* a LFS system is a bit of work.

Properly *maintaining* an LFS system is an ongoing *ton* of work.  Basically,
you end up maintaining your own distro - which means you need to keep up
to date on security issues on a per-program basis, and backport patches
when you discover problems with shared library mismatches..

For example:  Look at how many programs on your system use OpenSSL.
There's been more than a few security issues with it - and if the fix is "update
to the next release", you get to figure out what needs to be patched to use
the next version if there's an API change, or backport the OpenSSL fix for
the packages that haven't upgraded upstream to use the new OpenSSL API...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 486 bytes
Desc: not available
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20180715/1a0d19b4/attachment.sig>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Need Suggestions
  2018-07-14 16:04 Need Suggestions Athul Joy
  2018-07-14 16:27 ` ozgur at goosey.org
@ 2018-07-18  0:35 ` Richard Siegfried
  2018-07-18  0:43   ` Richard Siegfried
  2018-07-18  4:10   ` Dave Stevens
  2018-07-18  4:39 ` inventsekar
  2 siblings, 2 replies; 21+ messages in thread
From: Richard Siegfried @ 2018-07-18  0:35 UTC (permalink / raw)
  To: kernelnewbies

On 14/07/18 18:04, Athul Joy wrote:
> Dear friends, I am new to the Linux kernel development.
> Can anyone help me how to start my journey in order to build my own kernel?
> 
For me the debian kernel handbook was a great help especially chapter 4
and section 4.6.
(https://kernel-team.pages.debian.net/kernel-handbook/ch-common-tasks.html#s-kernel-org-package)

There also is a book from greg kroah hartmann about building your own
kernel that has a good reputation.

And I would recommend to start conservative, which means don't try out
too many new/changed kernel options at once. Start with "make oldconfig"
or even "make oldconfig". (If you don't know these two start with "make
help"). You can always read about new kernel options and features inside
the "make menuconfig" application with pressing "?"

Thanks,
-- Richard

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20180718/2596ecb7/attachment.sig>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Need Suggestions
  2018-07-18  0:35 ` Richard Siegfried
@ 2018-07-18  0:43   ` Richard Siegfried
  2018-07-18  4:10   ` Dave Stevens
  1 sibling, 0 replies; 21+ messages in thread
From: Richard Siegfried @ 2018-07-18  0:43 UTC (permalink / raw)
  To: kernelnewbies

On 18/07/18 02:35, Richard Siegfried wrote:
> or even "make oldconfig". (If you don't know these two start with "make
                ^^^^^^^^^ should be olddefconfig

Both copy the .config file of your current running kernel and use that
as a basis

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20180718/8fb3c4a1/attachment-0001.sig>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Need Suggestions
  2018-07-18  0:35 ` Richard Siegfried
  2018-07-18  0:43   ` Richard Siegfried
@ 2018-07-18  4:10   ` Dave Stevens
  2018-07-18  4:41     ` valdis.kletnieks at vt.edu
  1 sibling, 1 reply; 21+ messages in thread
From: Dave Stevens @ 2018-07-18  4:10 UTC (permalink / raw)
  To: kernelnewbies

On Wed, 18 Jul 2018 02:35:09 +0200
Richard Siegfried <richard_siegfried@systemli.org> wrote:

> On 14/07/18 18:04, Athul Joy wrote:
> > Dear friends, I am new to the Linux kernel development.
> > Can anyone help me how to start my journey in order to build my own
> > kernel? 
> For me the debian kernel handbook was a great help especially chapter
> 4 and section 4.6.
> (https://kernel-team.pages.debian.net/kernel-handbook/ch-common-tasks.html#s-kernel-org-package)
> 
> There also is a book from greg kroah hartmann about building your own
> kernel that has a good reputation.
> 
> And I would recommend to start conservative, which means don't try out
> too many new/changed kernel options at once. Start with "make
> oldconfig" or even "make oldconfig". (If you don't know these two
> start with "make help"). 

$ make help
make: *** No rule to make target 'help'.  Stop.

d


You can always read about new kernel options
> and features inside the "make menuconfig" application with pressing
> "?"
> 
> Thanks,
> -- Richard
> 



-- 
In modern fantasy (literary or governmental), killing people is the
usual solution to the so-called war between good and evil. My books are
not conceived in terms of such a war, and offer no simple answers to
simplistic questions.

----- Ursula Le Guin

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Need Suggestions
  2018-07-14 16:04 Need Suggestions Athul Joy
  2018-07-14 16:27 ` ozgur at goosey.org
  2018-07-18  0:35 ` Richard Siegfried
@ 2018-07-18  4:39 ` inventsekar
  2018-07-18 21:19   ` Daniel.
  2018-07-25 21:37   ` Himanshu Jha
  2 siblings, 2 replies; 21+ messages in thread
From: inventsekar @ 2018-07-18  4:39 UTC (permalink / raw)
  To: kernelnewbies

Hi Athul...
This is my collegemate's writing, ... This will solve all your
confusions....

---

The most important quality that you need to inculcate if you want to do any
kernel space programming is "Patience" (or persistence if you will). Though
it is a good quality for any large scale project, it is a fundamental
requirement for kernel programming. It is very easy to see progress and
make an impact on userspace projects, but even simple changes in the kernel
core will take a lot of time to get accepted, and will often require
multiple rewrites. But fear not, as there are plenty of people who have
conquered this mountain and it is not something to be worried about.

The starting steps will be:

1) Try to understand how to use git <http://git-scm.com/>. We were (are ?)
not taught to use a version control system in our college and it is such a
fundamental thing. So start using git for college assignments and get the
hang of it.

2) Start writing a lot of C programs and get experienced with pointers,
memory allocation, threading. You can start implementing things like Stack,
Queue, Trees etc. (whatever you study in datastructures) in a simple,
thread-safe way. Do not focus on how you can visualize these datastructures
but how you can effectively implement their functionality and thread
safety. Use pthreads for threading. Do not use any library (like Glib) for
giving you convenient datastructures (like Strings). Implement each of the
things on your own. (But when you are writing code for a product, use a
standard library always instead of re-inventing the wheel)

Write these C programs on Linux and compile using gcc. In our college days
we were using turboc on windows and I hope things have changed. Use a linux
distro (fedora <http://fedoraproject.org/>, debian <https://www.debian.org/>
, openSUSE <http://en.opensuse.org/>, Gentoo <https://www.gentoo.org/> etc.)
exclusively; Do not use Windows (at least for a while) to make yourself
aware of the sysadmin, shell-scripting parts of linux, which will come in
handy.

3) Grab a (any) book on Operating Systems theory and read it. The dinosaur
book <http://en.wikipedia.org/wiki/Operating_System_Concepts> by
Silberschatz et. al. is a good start.

4) Without hesitation buy, Robert Love's Linux Kernel Programming
<http://www.amazon.com/gp/product/0672329468/> book. It is one of the best
beginner material and start reading it parallel to the OS book. This is
easier to read than the previous one and more practical. But the previous
one adds more value and is more theoretical. Handle (3) and (4) in parallel
without blocking on any of the other activities.

5) After you are done with (1) and (2), and feel sufficiently confident
with C and pointers, grab the  linux kernel sources from
http://git.kernel.org/ and try to build the sources yourself.
http://kernelnewbies.org/KernelBuild should help. Learn how to install and
boot with the kernel that you have built.

6.1) Subscribe to Kernel Newbies mailing list
http://kernelnewbies.org/MailingList and read every mail, *even* if you do
not understand most of it.

6.2) Watch: https://www.youtube.com/watch?v=LLBrBBImJt4

6.3) Subscribe to http://lwn.net RSS feeds.

After this, you should be able to fix and send any trivial, documentation,
staging fixes. Once you have done this and get the hang of the process, you
will know how to send patches for any parts of the kernel.

By this time, you would have found your areas of interest in kernel
(filesystems, memory management, io scheduler, CPU scheduling etc.). You
will then have to dig deeper in those particular areas, by:
a) subscribing to the individual mailing lists (such as fs-devel
<http://marc.info/?l=linux-fsdevel>, etc.)
b) reading about the bug reports for the individual component
c) finding the literature that is relevant for your subsystem (The linux
memory management book
<https://www.kernel.org/doc/gorman/pdf/understand.pdf>Mel Gorman, etc).

Three other non-technical things that I would recommend are:

1) Create a new email address and use that for all your open source
activities. That way you do not miss any important updates from your
friends.

2) Kernel programming will not give you big money in the short and medium
term (at least in India). If your motivation is not excellence in
engineering, but becoming popular or rich (it is not wrong btw) then you
should focus on some other areas of programming (developing apps, websites,
solving user problems, making meaning etc.).

It will often take months (or even years) before you make a significant
contribution that is not merely a memory leak or bug fix. Be prepared for
that. But since you have age, energy, time (once you get married and/or
have kids you will understand) on your side, it is not that difficult.

Many people try kernel programming and then quit because they do not have
the patience and perseverance. It may also happen that they have found a
more interesting technology at its nascent stage (like Distributed
Computing, Artificial Intelligence, Containers, NLP etc.) It is not wrong
to quit midway :) Any little time spent on kernel programming will
immensely benefit you as a programmer even when you are doing user space
programming. This holds good for not just kernel programming but any
large-code-base/system programming (like Compilers, glibc, webkit, chrome,
firefox etc.)

3) Be more aware of the GSoC community in colleges around you.

All the best.

On Sat 14 Jul, 2018, 9:36 PM Athul Joy, <aathuljjoy333@gmail.com> wrote:

> Dear friends, I am new to the Linux kernel development.
> Can anyone help me how to start my journey in order to build my own
> kernel?
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20180718/b4994b27/attachment-0001.html>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Need Suggestions
  2018-07-18  4:10   ` Dave Stevens
@ 2018-07-18  4:41     ` valdis.kletnieks at vt.edu
  2018-07-18  5:00       ` Dave Stevens
  0 siblings, 1 reply; 21+ messages in thread
From: valdis.kletnieks at vt.edu @ 2018-07-18  4:41 UTC (permalink / raw)
  To: kernelnewbies

On Tue, 17 Jul 2018 21:10:05 -0700, Dave Stevens said:

> $ make help
> make: *** No rule to make target 'help'.  Stop.

Were you cd'ed into the directory that had the base of the kernel source tree?

Hint: the directory should look something like this:

[/usr/src/linux-next] ls
COPYING        Module.symvers  certs	 kernel		    patches	      signing_key.x509	vmlinux.o
CREDITS        Next	       crypto	 lib		    reverts	      sound		x509.genkey
Documentation  README	       drivers	 localversion-next  samples	      tags
Kbuild	       System.map      firmware  mm		    sched.h.patch     tools
Kconfig        arch	       fs	 modules.builtin    scripts	      usr
LICENSES       block	       include	 modules.order	    security	      virt
MAINTAINERS    build.default   init	 net		    signing_key.pem   vmlinux
Makefile       built-in.a      ipc	 null.dwo	    signing_key.priv  vmlinux-gdb.py

(Some files won't be there until you have a successful build - but the COPYING,
CREDITS, and MAINTAINERS files should be there.  If they aren't there, you're
in the wrong directory....
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 486 bytes
Desc: not available
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20180718/78b77064/attachment.sig>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Need Suggestions
  2018-07-18  4:41     ` valdis.kletnieks at vt.edu
@ 2018-07-18  5:00       ` Dave Stevens
  0 siblings, 0 replies; 21+ messages in thread
From: Dave Stevens @ 2018-07-18  5:00 UTC (permalink / raw)
  To: kernelnewbies

On Wed, 18 Jul 2018 00:41:56 -0400
valdis.kletnieks at vt.edu wrote:

> Were you cd'ed into the directory that had the base of the kernel
> source tree?

I wasn't. I also suggest make help | less

Thanks,

Dave

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Need Suggestions
  2018-07-18  4:39 ` inventsekar
@ 2018-07-18 21:19   ` Daniel.
  2018-07-18 21:29     ` Dave Stevens
  2018-07-25 21:37   ` Himanshu Jha
  1 sibling, 1 reply; 21+ messages in thread
From: Daniel. @ 2018-07-18 21:19 UTC (permalink / raw)
  To: kernelnewbies

2018-07-18 1:39 GMT-03:00 inventsekar <inventsekar@gmail.com>:

> Hi Athul...
> This is my collegemate's writing, ... This will solve all your
> confusions....
>
> ---
>
> The most important quality that you need to inculcate if you want to do
> any kernel space programming is "Patience" (or persistence if you will).
> Though it is a good quality for any large scale project, it is a
> fundamental requirement for kernel programming. It is very easy to see
> progress and make an impact on userspace projects, but even simple changes
> in the kernel core will take a lot of time to get accepted, and will often
> require multiple rewrites. But fear not, as there are plenty of people who
> have conquered this mountain and it is not something to be worried about.
>
> The starting steps will be:
>
> 1) Try to understand how to use git <http://git-scm.com/>. We were (are
> ?) not taught to use a version control system in our college and it is such
> a fundamental thing. So start using git for college assignments and get the
> hang of it.
>
> 2) Start writing a lot of C programs and get experienced with pointers,
> memory allocation, threading. You can start implementing things like Stack,
> Queue, Trees etc. (whatever you study in datastructures) in a simple,
> thread-safe way. Do not focus on how you can visualize these datastructures
> but how you can effectively implement their functionality and thread
> safety. Use pthreads for threading. Do not use any library (like Glib) for
> giving you convenient datastructures (like Strings). Implement each of the
> things on your own. (But when you are writing code for a product, use a
> standard library always instead of re-inventing the wheel)
>
> Write these C programs on Linux and compile using gcc. In our college days
> we were using turboc on windows and I hope things have changed. Use a linux
> distro (fedora <http://fedoraproject.org/>, debian
> <https://www.debian.org/>, openSUSE <http://en.opensuse.org/>, Gentoo
> <https://www.gentoo.org/> etc.) exclusively; Do not use Windows (at least
> for a while) to make yourself aware of the sysadmin, shell-scripting parts
> of linux, which will come in handy.
>
> 3) Grab a (any) book on Operating Systems theory and read it. The dinosaur
> book <http://en.wikipedia.org/wiki/Operating_System_Concepts> by
> Silberschatz et. al. is a good start.
>
> 4) Without hesitation buy, Robert Love's Linux Kernel Programming
> <http://www.amazon.com/gp/product/0672329468/> book. It is one of the
> best beginner material and start reading it parallel to the OS book. This
> is easier to read than the previous one and more practical. But the
> previous one adds more value and is more theoretical. Handle (3) and (4) in
> parallel without blocking on any of the other activities.
>
I can confirm, this book is GOOOOOOD! Also check LDD3,  it's open and
online available, you may find some of it's authors in this mailist! :-).
http://www.makelinux.net/ldd3/ it's a outdated but it was a very valuable
source to me. You can find the examples updated on the internet.

>
>
> 5) After you are done with (1) and (2), and feel sufficiently confident
> with C and pointers, grab the  linux kernel sources from
> http://git.kernel.org/ and try to build the sources yourself. http://
> kernelnewbies.org/KernelBuild should help. Learn how to install and boot
> with the kernel that you have built.
>
> 6.1) Subscribe to Kernel Newbies mailing list http://kernelnewbies.org/
> MailingList and read every mail, *even* if you do not understand most of
> it.
>
> 6.2) Watch: https://www.youtube.com/watch?v=LLBrBBImJt4
>
> 6.3) Subscribe to http://lwn.net RSS feeds.
>
> After this, you should be able to fix and send any trivial, documentation,
> staging fixes. Once you have done this and get the hang of the process, you
> will know how to send patches for any parts of the kernel.
>
> By this time, you would have found your areas of interest in kernel
> (filesystems, memory management, io scheduler, CPU scheduling etc.). You
> will then have to dig deeper in those particular areas, by:
> a) subscribing to the individual mailing lists (such as fs-devel
> <http://marc.info/?l=linux-fsdevel>, etc.)
> b) reading about the bug reports for the individual component
> c) finding the literature that is relevant for your subsystem (The linux
> memory management book
> <https://www.kernel.org/doc/gorman/pdf/understand.pdf>Mel Gorman, etc).
>
> Three other non-technical things that I would recommend are:
>
> 1) Create a new email address and use that for all your open source
> activities. That way you do not miss any important updates from your
> friends.
>
> 2) Kernel programming will not give you big money in the short and medium
> term (at least in India). If your motivation is not excellence in
> engineering, but becoming popular or rich (it is not wrong btw) then you
> should focus on some other areas of programming (developing apps, websites,
> solving user problems, making meaning etc.).
>
> It will often take months (or even years) before you make a significant
> contribution that is not merely a memory leak or bug fix. Be prepared for
> that. But since you have age, energy, time (once you get married and/or
> have kids you will understand) on your side, it is not that difficult.
>
> Many people try kernel programming and then quit because they do not have
> the patience and perseverance. It may also happen that they have found a
> more interesting technology at its nascent stage (like Distributed
> Computing, Artificial Intelligence, Containers, NLP etc.) It is not wrong
> to quit midway :) Any little time spent on kernel programming will
> immensely benefit you as a programmer even when you are doing user space
> programming. This holds good for not just kernel programming but any
> large-code-base/system programming (like Compilers, glibc, webkit, chrome,
> firefox etc.)
>
> 3) Be more aware of the GSoC community in colleges around you.
>
> All the best.
>
> On Sat 14 Jul, 2018, 9:36 PM Athul Joy, <aathuljjoy333@gmail.com> wrote:
>
>> Dear friends, I am new to the Linux kernel development.
>> Can anyone help me how to start my journey in order to build my own
>> kernel?
>> _______________________________________________
>> Kernelnewbies mailing list
>> Kernelnewbies at kernelnewbies.org
>> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>


-- 
?If you're going to try, go all the way. Otherwise, don't even start. ..."
  Charles Bukowski
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20180718/154fd549/attachment-0001.html>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Need Suggestions
  2018-07-18 21:19   ` Daniel.
@ 2018-07-18 21:29     ` Dave Stevens
  2018-07-18 23:10       ` valdis.kletnieks at vt.edu
  0 siblings, 1 reply; 21+ messages in thread
From: Dave Stevens @ 2018-07-18 21:29 UTC (permalink / raw)
  To: kernelnewbies

On Wed, 18 Jul 2018 18:19:05 -0300
"Daniel." <danielhilst@gmail.com> wrote:

> > Hi Athul...
> > This is my collegemate's writing, ... This will solve all your
> > confusions....
> >

is it the policy on this list to trim?

D

-- 
In modern fantasy (literary or governmental), killing people is the
usual solution to the so-called war between good and evil. My books are
not conceived in terms of such a war, and offer no simple answers to
simplistic questions.

----- Ursula Le Guin

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Need Suggestions
  2018-07-18 21:29     ` Dave Stevens
@ 2018-07-18 23:10       ` valdis.kletnieks at vt.edu
  2018-07-19  1:16         ` Daniel.
  0 siblings, 1 reply; 21+ messages in thread
From: valdis.kletnieks at vt.edu @ 2018-07-18 23:10 UTC (permalink / raw)
  To: kernelnewbies

On Wed, 18 Jul 2018 14:29:41 -0700, Dave Stevens said:
> On Wed, 18 Jul 2018 18:19:05 -0300 "Daniel." <danielhilst@gmail.com> wrote:
>
> > > Hi Athul...
> > > This is my collegemate's writing, ... This will solve all your
> > > confusions....
> > >
>
> is it the policy on this list to trim?

Only the irrelevant parts, leave the parts that are the context for the reply.
So that *should* have been trimmed down to:

---
> 4) Without hesitation buy,?Robert Love's Linux Kernel Programming?book. It is
> one of the best beginner material and start reading it parallel to the OS book.
> This is easier to read than the previous one and more practical. But the
> previous one adds more value and is more theoretical. Handle (3) and (4) in
> parallel without blocking on any of the other activities.

I can confirm, this book is GOOOOOOD! Also check LDD3,? it's open and online
available, you may find some of it's authors in this mailist! :-). http://
www.makelinux.net/ldd3/ it's a outdated but it was a very valuable source to
me. You can find the examples updated on the internet. 
---

Also, MUAs the encourage top-posting and allowing quoting without a '> ' or
other indicator of quoting depth are a pox on email.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 486 bytes
Desc: not available
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20180718/3934d885/attachment.sig>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Need Suggestions
  2018-07-18 23:10       ` valdis.kletnieks at vt.edu
@ 2018-07-19  1:16         ` Daniel.
  2018-07-19  2:37           ` valdis.kletnieks at vt.edu
  0 siblings, 1 reply; 21+ messages in thread
From: Daniel. @ 2018-07-19  1:16 UTC (permalink / raw)
  To: kernelnewbies

Em qua, 18 de jul de 2018 20:10, <valdis.kletnieks@vt.edu> escreveu:

> On Wed, 18 Jul 2018 14:29:41 -0700, Dave Stevens said:
> > On Wed, 18 Jul 2018 18:19:05 -0300 "Daniel." <danielhilst@gmail.com>
> wrote:
> >
> > > > Hi Athul...
> > > > This is my collegemate's writing, ... This will solve all your
> > > > confusions....
> > > >
> >
> > is it the policy on this list to trim?
>
> Only the irrelevant parts, leave the parts that are the context for the
> reply.
> So that *should* have been trimmed down to:
>
> ---
> > 4) Without hesitation buy, Robert Love's Linux Kernel Programming book.
> It is
> > one of the best beginner material and start reading it parallel to the
> OS book.
> > This is easier to read than the previous one and more practical. But the
> > previous one adds more value and is more theoretical. Handle (3) and (4)
> in
> > parallel without blocking on any of the other activities.
>
> I can confirm, this book is GOOOOOOD! Also check LDD3,  it's open and
> online
> available, you may find some of it's authors in this mailist! :-). http://
> www.makelinux.net/ldd3/ it's a outdated but it was a very valuable source
> to
> me. You can find the examples updated on the internet.
> ---
>
> Also, MUAs the encourage top-posting and allowing quoting without a '> ' or
> other indicator of quoting depth are a pox on email.
>

Sorry. Do I did something bad? I wasn't intended to.. I didn't think that
trimming was a bad idea, I just want to reinforce the book suggestion ...
Sorry

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20180718/6516d54a/attachment.html>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Need Suggestions
  2018-07-19  1:16         ` Daniel.
@ 2018-07-19  2:37           ` valdis.kletnieks at vt.edu
  2018-07-19  2:42             ` Daniel.
  0 siblings, 1 reply; 21+ messages in thread
From: valdis.kletnieks at vt.edu @ 2018-07-19  2:37 UTC (permalink / raw)
  To: kernelnewbies

On Wed, 18 Jul 2018 22:16:07 -0300, "Daniel." said:
> Sorry. Do I did something bad? I wasn't intended to.. I didn't think that
> trimming was a bad idea, I just want to reinforce the book suggestion ...
> Sorry

It's OK.. just remember to trim out the non-important stuff next time. :)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 486 bytes
Desc: not available
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20180718/f24ef80f/attachment.sig>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Need Suggestions
  2018-07-19  2:37           ` valdis.kletnieks at vt.edu
@ 2018-07-19  2:42             ` Daniel.
  0 siblings, 0 replies; 21+ messages in thread
From: Daniel. @ 2018-07-19  2:42 UTC (permalink / raw)
  To: kernelnewbies

>
> It's OK.. just remember to trim out the non-important stuff next time. :)
>

Okay! Thanks!

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20180718/a2efbf96/attachment.html>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Need Suggestions
  2018-07-18  4:39 ` inventsekar
  2018-07-18 21:19   ` Daniel.
@ 2018-07-25 21:37   ` Himanshu Jha
  2018-07-25 22:10     ` valdis.kletnieks at vt.edu
  1 sibling, 1 reply; 21+ messages in thread
From: Himanshu Jha @ 2018-07-25 21:37 UTC (permalink / raw)
  To: kernelnewbies

On Wed, Jul 18, 2018 at 10:09:28AM +0530, inventsekar wrote:
> Hi Athul...
> This is my collegemate's writing, ... This will solve all your
> confusions....
> 
> ---
> 
> The most important quality that you need to inculcate if you want to do any
> kernel space programming is "Patience" (or persistence if you will). 

Very true!! Patience.. :)

> Though it is a good quality for any large scale project, it is a fundamental
> requirement for kernel programming. It is very easy to see progress and
> make an impact on userspace projects, but even simple changes in the kernel
> core will take a lot of time to get accepted, and will often require
> multiple rewrites. But fear not, as there are plenty of people who have
> conquered this mountain and it is not something to be worried about.
> 
> The starting steps will be:
> 
> 1) Try to understand how to use git <http://git-scm.com/>. We were (are ?)
> not taught to use a version control system in our college and it is such a
> fundamental thing. So start using git for college assignments and get the
> hang of it.

You'll learn eventually...
For instance, when you base your work on old an tree and send cleanup to
Greg. And Greg patiently explains 
"the patch doesn't apply, please rebase :( "

Then you get know how to do an interactive rebase and more preferably
base your work on -next(https://www.kernel.org/doc/man-pages/linux-next.html)

> 2) Start writing a lot of C programs and get experienced with pointers,
> memory allocation, threading. You can start implementing things like Stack,
> Queue, Trees etc. (whatever you study in datastructures) in a simple,
> thread-safe way. Do not focus on how you can visualize these datastructures
> but how you can effectively implement their functionality and thread
> safety. Use pthreads for threading. Do not use any library (like Glib) for
> giving you convenient datastructures (like Strings). Implement each of the
> things on your own. (But when you are writing code for a product, use a
> standard library always instead of re-inventing the wheel)
> 
> Write these C programs on Linux and compile using gcc. In our college days
> we were using turboc on windows and I hope things have changed. Use a linux
> distro (fedora <http://fedoraproject.org/>, debian <https://www.debian.org/>
> , openSUSE <http://en.opensuse.org/>, Gentoo <https://www.gentoo.org/> etc.)
> exclusively; Do not use Windows (at least for a while) to make yourself
> aware of the sysadmin, shell-scripting parts of linux, which will come in
> handy.

Now, this part of section is really important and somehow if you think
you really learnt C well in the course offered at University. Then
please take a look at implicit conversions:
https://en.cppreference.com/w/c/language/conversion

	assert(sizeof(int) > -1);

That should be enough to shatter your confidence.

I learnt various concepts by reading ISO-C11 draft:
https://port70.net/~nsz/c/c11/n1570.html

You can also grab a pdf copy and refer when in doubt.

> 3) Grab a (any) book on Operating Systems theory and read it. The dinosaur
> book <http://en.wikipedia.org/wiki/Operating_System_Concepts> by
> Silberschatz et. al. is a good start.

If you're a computer undergrad, then you can certainly skip and move to
Love. Otherwise if you're an electronics student like me then you should
read this atleast few chapters.

> 4) Without hesitation buy, Robert Love's Linux Kernel Programming
> <http://www.amazon.com/gp/product/0672329468/> book. It is one of the best
> beginner material and start reading it parallel to the OS book. This is
> easier to read than the previous one and more practical. But the previous
> one adds more value and is more theoretical. Handle (3) and (4) in parallel
> without blocking on any of the other activities.

Highly recommended!

> 5) After you are done with (1) and (2), and feel sufficiently confident
> with C and pointers, grab the  linux kernel sources from
> http://git.kernel.org/ and try to build the sources yourself.
> http://kernelnewbies.org/KernelBuild should help. Learn how to install and
> boot with the kernel that you have built.
> 
> 6.1) Subscribe to Kernel Newbies mailing list
> http://kernelnewbies.org/MailingList and read every mail, *even* if you do
> not understand most of it.

Indeed.

> 6.2) Watch: https://www.youtube.com/watch?v=LLBrBBImJt4

That's how I started :)
Thanks Greg!

> 6.3) Subscribe to http://lwn.net RSS feeds.

Another great resource.
Thanks Jonathan!

> After this, you should be able to fix and send any trivial, documentation,
> staging fixes. Once you have done this and get the hang of the process, you
> will know how to send patches for any parts of the kernel.
> 
> By this time, you would have found your areas of interest in kernel
> (filesystems, memory management, io scheduler, CPU scheduling etc.). You
> will then have to dig deeper in those particular areas, by:
> a) subscribing to the individual mailing lists (such as fs-devel
> <http://marc.info/?l=linux-fsdevel>, etc.)
> b) reading about the bug reports for the individual component
> c) finding the literature that is relevant for your subsystem (The linux
> memory management book
> <https://www.kernel.org/doc/gorman/pdf/understand.pdf>Mel Gorman, etc).
> 
> Three other non-technical things that I would recommend are:
> 
> 1) Create a new email address and use that for all your open source
> activities. That way you do not miss any important updates from your
> friends.
> 
> 2) Kernel programming will not give you big money in the short and medium
> term (at least in India). If your motivation is not excellence in
> engineering, but becoming popular or rich (it is not wrong btw) then you
> should focus on some other areas of programming (developing apps, websites,
> solving user problems, making meaning etc.).
> 
> It will often take months (or even years) before you make a significant
> contribution that is not merely a memory leak or bug fix. Be prepared for
> that. But since you have age, energy, time (once you get married and/or
> have kids you will understand) on your side, it is not that difficult.
> 
> Many people try kernel programming and then quit because they do not have
> the patience and perseverance.

I know few students especially Indians.
Sad :(

> It may also happen that they have found a
> more interesting technology at its nascent stage (like Distributed
> Computing, Artificial Intelligence, Containers, NLP etc.) It is not wrong
> to quit midway :) Any little time spent on kernel programming will
> immensely benefit you as a programmer even when you are doing user space
> programming. This holds good for not just kernel programming but any
> large-code-base/system programming (like Compilers, glibc, webkit, chrome,
> firefox etc.)
> 
> 3) Be more aware of the GSoC community in colleges around you.

I can certainly help you on this _any_ time.

Background: I am an undergraduate student(3rd year), started nearly one
year ago and have contributed significantly in kernel. Currently working
on Google Summer of Code project:
https://summerofcode.withgoogle.com/projects/#6691473790074880

And probably I will be pushing nearly 1.3k lines of code next week for
the mainline, and more if we need advanced features for the sensor.

https://lore.kernel.org/lkml/20170726143215.GB28875 at nazgul.tnic/
You see how things have changed in *exactly* 1 year ;)

Another great source is Linux Foundation's Youtube channel:
If you want know what I'm working on, I mean what IIO actually is then
take a look https://www.youtube.com/watch?v=lBU77crSvcI
But Documentation is more important!

Lastly, thanks inventsekar for such a lucid explaination :)

Goodluck & Best wishes!
-- 
Himanshu Jha
Undergraduate Student
Department of Electronics & Communication
Guru Tegh Bahadur Institute of Technology

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Need Suggestions
  2018-07-25 21:37   ` Himanshu Jha
@ 2018-07-25 22:10     ` valdis.kletnieks at vt.edu
  2018-08-01 21:29       ` Ruben Safir
  0 siblings, 1 reply; 21+ messages in thread
From: valdis.kletnieks at vt.edu @ 2018-07-25 22:10 UTC (permalink / raw)
  To: kernelnewbies

On Thu, 26 Jul 2018 03:07:27 +0530, Himanshu Jha said:

> Now, this part of section is really important and somehow if you think
> you really learnt C well in the course offered at University. Then
> please take a look at implicit conversions:
> https://en.cppreference.com/w/c/language/conversion
>
> 	assert(sizeof(int) > -1);
>
> That should be enough to shatter your confidence.

If you want your confidence shaken:

https://www.lysator.liu.se/c/duffs-device.html

Fortunately, most maintainers will frown on stuff like that unless there's
a *damned* good reason - and Tom Duff had a very good reason indeed.

(Intro-to-c pop quiz - why is strcpy() not usable here?)

gcc 8.1.1 will accept Tom's code (with 3 warnings due to it
being pre-ANSI C).

For those who took a class on compiler design, and *think* they
know how LALR parsers and that stuff works - Examine the lexical
nesting of that, and figure out how the devil the compiler doesn't
get indigestion.. :)

And the K&R book on C does successive trimming of an strcpy(),
and finishes with

void strcpy(char *a, *b) { while (*a++ = *b++); }

The thing that's actually used a lot in the Linux kernel that gives
a lot of C newcomers heartburn is the widespread use of
structures of function pointers.. For example, this from include/linux/fs.h:

struct lock_manager_operations {
	int (*lm_compare_owner)(struct file_lock *, struct file_lock *);
	unsigned long (*lm_owner_key)(struct file_lock *);
	fl_owner_t (*lm_get_owner)(fl_owner_t);
	void (*lm_put_owner)(fl_owner_t);
	void (*lm_notify)(struct file_lock *);	/* unblock callback */
	int (*lm_grant)(struct file_lock *, int);
	bool (*lm_break)(struct file_lock *);
	int (*lm_change)(struct file_lock *, int, struct list_head *);
	void (*lm_setup)(struct file_lock *, void **);
};

That's the structure definition.  Novice challenge: Find one or more places
where this structure is initialized, and understand how and why that works.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 486 bytes
Desc: not available
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20180725/f95352e5/attachment.sig>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Need Suggestions
  2018-07-25 22:10     ` valdis.kletnieks at vt.edu
@ 2018-08-01 21:29       ` Ruben Safir
  2018-08-02  4:36         ` Himanshu Jha
  0 siblings, 1 reply; 21+ messages in thread
From: Ruben Safir @ 2018-08-01 21:29 UTC (permalink / raw)
  To: kernelnewbies

> 
> And the K&R book on C does successive trimming of an strcpy(),
> and finishes with
> 
> void strcpy(char *a, *b) { while (*a++ = *b++); }
> 
> The thing that's actually used a lot in the Linux kernel that gives
> a lot of C newcomers heartburn is the widespread use of
> structures of function pointers.. For example, this from include/linux/fs.h:
> 
> struct lock_manager_operations {
> 	int (*lm_compare_owner)(struct file_lock *, struct file_lock *);
> 	unsigned long (*lm_owner_key)(struct file_lock *);
> 	fl_owner_t (*lm_get_owner)(fl_owner_t);
> 	void (*lm_put_owner)(fl_owner_t);
> 	void (*lm_notify)(struct file_lock *);	/* unblock callback */
> 	int (*lm_grant)(struct file_lock *, int);
> 	bool (*lm_break)(struct file_lock *);
> 	int (*lm_change)(struct file_lock *, int, struct list_head *);
> 	void (*lm_setup)(struct file_lock *, void **);
> };
> 
> That's the structure definition.  Novice challenge: Find one or more places
> where this structure is initialized, and understand how and why that works.


That kind of stuff is not taught in C programming.  An answer can be
very educating.




> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


-- 
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

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Need Suggestions
  2018-08-01 21:29       ` Ruben Safir
@ 2018-08-02  4:36         ` Himanshu Jha
  0 siblings, 0 replies; 21+ messages in thread
From: Himanshu Jha @ 2018-08-02  4:36 UTC (permalink / raw)
  To: kernelnewbies

On Wed, Aug 01, 2018 at 05:29:53PM -0400, Ruben Safir wrote:
> > 
> > And the K&R book on C does successive trimming of an strcpy(),
> > and finishes with
> > 
> > void strcpy(char *a, *b) { while (*a++ = *b++); }
> > 
> > The thing that's actually used a lot in the Linux kernel that gives
> > a lot of C newcomers heartburn is the widespread use of
> > structures of function pointers.. For example, this from include/linux/fs.h:
> > 
> > struct lock_manager_operations {
> > 	int (*lm_compare_owner)(struct file_lock *, struct file_lock *);
> > 	unsigned long (*lm_owner_key)(struct file_lock *);
> > 	fl_owner_t (*lm_get_owner)(fl_owner_t);
> > 	void (*lm_put_owner)(fl_owner_t);
> > 	void (*lm_notify)(struct file_lock *);	/* unblock callback */
> > 	int (*lm_grant)(struct file_lock *, int);
> > 	bool (*lm_break)(struct file_lock *);
> > 	int (*lm_change)(struct file_lock *, int, struct list_head *);
> > 	void (*lm_setup)(struct file_lock *, void **);
> > };
> > 
> > That's the structure definition.  Novice challenge: Find one or more places
> > where this structure is initialized, and understand how and why that works.
> 
> 
> That kind of stuff is not taught in C programming.  An answer can be
> very educating.

https://en.cppreference.com/w/c/language/pointer#Pointers_to_functions

If you wish to see its use: refer iio drivers and grep for 
read_raw and write_raw.

Hope this helps.
-- 
Himanshu Jha
Undergraduate Student
Department of Electronics & Communication
Guru Tegh Bahadur Institute of Technology

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2018-08-02  4:36 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-14 16:04 Need Suggestions Athul Joy
2018-07-14 16:27 ` ozgur at goosey.org
2018-07-14 17:31   ` Cindy-Sue Causey
2018-07-14 18:07     ` ozgur at goosey.org
2018-07-15 13:39       ` valdis.kletnieks at vt.edu
2018-07-18  0:35 ` Richard Siegfried
2018-07-18  0:43   ` Richard Siegfried
2018-07-18  4:10   ` Dave Stevens
2018-07-18  4:41     ` valdis.kletnieks at vt.edu
2018-07-18  5:00       ` Dave Stevens
2018-07-18  4:39 ` inventsekar
2018-07-18 21:19   ` Daniel.
2018-07-18 21:29     ` Dave Stevens
2018-07-18 23:10       ` valdis.kletnieks at vt.edu
2018-07-19  1:16         ` Daniel.
2018-07-19  2:37           ` valdis.kletnieks at vt.edu
2018-07-19  2:42             ` Daniel.
2018-07-25 21:37   ` Himanshu Jha
2018-07-25 22:10     ` valdis.kletnieks at vt.edu
2018-08-01 21:29       ` Ruben Safir
2018-08-02  4:36         ` Himanshu Jha

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).