All of lore.kernel.org
 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; 34+ 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] 34+ 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; 34+ 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] 34+ 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; 34+ 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] 34+ 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; 34+ 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] 34+ 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; 34+ 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] 34+ 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; 34+ 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] 34+ 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; 34+ 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] 34+ 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; 34+ 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] 34+ 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; 34+ 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] 34+ 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; 34+ 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] 34+ 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; 34+ 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] 34+ 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; 34+ 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] 34+ 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; 34+ 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] 34+ 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; 34+ 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] 34+ 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; 34+ 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] 34+ 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; 34+ 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] 34+ 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; 34+ 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] 34+ 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; 34+ 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] 34+ 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; 34+ 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] 34+ 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; 34+ 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] 34+ messages in thread

* Need Suggestions
  2018-08-01 21:29       ` Ruben Safir
@ 2018-08-02  4:36         ` Himanshu Jha
  0 siblings, 0 replies; 34+ 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] 34+ messages in thread

* Need suggestions......
@ 2000-04-14 18:23 Ihor Lys
  0 siblings, 0 replies; 34+ messages in thread
From: Ihor Lys @ 2000-04-14 18:23 UTC (permalink / raw)
  To: linuxppc-embedded


Hi Everybody.....

I am currently in the process of figuring out what the minimum external
hardware requirements would be for a new project we are working on.

We currently use a motorola FADS board with an 850SAR for some other
non-linux development, has anyone booted linux on this configuration?

For various reasons we would like to run linux on either a MPC850SR or
or MPC860SR or MPC860T.
The final design of our system will be custom, but as usual, its
probably beasier to start with something semi-standard.
We don't need most of the goofy desktop stuff, (video, HDD, FDD, swap,
etc), but we do need ethernet, serial, and other I/O

Further: Can anyone tell me:
Which SIMPLE SBC boards work with a minimum of fuss.
What kind of driver support is there for perhipherals based on USB
How much ram is really needed for the kernel image itself
What minimum external perhipherals other than I/O are needed/supported?
(RTC? NVRAM?)
Is there any reference as to what external perhipherals might be
supported? Like external UARTs, Net adapters, PCMCIA cards, etc?

Thanks
Ihor



--
------------------------------------------------------
Ihor Lys                             TEL: 617-423-9999
Color Kinetics Inc.                  FAX: 617-423-9998
50 Milk St. 17th Floor               CEL: 617-899-4320
Boston, MA 02109                 www.colorkinetics.com


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

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

* Re: need suggestions
  1999-11-24  8:34       ` LiuTao
@ 1999-11-24 10:26         ` Magnus Damm
  0 siblings, 0 replies; 34+ messages in thread
From: Magnus Damm @ 1999-11-24 10:26 UTC (permalink / raw)
  To: LiuTao; +Cc: linuxppc-embedded



> I have a ADS8xx board and I downloaded kernel source mpc8xx-2.2.13.tgz
> from ppc.kernel.org. Can you tell me how to port it to ADS8xx board and
> make a bootrom of Linux?
> I am a newbie, so please tell something in detail.

First of all: Check the revision of the board and the cpu.
If you have a 860, find a cpu with revision C or later.
If you have a ADS with rev. ENG, PILOT or A you will have some trouble.

I have had linux up and running on a ADS board.
A good starting point is to read the manual and check what differs from the FADS. 

I have bootcode that is based on fadsrom by Dan Malek.
It is kind of a mess right now, but it should support both 
the ADS and the FADS board using 860(t).
It loads a zImage or vmlinux from a ATA-FLASH or the onboard flash-simm.
It understands ext2 and dos.
No network support, though.

I can mail the source to anyone who is interested.
You will need a linux source tree and a (cross)compiler.

But I have no time for answers.

Good luck /

magnus damm

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

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

* Re: need suggestions
  1999-11-23  3:46 ` Dan Malek
  1999-11-23  3:46   ` LiuTao
