RE: How to set up a debugging environment.

2010-07-07 Thread Viral Mehta

>2010/3/8 Mulyadi Santosa :
>> Hi...

>sorry for interrupting your conversation :)
Start a new thread then
>I recently try to use kgdb to debug kernel.
>my questions are:
>1. there are 2 uart under my plarform, I intent to let one for console
>one for kgdb.
>how coudl I tell kernel which one is for console and which one is for kgdb?
Give it as kernel parameters...
http://www.linuxquestions.org/questions/programming-9/kgdb-module-debugging-question-657611/

>2. do I need to compile my kernel with any additionally CFLAG ?
>appreciate your help,
>miloody

This Email may contain confidential or privileged information for the intended 
recipient (s) If you are not the intended recipient, please do not use or 
disseminate the information, notify the sender and delete it from your system.

__

--
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: How to set up a debugging environment.

2010-07-07 Thread loody
hi:

2010/3/8 Mulyadi Santosa :
> Hi...
>
> You forgot to Cc: to the mailing listplease keep kernelnewbies intact...
>
> On Mon, Mar 8, 2010 at 2:43 PM, become who you are born to be
> Chaitannya mahatme  wrote:
>> Hi ,
>>
>> Actually after a few hours of trying I figured out this, but got this error
>> message "During startup program terminated with signal SIGKILL."
>
> When did you see such message? During system boot inside Qemu?
>
>> Can some please explain me what has to be done.
>> Also 1 more thing, I have heard that kgdb has been a part of mainline
>> kernel. If so how to validate that?
>
> Simply check your kernel config. You should see something like below
> if your kernel has kgdb:
> $ grep -i kgdb /usr/src/kernels/linux-2.6.32/.config
> CONFIG_HAVE_ARCH_KGDB=y
> # CONFIG_KGDB is not set
>
sorry for interrupting your conversation :)
I recently try to use kgdb to debug kernel.
my questions are:
1. there are 2 uart under my plarform, I intent to let one for console
one for kgdb.
how coudl I tell kernel which one is for console and which one is for kgdb?
2. do I need to compile my kernel with any additionally CFLAG ?
appreciate your help,
miloody

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



SD Driver : FAT: FAT read failed (blocknr 8) in sd card error while removing sd card during writing

2010-07-07 Thread hardik patel
I have sd card on board ... During recording/writing SD card, remove SD card
... then i am getting endless error in dmesg as below :

end_request: I/O error, dev mmcblk0, sector 24
FAT: FAT read failed (blocknr 8)
mmcblk0: error -110 sending status comand<3>mmcblk0: error -110 sending
read/write command, response 0x0, card status 0x0
Block mmc_blk_issue_rq function call 346
end_request: I/O error, dev mmcblk0, sector 4
FAT: FAT read failed (blocknr 4)
MMC: killing requests for dead queue
end_request: I/O error, dev mmcblk0, sector 8
FAT: FAT read failed (blocknr 8)
FAT: FAT read failed (blocknr 4)
FAT: FAT read failed (blocknr 8)
FAT: FAT read failed (blocknr 4)
FAT: FAT read failed (blocknr 8)
FAT: FAT read failed (blocknr 4)
FAT: FAT read failed (blocknr 8)

How to stop this message ... what is ideal situation when we remove card
while writing .. can u help me what to do ?

where is the problem here? sd host controler driver problem or block driver
problem or file system problem

Note: I have formatted sd card with FAT32 file system .



With EXT3 File system :

Remove SD card while writing/recording we got error messages like below. but
this is not endless. After some time it stops.

===
end_request: I/O error, dev mmcblk0, sector 156536
mmcblk0: error -110 sending status comand<3>mmcblk0: error -110 sending
read/write command, response 0x0, card status 0x0
mmcblk0: error -110 requesting status
end_request: I/O error, dev mmcblk0, sector 4736
Aborting journal on device mmcblk0p1.
ext3_abort called.
EXT3-fs error (device mmcblk0p1): ext3_journal_start_sb: Detected aborted
journal
Remounting filesystem read-only
end_request: I/O error, dev mmcblk0, sector 4448
journal commit I/O error
===


