Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a bug in MAPDRV and a bug in the MFRSD kernel regarding DEV_STATUS routine #119

Merged
merged 1 commit into from Nov 30, 2023

Conversation

Konamiman
Copy link
Owner

@Konamiman Konamiman commented Apr 13, 2023

  • The MAPDRV function call code was corrupting the register holding the drive number while unmapping all the drives assigned to the device in the case where the driver reports that the device has changed. Thus the mapping information ended up written to an incorrect memory area.

  • The MegaFlashROM SCC+ SD driver was reporting "device changed" even after the device had been accessed with DEV_RW. A device is no longer considered as "changed" after it has been accessed.

Scenario to reproduce the issue:

  • MFRSD with two cards, the second one has at least 2 partitions.
  • On boot, A: is card 1 partition 1, B: is card 2 partition 1.
  • Right after boot map any drive to card 2 partition 2: MAPDDRV d: 2 3 1-3
  • Now switch to drive D:, computer crashes.

- MAPDRV was corrupting the register holding the drive number
  while unmapping all the drives in case the device reports
  it has changed. Thus the mapping information ended up written
  to an incorrect memory area.

- The MFRSD driiver was reporting "device changed" even after
  the device had been accessed with DEV_RW. A device is no longer
  considered as "changed" after it has been accessed.

Scenario to reproduce the issue:

- MFRSD with two cards, second one has at least 2 partitions
- On boot, A: is card 1 partition 1, B: is card 2 partition 1
- Right after boot map any drive to card 2 partition 2:
  MAPDDRV d: 2 3 1-3
- Now switch to drive D:, computer crashes
@Konamiman Konamiman self-assigned this Apr 13, 2023
@Konamiman Konamiman added this to the v2.1.2 milestone Apr 13, 2023
@Steveneska
Copy link
Contributor

I don't know if it's related to the same issue but running a MFRSCC+ SD with 2 SD Cards in the same configuration (A: is SD Card 1 partition 1 and B: is SD Card 2 partition 1), mapping C: and D: to SD Card 2 partitions 2 and 3 respectively and then switching to drive B: will return a bad drive name error in Basic and switching to C: right after a failure to switch to B: will hand the computer.

Somehow though, running let's say DEVINFO from drive A: before switching to drive B: will not reproduce this behavior as the partitions and drives are recognized as expected.

@Konamiman Konamiman changed the base branch from v2.1 to v2.1.2 November 21, 2023 12:20
@Konamiman Konamiman merged commit bd871d4 into v2.1.2 Nov 30, 2023
1 check passed
@Konamiman Konamiman mentioned this pull request Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants