]> git.sesse.net Git - pistorm/commitdiff
Cleanup warnings and LinuxJedi's docs
authorAndrew Hutchings <andrew@linuxjedi.co.uk>
Sat, 1 May 2021 06:48:42 +0000 (07:48 +0100)
committerAndrew Hutchings <andrew@linuxjedi.co.uk>
Sun, 2 May 2021 16:17:16 +0000 (17:17 +0100)
This branch:
* Adds information on modifying the systemd script provided in
  boot_scripts
* Adds documentation for the newest options on the PiStorm gui
* Fixes a memory leak and a potential crash on alloc failure for the gui
* Minor text changes in the gui
* Fixes minor compiler warnings for the PiSimple CLI (both for GCC and
  VBCC)

boot_scripts/README.md
platforms/amiga/pistorm-dev/pistorm_dev_amiga/PiSimple
platforms/amiga/pistorm-dev/pistorm_dev_amiga/PiStorm
platforms/amiga/pistorm-dev/pistorm_dev_amiga/README.md
platforms/amiga/pistorm-dev/pistorm_dev_amiga/build.sh [changed mode: 0644->0755]
platforms/amiga/pistorm-dev/pistorm_dev_amiga/gui_interact.c
platforms/amiga/pistorm-dev/pistorm_dev_amiga/pistorm_dev.c
platforms/amiga/pistorm-dev/pistorm_dev_amiga/simple_interact.c

index 9156a82cc38d29cb6224fe588fe1f1fdefa1bf61..e12a598d7f66a43f9c61c7ef6502c61d7acf22d0 100644 (file)
@@ -2,13 +2,59 @@
 
 ## 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
 
index 0d413a9e39a01144e90acb063f55caaea26b5558..f3c265dd281a004ae08c24e395784c23a008ca2b 100755 (executable)
Binary files a/platforms/amiga/pistorm-dev/pistorm_dev_amiga/PiSimple and b/platforms/amiga/pistorm-dev/pistorm_dev_amiga/PiSimple differ
index 4150c041b279b8f85832e9b8e3a4ccc66b2f04dc..d195961f73483f192bedf6e55f090a9418112e3a 100755 (executable)
Binary files a/platforms/amiga/pistorm-dev/pistorm_dev_amiga/PiStorm and b/platforms/amiga/pistorm-dev/pistorm_dev_amiga/PiStorm differ
index 7eb507f0147b41e12e467ba54c1b7928a4f3a2eb..de07a50c6db0708b5d59d0cb8bf196897b20bae7 100644 (file)
@@ -1,4 +1,4 @@
-# PiStorm Interaction Tool
+# PiStorm Interaction Tools
 
 ## Cross-Compiling
 
@@ -35,3 +35,13 @@ You can copy a file from the PiStorm to the Amiga. First of all, type in the fil
 ### 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.
index 789f4d83954ef7a2f2615c9668017c771ae6f6c3..6ceff0796fee309f4eaf6726d92df47b22f6dac9 100644 (file)
@@ -19,7 +19,7 @@
 extern unsigned int pistorm_base_addr;
 struct ReqToolsBase *ReqToolsBase;
 
-#define VERSION "v0.3"
+#define VERSION "v0.3.1"
 
 #define button1w 54
 #define button1h 11
@@ -212,7 +212,7 @@ struct Gadget RebootButton =
     &RebootButton_text, 0, NULL, GADREBOOT, NULL
 };
 
-UBYTE StatusBar_buf[128] = "PiStorm...";
+UBYTE StatusBar_buf[128] = "Reticulating splines...";
 
 struct IntuiText StatusBar_text =
 {
@@ -485,9 +485,11 @@ static char *GetSavePath()
     else
     {
         rtEZRequest("Out of memory!", "Oh no!", NULL, NULL);
+        return NULL;
     }
 
     strncpy(fullpath, (char*)filereq->Dir, 256);
+    rtFreeRequest((APTR)filereq);
     return fullpath;
 }
 
@@ -533,6 +535,10 @@ int main()
         no_board = TRUE;
         WriteGadgetText("PiStorm not found", StatusBar_buf, myWindow, &StatusBar);
     }
+    else
+    {
+        WriteGadgetText("PiStorm found!", StatusBar_buf, myWindow, &StatusBar);
+    }
     if (!no_board)
     {
         updateRTG(myWindow);
index 10cc3facd03517b143ce5013503cddd533cafc5e..e21bdcba20cf25f4fc7b3d0e7240dac9a359cbc7 100644 (file)
@@ -12,8 +12,6 @@
 #include <exec/io.h>
 #include <exec/execbase.h>
 
-#include <libraries/expansion.h>
-
 #include <devices/trackdisk.h>
 #include <devices/timer.h>
 #include <devices/scsidisk.h>
@@ -44,8 +42,8 @@ unsigned short short_val;
 
 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");
index 969cebf11598913f1b83bb78119997ddb4915622..2a07fe81ffb45841eab01ccf25109b381aadefb3 100644 (file)
@@ -18,8 +18,6 @@
 #include <exec/io.h>
 #include <exec/execbase.h>
 
-#include <libraries/expansion.h>
-
 #include <devices/trackdisk.h>
 #include <devices/timer.h>
 #include <devices/scsidisk.h>
@@ -110,7 +108,7 @@ int __stdargs main (int argc, char *argv[]) {
                 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 {
@@ -120,7 +118,7 @@ int __stdargs main (int argc, char *argv[]) {
                         } 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);