Re: using gdb to debug a 64-bit kernel

2010-07-07 Thread Mulyadi Santosa
On Thu, Jul 8, 2010 at 02:13, Robert P. J. Day  wrote:
>  in fact, that's exactly the right value based on this snippet from
> init/main.c:
>
>  unsigned long loops_per_jiffy = (1<<12);
>
> which is, of course, 4096.


Thanks for sharingso it's fixed in 64 bit environment...I assumen
it's x64...not IA 64. So pls CMIIW about my assumption

>
>  but i still don't know why i can't print the changing value of
> jiffies if i clear the cache with:
>
>  (gdb) core-file /proc/kcore

But, is it changing if you quit gdb and run it again? Just a stupid
confirmation..


-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com

--
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: using gdb to debug a 64-bit kernel

2010-07-07 Thread Robert P. J. Day

  ok, part of the mystery is solved and i'm just being an idiot:

On Wed, 7 Jul 2010, Robert P. J. Day wrote:

>   and this is also weird:
>
> (gdb) p loops_per_jiffy
> $16 = 4096
>
> huh?  that value is way too low for this system.  on my old 32-bit
> system, that value would be around 2 million or so.

  in fact, that's exactly the right value based on this snippet from
init/main.c:

  unsigned long loops_per_jiffy = (1<<12);

which is, of course, 4096.

  but i still don't know why i can't print the changing value of
jiffies if i clear the cache with:

  (gdb) core-file /proc/kcore

rday

-- 


Robert P. J. Day   Waterloo, Ontario, CANADA

Top-notch, inexpensive online Linux/OSS/kernel courses
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: using gdb to debug a 64-bit kernel

2010-07-07 Thread Robert P. J. Day
On Thu, 8 Jul 2010, Mulyadi Santosa wrote:

> On Thu, Jul 8, 2010 at 01:19, Robert P. J. Day  wrote:
>
> > however, since this *is* a 64-bit system, i apparently have no such
> > symbol, i would just use:
> >
> > (gdb) p __jiffies
> > $12 = 4294937296
> > (gdb) p __jiffies
> > $13 = 4294937296
> > (gdb) p __jiffies
> > $14 = 4294937296
>
> two things I would check first:
> - is the vmlinux file really the kernel uncompressed image of current
> running kernel?

  i'm pretty sure that's true -- "uname -r" tells me:
