[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[MiNT] modules hang 1.16.1 kernel (was RE: [Aranym-dev] [ARANYM.XIF] Hangs with 1.16.1 MiNT kernel)



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."