📄 smp-simulation.html
字号:
<HTML><HEAD> <META NAME="copyright" CONTENT="Copyright 2001 by MandrakeSoft S.A."> <META NAME="Author" CONTENT="Bryce Denney"> <META HTTP-EQUIV="Content-Type" CONTENT="text/html;CHARSET=iso-8859-1"> <TITLE>SMP Simulation</TITLE></HEAD><BODY TEXT="#000000" BGCOLOR="#ececec" LINK="#3333cc" VLINK="#666666"><CENTER><H1>Symmetric Multiprocessor (SMP) Simulation </H1></CENTER>Bochs can now simulate an SMP machine when you use "--enable-processors=N" in the configure command. SMP support was added by Bryce Denney, whowas very interested in watching a multiprocessor operating system work at a low level. It should also be helpful to operating system developerswho are writing SMP drivers, or just for users who want to test drivean SMP machine to see what it looks like.<p>It is important to understand that configuring bochs for 4 processors will makeyour single-threaded applications run faster in general! On the contrary, ithas to spend time simulating idle processors as well as the ones doing yourtask. The point is to simulate an SMP system, not to speed up a uniprocessorapplication.<p>What was required to make SMP work in Bochs? (Note that only Linux 2.2has been tested so far.)<ul><li> local APIC on each processor with timer<li> one I/O APIC model<li> implement RDTSC feature (read time stamp counter)<li> modifications to rombios.c to add a data structure called the IntelMultiprocessor Configuration. An SMP-aware operating system probes BIOS memory to find the structure, which contains information abouthow many processors, their IDs, interrupt sources, etc.</ul>What needs to be done to improve SMP support?<ul><li> still needs work on rombios.c to allow you to configure the number ofprocessors in the .bochsrc. Presently you have to choose the numberof processors at compile time.<li> debugger support is still limited. For example, you can set breakpoints,but you can't specify which processor you want to set the breakpoint for.<li> test on SMP systems other than linux 2.2.14<li> several parts of the APIC model which weren't needed for linux 2.2.14are not implemented yet and cause a panic. If you boot linux 2.4.3 for example, it says "panic: cluster model addressing not implemented". See<a href="http://sourceforge.net/tracker/index.php?func=detail&aid=421938&group_id=12580&atid=362580">this bug report</a> for tips on getting linux 2.4 to boot.(The apic is not the only problem!)<li> A number of people have suggested using threads to simulate each CPU ina different thread. Then on a real SMP machine, the threads can executein parallel. This is a great idea, but it's not done at present.</ul></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -