소스 검색

CLEAR_ROM file was crashing

Placing a CLEAR_ROM file on the root directory on the SD card
to clear the ROM drive was crashing. Best guess is it was trying
 to read beyond an SRAM boundary as there was a read overrun
because the write buffer was smaller than the byte count to be
written.

Creating a zeroed buffer the size as the sector size of the flash
corrects the issue.
J. Morio Sakaguchi 3 달 전
부모
커밋
e43fcf1847
1개의 변경된 파일2개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 3
      src/ROMDrive.cpp

+ 2 - 3
src/ROMDrive.cpp

@@ -88,9 +88,8 @@ bool romDriveCheckPresent(romdrive_hdr_t *hdr)
 // Clear the drive metadata header
 bool romDriveClear()
 {
-    romdrive_hdr_t hdr = {0x0};
-
-    if (!platform_write_romdrive((const uint8_t*)&hdr, 0, PLATFORM_ROMDRIVE_PAGE_SIZE))
+    memset(scsiDev.data, 0, PLATFORM_ROMDRIVE_PAGE_SIZE);
+    if (!platform_write_romdrive(scsiDev.data, 0, PLATFORM_ROMDRIVE_PAGE_SIZE))
     {
         logmsg("-- Failed to clear ROM drive");
         return false;