Jump to content
173 posts in this topic

Recommended Posts

5 hours ago, Austere.J said:

@theroadw

 

1) Add the boot argument `keepsyms=1` so that you can see which function triggers the kernel panic.

2) Remove the SD card while your system is booting.

3) Use your bootloader to inject the kernel extension.

4) Once your system boots, insert your card and check whether the same kernel panic occurs.

If so, please attach the full kernel panic report as well as your kernel log.

It is hard to see the log and debug the issue by watching the recording.

 

Note that I don't have macOS Mojave installed on my machine, so I have not checked the compatibility and tested the driver yet.

1- Will do and report back

2- No SD card present

3-Using OC injecting generates that KP in the video

4-System doesn't boot, will do #1 to have more information, I know the video is crappy, sorry.

 

@Hervé I noticed that and I tried compiling in Mojave but there are a couple of errors I don't know how to remove.

 

I guess my post wasn't very clear, the KP is on my Catalina boot.

I prefer to use Mojave for day to day and it would be great to also make this kext 10.14 compatible :)

19 hours ago, Hervé said:

@theroadw Afaik, the current kext(s) can on load/run on Catalina and Big Sur (and presumably later). It certainly does not load under Mojave. Not surprisingly given the information available in the Info.plist file which is indicative of the way it was compiled:



    <key>LSMinimumSystemVersion</key>
    <string>10.15</string>
    <key>NSHumanReadableCopyright</key>
    <string>Copyright © 2021 FireWolf. All rights reserved.</string>
    <key>OSBundleLibraries</key>
    <dict>
        <key>com.apple.iokit.IOPCIFamily</key>
        <string>2.9</string>
        <key>com.apple.iokit.IOStorageFamily</key>
        <string>2.1</string>
        <key>com.apple.kpi.iokit</key>
        <string>16.4</string>
        <key>com.apple.kpi.libkern</key>
        <string>16.4</string>
    </dict>

You could try to edit this to match Mojave's versions but would most likely need to try and recompile the code under Mojave directly. Xcode 10.x required...

It's possible to compile for Mojave and earlier fairly easy. You need to set the target macOS version within the project settings (I admittedly forget where, it's called MACOSX_DEPLOYMENT_TARGET though within the xcode project file)
I've gone as far back as 10.7 with it with ECEnabler. I do compile this though using Acidanthera's MacKernelSDK, though I believe it's still possible with the SDK that comes with Xcode

 

Edited by 1Revenger1
Post duplicated for some reason
1 hour ago, 1Revenger1 said:

It's possible to compile for Mojave and earlier fairly easy. You need to set the target macOS version within the project settings (I admittedly forget where, it's called MACOSX_DEPLOYMENT_TARGET though within the xcode project file)
I've gone as far back as 10.7 with it with ECEnabler. I do compile this though using Acidanthera's MacKernelSDK, though I believe it's still possible with the SDK that comes with Xcode

 

Thank you @1Revenger1, I've also done this in the past, but in this case it's not that simple. I've tried both, compiling in Catalina but setting the target OS to 10.14 and it compiles, but it refuses to load in Mojave, and I get KP in Catalina.

If I try to compile in Mojave I get a couple of errors:

402069672_ScreenShot2021-06-26at1_39_59AM.thumb.png.b805007d6ceb36a9c4df05f9647ecf82.png

I'm not sure why my KP seems to point at IOUSBFamily in my case.

If I don't inject this kext I don't have any USB or booting problems, and Cholonam's Sinetek works correctly on both Mojave and Catalina, so the device itself works.

On 6/25/2021 at 5:43 AM, theroadw said:

1- Will do and report back

2- No SD card present

3-Using OC injecting generates that KP in the video

4-System doesn't boot, will do #1 to have more information, I know the video is crappy, sorry.

 

I guess my post wasn't very clear, the KP is on my Catalina boot.

I prefer to use Mojave for day to day and it would be great to also make this kext 10.14 compatible :)

 

It seems that AppleSDXC.kext is loaded under macOS Catalina and therefore causes the kernel panic.

0.9.3v3 should resolve this issue but as a consequence your card reader will not be list by System Profiler.

(I need to find a robust way to prevent AppleSDXC from loading...)

Please use IORegistryExplorer to see the kext is loaded and attached.

RealtekPCIeCardReader_0.9.3v3_DEBUG.zip

