Jelajahi Sumber

Add docs about ROM drive, add led flash

Petteri Aimonen 3 tahun lalu
induk
melakukan
bbdd5bec2b
2 mengubah file dengan 23 tambahan dan 0 penghapusan
  1. 16 0
      README.md
  2. 7 0
      src/ZuluSCSI_disk.cpp

+ 16 - 0
README.md

@@ -98,6 +98,22 @@ Any read errors are logged into `zululog.txt`.
 Depending on hardware setup, you may need to mount diode `D205` and jumper `JP201` to supply `TERMPWR` to the SCSI bus.
 This is necessary if the drives do not supply their own SCSI terminator power.
 
+ROM drive in microcontroller flash
+----------------------------------
+The RP2040 model supports storing up to 1660kB image as a read-only drive in the
+flash chip on the PCB itself. This can be used as e.g. a boot floppy that is available
+even without SD card.
+
+To initialize a ROM drive, name your image file as e.g. `HD0.rom`.
+The drive type, SCSI ID and blocksize can be set in the filename the same way as for normal images.
+On first boot, the LED will blink rapidly while the image is being loaded into flash memory.
+Once loading is complete, the file is renamed to `HD0.rom_loaded` and the data is accessed from flash instead.
+
+The status and maximum size of ROM drive are reported in `zululog.txt`.
+To disable a previously programmed ROM drive, create empty file called `HD0.rom`.
+If there is a `.bin` file with the same ID as the programmed ROM drive, it overrides the ROM drive.
+There can be at most one ROM drive enabled at a time.
+
 Project structure
 -----------------
 - **src/ZuluSCSI.cpp**: Main portable SCSI implementation.

+ 7 - 0
src/ZuluSCSI_disk.cpp

@@ -132,6 +132,11 @@ bool scsiDiskProgramRomDrive(const char *filename, int scsi_id, int blocksize, S
     uint32_t pages = (filesize + AZPLATFORM_ROMDRIVE_PAGE_SIZE - 1) / AZPLATFORM_ROMDRIVE_PAGE_SIZE;
     for (uint32_t i = 0; i < pages; i++)
     {
+        if (i % 2)
+            LED_ON();
+        else
+            LED_OFF();
+
         if (file.read(scsiDev.data, AZPLATFORM_ROMDRIVE_PAGE_SIZE) <= 0 ||
             !azplatform_write_romdrive(scsiDev.data, (i + 1) * AZPLATFORM_ROMDRIVE_PAGE_SIZE, AZPLATFORM_ROMDRIVE_PAGE_SIZE))
         {
@@ -141,6 +146,8 @@ bool scsiDiskProgramRomDrive(const char *filename, int scsi_id, int blocksize, S
         }
     }
 
+    LED_OFF();
+
     file.close();
 
     char newname[MAX_FILE_PATH * 2] = "";