## Bootup script
+For your convience a startup script for systemd in Linux is located in this directory. This script will start PiStorm *before* the network connections have started.
+
+### Installation
+
To start PiStorm on automatically on boot, copy `pistorm.service` into /etc/systemd/system/ in your Pi's filesystem. Then run:
```bash
sudo systemctl enable pistorm
```
+### Customisation
+
+There are some things you may want to change in the systemd script. These instructions will help with that.
+
+#### Custom config
+
+If you wish to boot using a custom configuration file change `ExecStart` to:
+
+```ini
+ExecStart=/home/pi/pistorm/emulator --config-file myconfig.cfg
+```
+
+Where `myconfig.cfg` is your config file in the `pistorm` directory. If your config file is somewhere else you will need to put the full path for it there.
+
+**NOTE:** do not put an '=' between `--config-file` and the file name, this will not work.
+
+#### Different location
+
+You may want to run your PiStorm from a different location than `/home/pi/pistorm` this is fine, but it is important that the files that come with the emulator stay together in the same directory structure. For example, if you moved pistorm to `/opt/pistorm` you will need to change the following two lines:
+
+```ini
+ExecStart=/opt/pistorm/emulator
+WorkingDirectory=/opt/pistorm
+```
+
+It is important both lines are changed otherwise this can cause issues, particularly crashes.
+
+#### Startup order
-This script will start PiStorm *before* the network connections have started.
+If, for example, your PiStorm configuration depends on something like Samba running for PiScsi you will want to change the startup order so the PiStorm waits for that to run. In the `[Unit]` second add something like the following example:
+
+```ini
+After=network.target samba.service
+```
+
+Please see the systemd documentation for more informatino on this.
+
+### Applying changes
+
+If you have made any changes to the `pistorm.service` file *after* it has been copied over you will need to reload the systemd configuration for the changes to be seen. This can be done with:
+
+```bash
+sudo systemctl daemon-reload
+```
## Faster boot
-# PiStorm Interaction Tool
+# PiStorm Interaction Tools
## Cross-Compiling
### Reboot
Reboots the Amiga (not PiStorm).
+
+### Kickstart file
+
+This will let you choose a Kickstart ROM file on the Pi to boot from. As with Config gile, you can type the name of the Kickstart ROM file relative to the PiStorm's execution directory and hit "Commit". If the Kickstart ROM file is valie the PiStorm will load it in and the Amiga will immediately reboot.
+
+**NOTE:** Instead of rebooting the Amiga may crash here. This would be due to an interrupt trying to access an old ROM position in the new ROM file before the reboot could execute. You can resolve this by manually doing a Ctrl-A-A reboot.
+
+### Shutdown Pi
+
+When pressing this button and confirming, the Pi will safely shutdown the underlying Linux OS. When this happens the Amiga will essentially hang as it will be as if the CPU has been removed. There will be no indication that the Pi shutdown has completed so it is probably wise to wait 10-15 seconds before removing power if this option is used.
extern unsigned int pistorm_base_addr;
struct ReqToolsBase *ReqToolsBase;
-#define VERSION "v0.3"
+#define VERSION "v0.3.1"
#define button1w 54
#define button1h 11
&RebootButton_text, 0, NULL, GADREBOOT, NULL
};
-UBYTE StatusBar_buf[128] = "PiStorm...";
+UBYTE StatusBar_buf[128] = "Reticulating splines...";
struct IntuiText StatusBar_text =
{
else
{
rtEZRequest("Out of memory!", "Oh no!", NULL, NULL);
+ return NULL;
}
strncpy(fullpath, (char*)filereq->Dir, 256);
+ rtFreeRequest((APTR)filereq);
return fullpath;
}
no_board = TRUE;
WriteGadgetText("PiStorm not found", StatusBar_buf, myWindow, &StatusBar);
}
+ else
+ {
+ WriteGadgetText("PiStorm found!", StatusBar_buf, myWindow, &StatusBar);
+ }
if (!no_board)
{
updateRTG(myWindow);
#include <exec/io.h>
#include <exec/execbase.h>
-#include <libraries/expansion.h>
-
#include <devices/trackdisk.h>
#include <devices/timer.h>
#include <devices/scsidisk.h>
unsigned int pi_find_pistorm() {
unsigned int board_addr = 0xFFFFFFFF;
- struct ExpansionBase *expansionbase = (struct ExpansionBase *)OpenLibrary("expansion.library", 0L);
-
+ struct ExpansionBase *expansionbase = (struct ExpansionBase *)OpenLibrary((STRPTR)"expansion.library", 0L);
+
if (expansionbase == NULL) {
#ifdef HAS_STDLIB
printf("Failed to open expansion.library.\n");
#include <exec/io.h>
#include <exec/execbase.h>
-#include <libraries/expansion.h>
-
#include <devices/trackdisk.h>
#include <devices/timer.h>
#include <devices/scsidisk.h>
if (dest == NULL) {
printf ("Failed to allocate memory buffer for file. Aborting file transfer.\n");
} else {
- printf ("Found a %d byte file on the Pi side. Eating it.\n", filesize);
+ printf ("Found a %u byte file on the Pi side. Eating it.\n", filesize);
if (pi_transfer_file(argv[2], dest) != PI_RES_OK) {
printf ("Something went horribly wrong during the file transfer.\n");
} else {
} else {
fwrite(dest, filesize, 1, out);
fclose(out);
- printf ("%d bytes transferred to file %s.\n", filesize, argv[3]);
+ printf ("%u bytes transferred to file %s.\n", filesize, argv[3]);
}
}
free(dest);