Thank you, V0.9.3v3 works, and like you mentioned it doesn't show up in system profiler, but it does in IORegistryExplorer and I tested with 2 cards, here are my results.

 

Did a read/write stress test copying a 1GB file then copying the copy, and so on 10 times and then compared checksum to the original and data was identical.

The write speed was between 12MB/S ~ 22MB/S on both cards.

The read speed was ~50MB/s on one card and ~ 70MB/S on the other.

The card reader has problems ejecting a card if the laptop goes to sleep with a card loaded/mounted.

The card reader does not load a card after waking the laptop from sleep. (tested fresh boot->sleep->wake->load card... nothing)

Kext only tested in Catalina, will not load in Mojave.

Posted (edited)
1 hour ago, theroadw said:

Thank you, V0.9.3v3 works, and like you mentioned it doesn't show up in system profiler, but it does in IORegistryExplorer and I tested with 2 cards, here are my results.

 

Thanks for your test report.

 

1 hour ago, theroadw said:

The write speed was between 12MB/S ~ 22MB/S on both cards.

The read speed was ~50MB/s on one card and ~ 70MB/S on the other.

 

Most cards have slower write speed.

Did you test your card under other systems?

Are the statistics under macOS similar to those under other systems?

 

1 hour ago, theroadw said:

The card reader has problems ejecting a card if the laptop goes to sleep with a card loaded/mounted.

The card reader does not load a card after waking the laptop from sleep. (tested fresh boot->sleep->wake->load card... nothing)

 

Expected, because power management is not implemented yet.

The card needs to be reinitialized after the computer wakes up, so stay tuned. :)

 

On 6/27/2021 at 1:54 AM, wern apfel said:

Thanks for this driver. I tried it with the RTS522a controller, but  the card initialization fails. See the log. 

 

@wern apfel Your card did not respond to the CMD2 after being switched to 1.8V,

probably because I forgot to set the driving tables for RTS5227 and RTS522A.

 

Please try 0.9.3v4 and see if it resolves the issue.

If not, please attach the kernel log.

RealtekPCIeCardReader_0.9.3v4_DEBUG.zip

Edited by Austere.J
14 hours ago, Austere.J said:

Most cards have slower write speed.

Did you test your card under other systems?

Are the statistics under macOS similar to those under other systems?

 

The write results are pretty much the same across MacOS Windows and Linux. ~15MB/s

For the 70~75MB/s Card:

Read for Linux is ~80MB/s

Read for Windows is ~85MB/s.

 

It's possible the debug version limits the performance a bit, but overall it's great! can't wait for PM and older versions if possible!

 

Cheers!

Debug version does affect performance of course, that's perfectly normal; I had illustrated this here on p1.

 

v0.9.4 beta comes with basic power management support.

Link: https://github.com/0xFireWolf/RealtekPCIeCardReader/releases/tag/v0.9.4

 

Please focus on the following scenarios:

 

1) Put the machine to sleep without the card inserted.

Wake up your machine and insert the SD card.

Check whether the card can be recognized and work properly.

 

2) Put the machine to sleep with the card inserted.

Wake up your machine and check whether your SD card shows up.

If not, remove the card and insert it again and see whether the card can be recognized and work properly.

 

In my case, the SD card was initialized properly under macOS Big Sur and Catalina, but the system ejected the card after the machine waked up.

I have to remove the card and insert it back. However, the SD card showed up and was not ejected by the system under macOS Mojave.

Overall, the driver is pretty stable now on my machine with RTS525A.

 

@theroadw I tested the driver under macOS Mojave and it is working fine on my machine. Please give it a try.

On 7/9/2021 at 2:53 AM, Austere.J said:

1) Put the machine to sleep without the card inserted.

Wake up your machine and insert the SD card.

Check whether the card can be recognized and work properly.

Tested and it works correctly in both Catalina and Mojave.

 

On 7/9/2021 at 2:53 AM, Austere.J said:

2) Put the machine to sleep with the card inserted.

Wake up your machine and check whether your SD card shows up.

If not, remove the card and insert it again and see whether the card can be recognized and work properly.

In both OS the card would not show up on wake, and in Mojave there will be a "device not ejected" notification, but removing and re-inserting the card worked on both.

 

