Cleanup warnings and LinuxJedi's docs

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)
This commit is contained in:
Andrew Hutchings 2021-05-01 07:48:42 +01:00
parent 2910224b50
commit 007b35ae52
8 changed files with 70 additions and 12 deletions

View 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
This script will start PiStorm *before* the network connections have started.
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
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

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

0
platforms/amiga/pistorm-dev/pistorm_dev_amiga/build.sh Normal file → Executable file
View File

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

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

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