运行pintos时测试超时

时间:2016-10-01 10:59:53

标签: pintos

我刚刚开始使用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

我应该做些什么改变才能解决这个问题?

2 个答案:

答案 0 :(得分:0)

显然,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
  // ...
}

答案 1 :(得分:-1)

如果您将 qemu 用于 pinto。 您需要在 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 );

关注this guide了解更多