1

我刚刚开始使用 pintos 项目,在运行 ubuntu 14.04 x64 系统的家用计算机上工作。

我能够从src/threads/目录编译项目,并且初始测试pintos run alarm-multiple似乎工作正常(注意它默认运行 qemu):

zay@ubuntu:~/Documents/pintos/src/threads/build$ pintos run alarm-multiple
Prototype mismatch: sub main::SIGVTALRM () vs none at /home/zay/Documents/pintos/src/utils/pintos line 935.
Constant subroutine SIGVTALRM redefined at /home/zay/Documents/pintos/src/utils/pintos line 927.
qemu-system-x86_64 -drive cache=writeback,file=/tmp/YS3E7FICwo.dsk -m 4 -net none -serial stdio
PiLo hda1
Loading..........
Kernel command line: run alarm-multiple
Pintos booting with 4,088 kB RAM...
382 pages available in kernel pool.
382 pages available in user pool.
Calibrating timer...  286,310,400 loops/s.
Boot complete.
Executing 'alarm-multiple':
(alarm-multiple) begin
(alarm-multiple) Creating 5 threads to sleep 7 times each.
(alarm-multiple) Thread 0 sleeps 10 ticks each time,
(alarm-multiple) thread 1 sleeps 20 ticks each time, and so on.
(alarm-multiple) If successful, product of iteration count and
(alarm-multiple) sleep duration will appear in nondescending order.
(alarm-multiple) thread 0: duration=10, iteration=1, product=10
(alarm-multiple) thread 0: duration=10, iteration=2, product=20

但是,当我在make check下运行时src/threads/build,所有测试都会出现超时错误:

zay@ubuntu:~/Documents/pintos/src/threads/build$ make check
pintos -v -k -T 60 --qemu  -- -q  run alarm-multiple < /dev/null 2> tests/threads/alarm-multiple.errors > tests/threads/alarm-multiple.output
perl -I../.. ../../tests/threads/alarm-multiple.ck tests/threads/alarm-multiple tests/threads/alarm-multiple.result
FAIL tests/threads/alarm-multiple
run: TIMEOUT after 61 seconds of wall-clock time - load average: 0.20, 0.45, 0.26
pintos -v -k -T 60 --qemu  -- -q  run alarm-simultaneous < /dev/null 2> tests/threads/alarm-simultaneous.errors > tests/threads/alarm-simultaneous.output
perl -I../.. ../../tests/threads/alarm-simultaneous.ck tests/threads/alarm-simultaneous tests/threads/alarm-simultaneous.result
FAIL tests/threads/alarm-simultaneous
run: TIMEOUT after 61 seconds of wall-clock time - load average: 0.18, 0.40, 0.25
pintos -v -k -T 60 --qemu  -- -q  run alarm-priority < /dev/null 2> tests/threads/alarm-priority.errors > tests/threads/alarm-priority.output
perl -I../.. ../../tests/threads/alarm-priority.ck tests/threads/alarm-priority tests/threads/alarm-priority.result
FAIL tests/threads/alarm-priority
run: TIMEOUT after 61 seconds of wall-clock time - load average: 0.10, 0.34, 0.2

我应该做哪些改变来解决这个问题?

4

2 回答 2

2

显然,QEMU 不再支持端口上的断电顺序0x8900。这是一个使它对我有用的修复程序(在chaOs中找到):在文件devices/shutdown.c补丁shutdown_power_off中如下:

void
shutdown_power_off (void)
{
  // ...
  printf ("Powering off...\n");
  serial_flush ();
  outw (0xB004, 0x2000);  // <-- Add this line
  // ...
}
于 2017-07-24T08:49:43.010 回答
-1

如果您将qemu用于 pintos。您需要在devices/shutdown.c.

在后面插入一行 outw( 0x604, 0x0 | 0x2000 );printf (“Powering off…\n”); serial_flush ();如下图:

 /* This is a special power-off sequence supported by Bochs and
 QEMU, but not by physical hardware. */
 for (p = s; *p != '  printf ("Powering off...\n");
  serial_flush ();

//add the following line
outw( 0x604, 0x0 | 0x2000 );

按照本指南了解更多信息

于 2021-04-25T15:29:20.510 回答