home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!destroyer!cs.ubc.ca!uw-beaver!micro-heart-of-gold.mit.edu!xn.ll.mit.edu!ll.mit.edu!wolfson
- From: wolfson@ll.mit.edu (Harry Wolfson)
- Subject: SwapMMUMode() breaks INIT
- Message-ID: <1992Nov21.145938.18889@ll.mit.edu>
- Summary: why can't INIT change to 32bit on bootup
- Keywords: INIT, memory, OSUtils
- Sender: news@ll.mit.edu
- Organization: MIT Lincoln Laboratory
- Date: Sat, 21 Nov 92 14:59:38 GMT
- Lines: 56
-
- I am trying to write a pair of short INIT's that will
- set the memory addressing mode to 24 or 32 bits on
- startup.
-
- (The 24 bit INIT is for my Sys6 folder
- & the 32 bit INIT is for my Sys7 folder. That way
- I would save myself an extra few steps while switching
- systems and always retain 32 bit mode in sys7.)
-
- My code is very short and straight forward and *very*
- ineffective. I fix the pc as instructed in Tech note
- #228. Then call SwapMMUMode( &mode), with mode = 1
- or 0 (32 or 24 bit respectively). And that's all.
-
- I am testing the INIT on a IIci, Sys7.0.1, tuna 1.1.1
- and *all* extensions, etc. (other than Macsbug) turned
- off by Extensions Mngr. The compilied code looks likes
- its doing what its supposed to, but running the 24bit
- INIT (with 32bit mode set manually on the previous boot)
- looks like its going to change the mode - but never really
- does. Running the 32bit INIT (with 24bit mode previously set)
- actually *does* change the mode, and succesfully exits the
- INIT but causes a crash somewhere downstream during the
- startup sequence (crashes while trying to read from A6,
- which is something like 0x60341234).
-
- Is it impossible to set the mode during startup? Why?
- Or is my code doing something silly? Thanks for any help.
-
- Harry Wolfson
- wolfson@ll.mit.edu
-
- === code follows ===
-
- // MMU32.c
-
- #include <OSUtils.h>
-
- pascal void FixPC( void); // proto for MacsBug
-
- // from Tech note #228
- pascal void FixPC( void)
- = { 0x41FA, 0x000A, /* LEA *+$000C,A0 */
- 0x2008, /* MOVE.L A0,D0 */
- 0xA055, /* _StripAddress */
- 0x2040, /* MOVEA.L D0,A0 */
- 0x4ED0}; /* JMP (A0) ;jmps to next instr*/
-
- main() {
- char mode = 1;
-
- FixPC();
- SwapMMUMode ( &mode );
- }
-
-
-