@ 1999-11-24  8:56   ` Neil Russell
  1 sibling, 0 replies; 34+ messages in thread
From: Neil Russell @ 1999-11-24  8:56 UTC (permalink / raw)
  To: Dan Malek, LiuTao; +Cc: linuxppc, linuxppc-embedded


On Mon, Nov 22, 1999 at 10:46:53PM -0500, Dan Malek wrote:
> How do you load vxWorks?  I have worked on several vxWorks projects,

If you use vxWorks to load Linux, you would probably still have to pay
WindRiver a royalty.  Also, that would make the worlds largest bootloader;
well ok, OF is larger.

Many years ago, I wrote a boot loader that does (amongst other things)
BOOTP and TFTP.  I plan to port it to PPC for a project I'm doing soon
and I will publish it.  It wont be ready for a few months though.


-- 
Neil Russell <caret@c-side.com>

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

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

* Re: need suggestions
  1999-11-23  6:14     ` Dan Malek
  1999-11-23 18:47       ` Geert Uytterhoeven
@ 1999-11-24  8:34       ` LiuTao
  1999-11-24 10:26         ` Magnus Damm
  1 sibling, 1 reply; 34+ messages in thread
From: LiuTao @ 1999-11-24  8:34 UTC (permalink / raw)
  To: Dan Malek; +Cc: LinuxPPC Developers List, linuxppc-embedded


Hi:

Dan Malek wrote:
> My approach is to actually port a Linux kernel to the 8xx board, which
I have a ADS8xx board and I downloaded kernel source mpc8xx-2.2.13.tgz
from ppc.kernel.org. Can you tell me how to port it to ADS8xx board and
make a bootrom of Linux?
I am a newbie, so please tell something in detail.
Thanks!

LiuTao

> is pretty easy these days for just the minimal network support, then
> slightly "customize" it (so it doesn't use _all_ of memory) and flash
> is using S-record download or BDM tools.  I then just use the Linux
> kernel with a TFTP application to do the job.  Just mmap() the unused
> memory for loading a new image, and modify the reboot to call a
> specific address rather than return to rom.
> 
>         -- Dan

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

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

* Re: need suggestions
  1999-11-23 19:52 Jim Chapman
  1999-11-23 20:54 ` Frank McPherson
