LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-10-2007, 05:27 AM   #1
vrishankaryan
LQ Newbie
 
Registered: Aug 2007
Posts: 7

Rep: Reputation: 0
How to learn kernel programming?


I just got new job. I am here to work on embedded stuff. I need a thorough background in Linux - Kernel Programming and writing device drivers . Since i have always been using Windows and i have only written applications up until now , i kno nothing more than "How to use Linux". I need to start and hurry but dont kno how. Device Drivers are my ultimate target.I know it is a very difficult task. But , please suggest how to start to finally get there. I kno C and C++ . I know a bit on modules .I have worked a lotz on C in Windows. I have worked a little on C in Linux.I am very good at C but dont know much about hardware and device drivers and kernel and all. Dunno how to proceed . I am equipped with a few books on Linux Kernel Internals and Linux Device Drivers by Alessandro Rubini. Please help me soon.
 
Old 08-10-2007, 05:52 AM   #2
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Well reading the books is a good start, maybe the best I can think of; without knowledge you can't do much. After, or while reading the books, take some existing kernel modules (as source code) and go trough them, looking at how they work. Make changes to them and see how it works..that's the way I usually start with something new.

The other good alternative is to take a course on that kind of programming, if offered anywhere, but still your personal activity is what counts. Without reading books you don't know the "theoretic" stuff well enough to be good (quickly at least), but without doing, trying, failing and re-trying it yourself it's no good either.

EDIT: I don't think you'll be learning it in one night. Rushing things does no good. Either you take the time and learn it well, and be of use, or you hurry things up too much, don't learn it well and just get into trouble and spend your time solving them. If you're asked to hurry, you must explain you're not ready yet.

Last edited by b0uncer; 08-10-2007 at 05:53 AM.
 
Old 08-10-2007, 09:02 AM   #3
bassplayer69
Member
 
Registered: Jul 2007
Location: In a van down by the river...
Distribution: Slackware64-Current
Posts: 181

Rep: Reputation: 36
Quote:
Originally Posted by vrishankaryan
I just got new job. I am here to work on embedded stuff. I need a thorough background in Linux - Kernel Programming and writing device drivers . Since i have always been using Windows and i have only written applications up until now , i kno nothing more than "How to use Linux". I need to start and hurry but dont kno how. Device Drivers are my ultimate target.I know it is a very difficult task. But , please suggest how to start to finally get there. I kno C and C++ . I know a bit on modules .I have worked a lotz on C in Windows. I have worked a little on C in Linux.I am very good at C but dont know much about hardware and device drivers and kernel and all. Dunno how to proceed . I am equipped with a few books on Linux Kernel Internals and Linux Device Drivers by Alessandro Rubini. Please help me soon.

Hopefully, this isn't what your new job is in.
 
Old 08-10-2007, 08:33 PM   #4
Caesar Tjalbo
Member
 
Registered: Aug 2006
Location: Ņuņoa
Distribution: Aptosid
Posts: 93

Rep: Reputation: 16
Quote:
How to learn kernel programming?
Call Linus Torvalds.

You're desperate for work or very ambitious. I suppose I'd start with getting to know a couple of mainstream distributions like Fedora, SuSE, Ubuntu. Then Slackware, Gentoo and LFS. Whilst compiling you can maybe browse
Code:
http://kernelnewbies.org/
or read those books + their literature list.

But I'm a Linux n00b, not the best source. Depending on how well your knowledge and experience fits in, I think it's going to be a fairly steep and tall hill to climb.
 
Old 08-12-2007, 11:32 PM   #5
vrishankaryan
LQ Newbie
 
Registered: Aug 2007
Posts: 7

Original Poster
Rep: Reputation: 0
Thanks buddies

Thanks B0uncer and Caesar.I have gone through a few modules , and i am slowly getting more comfortable. Iwant to work more and more on Linux. I hope i do it right and quick , thanks again buddies
 
Old 08-13-2007, 12:56 PM   #6
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 115Reputation: 115
I've done low-level programming for over 30 years, and I DO know hardware.

That said, I am currently wrestling with a driver for a DSP that I'm integrating on the PCI bus in an embedded system, on contract for a very good rate.

I have complete documentation for the DSP and of course I have the linux kernel information to help me on the linux side, but even so this particular job is proving reasonably challenging. Right now I am sorting out how, in detail, the kernel's mapping of the DSP's memory buffer is actually related to the DSP's FIFO buffer that actually interfaces to that memory. The problem is made more complicated by the fact that I can dynamically change which portion of the DSP memory is actually mapped out.

I am setting up and running test cases, and observing what happens on both sides of the system, and I am working it all out.

The point is this. If you don't have the right kind of background, you have bitten off a BIG chunk, and you better allow yourself enough time to swallow it. You are now operating at a level where almost all the abstraction is removed, and you have to know about things like gate timings, buffer operations, bus addressing, and all that dirty detail stuff that the usual high level programmer (or even the typical C programmer) never sees. The abstraction provided by the kernel can help you, or it can hurt you. I actually was lured down a false path by something the kernel wanted to do for me that turns out to not be appropriate in my case with my particular hardware.

You also will be operating in a domain that very few people can help you with. In my case, I had been hoping to find a working driver for something similar to this DSP connected via PCI, but after googling extensively, I have drawn a blank. So I am breaking ground, and there seems to be no one who can answer my questions. This means I have to answer them myself, which takes time and effort. I'm getting there, but it isn't particularly easy.

Of course, this is the kind of programming that I prefer...

Good luck to you. Don't hesitate to ask when you get stuck, but don't be surprised if no one answers.

Oh...one further comment. Learn assembler.

Last edited by jiml8; 08-13-2007 at 01:00 PM.
 
Old 08-16-2007, 03:49 AM   #7
vrishankaryan
LQ Newbie
 
Registered: Aug 2007
Posts: 7

Original Poster
Rep: Reputation: 0
Smile Assembler

Dear Jim
Infact i was getting a bit confused and discouraged. I m pulling along but steadily and slowly .
That was a gr8 GO AHEAD advice.
Thanks a lot
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the best programming language to learn jax8 Programming 25 04-04-2010 11:21 AM
Which Programming Language to Learn? BlahBlah_X Programming 6 06-19-2007 09:12 AM
simple test circuit to learn kernel device driver programming slzckboy Programming 3 01-30-2006 03:12 AM
want to learn programming but not sure where to start SurferRoxyChiq Programming 6 01-14-2004 01:08 PM
Want to learn programming. ddpicard Programming 3 11-09-2001 02:20 PM


All times are GMT -5. The time now is 12:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration