How to run debug version of bochs non-interactively

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
kurmasz
Posts: 19
Joined: Tue Apr 04, 2017 2:37 pm

How to run debug version of bochs non-interactively

Post 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)?
User avatar
xenos
Member
Member
Posts: 1121
Joined: Thu Aug 11, 2005 11:00 pm
Libera.chat IRC: xenos1984
Location: Tartu, Estonia
Contact:

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

Post 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
Programmers' Hardware Database // GitHub user: xenos1984; OS project: NOS
kurmasz
Posts: 19
Joined: Tue Apr 04, 2017 2:37 pm

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

Post by kurmasz »

That's exactly what I was looking for. Thanks.
Post Reply