@ 1999-11-24  8:25 ` LiuTao
  1 sibling, 0 replies; 34+ messages in thread
From: LiuTao @ 1999-11-24  8:25 UTC (permalink / raw)
  To: Jim Chapman; +Cc: LinuxPPC Developers List, linuxppc-embedded


Hi Jim:

I have a bootrom of vxWorks and I want to use it to download any
files that I need through FTP or TFTP. When I try to do it, I found
some problems.
If I use it to download vxWorks's image through FTP, that's all right.
If I use it to download vxWorks's image through TFTP, there is error.
If I use it to download a test image(ELF file), there is error too.
I think there must be some requirements to the download files, right?
Maybe the format of ELF is not correct?
I also want to make a bootrom of Linux, can you tell me how to do it?
I am a newbie, so if you can, tell me something in detail please.
Thanks!

LiuTao

Jim Chapman wrote:
> 
> Re: using a vxworks bootrom to load zImage
> 
> I am using a standard vxworks bootrom to load a zImage, but I had to
> make a few modifications to the zImage startup code to make it work. For
> us, it is useful to share the same target hardware between vxworks and
> linux developers, without having to reblow the flash bootrom each time
> we switch. And by building BOOTP into the vxworks bootrom, we simply
> change the BOOTP server entry to have the target boot vxWorks or zImage
> without changing the bootrom. However, once we're rid of vxworks
> altogether, then a linux-centric bootrom would be a much better
> solution.
> 
> It turns out that the vxworks bootrom ELF support doesn't handle named
> ELF sections (it's yet another undocumented feature of Wind River code
> -- it silently ignores sections that aren't ".text" or ".data"...), and
> since the compressed vmlinux image is objcopy'd into a special "image"
> section by arch/ppc/mbxboot/Makefile, I had to find a way to put the
> image section inside the text segment so that the image data would be
> copied by the vxworks bootrom. There may be a clever way to do that
> using ld scripts, but I ended up converting the image data to assembly,
> and used a couple of public symbols at the start/end of the data so that
> (a modified) decompress_kernel() could find the image. The
> binary-to-assembly convertor is a simple perl script which does almost
> the same thing as vxWorks' binToAsm tool.
> 
> The initrd stuff would need similar treatment, but since I don't use
> initrd, I haven't implemented it.
> 
> If you want more details (and the binToAsm perl script) let me know.
> 
> -Jim

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

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

* Re: need suggestions
@ 1999-11-23 21:57 Brian Kuschak
  0 siblings, 0 replies; 34+ messages in thread
From: Brian Kuschak @ 1999-11-23 21:57 UTC (permalink / raw)
  To: Jim Chapman, LiuTao; +Cc: LinuxPPC Developers List, linuxppc-embedded


Jim,

Here's yet another way to do it.  We used a section
called .gzimage, but you could just as easily add it
to .text instead.  Instead of using the
link/objcopy/compile/link method in the Makefile, do
this instead:


zvmlinux: $(OBJECTS) ../coffboot/vmlinux.gz
      $(OBJCOPY) $(OBJCOPY_ARGS) -R .gzimage gzimage.o
      $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment
--add-section=.gzimage=../coffboot/vmlinux.gz
--set-section-flags=.gzimage=alloc,load,readonly,data
gzimage.o
      $(LD) $(ZLINKFLAGS) -o $@ $(OBJECTS)
     powerpc-elf-strip --strip-all $@

Create a dummy file called gzimage.c, where the zImage
data will be copied into section .gzimage:

/*
 * gzimage.c
 *
 * dummy file to allow a compressed zImage to be added
 * into a linker section, accessible by the boot code.
 */
char dummydummy;


Then add the following to the vmlinux.lds script, and
reference these symbols in your loader as extern
char[].  Modify the loader to load zImage data from
these addresses instead.  I think this method will
work for initrd as well.

/* For loader only: Put the zImage after everything
 * else
 */
  _gzstart = . ;
  .gzimage : { *(.gzimage) }
  _gzend = . ;



-Brian Kuschak


> ... had to find
> a way to put the
> image section inside the text segment so that the
> image data would be
> copied by the vxworks bootrom. There may be a clever
> way to do that
> using ld scripts...


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

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

* Re: need suggestions
  1999-11-23 19:52 Jim Chapman
@ 1999-11-23 20:54 ` Frank McPherson
  1999-11-24  8:25 ` LiuTao
  1 sibling, 0 replies; 34+ messages in thread
From: Frank McPherson @ 1999-11-23 20:54 UTC (permalink / raw)
  To: Jim Chapman; +Cc: LiuTao, LinuxPPC Developers List, linuxppc-embedded


Jim and others, 

We did some work last summer with a Dy4-177 VMEbus board which came to
us with the VxWorks bootrom intact, and used a similar solution to
yours.  

> The
> binary-to-assembly convertor is a simple perl script which does almost
> the same thing as vxWorks' binToAsm tool.

We are using a piggyback.c (different from the one in chrpboot)  to
produce the assembly.   It's probably no better or worse than the perl
script you've got.  

> The initrd stuff would need similar treatment, but since I don't use
> initrd, I haven't implemented it.

We DID find it useful to have initrd support, so our Makefiles can use
piggyback to make a tftp/vxworks loadable Linux kernel.   If this is
something you could use, please let me know.  

Cheers, 

Frank

-- 
Frank H. McPherson IV
W118 Embedded Solutions Team
The MITRE Corporation
703-883-5404

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

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

* Re: need suggestions
@ 1999-11-23 19:52 Jim Chapman
  1999-11-23 20:54 ` Frank McPherson
  1999-11-24  8:25 ` LiuTao
  0 siblings, 2 replies; 34+ messages in thread
From: Jim Chapman @ 1999-11-23 19:52 UTC (permalink / raw)
  To: LiuTao; +Cc: LinuxPPC Developers List, linuxppc-embedded


Re: using a vxworks bootrom to load zImage

I am using a standard vxworks bootrom to load a zImage, but I had to
make a few modifications to the zImage startup code to make it work. For
us, it is useful to share the same target hardware between vxworks and
linux developers, without having to reblow the flash bootrom each time
we switch. And by building BOOTP into the vxworks bootrom, we simply
change the BOOTP server entry to have the target boot vxWorks or zImage
without changing the bootrom. However, once we're rid of vxworks
altogether, then a linux-centric bootrom would be a much better
solution.

It turns out that the vxworks bootrom ELF support doesn't handle named
ELF sections (it's yet another undocumented feature of Wind River code
-- it silently ignores sections that aren't ".text" or ".data"...), and
since the compressed vmlinux image is objcopy'd into a special "image"
section by arch/ppc/mbxboot/Makefile, I had to find a way to put the
image section inside the text segment so that the image data would be
copied by the vxworks bootrom. There may be a clever way to do that
using ld scripts, but I ended up converting the image data to assembly,
and used a couple of public symbols at the start/end of the data so that
(a modified) decompress_kernel() could find the image. The
binary-to-assembly convertor is a simple perl script which does almost
the same thing as vxWorks' binToAsm tool.

The initrd stuff would need similar treatment, but since I don't use
initrd, I haven't implemented it.

If you want more details (and the binToAsm perl script) let me know.

-Jim


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

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

* Re: need suggestions
  1999-11-23  6:14     ` Dan Malek
