- user doc: improved save/restore description

- developer doc: added sections about the parameter tree and save/restore
This commit is contained in:
Volker Ruppert 2006-06-25 12:20:34 +00:00
parent f9754dadeb
commit 2fd7a95cb8
2 changed files with 105 additions and 9 deletions

View File

@ -1,7 +1,7 @@
<!--
================================================================
doc/docbook/development/development.dbk
$Id: development.dbk,v 1.22 2006-05-14 09:16:29 vruppert Exp $
$Id: development.dbk,v 1.23 2006-06-25 12:20:34 vruppert Exp $
This is the top level file for the Bochs Developers Manual.
================================================================
@ -415,6 +415,101 @@ If static methods are used then BX_CPU_THIS_PTR evaluates to BX_CPU(0)->. Ugly,
isn't it?
</para>
</section>
<section id="config-parameter-tree"><title>The configuration parameter tree</title>
<para>
Starting with version 1.3, the Bochs configuration parameters are stored in parameter
objects. These objects have get/set methods with min/max checks and it is possible
to define parameter handlers to perform side effects and to override settings.
Each parameter type has it's own object type with specific features (numeric,
boolean, enum, string and file name). A special object type containing a list of
parameters is designed for building and managing configuration menus or dialogs
automatically. In the original implementation the parameters could be accessed
only with their unique id from a static list or a special structure containing
pointers to all parameters.
</para>
<para>
Starting with version 2.3, the Bochs parameter object handling has been rewritten
to a parameter tree. There is now a root list containing child lists, and these
lists can contain lists or parameters and so on. The parameters are now accessed
by a name build from all the list names in the path and finally the parameter
name separated by periods.
<screen>
Bit32u megs = SIM->get_param_num("memory.standard.ram.size")->get();
</screen>
</para>
<para>
The example above shows how to get the memory size in megabytes from the simulator
interface. In the root list (".") there is child list named "memory" containing
a child list "standard". It's child list "ram" contains the numeric parameter type
"size". The SIM->get_param_num() methods returns the object pointer and the get()
method returns the parameter value.
</para>
<para>
The table below shows all parameter types used by the Bochs configuration interface.
<table>
<title>Parameter types</title>
<tgroup cols="2">
<thead>
<row>
<entry>Type</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>bx_object_c</entry>
<entry>Base class for all the other parameter types. It contains the unique parameter id and the object type value.</entry>
</row>
<row>
<entry>bx_param_c</entry>
<entry>Generic parameter class. It contains the name, label, description and the input/output formats.</entry>
</row>
<row>
<entry>bx_param_num_c</entry>
<entry>Numerical (decimal/hex) config settings are stored in this parameter type.</entry>
</row>
<row>
<entry>bx_param_bool_c</entry>
<entry>This parameter type is based on bx_param_num_c, but it is designed for boolean values. A dependency
list can be defined to enable/disable other parameters depending on the value change.</entry>
</row>
<row>
<entry>bx_param_enum_c</entry>
<entry>Based on bx_param_num_c this parameter type contains a list of valid values.</entry>
</row>
<row>
<entry>bx_param_string_c</entry>
<entry>Configuration strings are stored in this type of parameter.</entry>
</row>
<row>
<entry>bx_param_filename_c</entry>
<entry>Based on bx_param_string_c this parameter type is used for file names.</entry>
</row>
<row>
<entry>bx_list_c</entry>
<entry>Contains a list of pointers to parameters (bx_param_*_c and bx_list_c).
In the config interface it is used for menus/dialogs.</entry>
</row>
</tbody>
</tgroup>
</table>
</para>
</section>
<section id="save-restore"><title>The save/restore feature</title>
<para>
The save/restore feature is based on an extension to the parameter tree concept.
A subtree (list) called "save_restore" appears in the root of the parameter tree
and some new "shadow" parameter types store pointers to values instead of the values
itself. All the hardware objects have register_state() methods to register pointers
to the device registers and switches that need to be saved. The simulator interface
saves the registered data in text format to the specified folder (usually one file
per item in the save/restore list). Large binary arrays are registered with a
special parameter type, so they are saved as separate files.
</para>
<para>
&FIXME; Add some more information here.
</para>
</section>
</section>
<section id="configure-scripting"><title>Configure Scripting</title>

View File

@ -1,7 +1,7 @@
<!--
================================================================
doc/docbook/user/user.dbk
$Id: user.dbk,v 1.216 2006-06-22 18:50:47 vruppert Exp $
$Id: user.dbk,v 1.217 2006-06-25 12:20:34 vruppert Exp $
This is the top level file for the Bochs Users Manual.
================================================================
@ -4901,16 +4901,17 @@ file yet.
</section>
<section id="using-save-restore"><title>Save and restore simulation</title>
<para>
Starting with release 2.3 Bochs has limited save/restore support. The state of
Starting with version 2.3, Bochs has limited save/restore support. The state of
cpu(s), memory and all devices can be saved now. To enable this feature, Bochs
must be compile with the <option>--enable-save-restore</option> option. When running
must be compiled with the <option>--enable-save-restore</option> option. When running
Bochs with save/restore support there will be a new button in the header bar called
"Suspend". Depending on config interface and gui there will be a prompt where you
can enter a path or a gui folder selection dialog box. After pressing OK/Enter,
Bochs will save a set of files into the selected folder. The state of hard disk
images is not handled yet, so Bochs will ask you if you want to continue after
saving state. We don't recommend to continue unless you are running a read-only
guest system (e.g. Live-CD).
can enter a path 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.
The state of hard disk images is not handled yet, so Bochs will ask you if you
want to continue after saving state. We don't recommend to continue unless you
are running a read-only guest system (e.g. Live-CD).
</para>
<para>
To restore the saved simulation state you can select the restore function in the