2017年9月3日 星期日

[Linux][Archlinux] How to use bochs to simulate linux-0.12

Install bochs
pacman -S bochs

Download two file from oldlinux
1. bootimage-0.12-20040306
2. rootimage-0.12-20040306

Change permission about two file.
chmod 777 bootimage-0.12-20040306
chmod 777 rootimage-0.12-20040306

Create configuration file(boch.bxrc) under some folder which two file locate.

boch.bxrc

megs:32
romimage: file=$BXSHARE/BIOS-bochs-latest
vgaromimage: file=$BXSHARE/VGABIOS-lgpl-latest
floppya: 1_44=/tmp/test/bootimage-0.12-20040306, status=inserted
floppyb: 1_44=/tmp/test/rootimage-0.12-20040306, status=inserted
boot: a
log: bochsout.txt
mouse: enabled=0

now start bochs to simulate linux0.12
# bochs

Step 1

------------------------------
Bochs Configuration: Main Menu
------------------------------

This is the Bochs Configuration Interface, where you can describe the
machine that you want to simulate.  Bochs has already searched for a
configuration file (typically called bochsrc.txt) and loaded it if it
could be found.  When you are satisfied with the configuration, go
ahead and start the simulation.

You can also start bochs with the -q option to skip these menus.

1. Restore factory default configuration
2. Read options from...
3. Edit options
4. Save options to...
5. Restore the Bochs state from...
6. Begin simulation
7. Quit now

Please choose one: [2] 

Step 2

What is the configuration file name?
To cancel, type 'none'. [none] boch.bxrc

Step 3

This is the Bochs Configuration Interface, where you can describe the
machine that you want to simulate.  Bochs has already searched for a
configuration file (typically called bochsrc.txt) and loaded it if it
could be found.  When you are satisfied with the configuration, go
ahead and start the simulation.

You can also start bochs with the -q option to skip these menus.

1. Restore factory default configuration
2. Read options from...
3. Edit options
4. Save options to...
5. Restore the Bochs state from...
6. Begin simulation
7. Quit now

Please choose one: [6] 

Step 4

Please choose one: [6] 
00000000000i[      ] installing x module as the Bochs GUI
00000000000i[      ] using log file bochsout.txt
Next at t=0
(0) [0x0000fffffff0] f000:fff0 (unk. ctxt): jmpf 0xf000:e05b          ; ea5be000f0
<bochs:1> help

Step 5

<bochs:1> help
h|help - show list of debugger commands
h|help command - show short command description
-*- Debugger control -*-
    help, q|quit|exit, set, instrument, show, trace, trace-reg,
    trace-mem, u|disasm, ldsym, slist
-*- Execution control -*-
    c|cont|continue, s|step, p|n|next, modebp, vmexitbp
-*- Breakpoint management -*-
    vb|vbreak, lb|lbreak, pb|pbreak|b|break, sb, sba, blist,
    bpe, bpd, d|del|delete, watch, unwatch
-*- CPU and memory contents -*-
    x, xp, setpmem, writemem, crc, info,
    r|reg|regs|registers, fp|fpu, mmx, sse, sreg, dreg, creg,
    page, set, ptime, print-stack, ?|calc
-*- Working with bochs param tree -*-
    show "param", restore
<bochs:2> c (press c)

Another screen will show following message.
Then click “CONFIG” to set floppy A to another image

root floppy and press ENTER

Please type “1” to change the image of floppy A.

-----------------------
Bochs Runtime Options
-----------------------
1. Floppy disk 0: /tmp/bootimage-0.12-20040306, inserted
2. Floppy disk 1: /tmp/rootimage-0.12-20040306, inserted
3.
4.
5.
6.
7.
8.
9. Continue simulation
10. Quit now

Please choose one: [9] 1

Please type like following showing.

-----------------------
First Floppy Drive
-----------------------
Enter new filename, or 'none' for no disk: [/tmp/bootimage-0.12-20040306] /tmp/rootimage-0.12-20040306

Skill following settings.
Now show screen like below, then press enter to continue simulation.

-----------------------
Bochs Runtime Options
-----------------------
1. Floppy disk 0: /tmp/bootimage-0.12-20040306, inserted
2. Floppy disk 1: /tmp/rootimage-0.12-20040306, inserted
3.
4.
5.
6.
7.
8.
9. Continue simulation
10. Quit now

Please choose one: [9] 

The screen will show following message that mean we set all environment settings is working now.

[/usr/root]#

0 意見:

張貼留言