From: Ben Pfaff Date: Sat, 31 Mar 2007 14:40:29 +0000 (+0000) Subject: Fix bug in jitter reported by Godmar Back (BIOS wouldn't finish X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eae29259cd81d3d2e1426eb9a3f9c47eb06d0a88;p=pintos-anon Fix bug in jitter reported by Godmar Back (BIOS wouldn't finish initializing). --- diff --git a/src/misc/bochs-2.2.6-jitter.patch b/src/misc/bochs-2.2.6-jitter.patch index fe5144c..48917e0 100644 --- a/src/misc/bochs-2.2.6-jitter.patch +++ b/src/misc/bochs-2.2.6-jitter.patch @@ -15,7 +15,7 @@ diff -urp bochs-2.2.6/iodev/pit82c54.cc bochs-2.2.6.orig/iodev/pit82c54.cc if(thisctr.triggerGATE || thisctr.first_pass) { - set_count(thisctr, thisctr.inlatch); + unsigned n = thisctr.inlatch; -+ if (jitter) { ++ if (jitter && n > 5) { + n *= (double) rand() / RAND_MAX; + if (n < 5) + n = 5;