|
Post by linuph on Mar 8, 2013 12:21:31 GMT 1
I have a hardware modded XBOX1.1 running XBMC and XDSL (both 2004 versions) just fine. The HD is a 20Gb in stead of the standard 8/10Gb. I'm wondering if BaCon could be run on it. As you may know:
- there's only 64Mb memory - Linux only upto/including v2.4 would be suitable because of FATX
I don't know much else. Anyone with any experience? Is it possible at all?
Sorry about being vague. It's just that I want to know if I'm completely off-track or that there may be - I hope- possibilities.
|
|
|
Post by Pjot on Mar 8, 2013 14:44:53 GMT 1
Hi linuph, Interesting! To run BaCon you need the following: (1) Or BASH version 3.2 and higher, or KSH or ZShell. (2) a compiler suite like GCC or TCC. BR, Peter
|
|
|
Post by linuph on Mar 13, 2013 18:12:59 GMT 1
I have the XBOX running XDSL 0.7 beta 5. It is based on DSL 4.4.3. It is quite old but after updating from the DSL repository: - BASH 3.2 - GTK2-0705 - GNU utils (with updated busybox) - gcc-2.95 - xorg-7.2 I'm ready to give a go at BaCon.
So I installed bacon.bash, hug.bac and hug_imports.bac.
I need advice because it's a bit confusing now to put what where. I believe: - bacon.bash in /bin - hug.bac and hug_imports.bac in /usr/share/BaCon Is that correct?
Furthermore, bash 3.2 is in /bin/bash-3.2/ because I don't want to/can't remove the original bash 2.05 in /bin/. So should I point the compiler to /bin/bash-3.2/bash or put it in the shebang of the bac program? Like !#/bin/bash-3.2/bash?
So it works, partly, but the compiler complains that it cannot find cc on my system. I thought BaCon would look for gcc automatically. How can I solve that?
Sofar, I did a test with the "Fetch all BaCon programs" example. HUG/GTK is not yet involved there. That's to be tested in the next few days.
|
|
|
Post by Pjot on Mar 13, 2013 21:24:50 GMT 1
Well, there are no official rules for this. It depends on you. In the world of Unix, it is common practice to put your private binaries into '/usr/local/bin'. Subsequently the HUG include files could be put into '/usr/local/share/BaCon'. But nobody will complain if you don't I would try to change the shebang and see if that works. Again, no official rule here... Most Unix systems have a symlink called 'cc' which is pointing to gcc. So either you can create such a symlink yourself, or use BaCon together with the '-c' flag to specify gcc. HTH, Peter
|
|
|
Post by linuph on Mar 14, 2013 7:30:07 GMT 1
Peter, thanks for your reply. Rather basic Linux/Unix stuff I'd say I found that the XDSL gcc libraries were incomplete, so I downloaded/installed the gcc1 package from the DSL depository. By adding: PRAGMA LDFLAGS gcc PRAGMA COMPILER gccin the header of each bac program it now compiles without problems. I made a baconc script containing: /bin/bash-3.2/bash /usr/share/BaCon/bacon.bash $1 upx -9 -o upxcompressed $1 mv upxcompressed $1that does the compiling and compressing (of course I installed UPX as well). Usage: baconc <program> (without '.bac'). I sofar tried fetch.bac and 15puzzle.bac. Both compile and work without problems. Great stuff. On to the next challenge. Note: while compiling the processor runs at 100% and RAM usage is about 50%. Not bad at all! ;D
|
|
|
Post by vovchik on Mar 14, 2013 10:12:05 GMT 1
Dear linuph, Congratulations and glad to see bacon working. I would do two additional things - one for speed of conversion/compilation and the other for obtaining tiny binaries. To speed up compilation by a factor of roughly 10, compile bacon bac using bacon.bash and place the resulting executable (bacon) in /usr/bin or /usr/local/bin. You can UPX it too. And use it rather than bacon.bash in subsequent compiles. And in order to make bacon (the executable) small, and all subsequent bacon binaries small, use the following compile line: bacon -o -s -o -Os -o -fdata-sections -o -ffunction-sections -o -Wl,--gc-sections "$my_bac_file" You won't be sorry. Without that compile line and UPX my bacon binary is some 350k. After compiling with that line above and UPXing, my bacon binary is 60k. The size reduction with GUI binaries is even more remarkable. With kind regards, vovchik
|
|
|
Post by linuph on Mar 14, 2013 10:59:56 GMT 1
Vovchik, Thanks. Certainly very useful for the limited resources of the XBOX. I'll report back on how that works out. (btw thanks too for the reply you sent me on the Puppy Linux Forum about access to the BaCon forum: I finally got admitted after about 3 months.... )
|
|
|
Post by linuph on Mar 15, 2013 1:45:09 GMT 1
Screenshot from my Mac with the XBOX as VNC server. The direct video output of the XBOX is only composite/S-video and much worse. There's another (hardware) project to work on. Anyway, here's the 'proof' that BaCon on a modded XBOX works Attachments:
|
|
|
Post by alexfish on Mar 15, 2013 2:05:47 GMT 1
Nice theory proved. Now got reason to use a Xbox , could not think of a one before now BR Alex PS: What does the dog think about it .
|
|
|
Post by linuph on Mar 15, 2013 6:18:35 GMT 1
The dog didn't expect otherwise. He knows better than me ;D
I think I'll open a new thread 'BaCon on XBOX' and start with how it can be done.
|
|
|
Post by Pjot on Mar 15, 2013 20:17:22 GMT 1
Hey Linuph,
Very cool! Thanks for sharing your efforts.
Best regards Peter
|
|
|
Post by linuph on Mar 16, 2013 14:35:15 GMT 1
Peter, you're welcome. More to follow.
|
|
|
Post by linuph on Mar 16, 2013 14:43:32 GMT 1
Dear Vovchik, I'm working on your suggestion, but sofar I get "ERROR: hug.bac not found" when compiling the same '15puzzle.bac'. I guess it has something to do with permissions in XDSL. Such permissions and having to be 'root' are rather confusing to me, being 'educated' with Puppy Linux. Also, the bash version 2.05b of XDSL might have something to do with it. I'm investigating further. I'll get to the root of it...
|
|
|
Post by vovchik on Mar 16, 2013 21:18:43 GMT 1
Hi linuph, I don't really think it is a permissions problem, but who knows. "hug.bac" is just a text file and is usually located, at least in the demo progs I've seen, in the same dir as the demo source file. Bacon will look for it at the place stipulated by the INCLUDE statement. If it says INCLUDE "hug.bac", that means the converter will expect to find hug in the same dir as the source (or in the dir from which you invoked bacon). In any case, try to make a bacon binary for future compilations and shove it into /usr/bin or /usr/local/bin as root. It is really 10x faster. In order to do that, you need a newer bash, but if you managed to compile the puzzle, something must be right and your bash might be OK!!! With kind regards, vovchik
|
|
|
Post by linuph on Mar 17, 2013 3:04:14 GMT 1
Indeed, it's not a permission problem. Reason for all kinds of error messages was that I forgot to clean out temporary *.h and *.c files after a failed compilation. Another lesson learned.
I compiled bacon.bac: /bin/bash-3.2/bash bacon.bash -c gcc bacon.bac
But a next compilation: /bin/bash-3.2/bash bacon -c gcc <program>
gives the cryptic error message 'usr/bin/bacon: cannot execute binary'. Is there a way to error trace this?
BTW, the "slow" compilation with bacon.bash works fine.
|
|