⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 user.dbk

📁 用vc++编写的虚拟机仿真系统。可以模拟真实操作系统的一些功能。
💻 DBK
📖 第 1 页 / 共 5 页
字号:
<!--================================================================doc/docbook/user/user.dbk$Id: user.dbk,v 1.39 2002/03/28 07:50:34 bdenney Exp $This is the top level file for the Bochs Users Manual.================================================================--><!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [<!-- include definitions that are common to all bochs documentation --><!ENTITY % bochsdefs SYSTEM "../include/defs.sgm">%bochsdefs;]><book><bookinfo>   <title>Bochs User Manual</title>   <authorgroup>   <author><firstname>Kevin</firstname><surname>Lawton</surname></author>   <author><firstname>Bryce</firstname><surname>Denney</surname></author>   <editor><firstname>Michael</firstname><surname>Calabrese</surname></editor>   <editor><firstname>Vasudeva</firstname></editor>   </authorgroup></bookinfo><!-- *************************************************************** --><chapter><title>Introduction to Bochs</title><section id="whatisbochs"><title>What is Bochs?</title><para>Bochs is a program that simulates a complete Intel x86 computer.  It can be configured to act like a 286, 386, 486, Pentium, or Pentium Pro.Bochs interprets every instruction from power-up to reboot, and hasdevice models for all of the standard PC peripherals: keyboard, mouse,VGA card/monitor, disks, timer chips, network card, etc.  Because Bochssimulates the whole PC environment, the the software running in the simulation"believes" it is running on a real machine.  This approach allows Bochsto run a wide variety of software with no modification, include most popularx86 operating systems: Windows 95/98/NT, all Linux flavors, all BSD flavors,and more.</para><para>Bochs is written in the C++ programming language, and is designed to runon many different host platforms<footnote><para>Since Bochs can run on one kind of machine and simulate another machine, wehave to be clear in our terminology to avoid confusion.  The host platform isthe machine that runs the Bochs software.  The guest platform is the operatingsystem and applications that Bochs is simulating.</para></footnote>, including x86, PPC, Alpha, Sun, and MIPS.  No matter what thehost platform is, Bochs still simulates x86 software.  In other words, itdoes not depend on the native instructions of the host machine at all.This is both a strength and a weakness, and it's the major difference betweenBochs and many other x86 emulation software such as plex86, VMware, etc.Because Bochs uses software simulation for every single x86 instruction, itcan simulate a Windows application on an Alpha or Sun workstation.  However,the downside of Bochs's approach is simulation performance.  To model theprocessor accurately, Bochs must run many instructions for every simulated x86instruction, and this makes the simulated machine many times slower thanthe physical machine.  Commercial PC emulators (VMware, Connectix, etc.) canachieve much high emulation speed using a technique called virtualization<footnote><para>Virtualization takes advantage of simulating x86 instructions on anx86 machine, allowing large portions of the simulation to take placeat native hardware speed.  Whenever the simulated machine talks to thehardware or enters certain privileged modes (such as in kernel code),the simulator typically takes control and simulates that code insoftware at much slower speed, just like Bochs does.</para></footnote>, but they are neither portable to non-x86 platforms nor opensource.  <ulink url="http://www.plex86.org">Plex86</ulink>, Kevin Lawton'scurrent project, is working toward an open-source x86 simulator withvirtualization.</para><para>To do anything interesting in the simulated machine, Bochs needs to communicatewith the operating system on the host platform (the host OS).  When you press akey in the Bochs display window, a key event goes into the device model for thekeyboard.  When the simulated machine needs to read from the simulated harddisk, Bochs reads from a disk image file on the host machine.  When thesimulated machine sends a network packet to the local network, Bochs uses thehost platform's network card to send the packet out into the real world.  Theseinteractions between Bochs and the host operating system can be complicated,and in some cases they are host platform specific.  Sending a network packet inFreeBSD requires different code than sending the packet in Windows 95, forexample.  For this reason, certain features are supported on some hostplatforms and not others.  On Linux, Bochs can simulate a network card thatcommunicates with the world, but on BeOS the simulated network card may notwork because the communication code between the device model and the BeOSoperating system has not been written.</para><para><!-- really more like Background or Bochs History, but maybe it doesn't need its own section unless it gets to 3 paras or so  -->Bochs was written by Kevin Lawton starting in 1994.  It began as a commercial product, which you could buy with source code for $25...&NEEDHELP; <footnote><para>We need a Bochs historian to help out here.  For background, it would beinteresting to know how much Bochs used to cost and what it was used for.  Ithought I saw an interview out there somewhere where Kevin says why he startedit and some more background information.</para></footnote> Finally, in March 2000, Mandrakesoft bought Bochs and made it opensource under the GNU LGPL.<!-- we should make it clear that Kevin is no longer working on bochs,but I want to get some more background.  Did he get hired by Mandrakesoftto do plex86 at the same time as Bochs was bought?  In his linux.com interviewKevin said: "The only way I can move Bochs to open source is if someonesponsors that happening. That would be ideal, and would enable me to focus moreon Bochs and FreeMWare, rather than be sidetracked with related consultingjobs."The last version of Bochs that he released was 3/25/2000, three days after theMandrake press release.-->In March 2001, Kevin helped a few developers to move all Bochs activities frombochs.com to a new site at bochs.sourceforge.net.  Since then the Bochs Projecthas settled into its new home, and around release times has even hit #1 mostactive project of the week at Source Forge.  </para> </section>  <!-- end of Introduction:What is Bochs? section --><section><title>Who uses Bochs?</title><para> It is hard to estimate how many people have tried Bochs or use it on aregular basis, but a few statistics give an indication.  The <linklinkend="bochs-developers">bochs-developers mailing list</link>, which is theprimary source of news on bugs and releases, has over 300 subscribers.  Thelatest version has been downloaded over 40,000 times from SourceForge, notcounting mirrors or CVS users.</para><para>Bochs has many possible uses, and different people use it for different things.  Many people use it to run applications in a second operating system without needing two different computers or dual-booting.  Running Windows software on a non-x86 workstation or on an x86 UNIX box are commonuses.  Also, because every hardware instruction and every line of simulatorcode is accessible, Bochs is used extensively for debugging new operatingsystems.  If you were writing boot code for your home-brewedx86 operating system and it didn't work right, booting it in Bochs couldgive you great visibility into what is really going on.  The Bochs debugger lets you simulate quickly or slowly, pausing whenever you wantto look at the contents of memory or the CPU registers.  Or, if you wanted to study which parts of a program take the most time, you could useBochs to measure often pieces of the code were executed.</para><para>Bochs has been used as a teaching tool in Operating Systems classes, in whichstudents used and modified it to learn how the PC hardware works.  As a finalproject the students had to add a new peripheral device, so they had to learnall about I/O ports, interrupts, and device drivers.  Also, it has been used asa reference model to test x86-compatible hardware.  </para><para>There may be as many uses of Bochs as there are users.  Do you want to run your old DOS games?  Or learn to program under Linux, without leaving yourWindows desktop?  Or reverse engineer your printer driver?  You decide.</para></section>  <!-- end of Introduction:Who uses Bochs? section --><section><title>Will it work for me?</title><para>Bochs is very useful for some applications, and not well suited to others.This section tries to answer the question, "Will Bochs work for me?"</para><para> &FIXME; </para><!--I want this section to set reasonable expectations for people before theytry out Bochs.  They should not expect to find blazing speed and complainto the list because Bochs perfoms so poorly compared to their VMWare demo.For simulating x86 on x86, if they want blazing speed they should lookat a commercial simulator or plex86 (though it's still in development soit's not fast yet).Another factor is ease of setup.  With bochs you have to go editing configfiles in a text editor (with a very picky syntax), which is not for everybody.<para>If you are running on a x86 hardware, you have a range of choices.Check the installation section for your host platform to see what options Bochs supports on your platform<footnote><para>&FIXME; Well, it will when it has been written.</para></footnote>.  Bochs will run on Windows, Linux,FreeBSD, OpenBSD, or BeOS.  If the most important factor is speed, you maywant to try a virtualization product instead of Bochs (VMware, plex86).</para><para>If you are using a non-x86 machine, then Bochs is one of the few choices forrunning x86 software.  Bochs has been known to work on Solaris (Sparc), Linux (PowerPC/Alpha), MacOS (PowerPC), IRIX (MIPS), BeOS (PowerPC), DigitalUNIX (Alpha), and AIX (PowerPC).</para>--><para>You can also find more detailed testing information on the testingstatus page on the &bochswebsite;.  The testing status page tells whichcombinations of host platform and guest platform have been tried by other Bochsusers.</para></section>  <!-- end of Introduction:Will it work for me? section --><section><title>License</title><para>Bochs is copyrighted by MandrakeSoft S.A.<footnote><para>MandrakeSoft has web sites at<ulink url="http://mandrakesoft.com">http://mandrakesoft.com</ulink> and<ulink url="http://www.linux-mandrake.com">http://www.linux-mandrake.com</ulink>.</para></footnote>and distributed under theGNU Lesser General Public License<footnote><para>Complete text of the GNU LGPL is included with the source code in a filecalled COPYING, and is also <ulink url="http://www.gnu.org/licenses/lgpl.html">here</ulink>.</para></footnote>.  The following text appears at thetop of every source code file in the Bochs distribution:<programlisting>  This library is free software; you can redistribute it and/or  modify it under the terms of the GNU Lesser General Public  License as published by the Free Software Foundation; either  version 2 of the License, or (at your option) any later version.  This library is distributed in the hope that it will be useful,  but WITHOUT ANY WARRANTY; without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU  Lesser General Public License for more details.  You should have received a copy of the GNU Lesser General Public  License along with this library; if not, write to the Free Software  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA</programlisting></para></section>  <!-- end of Introduction:License section --><section><title>Features</title><para>The following table shows the features of Bochs and which platforms theycurrently work with.</para><table><title>Bochs Features</title><tgroup cols=3 align=left colsep=1 rowsep=1><thead>  <row>    <entry>Feature</entry>    <entry>Supported?</entry>    <entry>Description</entry>  </row></thead><tbody>  <row>    <entry>configure script</entry>    <entry>Yes</entry>    <entry>Bochs uses GNU autoconf to configure Makefiles and headers.    Autoconf helps Bochs to compile on a wide variety of platforms.    </entry>  </row>  <row>    <entry>386,486,Pentium Emulation</entry>    <entry>Yes</entry>    <entry>Bochs can be configured to emulate on of several families of Intel hardware.  Some Pentium features are supported, such as the Time Stamp Counter.</entry>  </row>  <row>    <entry>Pentium Pro Emulation</entry>    <entry>Incomplete</entry>    <entry>A few Pentium Pro features are supported, such as an on-chip APIC for SMP simulation.    </entry>  </row>  <row>    <entry>Cmd Line Debugger</entry>    <entry>Yes</entry>    <entry>Powerful command line debugger (optional) that lets you stop    execution and examine registers and memory, set breakpoints, etc.    </entry>  </row>  <row>    <entry>Floating Point</entry>    <entry>Yes</entry>    <entry>Uses software floating point routines written by Bill Metzenthen    </entry>  </row>  <row>    <entry>VGA</entry>    <entry>Yes</entry>    <entry>VGA color graphics emulation in a window    </entry>  </row>  <row>    <entry>Floppy disk</entry>    <entry>Yes</entry>    <entry>Supports floppy disk images on all platforms: 1.44M 3.5", 1.2M 5.25", and 720K 3.5".  On Unix and Windows NT/2000, Bochs can access the physical floppy drive.    </entry>  </row>  <row>    <entry>Hard disk</entry>    <entry>Yes</entry>    <entry>Emulates one or two AT/IDE hard drives via image files.  No physical    hard disk access is supported, primarily for safety reasons.  Only two    IDE devices, total, are supported.  So you can have two hard disks,    or one hard disk and one CDROM.    </entry>  </row>  <row>    <entry>Keyboard</entry>    <entry>Yes</entry>    <entry>Emulates a PS/2 keyboard with North American key mappings.  Keyboards with other key mappings are reported to have problems with special keys and punctuation.    </entry>  </row>  <row>    <entry>Mouse</entry>    <entry>Yes</entry>    <entry>Emulates a PS/2 mouse with 3 buttons.    </entry>  </row>  <row>    <entry>Network card</entry>    <entry>Yes</entry>    <entry>Emulates an NE2000 compatible network card.  On Windows NT/2000,    Linux, FreeBSD, and NetBSD, Bochs will forward packets to and from the

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -