Jump to content
IGNORED

A universal BJL API


Zerosquare

Recommended Posts

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 by Zerosquare
Link to comment
Share on other sites

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 by Zerosquare
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 by Zerosquare
Link to comment
Share on other sites

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 :D

 

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 by Zerosquare
Link to comment
Share on other sites

Thanks for the info ! In fact, I didn't realize that you included the full sources for your Packet Loader. Silly me :D

 

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.

Link to comment
Share on other sites

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 ;)

Link to comment
Share on other sites

I suggest skipping the use of BJL, and using serial transfers only.

 

And using the UART bug ? :D

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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. :P

 

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 by Zerosquare
  • Like 1
Link to comment
Share on other sites

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 by Zerosquare
Link to comment
Share on other sites

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.).

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...