home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / amiga / programm / 13049 < prev    next >
Encoding:
Text File  |  1992-09-03  |  3.6 KB  |  78 lines

  1. Newsgroups: comp.sys.amiga.programmer
  2. Path: sparky!uunet!haven.umd.edu!darwin.sura.net!Sirius.dfn.de!chx400!bernina!wild
  3. From: wild@nessie.cs.id.ethz.ch (Markus Wild)
  4. Subject: Re: GNU C and ixemul.library
  5. Message-ID: <1992Sep3.213312.15340@bernina.ethz.ch>
  6. Sender: news@bernina.ethz.ch (USENET News System)
  7. Organization: Swiss Federal Institute of Technology (ETH), Zurich, CH
  8. References: <SIE.92Sep3132123@introitus.fulcrum.bt.co.uk>
  9. Date: Thu, 3 Sep 1992 21:33:12 GMT
  10. Lines: 66
  11.  
  12. In article <SIE.92Sep3132123@introitus.fulcrum.bt.co.uk> sie@fulcrum.bt.co.uk (Simon Raybould) writes:
  13. >I've been trying to port bash to the amiga using Markus Wilds GNUC 2.2.2 
  14. >most things seem to be working fine, automatic completion, history
  15. >e.t.c.
  16.  
  17. With bash you face the following problems:
  18.   - data/bss space is far larger than 64k, so you won't be able to use the
  19.     -fbaserel mode, and hence can't make bash residentable with -resident.
  20.   - due to this, you can't really emulate any fork() calls like I did in
  21.     pdksh. 
  22.  
  23. The inability to emulate fork caused me not to consider a bash port, but 
  24. you may be successful if you manage to get a working fork, good luck!! I'd
  25. be very happy to toss ksh for bash, as bash is my usual shell that I use
  26. on any Unix I get access to (it's usually the first action to ftp the
  27. sources and compile a bash when I have to work on a new Unix ;-)).
  28.  
  29. >The problem is when a command is executed by bash, I get an "EMT trap"
  30. >and bash exits returning to the CLI prompt. Not long later the amiga
  31. >will usually crash.
  32.  
  33. I'd be very interested in which functions bash executes up to this point.
  34. You may find out by using the tracer (see the README.TRACE file in the
  35. 2.2.2 distribution). For short, open two shell windows, in one do
  36.  
  37.    ..> flush
  38.    ..> loadlib gcc:libs/ixemul.trace    ; this replaces ixemul.library
  39.    ..> trace -m        ; you may have to use trace -m -i here
  40.  
  41. In the other start bash.
  42.  
  43. If the problem only occurs after bash has initialized, shown the prompt,
  44. and you then try to execute a command, you should flush the library, load
  45. the traceing library, but not yet execute trace in the first shell. Then
  46. start bash, and as soon as bash shows the prompt, in the other shell start
  47. the tracer. This trick speeds up debugging, since I'd imagine that bash
  48. does thousands of ixemul calls until the real problem occurs.
  49.  
  50. >Any ideas as to what is causing this would help. I think this is an
  51. >Emulator trap.
  52.  
  53. Corrupt stack? You can reasonably argue that bash is not placing any
  54. emulator instructions into the instruction stream on purpose, so the trap
  55. must be the result of a corrupted instruction stream. Such a corruption
  56. can happen if returning to a corrupted stack frame.
  57.  
  58. >P.S. This is on a 68040 based amiga. If i run it on a 68000 based
  59. >amiga, I get "bus error" when a command is executed. The difference
  60. >may be to do with the MMU in the 040?
  61.  
  62. Looks even more like a stack problem then. Note: I know there are new
  63. exception frames on the 68040, incompatible to those of the 68030. However,
  64. I don't have documentation on these frames, so I couldn't incorporate them
  65. into ixemul.library. If you happen to have such documentation, I'd be
  66. glad if you could EMail it to me, and I'll try (won't be able to verify..)
  67. to incorporate them into ixemul.library. It might be the case in your
  68. specific problem, that ixemul rewinds the stack in a wrong way, ie. cleans
  69. up too much or too many stack, and then the program resumes executing at
  70. an undefined point.
  71.  
  72. -Markus
  73.  
  74. -- 
  75. Markus M. Wild    -  wild@nessie.cs.id.ethz.ch  |  wild@amiga.physik.unizh.ch 
  76. Vital papers will demonstrate their vitality by spontaneously moving
  77. from where you left them to where you can't find them.
  78.