Hacker News new | ask | show | jobs
by rvalles 1877 days ago
Did re-read your comment, and thought I'd point you to some code so you can quickly see how it works.

Regarding trackdisk.device, you might want to take a look at:

https://github.com/rvalles/pyamigadebug/blob/master/ExecLibr...

And the function calling mechanism for RomWack backend:

https://github.com/rvalles/pyamigadebug/blob/master/RomWack....

Ultimately, TrackdiskDevice ends up being a thin wrapper around ExecLibrary:

https://github.com/rvalles/pyamigadebug/blob/master/Trackdis...

For performance purposes, the Floppy tool does instead use this small server written in asm:

https://github.com/rvalles/pyamigadebug/blob/master/asm/flop...

And the python boilerplate client to talk with it:

https://github.com/rvalles/pyamigadebug/blob/master/FloppyXf...

For the BERR case, without the initial reboot, Amiga will just crash again when calls are made from the exception handler. Recovering control after a reboot is a nice and clean way to get the Amiga into a known state. It is definitely also doable without rebooting, but somewhat more involved.

Else, when entering the debugger via e.g. the extra debug menu present in workbench when loaded via "loadwb -debug", the context RomWack works with is a user context, so I just take over the user task. As long as I don't corrupt the stack (or anything else), I can even return cleanly.