From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stas Sergeev Subject: Re: bug in pic_prot.diff (was Re: Bootfile) Date: Thu, 06 Feb 2003 10:24:22 +0300 Sender: linux-msdos-owner@vger.kernel.org Message-ID: <3E420DA6.5050004@yahoo.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------030406070207060408080600" Return-path: List-Id: To: linux-msdos@vger.kernel.org This is a multi-part message in MIME format. --------------030406070207060408080600 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hello. Bart Oldeman wrote: >> BTW, release 1.1.4.5 was the last where snake.com is working under >> xdos/xdosemu. > after some binary searches I found out that Stas' pic_prot.diff is > guilty for doing this. There might be something wrong here. The report states that this game stopped working under "xdos/xdosemu", and I am sure my patch have nothing to do with an X code (that's why I haven't even tried the game - I was sure I couldn't break the X code). Now I tried, and indeed it doesn't work. However it misses the Eric A's userfont patch, so I think it never worked under xdosemu unless someone applied a userfont patch manually. > Stas, can you figure out why? I can only figure out why it doesn't work under console, but that's an entirely different story. Anyway, it seems to me that the watchdog patch was flawed: if I set the $_pic_watchdog=(1) or 2 or 3, the game works perfectly (under console of course), but if I set it to 10 and more - it locks up. That looks like a problem. The attached patch fixes it: now setting $_pic_watchdog to any reasonable value (within a range of 1-100 approx) will work for that game. However I have found my test-case for that problem screwed up by an XMS changes of 1.1.4.1. For now I just reverted an XMS changes to test the attached patch. I'll return to that problem when I'll have more time. Background: this game works inside a keyboard interrupt handler (probably many pop-up progs do so if they use a hot-key), so essentially it needs a reentrancy, which was restricted due to the timer jerkiness discussed recently around the Cosmo problem. That's why we need (sometimes) a $_pic_watchdog. --------------030406070207060408080600 Content-Type: text/plain; name="pic_wc.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="pic_wc.diff" --- src/base/dev/pic/pic.c Wed Feb 5 07:13:57 2003 +++ src/base/dev/pic/pic.c Thu Feb 6 08:53:07 2003 @@ -733,7 +733,6 @@ if (test_bit(ilevel, &pic_irqall)) { pic_push(ilevel); set_bit(ilevel, &pic_irqs_active); - pic_wcount = 0; } if (!in_dpmi || in_dpmi_dos_int) { @@ -838,7 +837,8 @@ pic_wirr&=~pic_newirr; /* clear watchdog timer */ pic_activate(); } - pic_wcount = 0; + if (!pic_icount) + pic_wcount = 0; } /* DANG_BEGIN_FUNCTION pic_request @@ -1031,9 +1031,8 @@ if(++pic_wcount >= config.pic_watchdog) { error("PIC: force reschedule\n"); pic_resched(); + pic_wcount = 0; } - } else { - pic_wcount = 0; } } } --------------030406070207060408080600--