Re: C programming resource

2010-11-22 Thread hiren panchasara
Pasting this from the faq doc Anuz recently prepared (with help from
others on this list) for newbies.

Thanks,
Hiren

C language programming books:

1. The C programming language by Kerninghan and Ritchie.
Its a must-have book, most code in Kernel is written in C language and
mastering C is important and there is nothing better than KnR for this job.
2. Practical C programming by By Steve Oualline
Good book for developing a good coding style in C language
3. C traps and pitfalls by Andrew koeing
A book which talks about limitations and issues with C programming, a very
helpful textbook to understand where you can make mistakes.
4. Expert C programming: deep C secrets by Peter V Linden
A very good books, which teaches a lot of nuances of  C language.
5. The C programming Manual by Harbison and Steele
This book ventures deep into the C programming language mostly details of
standards and changes in C, its quite advance in nature.



On Mon, Nov 22, 2010 at 9:37 PM, Sameer Rahmani lxsam...@gmail.com wrote:

 Hi,
 i'm not a C programmer , but i have a medium level of C programming
 knowledge that i think its not enough for spend time on kernel source.
 so could you people guide me for choosing a good resource for improving my
 C programming knowledge?



Re: is there still an active kernel janitors project?

2010-11-21 Thread hiren panchasara
Hi Robert,

I would be interested in getting started :)

Thanks,
Hiren

On Sun, Nov 21, 2010 at 5:06 AM, Robert P. J. Day rpj...@crashcourse.cawrote:


  i can suggest some very specific cleanups people can work on if
 they're bored.  one related to lists:

  list_for_each() - list_for_each_entry() calls

 that is, modifying the numerous (older-style) list_for_each() calls to
 the more convenient list_for_each_entry() calls, something that can
 be done little by little, a subsystem at a time.  good way to jump
 into kernel janitor work and get your name in the log.

 rday

 --

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

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

 --
 To unsubscribe from this list: send an email with
 unsubscribe kernelnewbies to ecar...@nl.linux.org
 Please read the FAQ at http://kernelnewbies.org/FAQ




Re: structure for Super IO chip detection

2010-11-18 Thread hiren panchasara
On Thu, Nov 18, 2010 at 5:47 AM, Bond jamesbond.2...@gmail.com wrote:

 On this link

 http://lxr.free-electrons.com/source/drivers/parport/parport_pc.c?v=2.6.29#L97
 they defined a structure superio_struct and initialized as

 superios[NR_SUPERIOS] = { {0,},};
 I am not able to understand above initialization has what is it
 getting initialized to.


Please put it into a small c prog and try it yourself. You will come to know
in a minute.

Thanks,
Hiren


Re: structure for Super IO chip detection

2010-11-18 Thread hiren panchasara
On Thu, Nov 18, 2010 at 9:58 PM, Bond jamesbond.2...@gmail.com wrote:

 On Thu, Nov 18, 2010 at 10:56 PM, hiren panchasara
 hiren.panchas...@gmail.com wrote:
  Please put it into a small c prog and try it yourself. You will come to
 know
  in a minute.
 I am not able to understand what program do I make to put thats why I
 asked.


A simple C program with only 2 things:
1) structure that you are confused about - simply copy and paste
2) printf statement to see how values are assigned.

Now change the value in 1) while initializing the structure and repeat.

You should be able to find how structures are declared/defined/used in any
good C programming book.

Thanks,
Hiren


Re: OS in-memory structure

2010-10-07 Thread hiren panchasara
On Thu, Oct 7, 2010 at 9:28 AM, Juan Rafael Garcia Blanco 
jgblanco.m...@gmail.com wrote:

 Hi, it has just been solved, thank you

Would you care to share?

Thanks.


 On Oct 7, 2010, at 5:55 PM, Juan Rafael Garcia Blanco wrote:

  Hi.
  During the boot process, Linux is loaded in main memory. When a system
 call is done, the OS executes again. If the system call is accompanied by
 some parameter, which is an address of the user process memory map, how can
 the kernel access that variable which is in user process memory map? I mean,
 when the kernel fires up an address, how is it translated? I can't find an
 answer to my question in books nor in the internet.
 
  Thank you very much


 --
 To unsubscribe from this list: send an email with
 unsubscribe kernelnewbies to ecar...@nl.linux.org
 Please read the FAQ at http://kernelnewbies.org/FAQ




Re: Integer Division on 32 Bit Machines

2010-09-08 Thread hiren panchasara
On Tue, Sep 7, 2010 at 11:22 PM, Bond jamesbond.2...@gmail.com wrote:



 On Tue, Sep 7, 2010 at 11:29 PM, hiren panchasara 
 hiren.panchas...@gmail.com wrote:

 Bond,

 This should help:  http://en.wikipedia.org/wiki/Typedef

 Thanks I read that. but in the question which original poster asked he
 mentioned signed long s64.
 I am not clear with that.

