ZBasic IDE & Wine

Questions and discussion about the ZBasic IDE.
Post Reply
Don_Kirby
Posts: 341
Joined: 15 October 2006, 3:48 AM
Location: Long Island, New York

ZBasic IDE & Wine

Post by Don_Kirby »

As an experiment, I'm getting my feet wet with Linux, and have successfully ported most of my often used applications to it. The ZBasic IDE works well within Wine (v0.9.46) but the compile process fails with the following:
Compiler wrote:"C:\Program: Interrupt/Exception caught (code = 0xc0000005, addr = 0xb7cfacba)
Is this a meaningful message from/for the compiler, or is it being generated by Wine?

-Don
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Re: ZBasic IDE & Wine

Post by dkinzer »

Don_Kirby wrote:Is this a meaningful message from/for the compiler, or is it being generated by Wine?
I'm fairly certain that it is not issued by the compiler. I haven't tried running it under Wine myself so I don't have much to offer in the way of advice.
- Don Kinzer
Don_Kirby
Posts: 341
Joined: 15 October 2006, 3:48 AM
Location: Long Island, New York

Post by Don_Kirby »

It appears that Wine does not agree with the backend compile process that ZBasic uses. I suspect that this is due to the fact that Linux is geared towards the GCC compiler but not towards the AVR platform. I have gotten ZBasic to compile non-native mode code, but no success yet with native mode.

Don, if I install the AVR compiler that is available for Linux, how would I go about modifying the IDE to call it rather than the windows version? If this is possible, I'm fairly certain that I could get the ZBasic IDE to function fully within Linux.

To be thorough, I have tested this on Ubuntu 7.10 and 8.04, Kubuntu, Xubuntu, and Puppy,. all giving the same result of a backend build error.

-Don
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Post by dkinzer »

Don_Kirby wrote:It appears that Wine does not agree with the backend compile process that ZBasic uses.
What kinds of errors or messages are you seeing? By default, when the compiler is built for a Windows environment, it constructs a batch file containing lines similar to those below and then the batch file is executed after modifying the environment so that the PATH entry contains references to the gcc binary directories in the ZBasic installation directory. (This avoids problems that could be caused by other versions of gcc being installed on the system.)

Code: Select all

@cd tempdir\proj
@rse make -f proj.mak >build.log
The build procedure is slightly different if the --verbose compiler option is present. In this case, the batch file is not built and the make utility is executed directly passing it the name of the makefile that was constructed during the front-end compile process. One side effect of this is that you'll see all of the build commands being executed in the IDE's output window. You might try this to see if it works any better.
Don_Kirby wrote:I have gotten ZBasic to compile non-native mode code
That's good news. Have you also been able to download?
Don_Kirby wrote:f I install the AVR compiler that is available for Linux, how would I go about modifying the IDE to call it rather than the windows version?
Actually, the IDE doesn't invoke the AVR compiler. Rather, it only knows about the ZBasic compiler (currently available only as a Windows console application) which it invokes to produce the downloadable image. The ZBasic compiler itself invokes the avr-gcc compiler if a native mode target is specified. There is a way to specify a different path the avr-gcc compiler but I highly doubt that doing so would be useful in this particular case.
- Don Kinzer
Don_Kirby
Posts: 341
Joined: 15 October 2006, 3:48 AM
Location: Long Island, New York

Post by Don_Kirby »

I'm still working on this, although I haven't made significant progress yet.

I don't have VM hardware available at the moment to test the download operation, and my current focus is the native mode platform, but I have no reason to think that the VM IDE/Compiler is mostly functional from within Linux.

As far as native mode is concerned, it seems to me that the windows version of the avr-gcc compiler is having a problem running inside the Wine emulator. What I'm attempting to do now is to interrupt the ZBasic compile process before the gcc is invoked so that I may manually finish the process using a native Linux gcc.

More to follow.

-Don
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Post by dkinzer »

Don_Kirby wrote:What I'm attempting to do now is to interrupt the ZBasic compile process before the gcc is invoked so that I may manually finish the process using a native Linux gcc.
If you use the ZBasic compiler option --keep-files, you should find a makefile and the generated source files in the build directory (usually named zxTempDir/<project>).
- Don Kinzer
Don_Kirby
Posts: 341
Joined: 15 October 2006, 3:48 AM
Location: Long Island, New York

