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

[MiNT] Current beta problems - solved



Hi!

I spent some hours today to take a look at the problems reported on beta
3 (instant freeze on 030 with MP enabled, instabilities like Mines from
Jay Software freezing/crashing the machine). Here are my results:

1. The problem with memory protection on the 030 was caused by someone
   messing up the Makefile: mprot030.c got compiled with -m68040,
   causing the 040 opcode for the inlined pflusha to be used, which is
   an illegal opcode on the 030. Apply the following diff if you want to
   fix it yourself:

-- snip --
--- ../orig/Makefile    Thu Aug 19 17:13:18 1999
+++ Makefile    Thu Aug 26 16:50:14 1999
@@ -376,8 +377,8 @@
 # overwrite the default
 # gcc brings errors without -m68030 option
 mprot030.o: mprot030.c mprot.h $(HFILES)
-       @echo "$(CC) $(CFLAGS) -m68040 -c $< -o $@"; \
-       $(CC) -Wp,-MD,.deps/$(@:.o=.P) $(CFLAGS) -m68040 -c $< -o $@
+       @echo "$(CC) $(CFLAGS) -m68030 -c $< -o $@"; \
+       $(CC) -Wp,-MD,.deps/$(@:.o=.P) $(CFLAGS) -m68030 -c $< -o $@
 
 # overwrite the default
 # gcc brings errors without -m68040 option
-- snap --

2. The problem with e.g. Mines is caused by the new syscall handler,
   which doesn't preserve registers a0-a2 like the old one did. This
   causes buggy software to crash which relies on the (ucodumented!)
   behaviour of old GEMDOS versions that a0-a2 are preserved, too. The
   docs only say a3-a6 and d3-d7 are preserved, so this is clearly a bug
   in these programs.

   Nevertheless, especially because the new handler already contains
   workarounds for some calls because of bugs in older versions of the
   MiNT library, I'd opt for always saving a0-a2 across GEMDOS calls
   (like my patched kernel currently does, which runs Mines just
   perfectly), it would also make the special workarounds unnecessary.

   Not preserving these registers can cause serious crashes because
   currently, they'll contain addresses within the kernel when returning
   from a call, so a buggy program that assumes the register wasn't
   touched will overwrite parts of the kernel. That was the case with
   Mines, and I'm sure there's more stuff like that outside.


Ciao

Thomas


-- 
Thomas Binder (Gryf @ IRCNet)  gryf@hrzpub.tu-darmstadt.de
PGP-key available on request!  binder@rbg.informatik.tu-darmstadt.de
Vote against SPAM:             http://www.politik-digital.de/spam/

Attachment: pgp23u1Pf_YLa.pgp
Description: PGP signature