From mint-bounce@lists.fishpool.fi Sun Jan 29 21:58:34 2006 X-Original-To: fnaumann@mail.boerde.de Delivered-To: fnaumann@mail.boerde.de Subject: [MiNT] modules hang 1.16.1 kernel (was RE: [Aranym-dev] [ARANYM.XIF] Hangs with 1.16.1 MiNT kernel) From: Petr Stehlik To: MiNT Mailing List In-Reply-To: <000101c6250b$febb6600$0480a8c0@in.systinet.com> References: <000101c6250b$febb6600$0480a8c0@in.systinet.com> Content-Type: text/plain; charset=ISO-8859-2 Date: Sun, 29 Jan 2006 21:53:01 +0100 Message-Id: <1138567981.6920.47.camel@joy.home> Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 X-MIME-Autoconverted: from 8bit to quoted-printable by ms1.avonet.cz id k0TKr2Km003383 X-ecartis-version: Ecartis v1.0.0 Sender: mint-bounce@lists.fishpool.fi Errors-To: mint-bounce@lists.fishpool.fi X-original-sender: joy@sophics.cz Precedence: bulk List-help: List-unsubscribe: List-Id: X-List-ID: X-Virus-Scanned: by amavisd-new at relay.boerde.de X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on relay.boerde.de X-Spam-Status: No, hits=-0.8 tagged_above=-50.5 required=7.0 tests=AWL, BAYES_00 X-Spam-Level: Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by wh58-508.st.uni-magdeburg.de id k0TKwYdu011700 This is a cross-post since original thread about a bug in MiNT worth 100 euro was posted in ARAnyM but now it belongs more to MiNT list. Standa Opichal píše v Ne 29. 01. 2006 v 14:41 -0500: > IMHO this is actually a bug in our binutils adaptation. When I save > only the d4 it is enough to get FreeMiNT running. And it is caused > by this the following binutils-2.13.2.1-mint.patch (from the RPM): If saving d4 fixes loading of FreeMiNT modules then I suppose the original code saved d0-d3 only. The question is why didn't it save all (d0-a6) registers? Are we short of space on stack? Is there a rule for module authors to not use the d4-d7 registers without saving and restoring them? Even if it was I would still think that the OS should always try to protect itself and save all registers it needs for its own run before executing external programs. In other words: binutils' usage of d4 is not wrong (eventhough it's very surprising). Standa's workaround (saving d4 register before executing module code) is not a workaround but a valid fix. And make sure that all Pexec like routines do save all registers as well since it's clear that there is a lot of programs that clobber d4 out there :-) Petr P.S. sys/module.c revision 1.28 tagged as beta_1_16_0 and dated 2004/07/15 contains the "save all registers" 'workaround' so all we need is to change our view and reword the original Frank's comment from | "Preserve all registers on module initialization callout. Otherwise it | looks like sometimes are registers modified but I can't explain why." to | "Preserve all registers on module initialization callout. Who knows | what registers they clobbered. Better be safe than sorry."