From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stas Sergeev Subject: Re: freezes when not emulating CPU (was: MIDI input patch) Date: Fri, 11 Sep 2009 14:57:57 +0400 Message-ID: <4AAA2D35.3040309@aknet.ru> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: Sender: linux-msdos-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: dosemu Hello. Bart Oldeman wrote: > exception happens -- I guess that was just meant for debugging). > Thanks (to Stas also), The "SB16 fixes from Stas Sergeev via x.zupftom@web.de on linux-msdos." is actually also the related FPU fix. There was a division by zero there in pcm_samp_period() (when called without the necessary checks), which I became aware of, because it started to produce SIGFPE when I played with vm86_fpu_state struct. Which means that the comment in do_vm86.c about fnsave is wrong, and the code that restores the dosemu FPU state should likely to be returned. You can, for example, memset the vm86_fpu_state to 0 in fpu_reset() and see the SIGFPE coming from all around the sound code (no other code use FPU in dosemu). Also, I found no docs about this FPU init/reset stuff, so everything in this patch is just a wild guesses based on a look into a bochs code. Also, there is a need to add the handling for exception 0x13 (SIMD FPE), which is what the SIGFPE is about today. I mean, at least print_exception_info() should write something meaningfull about SIGFPE instead of "Unknown exception". So I guess this patch needs more work, but it should be harmless in its current form too.