Recompile Yaroze Source
I started working on a cross compiler toolchain recently so I could do Net Yaroze programming on Linux, and I figured I would share my progress if anyone is interested:
https://github.com/ChrisRx/mipsel-ecoff-toolchain
I have built this on Arch Linux and in a docker container with Debian and successfully built out a toolchain that compiled the sample/check program provided by the SDK without errors (and the object dump looked correct as far as I can tell also). I ended up stepping down versions of GCC until I got to the one mentioned in the `Net Yaroze For Linux` document mentioned in this thread. I am working on getting it transfered to the Net Yaroze to make sure it actually works at the moment. Just wanted to say thanks to the information everyone has provided here, it was incredibly helpful and I look forward to (hopefully) finally doing some programming on my Net Yaroze!
https://github.com/ChrisRx/mipsel-ecoff-toolchain
I have built this on Arch Linux and in a docker container with Debian and successfully built out a toolchain that compiled the sample/check program provided by the SDK without errors (and the object dump looked correct as far as I can tell also). I ended up stepping down versions of GCC until I got to the one mentioned in the `Net Yaroze For Linux` document mentioned in this thread. I am working on getting it transfered to the Net Yaroze to make sure it actually works at the moment. Just wanted to say thanks to the information everyone has provided here, it was incredibly helpful and I look forward to (hopefully) finally doing some programming on my Net Yaroze!
So good news, it appears to be valid since I can run it in an emulator! The bad new though is that I can't seem to get it transferred over unfortunately. I'm running into errors where it says "SYNC ERROR (FFFFFFFF)" and aborts the transfer everytime (this is using siocons compiled in linux). The "Net Yaroze for Linux" document seems to reference a better utility for loading it called hssutils, but I can't seem to find that anymore. Does anyone know if that is available anywhere to download still, or possibly has it download locally and would be willing to provide it?
If you can't get that working try dosbox.. not ideal but at least you can try the DOS tools.
Siocons in Linux works fine for me on amd64 and on my raspberrypi, just not at slow speeds.. try changing the baud rate if you are using 9600bps
Siocons in Linux works fine for me on amd64 and on my raspberrypi, just not at slow speeds.. try changing the baud rate if you are using 9600bps
Hi Chris,
Did you manage to test the output from your setup on real hardware at all? I have a nice linux machine setup for this and was going to give it a try.
Did you manage to test the output from your setup on real hardware at all? I have a nice linux machine setup for this and was going to give it a try.
-
- What is PSXDEV?
- Posts: 2
- Joined: May 14, 2019
Hi guys,
I've had a play with this on my Macbook Pro and I can confirm that it works really well and does produce binaries that work on the Yaroze - I've made a little Docker setup at https://github.com/Davermouse/docker-yaroze which builds a VM with the compiler in it which should in theory work anywhere you can use Docker.
I had a similar issue pushing binaries to my console over a USB serial adapter from the Mac, I'm not entirely convinced, but I made it work 80% of the time at least by adding some delays to the handshake code in siocons - my vague theory is that the emulated port wasn't setting handshake lines quite as quickly as would be ideal. I can upload my tweaked source somewhere if that'd be of use.
Many thanks for getting this all to work though!
I've had a play with this on my Macbook Pro and I can confirm that it works really well and does produce binaries that work on the Yaroze - I've made a little Docker setup at https://github.com/Davermouse/docker-yaroze which builds a VM with the compiler in it which should in theory work anywhere you can use Docker.
I had a similar issue pushing binaries to my console over a USB serial adapter from the Mac, I'm not entirely convinced, but I made it work 80% of the time at least by adding some delays to the handshake code in siocons - my vague theory is that the emulated port wasn't setting handshake lines quite as quickly as would be ideal. I can upload my tweaked source somewhere if that'd be of use.
Many thanks for getting this all to work though!
-
gwald Verified
- Net Yaroze Enthusiast
- Posts: 282
- Joined: Sep 18, 2013
- I am a: programmer/DBA
- PlayStation Model: Net Yaroze
- Contact:
Ha cool!
Have you used my yarexe by any chance?
https://github.com/gwald/Yarexe
It's a hack of all the exe's that turn the yaroze's siocon's auto file into a single ps1 exe, which then the emulator ran, with printf debugging.. that was 90% of my workflow and worked pretty well, way faster then hardware (I used no$PSX and PCSXR).
It's for windows, never thought of porting it to linux, but it 'should' run in wine too.. never tested it![Confused :?](./images/smilies/icon_e_confused.gif)
edit: I just compiled it in linux, it was missing the strlwr strupr funcs and it compiled, I haven't tested it tho, but it should work, not sure how 64bit compliant that hacky coding is
Anyway, let me know if you use it or have issues with it.
Mike.
Have you used my yarexe by any chance?
https://github.com/gwald/Yarexe
It's a hack of all the exe's that turn the yaroze's siocon's auto file into a single ps1 exe, which then the emulator ran, with printf debugging.. that was 90% of my workflow and worked pretty well, way faster then hardware (I used no$PSX and PCSXR).
It's for windows, never thought of porting it to linux, but it 'should' run in wine too.. never tested it
![Confused :?](./images/smilies/icon_e_confused.gif)
edit: I just compiled it in linux, it was missing the strlwr strupr funcs and it compiled, I haven't tested it tho, but it should work, not sure how 64bit compliant that hacky coding is
![Laughing :lol:](./images/smilies/icon_lol.gif)
![Laughing :lol:](./images/smilies/icon_lol.gif)
![Shrug :shrug](./images/smilies/confusion/shrug.gif)
Anyway, let me know if you use it or have issues with it.
Mike.
This is great work and a great first post!! will give it a try.
So with this approach, along with the source version of siocons we pretty much can leave DOS behind for Yaroze development. Yay!
So with this approach, along with the source version of siocons we pretty much can leave DOS behind for Yaroze development. Yay!
-
- What is PSXDEV?
- Posts: 2
- Joined: May 14, 2019
Cheers, hopefully it's of some use to somebody.
I've actually got a matching slightly more hackily fixed version of Yarexe I've used on the Mac - cheers for updating it properly, if you don't mind I'll have a go at adding it to the Docker image - then it should be possible to make your exe entirely in the image and remove another external step.
I did have some fun and games finding a nice native emulator for Mac which accepts a exe - in the end I'm using mednafen, I've had some funky cmake issues with PCSXR but I should give that another go at some point.
I've just made a little tweak to the project to improve the first run experience - it'll now copy the sample check project into place for you so you have something to play with straight away. If anyone does have a go with it please let me know how it goes...
I've actually got a matching slightly more hackily fixed version of Yarexe I've used on the Mac - cheers for updating it properly, if you don't mind I'll have a go at adding it to the Docker image - then it should be possible to make your exe entirely in the image and remove another external step.
I did have some fun and games finding a nice native emulator for Mac which accepts a exe - in the end I'm using mednafen, I've had some funky cmake issues with PCSXR but I should give that another go at some point.
I've just made a little tweak to the project to improve the first run experience - it'll now copy the sample check project into place for you so you have something to play with straight away. If anyone does have a go with it please let me know how it goes...
Could this work as a replacement for the official PSYQ SDK compiler? I heard that psymake can be replaced with an old version of wmake. Perhaps CC can be replaced with this too?
I apologize for waiting so long to reply, however, I recently dusted off this code to dive back in where I left off in Jan. of this year.
I am currently looking at converting the Net Yaroze SDK mipsel-ecoff static library into mipsel-elf and seeing if that will work (funny enough, the original question in this thread). I think it may actually be possible to convert the existing mipsel-ecoff static library into object files where the ecoff headers are replaced with elf32 headers (similar to how the current programs out there convert to psx-exe and leave the text sections mostly intact). If this is successful, it would mean that the newest versions of GCC/LLVM could be used to link the Net Yaroze static library instead of having to use an ancient version of GCC. I mention this because it may be possible to do the same with the Windows static library, replacing the OS-specific file format only with a new one that is more portable, and keeping the underlying architecture-specific code intact. This is not something I'm really familiar with so it may not work, but figured I would throw it out there in case anyone has some helpful input on the matter.
I'll also update again when I get the initial commit for my yaroze tools out, for those that may be interested. Thanks again to everyone for all the help, this has been really fun!
Thank you for the tip with dosbox, at the time I was able to upload an executable built by my cross-compile toolchain and run it successfully on my DTL-H3001. After that I started trying to figure out what was wrong with the linux version of siocons since the source code was available, but didn't get anywhere with that initially before stepping away from it for a while. I did find some considerable bugs and WTFs in that code. For example, the executable sections are being written to the serial connection in a way that crosses the boundaries of each section and writes data from subsequent sections. It ends up working still, but its why the checksums for the same binary are different with the linux siocons vs. using dosbox and the dos siocons.exe.
I'm really glad it worked for you on macOS, that is so cool! BTW, the insight about adding delays to the handshake code for siocons was a huge help in figuring out what was going on with it. I'm hoping to have a better version available soon (at least a prototype of loading via serial for NY) after I get all my spaghetti code cleaned up.Davermouse wrote: ↑May 14th, 2019, 8:35 am Hi guys,
I've had a play with this on my Macbook Pro and I can confirm that it works really well and does produce binaries that work on the Yaroze - I've made a little Docker setup at https://github.com/Davermouse/docker-yaroze which builds a VM with the compiler in it which should in theory work anywhere you can use Docker.
I had a similar issue pushing binaries to my console over a USB serial adapter from the Mac, I'm not entirely convinced, but I made it work 80% of the time at least by adding some delays to the handshake code in siocons - my vague theory is that the emulated port wasn't setting handshake lines quite as quickly as would be ideal. I can upload my tweaked source somewhere if that'd be of use.
Many thanks for getting this all to work though!
I was using this to create exe's to run in an emulator and it was working great. I had started to formulate a PR to clean-up some of the code to work on linux and have better portability, but ended up finding it much easier to just rewrite in Go. I've been using that a lot lately for things like cross-platform tools since Go has a really powerful backend compiler for targeting a bunch of different platforms and producing single static binaries. I have it working locally and will be committing it to GitHub this week (along with any other tools I've created while trying to figure this stuff out). I couldn't have made any of this without using your work on Yarexe as a guide, so thank you for putting it out there!gwald wrote: ↑May 17th, 2019, 11:14 am Ha cool!
Have you used my yarexe by any chance?
https://github.com/gwald/Yarexe
It's a hack of all the exe's that turn the yaroze's siocon's auto file into a single ps1 exe, which then the emulator ran, with printf debugging.. that was 90% of my workflow and worked pretty well, way faster then hardware (I used no$PSX and PCSXR).
It's for windows, never thought of porting it to linux, but it 'should' run in wine too.. never tested it
edit: I just compiled it in linux, it was missing the strlwr strupr funcs and it compiled, I haven't tested it tho, but it should work, not sure how 64bit compliant that hacky coding is![]()
![]()
![]()
Anyway, let me know if you use it or have issues with it.
Mike.
I haven't looked at the PsyQ SDK very much, but it appears that the pre-compiled parts of it are all .obj and .lib files, which are (at least generally) the standard file extensions for Windows object and static library files, respectively.
I am currently looking at converting the Net Yaroze SDK mipsel-ecoff static library into mipsel-elf and seeing if that will work (funny enough, the original question in this thread). I think it may actually be possible to convert the existing mipsel-ecoff static library into object files where the ecoff headers are replaced with elf32 headers (similar to how the current programs out there convert to psx-exe and leave the text sections mostly intact). If this is successful, it would mean that the newest versions of GCC/LLVM could be used to link the Net Yaroze static library instead of having to use an ancient version of GCC. I mention this because it may be possible to do the same with the Windows static library, replacing the OS-specific file format only with a new one that is more portable, and keeping the underlying architecture-specific code intact. This is not something I'm really familiar with so it may not work, but figured I would throw it out there in case anyone has some helpful input on the matter.
I'll also update again when I get the initial commit for my yaroze tools out, for those that may be interested. Thanks again to everyone for all the help, this has been really fun!
https://github.com/ChrisRx/psxsdk
I have an initial commit of the tools I've been developing while working on the Net Yaroze. objdump is what I made recently and have been using it to convert the Net Yaroze development library from ECOFF to ELF by disassembling the object files from libps.a and recompiling them with gcc as mipself-elf instead.
I'm still not 100% sure that this will work, but at this point I'm pretty optimistic that this will work. If it does my end goal is to make the assembly source available in a way that it can be recompiled by any compiler that still supports MIPS-I (llvm apparently does not, but that might be another project).
As a side note, the sioload program there seems to work flawlessly with all baud rates, as I think I figured out the nuances that were causing the linux siocons to not work. There are a few points where modern computers CPUs executed code more quickly than anticipated by the original writer(s) of the linux siocons and it caused the data to be sent after initial a binary transfer before the Net Yaroze mon.exe was ready. Putting trivial waits in those places seems to have fixed it. I had a productive Holiday vacation this time around![Smile :)](./images/smilies/icon_e_smile.gif)
I have an initial commit of the tools I've been developing while working on the Net Yaroze. objdump is what I made recently and have been using it to convert the Net Yaroze development library from ECOFF to ELF by disassembling the object files from libps.a and recompiling them with gcc as mipself-elf instead.
I'm still not 100% sure that this will work, but at this point I'm pretty optimistic that this will work. If it does my end goal is to make the assembly source available in a way that it can be recompiled by any compiler that still supports MIPS-I (llvm apparently does not, but that might be another project).
As a side note, the sioload program there seems to work flawlessly with all baud rates, as I think I figured out the nuances that were causing the linux siocons to not work. There are a few points where modern computers CPUs executed code more quickly than anticipated by the original writer(s) of the linux siocons and it caused the data to be sent after initial a binary transfer before the Net Yaroze mon.exe was ready. Putting trivial waits in those places seems to have fixed it. I had a productive Holiday vacation this time around
![Smile :)](./images/smilies/icon_e_smile.gif)
Might be a stupid question but what would be the steps to get this working natively on windows machine, eg the original yaroze was DJGPP and didnt require a linux/unix shell etc.. is there a way to get it cross compiled to work natively on a windows machine?
-
gwald Verified
- Net Yaroze Enthusiast
- Posts: 282
- Joined: Sep 18, 2013
- I am a: programmer/DBA
- PlayStation Model: Net Yaroze
- Contact:
there is, I've compiled it and used it and works okay in linux.mrhaboobi wrote: ↑January 14th, 2020, 7:09 am Might be a stupid question but what would be the steps to get this working natively on windows machine, eg the original yaroze was DJGPP and didnt require a linux/unix shell etc.. is there a way to get it cross compiled to work natively on a windows machine?
But the way to do it, is setting up linux with a windows target toolchain ie:
sudo apt-get install mingw-w64
Then you can create 32-bit Windows executable with:
i686-w64-mingw32-gcc -o main32.exe main.c
And 64-bit Windows executable with:
x86_64-w64-mingw32-gcc -o main64.exe main.c
I was thinking about doing this, not sure if I will though.
Thanks Chris, i'll have to check that out!ChrisRx wrote: ↑January 11th, 2020, 7:36 am https://github.com/ChrisRx/psxsdk
As a side note, the sioload program there seems to work flawlessly with all baud rates, as I think I figured out the nuances that were causing the linux siocons to not work. There are a few points where modern computers CPUs executed code more quickly than anticipated by the original writer(s) of the linux siocons and it caused the data to be sent after initial a binary transfer before the Net Yaroze mon.exe was ready. Putting trivial waits in those places seems to have fixed it. I had a productive Holiday vacation this time around![]()
Be cool if you could target windows. i dont have a linux set up ![Smile :)](./images/smilies/icon_e_smile.gif)
![Smile :)](./images/smilies/icon_e_smile.gif)
gwald wrote: ↑December 14th, 2020, 9:07 amthere is, I've compiled it and used it and works okay in linux.mrhaboobi wrote: ↑January 14th, 2020, 7:09 am Might be a stupid question but what would be the steps to get this working natively on windows machine, eg the original yaroze was DJGPP and didnt require a linux/unix shell etc.. is there a way to get it cross compiled to work natively on a windows machine?
But the way to do it, is setting up linux with a windows target toolchain ie:
sudo apt-get install mingw-w64
Then you can create 32-bit Windows executable with:
i686-w64-mingw32-gcc -o main32.exe main.c
And 64-bit Windows executable with:
x86_64-w64-mingw32-gcc -o main64.exe main.c
I was thinking about doing this, not sure if I will though.
Thanks Chris, i'll have to check that out!ChrisRx wrote: ↑January 11th, 2020, 7:36 am https://github.com/ChrisRx/psxsdk
As a side note, the sioload program there seems to work flawlessly with all baud rates, as I think I figured out the nuances that were causing the linux siocons to not work. There are a few points where modern computers CPUs executed code more quickly than anticipated by the original writer(s) of the linux siocons and it caused the data to be sent after initial a binary transfer before the Net Yaroze mon.exe was ready. Putting trivial waits in those places seems to have fixed it. I had a productive Holiday vacation this time around![]()
Who is online
Users browsing this forum: No registered users and 2 guests