@ 1999-11-23 18:47       ` Geert Uytterhoeven
  1999-11-24  8:34       ` LiuTao
  1 sibling, 0 replies; 34+ messages in thread
From: Geert Uytterhoeven @ 1999-11-23 18:47 UTC (permalink / raw)
  To: Dan Malek; +Cc: LiuTao, linuxppc


On Tue, 23 Nov 1999, Dan Malek wrote:
> LiuTao wrote:
> > .......... So I hope
> > to find a TFTP source code and program a bootloader by myself.
> > Of course, if anybody has a presented bootloader source code,
> > that's great.
> 
> A couple of people from Motorola have indicated, for the past year
> or so, an interest in providing a TFTP monitor for the FADS board.
> When they have asked what to do, I said make sure it is GPL and send
> it to me for posting on a server somewhere (like ppc.kernel.org).
> I have never heard a reply.
> 
> I am sure you could put something together from some of the netboot
> code that is around.

What about starting from PMON for the MIPS? It's real public domain.

Gr{oetje,eeting}s,
--
Geert Uytterhoeven -- Linux/{m68k~Amiga,PPC~CHRP} -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

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

* Re: need suggestions
  1999-11-23  3:46   ` LiuTao
@ 1999-11-23  6:14     ` Dan Malek
  1999-11-23 18:47       ` Geert Uytterhoeven
  1999-11-24  8:34       ` LiuTao
  0 siblings, 2 replies; 34+ messages in thread
From: Dan Malek @ 1999-11-23  6:14 UTC (permalink / raw)
  To: LiuTao; +Cc: linuxppc


LiuTao wrote:


> .......... So I hope
> to find a TFTP source code and program a bootloader by myself.
> Of course, if anybody has a presented bootloader source code,
> that's great.

A couple of people from Motorola have indicated, for the past year
or so, an interest in providing a TFTP monitor for the FADS board.
When they have asked what to do, I said make sure it is GPL and send
it to me for posting on a server somewhere (like ppc.kernel.org).
I have never heard a reply.

I am sure you could put something together from some of the netboot
code that is around.

