如果大家按照作者的详细步骤操作时出现如下之类的问题:
warning: No executable has been specified and target does not support
determining executable automatically. Try using the "file" command.
/etc/gdb/gdbinit:3: Error in sourced command file:
Remote 'g' packet reply is too long (expected 308 bytes, got 608 bytes): 0000000000000000685301020080ffff0000000000000000ac2d00020080fffffe000000000000000000000000000000b0ff08000080ffff88ff08000080ffffff0000000000000000000000000000000000000000000000b025010000000000000000000000000000000000000000000000000000000000685301020080ffffe52d00020080ffff4600200008000000100000001000
这个问题是GDB调试64位Kernel时才有的,解决的方法是在进行gdb操作前先在(gdb)后面执行如下语句:
(gdb) set architecture i386:x86-64:intel
(gdb) target remote:1234
Remote debugging using :1234
(gdb) symbol-file Cosmos/build/Cosmos.elf
Reading symbols from Cosmos/build/Cosmos.elf...
(gdb) b *0x04000000
Breakpoint 1 at 0x4000000
(gdb) b *0x04000068
Breakpoint 3 at 0x4000068
(gdb) c
Continuing.
玩吧!
展开
作者回复: 6666
2
摘星
2022-06-08
做完上面流程后 最后使用 qemu-system-x86_64 -drive format=raw,file=hd.img -m 512M -cpu kvm64,smep,smap -s 这个命令,qemu启动了,到grub菜单几秒后 依然弹出 错误提示:"My computer is not support ACPI" 啊? 我已经确定那个init_acpid函数已经注释了,也按照步骤 将hd.img更新了。
作者回复: 可能是没做对
磊
2022-03-27
info all registers 怎么看不到cr0寄存器,搜索了一圈,也没找到gdb能显示cr0这一类控制寄存器的,请教下上图gdb这个怎么出来的?