Zerosquare Posted August 7, 2006 Share Posted August 7, 2006 (edited) As some of you may know, I am currently developing a USB BJL gizmo (Catnip Cable). Ray suggested I should team up with swapd0, because he has written a real-time debugger, and it would be fine to have both working in cooperation. That gave me an idea : we have different hardware, and different operating systems, but a lot of us use BJL (either the ROM version, the CD version, or Protector:SE's built-in version). Wouldn't it be cool to create a hardware and OS-independant BJL API, so that tools we create (uploaders, debuggers, etc.) could run everywhere ? Besides, that kind of cooperation would allow everybody to focus on his/her abilities without having to reinvent the wheel -- for example, I can work on hardware and PC software, but I know very little about actual Jag coding (yet ). Here are a few initial suggestions for the API and related projects : Open-source (not necessarily GPL, but the source should be public) In C (plain ANSI whenever possible) Reasonably simple And here is what I can contribute : Windows code for the standard BJL cable, and the Catnip cable (partly done already). Limited Linux testing. Reverse-engineering of the BJL protocol (partly done already, also). Any comments ? Edited August 7, 2006 by Zerosquare Quote Link to comment Share on other sites More sharing options...
JagChris Posted August 7, 2006 Share Posted August 7, 2006 (edited) Excellent idea! Any chance BJL on the PC can be made bidirectional for debugging? Edited August 7, 2006 by JagChris Quote Link to comment Share on other sites More sharing options...
Zerosquare Posted August 7, 2006 Author Share Posted August 7, 2006 (edited) Any chance BJL on the PC can be made bidirectional for debugging?I'm pretty sure that's possible. There are more programs available on the Atari platform (GT Turbo showed me a debugger, and started to reverse-engineer it a while ago), the problem is that many parts of the BJL protocol are not documented. So anyone willing to analyze 68000 ASM code is welcome to join the effort Edited August 7, 2006 by Zerosquare Quote Link to comment Share on other sites More sharing options...
JagChris Posted August 7, 2006 Share Posted August 7, 2006 Any chance BJL on the PC can be made bidirectional for debugging?I'm pretty sure that's possible. There are more programs available on the Atari platform.. I'm aware of that but PCs are immensely more prevelent and far cheaper and easier to come by. Adapting these tools for the PC and the Jags future makes sense. Quote Link to comment Share on other sites More sharing options...
GT Turbo Posted August 7, 2006 Share Posted August 7, 2006 Very nice idea If you need some other reverse enginneering about the Bjl debugger, you know where you can contact me GT Quote Link to comment Share on other sites More sharing options...
JagChris Posted August 7, 2006 Share Posted August 7, 2006 Any chance BJL on the PC can be made bidirectional for debugging?I'm pretty sure that's possible. There are more programs available on the Atari platform (GT Turbo showed me a debugger, and started to reverse-engineer it a while ago), the problem is that many parts of the BJL protocol are not documented. So anyone willing to analyze 68000 ASM code is welcome to join the effort Any possibility Bastian will release the source code? Quote Link to comment Share on other sites More sharing options...
justclaws Posted August 7, 2006 Share Posted August 7, 2006 Hello, I'm pretty sure that's possible. There are more programs available on the Atari platform (GT Turbo showed me a debugger, and started to reverse-engineer it a while ago), the problem is that many parts of the BJL protocol are not documented. So anyone willing to analyze 68000 ASM code is welcome to join the effort Why don't you just drop Bastian Schick a message?He's a really helpful guy, and I'm sure he could add some more details! BJL generally implements the JagServer calls as well, the original devkit for home-brew coder. UGD-JAG was for JagServer, then BJL and the rest! Cheers, JustClaws. Quote Link to comment Share on other sites More sharing options...
Zerosquare Posted August 7, 2006 Author Share Posted August 7, 2006 Why don't you just drop Bastian Schick a message?We tried to, but he stopped responding to e-mail several months ago Quote Link to comment Share on other sites More sharing options...
JagMod Posted August 7, 2006 Share Posted August 7, 2006 The source to BJL and the uploaders are here: http://www.monlynx.de/download/jaguar/ No need to reverse anything. Quote Link to comment Share on other sites More sharing options...
swapd0 Posted August 7, 2006 Share Posted August 7, 2006 Hi everybody, here are some notes about my debugger. The sending&receiving routines are written in 68000 code, the sending code is a translation from BJL GPU-loader routines, receiving was a lot harder, I tried to different routines but at the end only worked the serial one, I send data from Jaguar to PC using the bussy bit, this means that is a bit slow. To make the debugger I builded set of commands, some with extra data, they are sended to Jaguar (must be on debugger mode, included into PacketLoader) and the Jaguar return the processor state (registers), then they are printed on screen. To debug some simple examples are ok, but it has some missing features, like change register value and watch memory, and some features need to be updated bacause it's a bit slow, on 68000 code you can execute step by step and skip one instruction, breakpoints are implemented but don't work . On GPU/DPS only single step is implemented. To put the Jaguar into debugger mode I have two options, upload the file with '0' pressed, or put into the code a trap #0 (near buggy code better) In PacketLoader from my web, I include the pc-loader and driver with the send&receive routines (PC side). You can have a look at it, to see how it works. See Ya Rober Quote Link to comment Share on other sites More sharing options...
Zerosquare Posted August 7, 2006 Author Share Posted August 7, 2006 (edited) The source to BJL and the uploaders are here:http://www.monlynx.de/download/jaguar/ No need to reverse anything. Thanks, but by "reverse-engineering" I meant extracting the algorithms from the code, so that they can be reimplemented on other hardware and OS. The C source file for the uploader only handles the standard uploading stuff, all the rest (auto-switching to 8 or 4-bit downloading mode, EEPROM access, debugging, etc.) is done in assembler. Actually I've ported the PC stuff in BJL.s back from ASM to C in this project, but a lot of things have been implemented only on the Atari. Edited August 7, 2006 by Zerosquare Quote Link to comment Share on other sites More sharing options...
Zerosquare Posted August 7, 2006 Author Share Posted August 7, 2006 (edited) Hi everybody, here are some notes about my debugger...Thanks for the info ! In fact, I didn't realize that you included the full sources for your Packet Loader. Silly me What do you think of the idea ? Would you be interested in releasing the sources for your PC-side debugger program (Jdb), so that you or someone else could create a "universal" version ? (To avoid confusion : if I understood correctly, swapd0 uses BJL only to transfer his Packet Loader program to the Jag, and has written the debugger himself. I believe there are also debugging functions built into the BJL ROM -- that's a different thing.) Edited August 7, 2006 by Zerosquare Quote Link to comment Share on other sites More sharing options...
swapd0 Posted August 7, 2006 Share Posted August 7, 2006 Thanks for the info ! In fact, I didn't realize that you included the full sources for your Packet Loader. Silly me What do you think of the idea ? Would you be interested in releasing the sources for your PC-side debugger program (Jdb), so that you or someone else could create a "universal" version ? For now it's a bit buggy, and it has GUI so that makes it harder to port, it should be nice to create a CLI version, and then include a GUI. Quote Link to comment Share on other sites More sharing options...
JagMod Posted August 7, 2006 Share Posted August 7, 2006 I suggest skipping the use of BJL, and using serial transfers only. Quote Link to comment Share on other sites More sharing options...
Zerosquare Posted August 9, 2006 Author Share Posted August 9, 2006 I suggest skipping the use of BJL, and using serial transfers only.Sorry, I don't understand what you mean. Anyways, I am currently making a draft of the API and converting "lo" (the uploader) to work with it, and I should release it soon. That should give you some pointers on what I'm thinking about Quote Link to comment Share on other sites More sharing options...
Fredifredo Posted August 10, 2006 Share Posted August 10, 2006 I suggest skipping the use of BJL, and using serial transfers only. And using the UART bug ? Quote Link to comment Share on other sites More sharing options...
Songbird Posted August 10, 2006 Share Posted August 10, 2006 And using the UART bug ? Nothing that a good CRC can't detect and fix. Quote Link to comment Share on other sites More sharing options...
JagMod Posted August 10, 2006 Share Posted August 10, 2006 I suggest skipping the use of BJL, and using serial transfers only. And using the UART bug ? There are many problems with incompatible parallel ports on pcs that make using BJL difficult. Not to mention the custom cable which must be built. Serial ports on pcs are very standard and run at 115k. BJL may be faster when it works, but serial transfers work 100% of the time. Quote Link to comment Share on other sites More sharing options...
JagChris Posted August 10, 2006 Share Posted August 10, 2006 I bought the BJL Adapter and I use a standard Paralell cable. My failure rate on transfers is very low. Maybe 1 out of 15 or 20. Quote Link to comment Share on other sites More sharing options...
JagMod Posted August 10, 2006 Share Posted August 10, 2006 I bought the BJL Adapter and I use a standard Paralell cable. My failure rate on transfers is very low. Maybe 1 out of 15 or 20. 1 out of 15 = 6.66% of the time 1 out of 20 = 5% of the time. I'm saying I have 0% failure with serial transfers. When you are debugging, you want accurate results being returned. Quote Link to comment Share on other sites More sharing options...
Zerosquare Posted August 10, 2006 Author Share Posted August 10, 2006 (edited) Here's the first draft of the API, and a modified uploader using it. It's by no means final or perfect or anything, just something to show what I have in mind. And it's actually functional (under Windows that is - it's supposed to work under Linux too, but I've not tested it at all yet). If you're a Jag developer, please take a look at the sources (bjl_api.h can be used as a summary) and offer your comments and suggestions ! (To swapd0 : I haven't implemented your bit-by-bit input code yet, but I will. Honest ) I'm saying I have 0% failure with serial transfers.When you are debugging, you want accurate results being returned. Don't want to beat my own drum, but I have 0% failure with my BJL-based Catnip Cable too. Anyways, serial may have its advantages, but : The hardware is buggy, and there is no publicly known way of fixing it (though CRC could probably be used as a workaround, as Songbird said) It requires extra hardware. Well BJL does too, but the parallel cable is cheaper and easier to make. It requires new software on the Jag side. BJL is already available, in at least 3 different formats. It requires new software on the PC side. BJL code has been around for years. There is a significant number of BJL users already. I assume you're thinking about JUGS ? Please keep in mind that everybody cannot afford it, and I doubt Scatologic would release the needed technical details. bjl_api_draft.zip Edited August 12, 2006 by Zerosquare 1 Quote Link to comment Share on other sites More sharing options...
JagMod Posted August 10, 2006 Share Posted August 10, 2006 Good luck with that. Quote Link to comment Share on other sites More sharing options...
Zerosquare Posted August 12, 2006 Author Share Posted August 12, 2006 (edited) No comments yet ? NOTE : There was a bug in the previous draft version which could occasionally corrupt transfers. It has been fixed, and the file in the previous post has been updated. The name has also been changed, but it is otherwise the same thing. Edited August 12, 2006 by Zerosquare Quote Link to comment Share on other sites More sharing options...
JagChris Posted August 13, 2006 Share Posted August 13, 2006 I'll check it out. See what it does. Any startup tips? Quote Link to comment Share on other sites More sharing options...
Zerosquare Posted August 13, 2006 Author Share Posted August 13, 2006 I'll check it out. See what it does. Any startup tips?That depends on whether you're interested in Jag tools development. If you're not, then it's similar in functionality to the modified Windows version of the BJL uploader I posted earlier -- internal code modifications shouldn't affect you. You can help by testing whether it works OK for you (to make sure I didn't break anything while making the changes). If you are, then it's an attempt to create a reusable BJL API, and modify the existing uploader to use it instead of accessing the hardware directly. I'll be glad to hear about what you think of it (any functions I've forgotten, better ways to do stuff, others ideas, etc.). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.