Alchemical Symbols ⭕🟪🧧🥬🟥🟦🟧
←↑→↓↖↙↗↘↕⏤
unicode=Geometric Shapes
▶ 仅仅个别字不同的时候的对比标识
◆
◉ 着重强调
◆ 1、
◆ 2、
◆ 3、
Miscellaneous Symbols
☞
Dingbats
✍ 重点记忆,个人总结的点,或者知识。
✎✎
⟱
⬢命令集⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢命令集⬢
sudo mkdir /home/asd
sudo mount -t vboxsf 1 /home/asd
ls /home/asd
⬢命令集⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢⬢命令集⬢
章节号 | 内容 |
---|---|
1图片格式(png) | 宽度大于610px,保持高宽比减低为620px |
1-1 | 应用 |
1-1-1 | 方法 |
第6章节 使用Bochs( Using Bochs)
After starting Bochs either from the command prompt or the OS shell, the following steps are done before the simulation is running.
在从命令提示符或OS shell启动Bochs之后,在运行模拟之前完成以下步骤:
◆ parse command line (except bochsrc options)
◆ load selected config file (bochsrc) or search for the default one
◆ parse remaining command line options (bochsrc syntax)
◆ initialize configuration interface
◆ enter start menu / dialog (unless quick start mode is enabled)
◆ initialize all parts of the simulator
◆ enter debugger prompt / dialog (if present)
◆ enter the simulation loop
During simulation, Bochs usually generates more or less log output. By default it is sent to the console, otherwise to the specified log file. The amount of output can be controlled with the log options in bochsrc, the start menu and the runtime configuration.
Under certain conditions Bochs can cause a panic and usually asks the user what to do. If such a panic happens during startup, it is mostly a configuration or permission problem and we recommend to quit Bochs and to review the bochsrc options used.
To quit the simulation, the "power" button in the Bochs headerbar should be used, unless the guest OS has the capability to turn off the computer (APM or ACPI).
If a Bochs runtime issue cannot be fixed by configuration changes and it has not yet been reported in the bochs-developers mailing list or the SF trackers for Bochs, it should be reported in the mailing list or the SF bug tracker for the Bochs project.
-
6-1 使用Bochs — Command line arguments
The following table shows the arguments that can be used on the command line. For other arguments, see section bochsrc.
| Argument | Description |
| -------------------- | ---------------------------------------------------------- |
| -q | quick start (skip configuration interface) |
| -f `*filename*` | specify configuration file |
| -log `*filename*` | specify Bochs log file |
| -dbglog `*filename*` | specify Bochs internal debugger log file |
| -n | don't try to load a configuration file |
| -r `*path*` | specify path for restoring state |
| -noconsole | disable console window (Windows only) |
| --help | display help message and exit |
| --help features | display available features / devices and exit |
| --help cpu | display supported CPU models and exit (CPU level > 4 only) |
例子:
eqweq@pop-os:/$ bochs --help cpu
========================================================================
Bochs x86 Emulator 2.6.9
Built from SVN snapshot on April 9, 2017
Compiled on Nov 25 2019 at 08:07:22
========================================================================
Supported CPU models:
bx_generic
pentium
pentium_mmx
amd_k6_2_chomper
p2_klamath
p3_katmai
p4_willamette
core_duo_t2400_yonah
atom_n270
00000000000i[SIM ] quit_sim called with exit code 0
These arguments are handled directly after starting Bochs. The next step is to load a default or specified configuration file (unless disabled with -n). Then the rest of the command line (bochsrc options) is parsed. This is done after reading the configuration file so that the command line arguments can override the settings from the file.
命令行参数设置优先级比配置文件高,如果命令行参数设定了某些值,文件中的值将被覆盖不再执行。
-
6-2 使用Bochs — Search order for the configuration file
If no configuration file is specified on the command line and config file loading is not disabled, Bochs searches for a default configuration file. This is the search order:
如果在命令行上未指定配置文件,并且未禁用配置文件加载,则Bochs将搜索默认配置文件。
1、.bochsrc in the current directory
2、bochsrc in the current directory
3、bochsrc.txt in the current directory
4、(win32 only) bochsrc.bxrc in the current directory
5、(Unix only) .bochsrc in the user's home directory
6、(Unix only) bochsrc in the /etc directory
-
6-3 使用Bochs — The configuration interface 'textconfig'
6-3-1. 使用Bochs — The configuration interface 'textconfig' — The start menu
If you start Bochs without the quickstart argument (-q), the Bochs configuration main menu appears:
Here you can load, edit and save the configuration and finally start the simulation. It is possible to start Bochs without a config file and to edit all the settings using the item "Edit options". Don't forget to save the configuration if you want to use this setup for another Bochs session.
6-3-2. 使用Bochs — The configuration interface 'textconfig' — The Bochs headerbar
The headerbar appears on top of the Bochs simulation window. Here you can control the behavoiur of Bochs at runtime if you click on one of these buttons:
floppy buttons
Here you can toggle the status of the floppy media (inserted/ejected). 可以切换软盘介质的状态(插入/弹出)。Bochs for win32 presents you a small dialog box for changing the floppy image. You can setup floppy drives using floppya/floppyb option.
cdrom button
Here you can toggle the media status of the first CD-ROM drive (inserted/ejected). CD-ROM drives can be set up using ata(0-3)-master/-slave option. On some platforms this button brings a up a small dialog box for changing the CD-ROM image.
mouse button
Here you can enable the creation of mouse events by the host. Once mouse events are captured, you cannot reach the button anymore, in order to disable capturing again. By default you can enable and disable the mouse capture pressing the CTRL key and the third (middle) mouse button. See the mouse option parameter 'toggle' for other methods to toggle the mouse capture.
使用ctrl+鼠标中键的组合键,来取消鼠标捕捉。
Note: Changing the mouse capture at runtime is not supported by all display libraries, but it is already present on RFB, SDL, SDL2, VNCSRV, Win32, wxWidgets and X11.
Note: Support for 2 button mouse to toggle the capture mode not yet complete - using another toggle method is recommended in that case.
user button
Press this button if you want to send the keyboard shortcut defined with the user_shortcut parameter of the keyboard option to the guest. Depending on the used display_library option, it may even be possible to edit the shortcut before sending it.
copy button
The text mode screen text can be exported to the clipboard after pressing this button. The button has no effect in graphics mode.
paste button
Text in the clipboard can also be pasted, through Bochs, to the guest OS, as simulated keystrokes. Keyboard mapping must be enabled to make this feature work.
snapshot button
Press this button if you want to save a snapshot of the Bochs screen. All text and graphics modes are now supported. If gui dialogs are supported (e.g. on win32) Bochs presents you a "Save as..." dialog box to specify the filename. All other platforms are using the fixed filenames "snapshot.txt" or "snapshot.bmp".
config button
This button stops the Bochs simulation and starts the runtime configuration. (see below).
停止模拟,进行runtime设置。
reset button
Press this button to trigger a hardware reset.
硬件重启。
suspend button
Press this button to save current simulation state to a disk. The simulation could be restored back using bochs -r command. For more details read the Save and restore simulation section.
暂停按钮。把当前模拟的状态存入(虚拟机)硬盘。可以使用bochs -r命令重新加载模拟。??
power button
This button stops the simulation and quits bochs.
Some of this features may not be implemented or work different on your host platform.
6-3-3. 使用Bochs — The configuration interface 'textconfig' — The runtime configuration
If you want to change certain settings at runtime, you have to press the "config" button in the headerbar. The simulation stops and the runtime menu appears on the console window / xterm.
In the runtime configuration you can change the floppy/cdrom image or device, change the log options or adjust some other settings. If you have trouble with a specific device, you can change the log options for this device only to get more information (e.g. report debug messages).
-
6-4 使用Bochs — Pre-defined CPU models
If Bochs is compiled with cpu level 5 or higher the CPUID opcode is supported and it can return some information about the cpu model and it's features. When using a pre-defined CPU model in Bochs the features reported by CPUID are set up according to the model's specification. The following table shows all available CPU models with a short description. The amount of choices depends on the CPU features enabled at compile time (3rd column).
| Value | Description | Required Features |
| ------------------------- | ------------------------------------------------------------ | ------------------------ |
| bx_generic | Default Bochs CPU configured with [CPUID](http://bochs.sourceforge.net/doc/docbook/user/bochsrc.html#BOCHSOPT-CPUID) option | cpu level 5 |
| pentium | Intel Pentium (P54C) | cpu level 5 |
| pentium_mmx | Intel Pentium MMX | cpu level 5 |
| amd_k6_2_chomper | AMD-K6(tm) 3D processor (Chomper) | cpu level 5 |
| p2_klamath | Intel Pentium II (Klamath) | cpu level 6 |
| p3_katmai | Intel Pentium III (Katmai) | cpu level 6 |
| p4_willamette | Intel(R) Pentium(R) 4 (Willamette) | cpu level 6 |
| core_duo_t2400_yonah | Intel(R) Core(TM) Duo CPU T2400 (Yonah) | cpu level 6 |
| atom_n270 | Intel(R) Atom(TM) CPU N270 | cpu level 6 |
| p4_prescott_celeron_336 | Intel(R) Celeron(R) 336 (Prescott) | cpu level 6, x86-64 |
| athlon64_clawhammer | AMD Athlon(tm) 64 Processor 2800+ (Clawhammer) | cpu level 6, x86-64 |
| athlon64_venice | AMD Athlon(tm) 64 Processor 3000+ (Venice) | cpu level 6, x86-64 |
| turion64_tyler | AMD Turion(tm) 64 X2 Mobile TL-60 (Tyler) | cpu level 6, x86-64 |
| phenom_8650_toliman | AMD Phenom X3 8650 (Toliman) | cpu level 6, x86-64 |
| core2_penryn_t9600 | Intel Mobile Core 2 Duo T9600 (Penryn) | cpu level 6, x86-64 |
| corei5_lynnfield_750 | Intel(R) Core(TM) i5 750 (Lynnfield) | cpu level 6, x86-64 |
| corei5_arrandale_m520 | Intel(R) Core(TM) i5 M 520 (Arrandale) | cpu level 6, x86-64 |
| corei7_sandy_bridge_2600k | Intel(R) Core(TM) i7-2600K (Sandy Bridge) | cpu level 6, x86-64, avx |
| zambezi | AMD FX(tm)-4100 Quad-Core Processor (Zambezi) | cpu level 6, x86-64, avx |
| trinity_apu | AMD A8-5600K APU (Trinity) | cpu level 6, x86-64, avx |
| ryzen | AMD Ryzen 7 1700 | cpu level 6, x86-64, avx |
| corei7_ivy_bridge_3770k | Intel(R) Core(TM) i7-3770K CPU (Ivy Bridge) | cpu level 6, x86-64, avx |
| corei7_haswell_4770 | Intel(R) Core(TM) i7-4770 CPU (Haswell) | cpu level 6, x86-64, avx |
| broadwell_ult | Intel(R) Processor 5Y70 CPU (Broadwell) | cpu level 6, x86-64, avx |
-
6-5 使用Bochs — Save and restore simulation
Bochs has now full save/restore support. The state of cpu(s), memory, devices and hard drive images [1] can be saved. When running Bochs there will be a button in the header bar called "Suspend". Depending on config interface and gui there will be a prompt where you can enter a path to an existing directory or a gui folder selection dialog box. It is possible to save the state at any time, but we recommend to do it when the simulation is idle. After pressing OK/Enter, Bochs will save a set of files into the selected folder. It is possible to continue after saving the state, but when using the restore function in a new Bochs session, all changes after this checkpoint will be lost.
To restore the saved simulation state you can select the restore function in the text mode start menu or specify the restore path at the command line:
bochs -r /path/to/save-restore-data
Then Bochs will start up using the saved configuration and log options, restores the state of the hardware and begins the simulation. In the restore mode Bochs will ignore bochsrc options from the command line and does not load a normal config file.
The disk image mode "vvfat" does not support save/restore. All other disk image modes copy the whole image or the file containing changes (journal). This may take some time, so be patient when using this feature.
-
6-6 使用Bochs — Using sound
6-6-1. 使用Bochs — Using sound — Sound basics
Bochs supports two types of soundcards (SB16 ISA and ES1370 PCI) and the legacy PC speaker. The lowlevel sound interface provides a set of functions for wave (PCM) input / output and MIDI output using the host sound system. A driver must not implement all of these functions. The following table shows the supported drivers and their features.
| Name | Description | Wave input | MIDI output |
| ---- | ----------------------------------------------------------------------- | ---------- | ----------- |
| alsa | use the default ALSA PCM device and the default ALSA sequencer on Linux | Yes | Yes |
| oss | use the Open Sound System on Linux and FreeBSD | Yes | Yes |
| osx | for output on Mac OS 9 and Mac OSX | No | Yes |
| sdl | for wave output on platforms supported by SDL (1.2.x or 2.x) | No | No |
| win | for output to the midi and wave mapper of Windows | Yes | Yes |
These special values are also valid for the sound driver:
◆default - select platform-default sound driver.
◆file - wave and MIDI output to file(s)
◆dummy - no output at all
When compiling Bochs, the lowlevel sound support is activated if one of the soundcards is enabled (--enable-sb16
or --enable-es1370
). The configure script detects the available drivers and sets up a platform-default one.
At runtime the lowlevel sound module will be loaded automatically if one of the sound devices is enabled in the. The drivers and devices for wave input / output and MIDI output must be set up with the sound option.
6-6-2. 使用Bochs — Using sound — The PC speaker
The PC speaker is connected to the PIT 8254 timer #2 and generates a square wave beep with a frequency depending on the timer value. In Bochs the speaker is a separate plugin that is controlled by the two events "beep on" and "beep off". The "beep on" event is also called when the frequency changes while turned on.
The destination for the speaker output can be selected with the mode
parameter of the speaker option. Three choices are available:
◆sound : the beep is generated by the square wave generator which is a part of the lowlevel sound support.
◆system : only available on Linux and Windows. On Linux /dev/console is used for output and on Windows the Beep() function.
◆gui : forwards the beep to the related gui methods (currently only used by the Carbon gui).
6-6-3. 使用Bochs — Using sound — SB16 runtime configuration
Most of the SB16 configuration parameters are available in the runtime configuration menu or dialog. In addition to this, there is a small program called SB16CTRL to change emulation settings from inside the simulation.
Runtime options
Unlike other devices, the SB16 emulation has it's own logfile and a loglevel parameter to control what should be printed there. Both the log
file and loglevel
parameters can be changed at runtime. See the sb16 bochsrc option for details.
The output parameters midimode
, midifile
, wavemode
and wavefile
are also available at runtime.
The dmatimer
parameter controls the DMA timing for wave (PCM) input and output. When you get non-continuous sound this value can be ajusted to fix this. This needs a reasonably correct setting for the cpu: ips option.
SB16CTRL
The source for the SB16CTRL program that is used to modify the runtime behavior of the SB16 emulation is included in misc/sb16/. It is a C program that can be run from inside the emulation.
It currently supports the following commands:
| Option | Description |
| ------------------- | ------------------------------------------------------------ |
| `-i *number*` | Show the selected emulator info string, e.g. **sb16ctrl -i 3** to show how many patch translations are active. |
| `-t *six numbers*` | Load a translation into the translation table. The numbers are: "OldBankMSB,OldBankLSB,OldProgram,NewBankMSB,NewBankLSB,NewProgram". All values can be 0..127 or 255. 255 for "Old" values means *match any* and for "New" values means *don't change*, e.g. **sb16ctrl -t 255,255,0,255,255,32** to change patch 0 (Piano) to patch 32 (Acoustic Bass). |
| `-r` | Reset the patch translation table e.g. **sb16ctrl -r**. |
| `-m *some numbers*` | Upload the given numbers to the midi output device. Note that it should be a complete midi message, and also that it is subject to patch translation, e.g. **sb16ctrl -m 0x80,64,0** to send a note-off message to channel 0. |
| `-f *filename*` | Read in a file and execute the commands in it. These have the same format as the above commands, except that they don't have the dash "-" in front of them. Comment lines are supported and start with a hash sign "#". |
| `-h` | Show a brief summary of the commands. |
All numbers can be valid parameters to the strtol() function, so hex and octal notation is fine. They have to be delimited by either commas "," or slashes "/", spaces are not allowed.
The command line can have any number of commands. However, if none are given, "-f -" is assumed, which means commands are taken from stdin.
第7章节 问题及解决( Common problems and what to do about them (Troubleshooting))
-
7-1 问题及解决 — Bochs panics! What can I do?
Bochs does a very good job in emulating an x86 compatible computer, however, it does not (yet) include a full (100%) emulation of every possible instruction, (BIOS) function call or (hardware) device. Thus, in case something unusual happens, either a not-so-common call to some (BIOS) function or device by some software running inside of it, Bochs has two possibilities to react: If the command doesn't look important (mainly happens only to non-implemented functions in the BIOS), a notice is logged to the log file and the emulation continues. If, however, the command looks important, Bochs panics, because the software being emulated might depend on the successful execution of the given instruction or behavior of the device.
A panic does not always mean that the software won't run inside of Bochs, as the software might just be probing the computer for the presence of some instruction/device, and in case it is not found, it simply won't be used at all, by the software.
You can tell Bochs what to do in case of a panic, by re-configuring the panic option. If you change the action to "ask", Bochs reports what has happened and asks you what to do. The appearance of the "ask" feature depends on the display library used and the platform. Some display libraries don't support it at all.
“ask”功能的外观取决于使用的显示库和平台。一些显示库根本不支持它。
Some of the device names reported in the panic message are abbreviations, since the length of the 'prefix' is limited to 6 characters. The log function module table may help you finding out the name of the device that caused the panic. It also gives you a short description of the module.
-
7-2 问题及解决 — Mouse behavior, enabling and disabling
Refer to Section 5.3.2 for information on how to enable or disable the mouse inside of Bochs at run-time.
The mouse cursor movement speed mostly doesn't match the real movement. This is caused by the variable emulation speed (from the user's point of view) and the relative mouse position data that standard PS/2, serial or USB mice are generating. The alternative is the USB tablet emulation that generates absolute mouse position data. We recommend to use it with the display libraries 'rfb' and 'vncsrv'.
-
7-3 问题及解决 — Text-mode is broken in some ancient DOS progra
If you are using a program written for DOS which seems to use the text-mode but doesn't display the text properly, you can try the other VGA BIOS, either VGABIOS-lgpl-latest or VGABIOS-elpin-2.40, see the vgaromimage option.
如果您使用的是一个为DOS编写的程序,该程序似乎使用文本模式,但无法正确显示文本,则可以尝试其他VGA BIOS。
第9章节 技巧( Tips and Techniques)
-
9-1 技巧 — Specify log options by device
This table shows the name used for setting up the log actions per device, the prefix that appears in the log file or when a panic occurs and a short description of the module. This example shows how to turn on debug messages for a specific device in bochsrc.
下方表显示用于设置每个设备的日志操作的名称、日志文件中出现的前缀或出现死机时的前缀以及模块的简短说明。下行代码演示如何在bochsrc中为特定设备打开调试消息。
debug: action=ignore, pci=report
The names can be used in upper case or lower case, since the check is not case sensitive. Note that the module names cannot be checked while reading the config file, since most of the modules do not exist at this point. Invalid names or names of modules not present in the current configuration will cause a panic when the simulation is starting.
**Table 8-1. Log function module names and prefixes**
| Name | Prefix | Description |
| -------------- | ------ | ------------------------------------------------------------ |
| ACPI | ACPI | PIIX4 ACPI controller |
| apic0 | APIC0 | APIC of first CPU |
| BIOS | BIOS | System BIOS |
| busmouse | BUSM | Busmouse |
| BXVGA | BXVGA | VGA adapter with VBE support |
| CD1 | CD1 | Lowlevel CD-ROM support for the first device (if configured, there can be CD2, CD3, CD4, ...) |
| cirrus | CIRRUS | Cirrus SVGA |
| CMOS | CMOS | CMOS RAM + RTC |
| cpu0 | CPU0 | First CPU (SMP emulation can have cpu1, cpu2, cpu3,...) |
| devices | DEV | Devices subsystem |
| DMA | DMA | DMA controller |
| E1000 | E1000 | Intel(R) Gigabit Ethernet |
| es1370 | ES1370 | ES1370 soundcard |
| extfpuirq | EXFIRQ | External FPU IRQ |
| floppy | FLOPPY | Floppy controller |
| gameport | GAME | Standard PC gameport |
| GDBST | GDBST | GDB stub support |
| GUI | GUI | Generic GUI code |
| harddrv | HD | IDE HD/CD emulation |
| hdimage | IMG | Disk image support |
| ioapic | IOAPIC | I/O APIC |
| iodebug | IODBG | I/O interface to debugger |
| keyboard | KBD | PS/2 keyboard and mouse |
| keymap | KEYMAP | Keyboard mapping |
| logio | IO | Bochs logging subsystem |
| memory | MEM0 | Memory management |
| MACGUI | MGUI | MacOS9 / MacOSX gui |
| NE2K | NE2K | NE2000 ethernet adapter |
| NOGUI | NOGUI | GUI without input/output interface ("nogui") |
| parallel | PAR | Parallel port support |
| PCI | PCI | i440FX PCI bridge |
| pci2isa | P2ISA | PCI-to-ISA bridge |
| pcidev | PCIDEV | Host PCI device mapping |
| pcipnic | PNIC | PCI pseudo NIC |
| pci_ide | PIDE | PCI IDE controller |
| pc_system | SYS | CPU-to-devices interface and timing control |
| PIC | PIC | Programmable interrupt controller |
| PIT | PIT | I/O interface for 82C54 timer |
| pit82c54 | PIT81 | 82C54 timer core |
| PLUGIN | PLUGIN | Plugin interface |
| RFB | RFB | RFB gui |
| SB16 | SB16 | SB16 soundcard |
| SCSICD | SCSICD | SCSI CD-ROM emulation for USB |
| SCSIHD | SCSIHD | SCSI hard drive emulation for USB |
| SDL | SDL | SDL 1.2.x gui |
| SDL2 | SDL2 | SDL 2.x gui |
| serial | SER | Serial port emulation |
| serial_raw | SERR | Lowlevel serial port support |
| siminterface | SIM | Simulator interface |
| slowdown_timer | STIMER | Slowdown timer |
| speaker | PCSPK | Lowlevel support for the PC speaker |
| VGAGUI | VGAGUI | SVGA gui |
| TERM | TERM | Term gui |
| unmappped | UNMAP | Unmapped I/O handler |
| usb_cbi | USBCBI | USB (UFI/CBI) floppy emulation |
| usb_ehci | EHCI | USB EHCI controller |
| usb_hid | USBHID | USB HID device emulation |
| usb_hub | USBHUB | External USB hub emulation |
| usb_msd | USBMSD | USB MSD (disk/cdrom) emulation |
| usb_ohci | OHCI | USB OHCI controller |
| usb_printer | USBPR | USB printer emulation |
| usb_uhci | UHCI | USB UHCI controller |
| usb_xhci | XHCI | USB xHCI controller |
| VGA | VGA | Standard VGA |
| vgabios | VBIOS | VGA BIOS |
| virt_timer | VTIMER | Virtual timer |
| WINGUI | WINGUI | WIN32 gui |
| WX | WX | wxWidgets gui |
| XGUI | XGUI | X11 gui |
-
9-2 技巧 — How to make a simple disk image
This was contributed by Greg Alexander in October 2001 and updated by Volker Ruppert in October 2013.
What you need:
◆An executable version of Bochs. See Downloading Bochs and Compiling Bochs.
◆The bximage program, included with Bochs.
◆A FreeDOS boot disk, or a boot disk from another OS capable of producing DOS partitions (e.g. a Linux install disk).
一个FreeDOS启动盘,或者从另一个能够产生DOS分区的OS启动盘
◆(Optional) mtools, a program for manipulating DOS disks/images.
This directory contains mtools. Mtools is a collection of utilities to access MS-DOS disks from GNU and Unix without mounting them. It supports Win'95 style long file names, OS/2 Xdf disks and 2m disks (store up to 1992k on a high density 3 1/2 disk). In addition to file access, it supports many FAT-specific features: volume labels, FAT-specific file attributes (hidden, system, ...), "bad block" map maintenance, access to remote floppy drives, Iomega ZIP disk protection, "secure" erase, display of file's on-disk layout, etc.
Mtools是一组实用程序,用于从GNU和Unix访问MS-DOS磁盘,而无需安装它们。
Mtools' configurator file is stored in /etc/mtools.conf
Create a flat image
**Table 8-5. Supported Disk Modes**
| Name | Description | Features |
| -------- | ------------------------------------------------------------ | ----------------------------------------------------- |
| flat | one file, flat layout | accessible with mtools or winimage-like tools |
| concat | multiple files, concatenated | mappable to contained partitions |
| external | accessed through an external C++ class | developer specific, needs a C++ class at compile time |
| dll | accessed through a DLL | developer specific, windows only |
| sparse | up to 10 layers stackable files | commitable, rollbackable, growing |
| vmware3 | vmware3 disk support | vmware version 3 compatibility |
| vmware4 | vmware4 disk support | vmware version 4 (VMDK) compatibility |
| undoable | read-only base file with a commitable redolog | commitable, rollbackable |
| growing | one growing file | growing |
| volatile | read-only base file with a volatile redolog | always rollbacked |
| vpc | VirtualPC disk support | fixed / dynamic size supported |
| vbox | Oracle(tm) VM VirtualBox disk support | VDI version 1.1 fixed / dynamic size supported |
| vvfat | local directory appears as VFAT disk (with volatile redolog) | optional commit or rollback |
Option 1: Using the Unix dd utility:
方式一,使用linux的dd工具(命令):
You will need to know the geometry of the disk you want to create. You have to compute the disk sector count:
Sectors = Cylinders * Heads * SectorsPerTrack
CHS寻址模式将硬盘划分为磁头(Heads)、柱面(Cylinder)、扇区(Sector)。
◆磁头(Heads):每张磁片的正反两面各有一个磁头,一个磁头对应一张磁片的一个面。因此,用第几磁 头就可以表示数据在哪个磁面。
◆柱面(Cylinder):所有磁片中半径相同的同心磁道构成“柱面",意思是这一系列的磁道垂直叠在一起,就形成一个柱面的形状。简单地理解,柱面数=磁道数。
◆扇区(Sector):将磁道划分为若干个小的区段,就是扇区。虽然很小,但实际是一个扇子的形状,故称为扇区。每个扇区的容量为512字节。
Cylinder柱面数表示硬盘每面盘面上有几条磁道,编号是从0开始,最大为1023,表示有1024个磁道。
Head磁头数表示磁盘共有几个磁头,也就是几面盘面,编号从0开始,最大为255,表示有256个磁头。
Sector/Track扇区数表示每条磁道上有几个扇区,编号从1开始,最大为63,表示63个扇区,每个扇区为512字节,他是磁盘的最小存储单位。
Use the dd command to create your file:
dd if=/dev/zero of=teaching.img bs=512 count=sectors
(replace "sectors" with the number you computed at the previous step).
When you'll update your configuration file, please fill in the same cylinders, heads and sector per track values.
Option 2: Run bximage to create a disk image file. You will be greeted with the following prompt:
Since we want to create a new image, we have to type '1' and then Enter.
由于要创建新图像,必须键入“1”。具体过程如下:
计算过程为:因为Cylinders、Heads都是从0开始计数
所以总扇区数=21x17x63=22,491
每个扇区有512字节,所以总字节数=22848x512=11,515,392字节
因为1M=1024x1024=1,048,576
则11,515,392÷1,048,576=10M
The following line should appear in your bochsrc:
根据上面的生成结果,下面这段设置应该写入bochsrc中:
ata0-master: type=disk, path="teaching.img", mode=flat, cylinders=20, heads=16, spt=63
At this point, a file called "teaching.img" was created in my current directory and is ready to be used as an image file for a Bochs session.
Partition and format your image file