Post by Don_Kirby »

A little more information..

The latest error message comes in two parts. This is the first time I've gotten Wine to output a stackdump, which is Greek to me, but may mean something to those who are versed in such things.
IDE wrote: >"C:\Program Files\ZBasic\zbasic.exe" --target-device=ZX24n --directory="Z:\media\Storage\Projects\Source Code/" --project="ZXOnly.pjt"
make: Entering directory `Z:/media/Storage/Projects/Source Code/zxTempDir/ZXOnly'
avr-gcc -c -Dzx24n -mmcu=atmega644p -std=gnu99 -fgnu89-inline -gdwarf-2 -Os -I"C:/Program Files/ZBasic/zxlib" -I. -Wall -Wstrict-prototypes -funsigned-char -fpack-struct MainTask.c -o MainTask.o
0 [main] sh 18 handle_exceptions: Exception: STATUS_ACCESS_VIOLATION
1689 [main] sh 18 open_stackdumpfile: Dumping stack trace to sh.exe.stackdump
make: *** [MainTask.o] Error 101120
"C:\Program: Interrupt/Exception caught (code = 0xc0000005, addr = 0xb7d83cbc)
Error: one or more errors occurred in the back-end build process for "ZXOnly.zxb"
>Exit code: 1
Which brings us to the stackdump:
WINE wrote:Exception: STATUS_ACCESS_VIOLATION at eip=00006042
eax=7B926930 ebx=7B8B0000 ecx=00110020 edx=00110024 esi=7FFDCC00 edi=C0000033
ebp=00673178 esp=006730CC program=C:\Program Files\ZBasic\WinAvr\utils\bin\sh.exe
cs=0073 ds=007B es=007B fs=0033 gs=003B ss=007B
Stack trace:
Frame Function Args
00673178 00006042 (7FFDCC00, 80000000, 00000007, 00673208)
006731A8 7B847BD2 (006733F8, 80000000, 00000007, 00673208)
00673218 30011C81 (00673738, 00190000, 00000000, 00673738)
00673258 3001360A (00673738, 006733F8, 00190000, 00000000)
00673778 3006775B (30067ABA, 006737E8, 00677828, 00000001)
006737B8 3006B821 (006737E8, 00677828, 00000000, 00000000)
006777E8 3002BACA (00677888, 00677828, 0068FB48, 00000000)
00677868 3002B352 (00677888, 00677888, 0067F8D8, 0068FB48)
0067F898 3002BBF8 (0067F8D8, 0068FB48, 0068FB48, 00000000)
006878E8 3002B292 (00687968, 0068FB48, 00000000, 00000000)
00687928 3002BC71 (00687968, 0068FB48, 00000000, 00000000)
0068F978 3002B9D1 (0068F990, 00000C90, 00000000, 0068FB48)
0068FB78 30003529 (0068FC15, 300C2AD8, 300C2AD4, 0068FBC4)
0068FBC8 300037B9 (0068FCDB, 300C2AD8, 300C2AD4, 00000001)
0068FDB8 30004356 (00000000, 00000000, 7FFDF000, 7BC43651)
0068FE88 300047B1 (004011C8, 7FFDF000, 7BC43BAD, 7BC320DF)
End of stack trace (more stack frames may be present)
My search of the available support resources at WineHQ.org has yet to turn up anything useful.

-Don
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Post by dkinzer »

WINE wrote:program=C:\Program Files\ZBasic\WinAvr\utils\bin\sh.exe
That portion of of the dump indicates that the fault occurred in the shell program. This is supplied as part of the WinAVR package and it is used for executing programs as part of the "make" process.

We're looking into the issues and hope to have something to report within a few weeks.
- Don Kinzer
Don_Kirby
Posts: 341
Joined: 15 October 2006, 3:48 AM
Location: Long Island, New York

Post by Don_Kirby »

Thanks Don, If I come up with anything in the mean time, I'll post it here.

-Don
Post Reply