What exactly is your question? Please elaborate.

Thanks,
Hiren


Re: Integer Division on 32 Bit Machines

2010-09-08 Thread hiren panchasara
On Tue, Sep 7, 2010 at 11:53 PM, Bond jamesbond.2...@gmail.com wrote:



 On Wed, Sep 8, 2010 at 12:22 PM, hiren panchasara 
 hiren.panchas...@gmail.com wrote:



 What exactly is your question? Please elaborate.


 In the code signed and unsigned word are used what is that and why is that
 used?

First search in google gave me this:
http://www.rwc.uc.edu/koehler/comath/13.html

I think you should read up more on C.

http://www.amazon.com/Programming-Language-2nd-Brian-Kernighan/dp/0131103628

Thanks,
Hiren






Re: Integer Division on 32 Bit Machines

2010-09-07 Thread hiren panchasara
Bond,
On Tue, Sep 7, 2010 at 10:44 AM, Bond jamesbond.2...@gmail.com wrote:



 On Tue, Sep 7, 2010 at 3:32 PM, Andreas Leppert wu...@web.de wrote:

 Hello,

 I have encountered a problem on my 32 bit machine. Here some code
 snippets:

 typedef signed long s64;

 Hi sorry my reply wont help you.
 Since I was reading this thread wanted to know
 what is the meaning of typedef signed long s64
 I searched at Google but could not find it.

This should help:  http://en.wikipedia.org/wiki/Typedef

Thanks,
Hiren





 --
 Everything is okay in the end, if it's not ok, then it's not the end.



Re: A question

2010-09-02 Thread hiren panchasara
Thanks a lot Prabhu for great explanation, comments in-line:

On Wed, Sep 1, 2010 at 10:02 PM, Prabhu nath gprabhun...@gmail.com wrote:

 Interrupt context is a loaded term. It is used for both top-half and
 bottom-half processing.

I need some more reading, will do that :)

 Linux defines two terms in the top-half, one is Interrupt handler (IH) and
 Interrupt Service Routine (ISR).
 Interrupt handler is a standard kernel code that is executed by the
 processor once the interrupt is generated. To abstract it, this generic code
 is executed for all the generated interrupts. This, in general saves the
 present processor context and paves way for the execution of ISR.
 ISR is a interrupt service routine written by a device driver programmer to
 handle the interrupt of a device. ISR is mainly responsible to verify the
 status register of a device to find out the cause of the interrupt and act
 accordingly.

 Both IH and ISR will not have a context of its own. Interrupts generated by
 a hardware device is asynchronous. i.e. it can be generated at any point in
 time.
 When such a interrupt is generated, the current execution is interrupted
 and the execution  control is transferred to IH and ISR will be executed.
 Thus we can infer that both IH and ISR will be executing in an anonymous
 context.

I am struggling to find meaning of interrupt context now.


 For Eg. Consider there are 3 tasks T2, T3. Suppose T2 invoked a read system
 call to read data from the secondary media (say hard disk), driver of the
 hard disk will initiate the device to gather the data and put task T2 in the
 wait queue and invokes scheduler. Now, scheduler picks up say T3. When
 processor is executing task T3, there was interrupt generated by the
 harddisk controller indicating that data is ready. At this point IH and ISR
 is executed. IH and ISR of this interrupt has no relevance to task T3, but
 still it is executed in the context of T3. Hence we say that IH and ISR will
 always be executed in the anonymous context.

Wow, didnt know this. So IH and ISR wont execute in interrupt context? What
is interrupt context then? and if they execute in context of T3, does it
have any side-effect on processing of T3?


 Most of the bottom half execution happens the same way, i.e. it will be
 executing in the anonymous context unless the job of bottom half is
 relegated to respective kernel threads. In the latter case the bottom half
 execution will have its own context.

 For more details about top-half and bottom half, refer ULK 3rd edtion by
 Bovet, Chapter 4

Would read it.

Thanks again for great insights.


 Regards,
 Prabhu



 On Wed, Sep 1, 2010 at 9:08 PM, Hiren Panchasara 
 hiren.panchas...@gmail.com wrote:

 Process context is schedulable but interrupt context is not. Why and how?
 Any examples I can look at?

 Thanks.



 --
 To unsubscribe from this list: send an email with
 unsubscribe kernelnewbies to ecar...@nl.linux.org
 Please read the FAQ at http://kernelnewbies.org/FAQ





A question

2010-09-01 Thread Hiren Panchasara
Process context is schedulable but interrupt context is not. Why and how?
Any examples I can look at?

Thanks. 



--
To unsubscribe from this list: send an email with
unsubscribe kernelnewbies to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