点击恢复出厂设置后,系统重启,再次进入系统后,一切数据都被清空,怎样可以得知之前到底是否恢复出厂设置了呢?怎样可以标记恢复出厂设置事件?我希望在系统重启后,根据客户需求,判断出刚刚恢复过出厂设置,然后添加一些响应和处理,同时还要区别于正常开机或者重启,怎么做呢? 最开始遇到这个问题,我束手无策,只是大致猜想应该是在Bootloarder中操作捕捉标记,应该很麻烦,所以发了个帖子询问。...
To debug boot code, set a break point at 0x7C00, because the boot sector of the floppy disk or the MBR is loaded by the BIOS at 0000:7C00. This is a standard of the IBM PC, not a standard in Intel processors.
In my installation, "C:\Program Files\Bochs-2.4.6\docs\user\internal-debugger.html" contains the debugger documentation. Optionally, gdb can be used together with bochs. Note that unlike DOS Debug/WinDBG, the Bochs debugger requires explicit "0x" prefix to represent a hexadecimal value.
Common debugger commands: x (examine memory at a linear address), xp (examine memory at a physical address), set (set register value), show (sets options for CPU mode change, interrupt, etc.), trace, udisasm (disassemble - show assembly instruction in memory), record (record console output into a file), playback (read console input from a file), ldsym/slist (symbol-related).
常用的调试器命令:x(检查内存中某线性地址的内容),xp(检查某物理地址的内容),set(设置寄存器值),show(设置 CPU 模式改变选项、中断等等),trace(跟踪),udisasm (反汇编??显示内存中的汇编指令),record(记录命令行输出到文件中),playback(从文件中读取命令行输入),ldsym/slist(调试符号相关)。
Debugging the FreeDOS kernel
更多:ccontcontinue(类似于 DEBUG/WinDBG 中的 g),sstep(类似于 DEBUG/WinDBG 中的 t),电信传奇私服发布网,pnnext(类似于 DEBUG/WinDBG 中的 p),vb/lb/pb(中断于 虚拟/线性/物理 地址,类似于 WinDBG 中的 bp),ddeldelete(like WinDBG 中的 bd),watch(类似于 WinDBG 中的数据断点),setpmem(设置内存值,类似于 WinDBG 中的 e),rregregsregisters(类似于 DEBUG/WinDBG 中的 r),page(在 线性/物理 地址之间转换),set(自动显示调试信息的选项),?calc(计算简单表达式)。
Bochs 调试器可以作为调试内核的一个很好的开头。为了简单起见,FreeDOS 内核可以被安装在一个虚拟软盘之上。在 Windows 上,要启动 Bochs 调试器的话,使用安装好的传奇外传sf中的 bochsdbg.exe。它会自动在虚拟机启动的当口将它立即中断下来。
More: ccontcontinue (like g in DEBUG/WinDBG), sstep (like t in DEBUG/WinDBG), pnnext (like p in DEBUG/WinDBG), vb/lb/pb (break at virtual/linear/physical address, like bp in WinDBG),热血传奇私服, blistinfo break (lists breakpoints), bpe/bpd (enable/disable breakpoint, like be/bd in WinDBG), ddeldelete (like bd in WinDBG), watch (like data breakpoints in WinDBG), setpmem (sets memory value, like e in DEBUG/WinDBG), crc (computes CRC for a region), info (lists various status information), rregregsregisters (like r in DEBUG/WinDBG),传奇sf, page (converts between linear/physical address), set (options for auto-displaying debugging information), ?calc (calculates simple expressions).
Bochs debugger can be a very good first step to debug the kernel. For simplicity, the FreeDOS kernel can be installed on a virtual floppy disk, and Bochs can boot from it. On Windows, to launch the Bochs debugger, use bochsdbg.exe in the Bochs installation. It will automatically break into the virtual machine as soon as it is started.
在我的安装中,“C:\Program Files\Bochs-2.4.6\docs\user\internal-debugger.html”里面是调试器的文档。另一个选项是将 gdb 与 Bochs 一起使用。注意与 DOS 的 Debug 及 WinDBG 不同的是,Bochs 调试器要求十六进制数必须显式标明 0x 前缀。
To break the virtual machine into the debugger at anytime,传奇sf, press Ctrl+C in the bochsdbg console window.