home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / mac / programm / 18751 < prev    next >
Encoding:
Text File  |  1992-11-21  |  2.1 KB  |  69 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. 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
  3. From: wolfson@ll.mit.edu (Harry Wolfson)
  4. Subject: SwapMMUMode() breaks INIT
  5. Message-ID: <1992Nov21.145938.18889@ll.mit.edu>
  6. Summary: why can't INIT change to 32bit on bootup
  7. Keywords: INIT, memory, OSUtils
  8. Sender: news@ll.mit.edu
  9. Organization: MIT Lincoln Laboratory
  10. Date: Sat, 21 Nov 92 14:59:38 GMT
  11. Lines: 56
  12.  
  13. I am trying to write a pair of short INIT's that will
  14. set the memory addressing mode to 24 or 32 bits on
  15. startup. 
  16.  
  17. (The 24 bit INIT is for my Sys6 folder
  18. & the 32 bit INIT is for my Sys7 folder. That way
  19. I would save myself an extra few steps while switching
  20. systems and always retain 32 bit mode in sys7.) 
  21.  
  22. My code is very short and straight forward and *very*
  23. ineffective. I fix the pc as instructed in Tech note
  24. #228. Then call SwapMMUMode( &mode), with mode = 1 
  25. or 0 (32 or 24 bit respectively). And that's all.
  26.  
  27. I am testing the INIT on a IIci, Sys7.0.1, tuna 1.1.1
  28. and *all* extensions, etc. (other than Macsbug) turned
  29. off by Extensions Mngr. The compilied code looks likes 
  30. its doing what its supposed to, but running the 24bit
  31. INIT (with 32bit mode set manually on the previous boot)
  32. looks like its going to change the mode - but never really
  33. does. Running the 32bit INIT (with 24bit mode previously set)
  34. actually *does* change the mode, and succesfully exits the 
  35. INIT but causes a crash somewhere downstream during the
  36. startup sequence (crashes while trying to read from A6,
  37. which is something like 0x60341234).
  38.  
  39. Is it impossible to set the mode during startup? Why?
  40. Or is my code doing something silly? Thanks for any help.
  41.  
  42. Harry Wolfson
  43. wolfson@ll.mit.edu
  44.  
  45. === code follows ===
  46.  
  47. // MMU32.c
  48.  
  49. #include <OSUtils.h>
  50.  
  51. pascal void FixPC( void);        // proto for MacsBug
  52.  
  53. // from Tech note #228
  54. pascal void FixPC( void)
  55. = {    0x41FA, 0x000A,        /* LEA    *+$000C,A0    */
  56.     0x2008,            /* MOVE.L A0,D0        */
  57.     0xA055,            /* _StripAddress    */
  58.     0x2040,            /* MOVEA.L D0,A0    */
  59.     0x4ED0};        /* JMP    (A0) ;jmps to next instr*/
  60.  
  61. main() {    
  62.     char    mode = 1;
  63.         
  64.     FixPC();
  65.     SwapMMUMode ( &mode );
  66. }
  67.  
  68.  
  69.