Get "Remote failure reply:E01 when using gdb remote debug --
Posted: Mon Aug 04, 2008 1:58 am
in my kernel, I setup the serial port baud rate to 9600 and break points, then I wait for the gdb in the host to connect.
In the host, I start gdb with my kernel image as the argument, set serial baud rate 9600
then gdb prints a message which shows me the connection has been establised
But if I type "next" command, gdb will give me an error message
if I type "step" command at this time, it executes very well.
Does anyone knows how to deal with this problem
My gdb version is GNU gdb 6.6-debian
Below is my gdb stub
Code: Select all
int main()
{
setup_gdt();
setup_idt();
init_serial_port(9600);
printk("setup debug traps");
set_debug_traps();
breakpoint();
func1();
func2();
.....
}
then gdb prints a message which shows me the connection has been establised
Code: Select all
(gdb) set remotebaud 9600
(gdb) target remote /dev/ttyS0
Remote debugging using /dev/ttyS0
breakpoint () at /home/penjyhu/mini-kernel/source/debug/i386-stub.c:957
957 }
Code: Select all
(gdb) next
Remote failure reply: E01Does anyone knows how to deal with this problem
My gdb version is GNU gdb 6.6-debian
Below is my gdb stub
Code: Select all
void putDebugChar(int ch)
{
unsigned timeout = 0xffff;
while ((inportb(serial_base + LSR) & XMTRDY) == 0 && --timeout)
cpu_relax();
outportb( serial_base + TXR, (char)ch);
}
int getDebugChar()
{
unsigned timeout = 0xffff;
unsigned char ch;
while ((inportb(serial_base + LSR) & 0x01) == 0)// && --timeout)
cpu_relax();
ch = inportb(serial_base + RXR);
return ch;
}