"2.6.35-rc4-rday", while when i start gdb, i get:

  ...
  Core was generated by `BOOT_IMAGE=/vmlinuz-2.6.35-rc4-rday

i don't know how much more confident i can be that vmlinux matches the
running kernel -- that's the only vmlinux file on the system.

> - is your gdb capable to interpret 64 bit data and "report" it in 32
> bit realm?

  i'm not even sure what you're asking -- i simply installed gdb on
this 64-bit version of ubuntu, what else do i need to worry about?
and remember, i did say that this was the first time i've tried this
on a 64-bit system so it may well be that there's something really
obvious i don't know.

rday

-- 


Robert P. J. Day   Waterloo, Ontario, CANADA

Top-notch, inexpensive online Linux/OSS/kernel courses
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: using gdb to debug a 64-bit kernel

2010-07-07 Thread Mulyadi Santosa
On Thu, Jul 8, 2010 at 01:19, Robert P. J. Day  wrote:

> however, since this *is* a 64-bit system, i apparently have no such
> symbol, i would just use:
>
> (gdb) p __jiffies
> $12 = 4294937296
> (gdb) p __jiffies
> $13 = 4294937296
> (gdb) p __jiffies
> $14 = 4294937296

two things I would check first:
- is the vmlinux file really the kernel uncompressed image of current
running kernel?

- is your gdb capable to interpret 64 bit data and "report" it in 32 bit realm?

CMIIW people

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com

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



using gdb to debug a 64-bit kernel

2010-07-07 Thread Robert P. J. Day

  currently, i'm working on a short writeup showing how to use gdb to
debug a running kernel and, when i first wrote this a while back, it
was for a 32-bit system and things worked just fine.

  in short, i fired up gdb using the standard kernel-oriented
invocation with:

  $ sudo gdb /tmp/vmlinux /proc/kcore

where i copied the vmlinux file for the running kernel into /tmp to
save keystrokes.  and that's the standard way to use gdb to debug the
kernel, but here's where it starts to get weird.

  on a 32-bit system, if i wanted to print the current value of
jiffies, i used:

(gdb) p jiffies_64

however, since this *is* a 64-bit system, i apparently have no such
symbol, i would just use:

(gdb) p __jiffies
$12 = 4294937296
(gdb) p __jiffies
$13 = 4294937296
(gdb) p __jiffies
$14 = 4294937296
...

and as kernel-oriented gdb users know, you'll keep getting the same
answer over and over until you flush the gdb cache and reread
/proc/kcore:

(gdb) core-file /proc/kcore

but even after i do that, i'll get the same value.  why?  is there
some really fundamental difference between debugging a 32-bit vs
64-bit kernel?

  and this is also weird:

(gdb) p loops_per_jiffy
$16 = 4096

huh?  that value is way too low for this system.  on my old 32-bit
system, that value would be around 2 million or so.

  none of this makes sense.  am i missing something fundamental?  this
is the first time i've tried this on a 64-bit system.

rday

-- 


Robert P. J. Day   Waterloo, Ontario, CANADA

Top-notch, inexpensive online Linux/OSS/kernel courses
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: multiple alternate superblocks

2010-07-07 Thread Manish Katiyar
On 7/7/10, Onkar Mahajan  wrote:
> Is it possible to supply multiple alternate superblocks
> while doing a mount in Linux ?

Why would you want to do that ? What is the expected behavior in such cases ?


>
> -Regards,
> Onkar
>
> --
> 
>
> Your work is going to fill a large part of your
> life, and the only way to be truly satisfied is
> to do what you believe is great work. And the
> only way to do great work is to love what
> you do. If you haven’t found it yet, keep
> looking, and don’t settle. As with all matters
> of the heart, you’ll know when you find it.
>-  Steve Jobs
> 
>


-- 
Thanks -
Manish
==
[$\*.^ -- I miss being one of them
==

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



SATA driver implementation

2010-07-07 Thread Murali N
Hi,
I am writing SATA driver for on chip SATA controller, here i have few questions:

1. AFAIK, SATA device falls under PCI class device in kernel, so its
make use of some of the PCI API utilities to read the PCI header
   ( where one can get the information about the SATA controller base
address ). But in kernel code, one of the driver
   ( /driver/ata/sata_fsl.c ) i have not seen any PCI API's used in
the driver code but other drivers are extensively (driver/ata/sata*)
   using the PCI API's to get the controller information. Why is it so?

2. Can anybody give me the call flow how the user-space request
reaches the actual SATA driver?. l am looking for a rough sequence
call flow from system call ( read/write ) to the actual drivers
API's getting called.

Also can anyone point me to some good resource links on SATA & its
example drivers.

Thanks for your help!!!

--
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: multiple alternate superblocks

2010-07-07 Thread Mulyadi Santosa
On Wed, Jul 7, 2010 at 08:19, Onkar Mahajan  wrote:
> Is it possible to supply multiple alternate superblocks
> while doing a mount in Linux ?

I think your question might be interpreted vary between person to
person. Do you mean, Linux kernel will use information according to
multilple copy of superblock of a filesystem?

If that's what you mean, IMO it's not...at least that's what I know.
Even during fsck, you need to determine which superblock is the valid
one that will be used as the base information.


PS: Can't agree more with your quote...Steve Jobs is always one of my idol...

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com

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