Page 1 of 1

How to run debug version of bochs non-interactively

Posted: Thu Jun 01, 2017 11:30 am
by kurmasz
I would like to write some completely automated system tests for my OS (i.e., I run a test script and get a "success" or "fail" message). The problem is that I have the debug features compiled into bochs; thus, when I run "bochs -q" it stops at the debug command line and waits for the user to press "c". Is there a way to tell bochs not to pause at the command line (other than replacing the debug version with the non-debug version)?

Re: How to run debug version of bochs non-interactively

Posted: Thu Jun 01, 2017 11:41 am
by xenos
You can run your bochs version as "bochs -rc somefile.txt", where somefile.txt contains commands to be executed by the debugger, one on each line. I often use something like this to set a breakpoint, run until that point, dump registers and exit:

Code: Select all

lb 0x1234
c
info registers
q

Re: How to run debug version of bochs non-interactively

Posted: Thu Jun 01, 2017 12:01 pm
by kurmasz
That's exactly what I was looking for. Thanks.