My approach is to actually port a Linux kernel to the 8xx board, which
is pretty easy these days for just the minimal network support, then
slightly "customize" it (so it doesn't use _all_ of memory) and flash
is using S-record download or BDM tools.  I then just use the Linux
kernel with a TFTP application to do the job.  Just mmap() the unused
memory for loading a new image, and modify the reboot to call a
specific address rather than return to rom.



	-- Dan

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

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

* Re: need suggestions
  1999-11-23  3:46 ` Dan Malek
@ 1999-11-23  3:46   ` LiuTao
  1999-11-23  6:14     ` Dan Malek
  1999-11-24  8:56   ` Neil Russell
  1 sibling, 1 reply; 34+ messages in thread
From: LiuTao @ 1999-11-23  3:46 UTC (permalink / raw)
  To: Dan Malek; +Cc: linuxppc


Hi Dan:

Thanks for your advice.
The bootloader that I am using with vxWorks uses FTP but not TFTP.
And I don't have the source code of that bootloader. I think there
are maybe some problems to use it download and boot linux. So I hope
to find a TFTP source code and program a bootloader by myself.
Of course, if anybody has a presented bootloader source code,
that's great.

LiuTao

Dan Malek wrote:
> 
> LiuTao wrote:
> 
> > ........ The board
> > is running well with vxWorks now.
> > I want to make a bootloader on the board.
> 
> How do you load vxWorks?  I have worked on several vxWorks projects,
> and all of the systems had the vxWorks TFTP loader in the rom.  Use
> the same thing (whatever that is) to load the Linux/PPC image.
> 
> The zImage is linked such that you can just treat it as a bag o' bits
> to dump into memory.  Even with non-standard boot loaders, all you
> need to do is write a simple program to strip the 64K ELF header, place
> your own header on the top, make sure it gets loaded above 0x180000
> and jump to the start of the image.
> 
>         -- Dan

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

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

* Re: need suggestions
  1999-11-23  1:42 LiuTao
@ 1999-11-23  3:46 ` Dan Malek
  1999-11-23  3:46   ` LiuTao
  1999-11-24  8:56   ` Neil Russell
  0 siblings, 2 replies; 34+ messages in thread
From: Dan Malek @ 1999-11-23  3:46 UTC (permalink / raw)
  To: LiuTao; +Cc: linuxppc, linuxppc-embedded


LiuTao wrote:

> ........ The board
> is running well with vxWorks now.
> I want to make a bootloader on the board.


How do you load vxWorks?  I have worked on several vxWorks projects,
and all of the systems had the vxWorks TFTP loader in the rom.  Use
the same thing (whatever that is) to load the Linux/PPC image.

The zImage is linked such that you can just treat it as a bag o' bits
to dump into memory.  Even with non-standard boot loaders, all you
need to do is write a simple program to strip the 64K ELF header, place
your own header on the top, make sure it gets loaded above 0x180000
and jump to the start of the image.


	-- Dan

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

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

* need suggestions
@ 1999-11-23  1:42 LiuTao
  1999-11-23  3:46 ` Dan Malek
  0 siblings, 1 reply; 34+ messages in thread
From: LiuTao @ 1999-11-23  1:42 UTC (permalink / raw)
  To: linuxppc


Hi All:

I just completed a board with MPC860, there are 16M SDRAM, 2M Flash,
one ethernet port and two serial ports(SMC) on the board. The board
is running well with vxWorks now.
I want to make a bootloader on the board. With the bootloader, I can
download Linux image through TFTP to SDRAM and run it. I also can 
burn the downloaded image into flash, so next time I can boot Linux
from flash. 
I know that many people did this successfully on various boards. 
Can you give me some suggestions? Can you tell me how to do it?
Thanks!

LiuTao

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

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

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

Thread overview: 34+ 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
  -- strict thread matches above, loose matches on Subject: below --
2000-04-14 18:23 Need suggestions Ihor Lys
1999-11-23 21:57 need suggestions Brian Kuschak
1999-11-23 19:52 Jim Chapman
1999-11-23 20:54 ` Frank McPherson
1999-11-24  8:25 ` LiuTao
1999-11-23  1:42 LiuTao
1999-11-23  3:46 ` Dan Malek
1999-11-23  3:46   ` LiuTao
1999-11-23  6:14     ` Dan Malek
1999-11-23 18:47       ` Geert Uytterhoeven
1999-11-24  8:34       ` LiuTao
1999-11-24 10:26         ` Magnus Damm
1999-11-24  8:56   ` Neil Russell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.