1 This patch adds the `jitter' feature described in the project
2 documentation, in which timer interrupts are delivered at random
5 diff -urp bochs-2.1.1.orig/bochs.h bochs-2.1.1/bochs.h
6 --- bochs-2.1.1.orig/bochs.h 2004-02-11 14:28:03.000000000 -0800
7 +++ bochs-2.1.1/bochs.h 2004-09-20 17:02:01.000000000 -0700
8 @@ -757,4 +757,6 @@ int bx_init_hardware ();
14 #endif /* BX_BOCHS_H */
15 diff -urp bochs-2.1.1.orig/iodev/pit82c54.cc bochs-2.1.1/iodev/pit82c54.cc
16 --- bochs-2.1.1.orig/iodev/pit82c54.cc 2004-02-11 14:28:53.000000000 -0800
17 +++ bochs-2.1.1/iodev/pit82c54.cc 2004-09-20 17:18:24.000000000 -0700
23 #define LOG_THIS this->
26 @@ -356,7 +357,13 @@ pit_82C54::clock(Bit8u cnum) {
28 if(thisctr.count_written) {
29 if(thisctr.triggerGATE || thisctr.first_pass) {
30 - set_count(thisctr, thisctr.inlatch);
31 + unsigned n = thisctr.inlatch;
33 + n *= (double) rand() / RAND_MAX;
37 + set_count(thisctr, n);
38 thisctr.next_change_time=(thisctr.count_binary-1) & 0xFFFF;
40 if(thisctr.inlatch==1) {
41 diff -urp bochs-2.1.1.orig/main.cc bochs-2.1.1/main.cc
42 --- bochs-2.1.1.orig/main.cc 2004-02-11 14:28:41.000000000 -0800
43 +++ bochs-2.1.1/main.cc 2004-09-20 17:15:39.000000000 -0700
47 int bochsrc_include_count = 0;
52 @@ -2022,6 +2024,13 @@ bx_init_main (int argc, char *argv[])
53 else if (!strcmp ("-q", argv[arg])) {
54 SIM->get_param_enum(BXP_BOCHS_START)->set (BX_QUICK_START);
56 + else if (!strcmp ("-j", argv[arg])) {
57 + if (++arg >= argc) BX_PANIC(("-j must be followed by a number"));
60 + srand (atoi (argv[arg]));
63 else if (!strcmp ("-f", argv[arg])) {
64 if (++arg >= argc) BX_PANIC(("-f must be followed by a filename"));
65 else bochsrc_filename = argv[arg];