[Qemu-devel] How can qemu to generate a signal 0 on i386 target (Linux) and i386 host?

2007-04-25 Thread Neo Jia

hi,

I am using kgdb to debug Linux kernel. Both the target and host are
IA32 platform. But I got the following from my gdb console:

Program terminated with signal 0, Signal 0.
The program no longer exists.

In fact, this signal is not defined on my gdb.


From the post http://sourceware.org/ml/gdb/2004-03/msg1.html, it

seems that this signal is generated from the qemu instead of sent by
the bottom hardware.

So, I am wondering if there is anybody can point me to the code of
qemu, which will take care those signals.

Thanks,
Neo

--
I would remember that if researchers were not ambitious
probably today we haven't the technology we are using!




[Qemu-devel] Re: How to debug Linux kernel on qemu with kgdb?

2007-04-25 Thread Neo Jia

On 4/25/07, Jan Kiszka <[EMAIL PROTECTED]> wrote:

Neo Jia wrote:
> On 4/25/07, Jan Kiszka <[EMAIL PROTECTED]> wrote:
>> Neo Jia wrote:
>> > On 4/25/07, Jan Kiszka <[EMAIL PROTECTED]> wrote:
>> >> Neo Jia wrote:
>> >> > On 4/25/07, Jan Kiszka <[EMAIL PROTECTED]> wrote:
>> >> >> Neo Jia wrote:
>> >> >> > hi,
>> >> >> >
>> >> >> > I am trying to use debug kgdb patched linux kernel on my qemu.
>> Both
>> >> >> > the native and target platform are IA32. I am wondering if
>> there is
>> >> >> > anyone can show me the procedure?
>> >> >>
>> >> >> Yep, see
>> >> https://mail.gna.org/public/xenomai-core/2006-09/msg00202.html
>> >> >>
>> >> >> (BTW, I think that kgdb bug is still unfixed - I never got a
>> >> feedback.)
>> >> >
>> >> > I can connect gdb through /dev/pts/XX. My qemu is lanuched by
>> >> >
>> >> > qemu -nographic -hda linux.img -kernel
>> >> > ./2.6.15.5-kgdb/vmlinuz-2.6.15.5-kgdb -serial pty -append "kgdbwait
>> >> > console=ttyS0 root=/dev/hda sb=0x220,5,1,5 ide2=noprobe ide3=noprobe
>> >> > ide4=noprobe ide5=noprobe"
>> >> >
>> >> > Do you know where can I get the console output?
>> >> >
>> >>
>> >> Use "... -serial stdio -serial pty ..." and attached kgdb to the
>> second
>> >> serial port (I think to recall that is default anyway). The first
>> one is
>> >> then used for the kernel console.
>> >>
>> >> > I would like to work out kgdb + qemu to debug linux kernel.
>> >>
>> >> ??? So you really want to debug the kernel when kgdb is applied, ie.
>> >> actually debug kgdb? If you only intend to debug the kernel itself,
>> qemu
>> >> -s + gdb is enough.
>> >
>> > Jan,
>> >
>> > I just would like to debug kernel itself. I have tried qemu -s + gdb
>> > but it keeps
>> > getting "apic_timer_interrupt" when I am using "n" command.
>> >
>> > The following is the output:
>> >
>> >> gdb vmlinux
>> > GNU gdb 6.5.50.20060621-cvs
>> > Copyright (C) 2006 Free Software Foundation, Inc.
>> > GDB is free software, covered by the GNU General Public License, and
>> you
>> > are
>> > welcome to change it and/or distribute copies of it under certain
>> > conditions.
>> > Type "show copying" to see the conditions.
>> > There is absolutely no warranty for GDB.  Type "show warranty" for
>> details.
>> > This GDB was configured as "i686-pc-linux-gnu"...Using host
>> > libthread_db library "/lib/tls/libthread_db.so.1".
>> >
>> > (gdb) target remote localhost:1234
>> > Remote debugging using localhost:1234
>> > 0xfff0 in ?? ()
>> > warning: shared library handler failed to enable breakpoint
>> > (gdb) c
>> > Continuing.
>> >
>> > Program received signal SIGINT, Interrupt.
>> > default_idle () at include/asm/bitops.h:252
>> > 252 return ((1UL << (nr & 31)) & (addr[nr >> 5])) != 0;
>> > (gdb) b sys_ex
>> > sys_execve  sys_exitsys_exit_group
>> > (gdb) b sys_execve
>> > Breakpoint 1 at 0xc0101ac1: file arch/i386/kernel/process.c, line 791.
>> > (gdb) c
>> > Continuing.
>> >
>> > Breakpoint 1, sys_execve (regs=
>> >  {ebx = 135197704, ecx = 135197864, edx = 135244936, esi =
>> > 135197704, edi = 135197704, ebp = -1079176984, eax = 11, xds = 123,
>> > xes = 123, orig_eax = 11, eip = -1208835017, xcs = 115, eflags = 582,
>> > esp = -1079177012, xss = 123})
>> >at arch/i386/kernel/process.c:791
>> > 791 filename = getname((char __user *) regs.ebx);
>> > (gdb) n
>> > 0xc0103666 in apic_timer_interrupt () at include/asm/current.h:9
>> > 9   {
>>
>> That's normal. You stopped the kernel in sys_execve with interrupts
>> enabled. When continuing, qemu replays any pending interrupts, here the
>> timer. Thus your next instruction is not in sys_execve, but in the
>> interrupt handler. You can try finish then and hope that you will return
>> to the next line in sys_execve, or you put another breakpoint at the
>> next interesting spot and just issue continue.
>>
>> Jan
>>
>>
>> PS: Using kgdb from inside qemu should work (at least it once did for
>> me), but it is really slw.
>>
>
> Could you show me the procedure you did? I just want to use this to
> learn kernel code.

Did you redirect kgdb to ttyS1?


Yes, I just redirect kgdb to ttyS1 but still nothing. But if I
compiled with "CONFIG_KGDB_CONSOLE=y", it will show on the gdb
console.

Is a bug or wrong configuration?

Thanks,
Neo



Jan






--
I would remember that if researchers were not ambitious
probably today we haven't the technology we are using!




[Qemu-devel] Re: How to debug Linux kernel on qemu with kgdb?

2007-04-25 Thread Jan Kiszka
Neo Jia wrote:
> On 4/25/07, Jan Kiszka <[EMAIL PROTECTED]> wrote:
>> Neo Jia wrote:
>> > On 4/25/07, Jan Kiszka <[EMAIL PROTECTED]> wrote:
>> >> Neo Jia wrote:
>> >> > On 4/25/07, Jan Kiszka <[EMAIL PROTECTED]> wrote:
>> >> >> Neo Jia wrote:
>> >> >> > hi,
>> >> >> >
>> >> >> > I am trying to use debug kgdb patched linux kernel on my qemu.
>> Both
>> >> >> > the native and target platform are IA32. I am wondering if
>> there is
>> >> >> > anyone can show me the procedure?
>> >> >>
>> >> >> Yep, see
>> >> https://mail.gna.org/public/xenomai-core/2006-09/msg00202.html
>> >> >>
>> >> >> (BTW, I think that kgdb bug is still unfixed - I never got a
>> >> feedback.)
>> >> >
>> >> > I can connect gdb through /dev/pts/XX. My qemu is lanuched by
>> >> >
>> >> > qemu -nographic -hda linux.img -kernel
>> >> > ./2.6.15.5-kgdb/vmlinuz-2.6.15.5-kgdb -serial pty -append "kgdbwait
>> >> > console=ttyS0 root=/dev/hda sb=0x220,5,1,5 ide2=noprobe ide3=noprobe
>> >> > ide4=noprobe ide5=noprobe"
>> >> >
>> >> > Do you know where can I get the console output?
>> >> >
>> >>
>> >> Use "... -serial stdio -serial pty ..." and attached kgdb to the
>> second
>> >> serial port (I think to recall that is default anyway). The first
>> one is
>> >> then used for the kernel console.
>> >>
>> >> > I would like to work out kgdb + qemu to debug linux kernel.
>> >>
>> >> ??? So you really want to debug the kernel when kgdb is applied, ie.
>> >> actually debug kgdb? If you only intend to debug the kernel itself,
>> qemu
>> >> -s + gdb is enough.
>> >
>> > Jan,
>> >
>> > I just would like to debug kernel itself. I have tried qemu -s + gdb
>> > but it keeps
>> > getting "apic_timer_interrupt" when I am using "n" command.
>> >
>> > The following is the output:
>> >
>> >> gdb vmlinux
>> > GNU gdb 6.5.50.20060621-cvs
>> > Copyright (C) 2006 Free Software Foundation, Inc.
>> > GDB is free software, covered by the GNU General Public License, and
>> you
>> > are
>> > welcome to change it and/or distribute copies of it under certain
>> > conditions.
>> > Type "show copying" to see the conditions.
>> > There is absolutely no warranty for GDB.  Type "show warranty" for
>> details.
>> > This GDB was configured as "i686-pc-linux-gnu"...Using host
>> > libthread_db library "/lib/tls/libthread_db.so.1".
>> >
>> > (gdb) target remote localhost:1234
>> > Remote debugging using localhost:1234
>> > 0xfff0 in ?? ()
>> > warning: shared library handler failed to enable breakpoint
>> > (gdb) c
>> > Continuing.
>> >
>> > Program received signal SIGINT, Interrupt.
>> > default_idle () at include/asm/bitops.h:252
>> > 252 return ((1UL << (nr & 31)) & (addr[nr >> 5])) != 0;
>> > (gdb) b sys_ex
>> > sys_execve  sys_exitsys_exit_group
>> > (gdb) b sys_execve
>> > Breakpoint 1 at 0xc0101ac1: file arch/i386/kernel/process.c, line 791.
>> > (gdb) c
>> > Continuing.
>> >
>> > Breakpoint 1, sys_execve (regs=
>> >  {ebx = 135197704, ecx = 135197864, edx = 135244936, esi =
>> > 135197704, edi = 135197704, ebp = -1079176984, eax = 11, xds = 123,
>> > xes = 123, orig_eax = 11, eip = -1208835017, xcs = 115, eflags = 582,
>> > esp = -1079177012, xss = 123})
>> >at arch/i386/kernel/process.c:791
>> > 791 filename = getname((char __user *) regs.ebx);
>> > (gdb) n
>> > 0xc0103666 in apic_timer_interrupt () at include/asm/current.h:9
>> > 9   {
>>
>> That's normal. You stopped the kernel in sys_execve with interrupts
>> enabled. When continuing, qemu replays any pending interrupts, here the
>> timer. Thus your next instruction is not in sys_execve, but in the
>> interrupt handler. You can try finish then and hope that you will return
>> to the next line in sys_execve, or you put another breakpoint at the
>> next interesting spot and just issue continue.
>>
>> Jan
>>
>>
>> PS: Using kgdb from inside qemu should work (at least it once did for
>> me), but it is really slw.
>>
> 
> Could you show me the procedure you did? I just want to use this to
> learn kernel code.

Did you redirect kgdb to ttyS1?

Jan



signature.asc
Description: OpenPGP digital signature


[Qemu-devel] Re: How to debug Linux kernel on qemu with kgdb?

2007-04-25 Thread Neo Jia

On 4/25/07, Jan Kiszka <[EMAIL PROTECTED]> wrote:

Neo Jia wrote:
> On 4/25/07, Jan Kiszka <[EMAIL PROTECTED]> wrote:
>> Neo Jia wrote:
>> > On 4/25/07, Jan Kiszka <[EMAIL PROTECTED]> wrote:
>> >> Neo Jia wrote:
>> >> > hi,
>> >> >
>> >> > I am trying to use debug kgdb patched linux kernel on my qemu. Both
>> >> > the native and target platform are IA32. I am wondering if there is
>> >> > anyone can show me the procedure?
>> >>
>> >> Yep, see
>> https://mail.gna.org/public/xenomai-core/2006-09/msg00202.html
>> >>
>> >> (BTW, I think that kgdb bug is still unfixed - I never got a
>> feedback.)
>> >
>> > I can connect gdb through /dev/pts/XX. My qemu is lanuched by
>> >
>> > qemu -nographic -hda linux.img -kernel
>> > ./2.6.15.5-kgdb/vmlinuz-2.6.15.5-kgdb -serial pty -append "kgdbwait
>> > console=ttyS0 root=/dev/hda sb=0x220,5,1,5 ide2=noprobe ide3=noprobe
>> > ide4=noprobe ide5=noprobe"
>> >
>> > Do you know where can I get the console output?
>> >
>>
>> Use "... -serial stdio -serial pty ..." and attached kgdb to the second
>> serial port (I think to recall that is default anyway). The first one is
>> then used for the kernel console.
>>
>> > I would like to work out kgdb + qemu to debug linux kernel.
>>
>> ??? So you really want to debug the kernel when kgdb is applied, ie.
>> actually debug kgdb? If you only intend to debug the kernel itself, qemu
>> -s + gdb is enough.
>
> Jan,
>
> I just would like to debug kernel itself. I have tried qemu -s + gdb
> but it keeps
> getting "apic_timer_interrupt" when I am using "n" command.
>
> The following is the output:
>
>> gdb vmlinux
> GNU gdb 6.5.50.20060621-cvs
> Copyright (C) 2006 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you
> are
> welcome to change it and/or distribute copies of it under certain
> conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB.  Type "show warranty" for details.
> This GDB was configured as "i686-pc-linux-gnu"...Using host
> libthread_db library "/lib/tls/libthread_db.so.1".
>
> (gdb) target remote localhost:1234
> Remote debugging using localhost:1234
> 0xfff0 in ?? ()
> warning: shared library handler failed to enable breakpoint
> (gdb) c
> Continuing.
>
> Program received signal SIGINT, Interrupt.
> default_idle () at include/asm/bitops.h:252
> 252 return ((1UL << (nr & 31)) & (addr[nr >> 5])) != 0;
> (gdb) b sys_ex
> sys_execve  sys_exitsys_exit_group
> (gdb) b sys_execve
> Breakpoint 1 at 0xc0101ac1: file arch/i386/kernel/process.c, line 791.
> (gdb) c
> Continuing.
>
> Breakpoint 1, sys_execve (regs=
>  {ebx = 135197704, ecx = 135197864, edx = 135244936, esi =
> 135197704, edi = 135197704, ebp = -1079176984, eax = 11, xds = 123,
> xes = 123, orig_eax = 11, eip = -1208835017, xcs = 115, eflags = 582,
> esp = -1079177012, xss = 123})
>at arch/i386/kernel/process.c:791
> 791 filename = getname((char __user *) regs.ebx);
> (gdb) n
> 0xc0103666 in apic_timer_interrupt () at include/asm/current.h:9
> 9   {

That's normal. You stopped the kernel in sys_execve with interrupts
enabled. When continuing, qemu replays any pending interrupts, here the
timer. Thus your next instruction is not in sys_execve, but in the
interrupt handler. You can try finish then and hope that you will return
to the next line in sys_execve, or you put another breakpoint at the
next interesting spot and just issue continue.

Jan


PS: Using kgdb from inside qemu should work (at least it once did for
me), but it is really slw.



Could you show me the procedure you did? I just want to use this to
learn kernel code.

Thanks,
Neo







--
I would remember that if researchers were not ambitious
probably today we haven't the technology we are using!




Re: [Qemu-devel] Re: Detecting an assembly instruction in QEMU

2007-04-25 Thread Atif Hashmi

Hi Eduardo,

Thanks for pointing me to the file. Could you please clarify one more thing.

Instructions like addl %ebx, (%eax) are also considered to be memory
refernce instructions. Do these type of instructions also refer to the
functions that you mentioned.

Secondly, what is the purpose of undef ASM_SOFTMMU

Thanks,
Atif

On 4/25/07, Atif Hashmi <[EMAIL PROTECTED]> wrote:


Hi Eduardo,

Thanks for pointing me to the file. Could you please clarify one more
thing.

Instructions like addl %ebx, (%eax) are also considered to be assembly
instructions. Do these type of instructions also refer to the functions that
you mentioned.

Thanks,
Atif

On 4/24/07, Eduardo Felipe <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> You have a description of memory access instruction format in cpu-all.h,
> under
> /* CPU memory access without any memory or io remapping */
>
> These instructions are defined in softmmu_header.h. If you don't care
> too much about performance it will be easier to modify the code written in C
> (undef ASM_SOFTMMU in op.c).
>
> Regards,
> Eduardo





[Qemu-devel] qemu/target-mips op_template.c translate.c

2007-04-25 Thread Thiemo Seufer
CVSROOT:/sources/qemu
Module name:qemu
Changes by: Thiemo Seufer  07/04/25 16:41:11

Modified files:
target-mips: op_template.c translate.c 

Log message:
Next attempt to get the lui sign extension right.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/target-mips/op_template.c?cvsroot=qemu&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/qemu/target-mips/translate.c?cvsroot=qemu&r1=1.67&r2=1.68




Re: [Qemu-devel] Re: Detecting an assembly instruction in QEMU

2007-04-25 Thread Atif Hashmi

Hi Eduardo,

Thanks for pointing me to the file. Could you please clarify one more thing.

Instructions like addl %ebx, (%eax) are also considered to be assembly
instructions. Do these type of instructions also refer to the functions that
you mentioned.

Thanks,
Atif

On 4/24/07, Eduardo Felipe <[EMAIL PROTECTED]> wrote:


Hi,

You have a description of memory access instruction format in cpu-all.h,
under
/* CPU memory access without any memory or io remapping */

These instructions are defined in softmmu_header.h. If you don't care too
much about performance it will be easier to modify the code written in C
(undef ASM_SOFTMMU in op.c).

Regards,
Eduardo


[Qemu-devel] Re: How to debug Linux kernel on qemu with kgdb?

2007-04-25 Thread Jan Kiszka
Neo Jia wrote:
> On 4/25/07, Jan Kiszka <[EMAIL PROTECTED]> wrote:
>> Neo Jia wrote:
>> > On 4/25/07, Jan Kiszka <[EMAIL PROTECTED]> wrote:
>> >> Neo Jia wrote:
>> >> > hi,
>> >> >
>> >> > I am trying to use debug kgdb patched linux kernel on my qemu. Both
>> >> > the native and target platform are IA32. I am wondering if there is
>> >> > anyone can show me the procedure?
>> >>
>> >> Yep, see
>> https://mail.gna.org/public/xenomai-core/2006-09/msg00202.html
>> >>
>> >> (BTW, I think that kgdb bug is still unfixed - I never got a
>> feedback.)
>> >
>> > I can connect gdb through /dev/pts/XX. My qemu is lanuched by
>> >
>> > qemu -nographic -hda linux.img -kernel
>> > ./2.6.15.5-kgdb/vmlinuz-2.6.15.5-kgdb -serial pty -append "kgdbwait
>> > console=ttyS0 root=/dev/hda sb=0x220,5,1,5 ide2=noprobe ide3=noprobe
>> > ide4=noprobe ide5=noprobe"
>> >
>> > Do you know where can I get the console output?
>> >
>>
>> Use "... -serial stdio -serial pty ..." and attached kgdb to the second
>> serial port (I think to recall that is default anyway). The first one is
>> then used for the kernel console.
>>
>> > I would like to work out kgdb + qemu to debug linux kernel.
>>
>> ??? So you really want to debug the kernel when kgdb is applied, ie.
>> actually debug kgdb? If you only intend to debug the kernel itself, qemu
>> -s + gdb is enough.
> 
> Jan,
> 
> I just would like to debug kernel itself. I have tried qemu -s + gdb
> but it keeps
> getting "apic_timer_interrupt" when I am using "n" command.
> 
> The following is the output:
> 
>> gdb vmlinux
> GNU gdb 6.5.50.20060621-cvs
> Copyright (C) 2006 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you
> are
> welcome to change it and/or distribute copies of it under certain
> conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB.  Type "show warranty" for details.
> This GDB was configured as "i686-pc-linux-gnu"...Using host
> libthread_db library "/lib/tls/libthread_db.so.1".
> 
> (gdb) target remote localhost:1234
> Remote debugging using localhost:1234
> 0xfff0 in ?? ()
> warning: shared library handler failed to enable breakpoint
> (gdb) c
> Continuing.
> 
> Program received signal SIGINT, Interrupt.
> default_idle () at include/asm/bitops.h:252
> 252 return ((1UL << (nr & 31)) & (addr[nr >> 5])) != 0;
> (gdb) b sys_ex
> sys_execve  sys_exitsys_exit_group
> (gdb) b sys_execve
> Breakpoint 1 at 0xc0101ac1: file arch/i386/kernel/process.c, line 791.
> (gdb) c
> Continuing.
> 
> Breakpoint 1, sys_execve (regs=
>  {ebx = 135197704, ecx = 135197864, edx = 135244936, esi =
> 135197704, edi = 135197704, ebp = -1079176984, eax = 11, xds = 123,
> xes = 123, orig_eax = 11, eip = -1208835017, xcs = 115, eflags = 582,
> esp = -1079177012, xss = 123})
>at arch/i386/kernel/process.c:791
> 791 filename = getname((char __user *) regs.ebx);
> (gdb) n
> 0xc0103666 in apic_timer_interrupt () at include/asm/current.h:9
> 9   {

That's normal. You stopped the kernel in sys_execve with interrupts
enabled. When continuing, qemu replays any pending interrupts, here the
timer. Thus your next instruction is not in sys_execve, but in the
interrupt handler. You can try finish then and hope that you will return
to the next line in sys_execve, or you put another breakpoint at the
next interesting spot and just issue continue.

Jan


PS: Using kgdb from inside qemu should work (at least it once did for
me), but it is really slw.



signature.asc
Description: OpenPGP digital signature


[Qemu-devel] Re: How to debug Linux kernel on qemu with kgdb?

2007-04-25 Thread Neo Jia

On 4/25/07, Jan Kiszka <[EMAIL PROTECTED]> wrote:

Neo Jia wrote:
> On 4/25/07, Jan Kiszka <[EMAIL PROTECTED]> wrote:
>> Neo Jia wrote:
>> > hi,
>> >
>> > I am trying to use debug kgdb patched linux kernel on my qemu. Both
>> > the native and target platform are IA32. I am wondering if there is
>> > anyone can show me the procedure?
>>
>> Yep, see https://mail.gna.org/public/xenomai-core/2006-09/msg00202.html
>>
>> (BTW, I think that kgdb bug is still unfixed - I never got a feedback.)
>
> I can connect gdb through /dev/pts/XX. My qemu is lanuched by
>
> qemu -nographic -hda linux.img -kernel
> ./2.6.15.5-kgdb/vmlinuz-2.6.15.5-kgdb -serial pty -append "kgdbwait
> console=ttyS0 root=/dev/hda sb=0x220,5,1,5 ide2=noprobe ide3=noprobe
> ide4=noprobe ide5=noprobe"
>
> Do you know where can I get the console output?
>

Use "... -serial stdio -serial pty ..." and attached kgdb to the second
serial port (I think to recall that is default anyway). The first one is
then used for the kernel console.


I also tried this but it seems that kgdb cannot connect to /dev/pts/XX
with "-serial stdio".
I did anything wrong?

Thanks,
Neo



> I would like to work out kgdb + qemu to debug linux kernel.

??? So you really want to debug the kernel when kgdb is applied, ie.
actually debug kgdb? If you only intend to debug the kernel itself, qemu
-s + gdb is enough.

Jan






--
I would remember that if researchers were not ambitious
probably today we haven't the technology we are using!




[Qemu-devel] Re: How to debug Linux kernel on qemu with kgdb?

2007-04-25 Thread Neo Jia

On 4/25/07, Jan Kiszka <[EMAIL PROTECTED]> wrote:

Neo Jia wrote:
> On 4/25/07, Jan Kiszka <[EMAIL PROTECTED]> wrote:
>> Neo Jia wrote:
>> > hi,
>> >
>> > I am trying to use debug kgdb patched linux kernel on my qemu. Both
>> > the native and target platform are IA32. I am wondering if there is
>> > anyone can show me the procedure?
>>
>> Yep, see https://mail.gna.org/public/xenomai-core/2006-09/msg00202.html
>>
>> (BTW, I think that kgdb bug is still unfixed - I never got a feedback.)
>
> I can connect gdb through /dev/pts/XX. My qemu is lanuched by
>
> qemu -nographic -hda linux.img -kernel
> ./2.6.15.5-kgdb/vmlinuz-2.6.15.5-kgdb -serial pty -append "kgdbwait
> console=ttyS0 root=/dev/hda sb=0x220,5,1,5 ide2=noprobe ide3=noprobe
> ide4=noprobe ide5=noprobe"
>
> Do you know where can I get the console output?
>

Use "... -serial stdio -serial pty ..." and attached kgdb to the second
serial port (I think to recall that is default anyway). The first one is
then used for the kernel console.

> I would like to work out kgdb + qemu to debug linux kernel.

??? So you really want to debug the kernel when kgdb is applied, ie.
actually debug kgdb? If you only intend to debug the kernel itself, qemu
-s + gdb is enough.


Jan,

I just would like to debug kernel itself. I have tried qemu -s + gdb
but it keeps
getting "apic_timer_interrupt" when I am using "n" command.

The following is the output:


gdb vmlinux

GNU gdb 6.5.50.20060621-cvs
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...Using host
libthread_db library "/lib/tls/libthread_db.so.1".

(gdb) target remote localhost:1234
Remote debugging using localhost:1234
0xfff0 in ?? ()
warning: shared library handler failed to enable breakpoint
(gdb) c
Continuing.

Program received signal SIGINT, Interrupt.
default_idle () at include/asm/bitops.h:252
252 return ((1UL << (nr & 31)) & (addr[nr >> 5])) != 0;
(gdb) b sys_ex
sys_execve  sys_exitsys_exit_group
(gdb) b sys_execve
Breakpoint 1 at 0xc0101ac1: file arch/i386/kernel/process.c, line 791.
(gdb) c
Continuing.

Breakpoint 1, sys_execve (regs=
 {ebx = 135197704, ecx = 135197864, edx = 135244936, esi =
135197704, edi = 135197704, ebp = -1079176984, eax = 11, xds = 123,
xes = 123, orig_eax = 11, eip = -1208835017, xcs = 115, eflags = 582,
esp = -1079177012, xss = 123})
   at arch/i386/kernel/process.c:791
791 filename = getname((char __user *) regs.ebx);
(gdb) n
0xc0103666 in apic_timer_interrupt () at include/asm/current.h:9
9   {
(gdb) quit

Thanks,
Neo



Jan






--
I would remember that if researchers were not ambitious
probably today we haven't the technology we are using!




[Qemu-devel] qemu/target-mips translate.c

2007-04-25 Thread Thiemo Seufer
CVSROOT:/sources/qemu
Module name:qemu
Changes by: Thiemo Seufer  07/04/25 13:58:52

Modified files:
target-mips: translate.c 

Log message:
Fix lui sign extension.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/target-mips/translate.c?cvsroot=qemu&r1=1.66&r2=1.67




Re: [Qemu-devel] OpenHackWare hacking

2007-04-25 Thread David Woodhouse
On Fri, 2007-04-20 at 16:08 -0700, Ed Swierk wrote:
> - The Fedora 6 version of yaboot looks for a "conf=" parameter in the 
> bootargs 
> to tell it where to find yaboot.conf; OHW needs to read this parameter from 
> the boot script and pass it along.

That's optional -- if you don't pass it, then yaboot should
find /etc/yaboot.conf instead of the 32-bit-specific one, and you'll
have to manually choose 'linux32' instead of the default 'linux64'. But
the installer should work nonetheless.

-- 
dwmw2





Re: [Qemu-devel] Minos-type integrity checking in QEMU

2007-04-25 Thread maestro
Hello Shashi!

you might wanna take a look at the argos [0] project. they do exactly
that kind of stuff.
we implemented something quite similar as the base of my masters thesis
a technical report is available at [1] although what you need is only
covered in a single chapter.

btw. i found it to be easier to make the changes in translate.c instead
of changing every op in op.c

cheers
m.

[0] http://www.few.vu.nl/argos/
[1] http://seclab.tuwien.ac.at/papers/tqana.pdf

Am Mittwoch, den 25.04.2007, 01:16 -0700 schrieb Shashidhar Mysore:
> Hi,
> 
> I am trying to incorporate into QEMU (x86) some structures to maintain
> integrity of data that flows in the processor. Specifically, I want to
> maintain a bit for every physical memory address and transfer the
> state information for every address along onto the virtual memory, and
> also down to the instructions which operate on data, and bit arrays
> for registers (so that when an operand is fetched from a particular
> register, we also have the state information for that register). I am
> trying to build a Minos type architecture
> ( http://minos.cs.ucdavis.edu/) but in QEMU instead of Bochs. 
> 
> For this, as far as I can see, I need to maintain a set of new
> structures to shadow the physical memory and make changes to the micro
> ops defined in target-i386/op.c so that every instruction can track
> the state and store them for every register used as an operand. I'm
> not sure if somebody has already implemented such a system on QEMU? I
> am just beginning to think and work on this, so any
> pointers/suggestions would be greatly appreciated. Please let me know
> your views on this. 
> 
> Thanks,
> -Shashi.





[Qemu-devel] sh4: minor fixes for current cvs

2007-04-25 Thread Magnus Damm

Hi everyone,

Attached are a few minor fixes for the sh4 user space emulator. Please commit.

I will continue to improve the sh4 user space and system emulation
code in the near future, so feel free to send any qemu on sh4 related
questions or comments to me!

Thanks in advance,

/ magnus
sh4: Use 16-bit uid wrappers

Without this patch a simple hello world program emits this:
qemu: Unsupported syscall: 47

Signed-off-by: Magnus Damm <[EMAIL PROTECTED]>

--- 0001/linux-user/syscall.c
+++ work/linux-user/syscall.c	2007-04-17 11:48:24.0 +0900
@@ -74,7 +74,7 @@
 //#define DEBUG
 
 #if defined(TARGET_I386) || defined(TARGET_ARM) || defined(TARGET_SPARC) \
-|| defined(TARGET_M68K)
+|| defined(TARGET_M68K) || defined(TARGET_SH4)
 /* 16 bit uid wrappers emulation */
 #define USE_UID16
 #endif
sh4: Fix opcode for sts.l fpul/cpscr

0x4052/0x4062 should be used instead of 0x0052/0x0062 according to the
SH-4 Software Manual.

Signed-off-by: Magnus Damm <[EMAIL PROTECTED]>

--- 0001/target-sh4/translate.c
+++ work/target-sh4/translate.c	2007-04-17 15:51:36.0 +0900
@@ -1003,8 +1003,8 @@ void decode_opc(DisasContext * ctx)
 	LDST(mach, 0x400a, 0x4006, lds, 0x000a, 0x4002, sts,)
 	LDST(macl, 0x401a, 0x4016, lds, 0x001a, 0x4012, sts,)
 	LDST(pr, 0x402a, 0x4026, lds, 0x002a, 0x4022, sts,)
-	LDST(fpul, 0x405a, 0x4056, lds, 0x005a, 0x0052, sts,)
-	LDST(fpscr, 0x406a, 0x4066, lds, 0x006a, 0x0062, sts, ctx->flags |=
+	LDST(fpul, 0x405a, 0x4056, lds, 0x005a, 0x4052, sts,)
+	LDST(fpscr, 0x406a, 0x4066, lds, 0x006a, 0x4062, sts, ctx->flags |=
 	 MODE_CHANGE;)
 case 0x00c3:		/* movca.l R0,@Rm */
 	gen_op_movl_rN_T0(REG(0));
sh4: Fix inc8 and dec8 operations

We should increment and decrement by 8 according to the SH-4 Software Manual.

Signed-off-by: Magnus Damm <[EMAIL PROTECTED]>

--- 0001/target-sh4/op.c
+++ work/target-sh4/op.c	2007-04-25 16:18:47.0 +0900
@@ -737,7 +737,7 @@ void OPPROTO op_dec4_rN(void)
 
 void OPPROTO op_dec8_rN(void)
 {
-env->gregs[PARAM1] -= 4;
+env->gregs[PARAM1] -= 8;
 RETURN();
 }
 
@@ -761,7 +761,7 @@ void OPPROTO op_inc4_rN(void)
 
 void OPPROTO op_inc8_rN(void)
 {
-env->gregs[PARAM1] += 4;
+env->gregs[PARAM1] += 8;
 RETURN();
 }
 


[Qemu-devel] Minos-type integrity checking in QEMU

2007-04-25 Thread Shashidhar Mysore

Hi,

I am trying to incorporate into QEMU (x86) some structures to maintain
integrity of data that flows in the processor. Specifically, I want to
maintain a bit for every physical memory address and transfer the state
information for every address along onto the virtual memory, and also down
to the instructions which operate on data, and bit arrays for registers (so
that when an operand is fetched from a particular register, we also have the
state information for that register). I am trying to build a Minos type
architecture ( http://minos.cs.ucdavis.edu/) but in QEMU instead of Bochs.

For this, as far as I can see, I need to maintain a set of new structures to
shadow the physical memory and make changes to the micro ops defined in
target-i386/op.c so that every instruction can track the state and store
them for every register used as an operand. I'm not sure if somebody has
already implemented such a system on QEMU? I am just beginning to think and
work on this, so any pointers/suggestions would be greatly appreciated.
Please let me know your views on this.

Thanks,
-Shashi.