Some odd behavior, in Catalina is that I could remove the drive without ejecting first without any notification, in Mojave the system alerted me of first ejecting the drive, don't know if this is normal.

Also on Mojave I got a early KP when I switched to the Release Version, but the next reboot was fine.

 

Speed is ~13MB/s write and 83MB/s read, awesome!!! Thank you for this Kext.

  • Austere.J changed the title to Realtek PCIe/USB Card Reader Driver for macOS
Posted (edited)

The project has been rebranded. :)

 

v0.9.5 beta comes with support for USB-based RTS5129, RTS5139 and RTS5179 card readers.

@b0ltun For those who have aforementioned chips, please give a try and report any issues, as I don't have the hardware to test with.

 

The bonus feature has been reenabled, but you need to the install the companion Lilu plugin (https://github.com/0xFireWolf/RealtekCardReaderFriend).

Check the main post or the repo for details.

 

Link: https://github.com/0xFireWolf/RealtekCardReader/releases/tag/v0.9.5

Edited by Austere.J
  • Thanks 2
4 hours ago, whatnameisit said:

I have tried v0.9.5 beta with RTS5129 and the kext doesn't seem to load.

 

I forgot to add: the log with boot-arg and DebugEnhancer is empty.


When did you dump your attached IOReg report? Before or after inserting a SD card?


I check your IOReg and surprisingly found that your card reader does not publish the host interface required by this driver.

 

Does the driver load after you insert the card? If not, please attach the IOReg report and the kernel log (if not empty).

The attached IOReg report was before inserting the card I think.

I'm attaching new reports as you requested. The log is still empty.

IOReg.zip

 

I wonder if this would help.

1. IOReg report from a year ago of a machine with RTS5138 which is natively supported. This I believe is before inserting the card.

2. Alcor 058f6366, works natively. https://www.dropbox.com/s/ykx69y9e6bl379n/2.zip?dl=0

1. before inserting card.ioreg.zip

Edited by whatnameisit
upload more files
2 hours ago, whatnameisit said:

The attached IOReg report was before inserting the card I think.

I'm attaching new reports as you requested. The log is still empty.

I wonder if this would help.

1. IOReg report from a year ago of a machine with RTS5138 which is natively supported. This I believe is before inserting the card.

2. Alcor 058f6366, works natively.

 

Thank you for the IOReg reports. They are really helpful, and I think I have found the issue.

 

The driver needs to attach to the USB host device itself and find the interface manually

instead of dreaming that someone will create an interface for it. :star_smile:

 

That's why the driver never gets loaded and you cannot find the log.

 

Stay tuned. :cowboy:

  • Like 1

@Austere.J

thank you for amazing work!.

File 0.9.5 beta debug file.

OS : 12.0 beta 21A5284e

i tested your work. here is log

 

info

USB2.0-CRW:

  제품 ID: 0x0129

  공급업체 ID: 0x0bda  (Realtek Semiconductor Corp.)

  버전: 39.60

  일련 번호: 20100201396000000

  속도: 최대 480Mb/

  제조업체: Generic

  위치 ID: 0x14600000 / 4

  사용 가능한 전류량(mA): 500

  필요한 전류량(mA): 500

  추가 동작 전류(mA): 0

  내장:

 

log

Spoiler

[   15.753024]: RTSX: virtual bool RealtekUSBCardReaderController::start(IOService *) DInfo: ==================================================
[   15.753038]: RTSX: virtual bool RealtekUSBCardReaderController::start(IOService *) DInfo: Starting the Realtek USB card reader controller...
[   15.753045]: RTSX: virtual bool RealtekUSBCardReaderController::start(IOService *) DInfo: ==================================================
[   15.753050]: RTSX: virtual bool RealtekCardReaderController::start(IOService *) DInfo: =======================================================
[   15.753055]: RTSX: virtual bool RealtekCardReaderController::start(IOService *) DInfo: Starting the Realtek PCIe/USB card reader controller...
[   15.753060]: RTSX: virtual bool RealtekCardReaderController::start(IOService *) DInfo: =======================================================
[   15.753093]: RTSX: bool RealtekCardReaderController::setupWorkLoop() DInfo: Creating the workloop and the command gate...
[   15.753111]: RTSX: bool RealtekCardReaderController::setupWorkLoop() DInfo: The workloop and the command gate have been created.
[   15.753116]: RTSX: virtual bool RealtekCardReaderController::start(IOService *) DInfo: =======================================================
[   15.753135]: RTSX: virtual bool RealtekCardReaderController::start(IOService *) DInfo: The base card reader controller started successfully...
[   15.753139]: RTSX: virtual bool RealtekCardReaderController::start(IOService *) DInfo: =======================================================
[   15.753145]: RTSX: bool RealtekUSBCardReaderController::setupUSBInterface() DInfo: Taking the ownership of the USB host interface...
[   15.753167]: RTSX: bool RealtekUSBCardReaderController::setupUSBInterface() DInfo: The card reader controller now owns the host interface.
[   15.753172]: RTSX: bool RealtekUSBCardReaderController::setupUSBInterface() DInfo: Fetching the bulk endpoints...
[   15.753451]: RTSX: bool RealtekUSBCardReaderController::setupUSBInterface() Error: Failed to retrieve the output bulk endpoint.
[   15.753511]: RTSX: virtual bool RealtekUSBCardReaderController::start(IOService *) Error: Failed to setup the host interface.

 

now i can't get sd card reader.

thanks in advance

 

Edited by Sherlocks
1 minute ago, Sherlocks said:

@Austere.J

thank you for amazing work!.

test file 0.9.5 beta debug file.

i tested your work. here is log

 

info

USB2.0-CRW:

  제품 ID: 0x0129

  공급업체 ID: 0x0bda  (Realtek Semiconductor Corp.)

  버전: 39.60

  일련 번호: 20100201396000000

  속도: 최대 480Mb/

  제조업체: Generic

  위치 ID: 0x14600000 / 4

  사용 가능한 전류량(mA): 500

  필요한 전류량(mA): 500

  추가 동작 전류(mA): 0

  내장:

 

now i can't get sd card reader.

thanks in advance

 

 

Hi Sherlocks,

 

Could you please attach the IOReg reports before and after you insert the card?

 

Thanks.

20 hours ago, Austere.J said:

 

Hi Sherlocks,

 

Could you please attach the IOReg reports before and after you insert the card?

 

Thanks.

 

here is.

if you want test, i can help you in messenger like skype, element, discord, test. now i have enough time

deleted

 

Edited by Sherlocks
22 minutes ago, Sherlocks said:

here is.

if you want test, i can help you in messenger like skype, element, discord, test. now i have enough time

 

@Sherlocks Really interesting. Your IOReg dump shows that your RTS5129 has already been configured and exposed the host interface,

while @whatnameisit's card reader needs to be configured by the driver manually.

 

Anyway, I have changed the matching dictionary, so the driver should attach to the host device and configure the card reader if necessary,

so @whatnameisit please try this one.

 

In addition, @Sherlocks the driver cannot find bulk endpoints of your card reader,

probably because their addresses are not the same as the ones on Linux.

I have updated the code to search for them instead of using hard-coded constants from the Linux driver.

Please give a try. I really want to chat with you to speed up testing the driver, but unfortunately I am not available today.

I expect that the driver is buggy since I do not have any USB-based card readers to test with.

 

RealtekCardReader_0.9.6_962337e_DEBUG.zip

 

19 hours ago, Austere.J said:

 

@Sherlocks Really interesting. Your IOReg dump shows that your RTS5129 has already been configured and exposed the host interface,

while @whatnameisit's card reader needs to be configured by the driver manually.

 

Anyway, I have changed the matching dictionary, so the driver should attach to the host device and configure the card reader if necessary,

so @whatnameisit please try this one.

 

In addition, @Sherlocks the driver cannot find bulk endpoints of your card reader,

probably because their addresses are not the same as the ones on Linux.

I have updated the code to search for them instead of using hard-coded constants from the Linux driver.

Please give a try. I really want to chat with you to speed up testing the driver, but unfortunately I am not available today.

I expect that the driver is buggy since I do not have any USB-based card readers to test with.

 

RealtekCardReader_0.9.6_962337e_DEBUG.zip 207.7 kB · 1 download

 

good signal in log. but still not working(no show any sdcard icon on desktop and finder)

please check log and ioreg

please tell me your messenger id to message for insanelymac messages. i will add your id.

 

deleted

 

more log

deleted

 

Edited by Sherlocks
  • Austere.J changed the title to Realtek PCIe/USB SD Card Reader Driver for macOS
×
×
  • Create New...