General Mac OS X Discussion General Apple and Mac OS X Discussion

Reply
 
LinkBack Thread Tools Display Modes
  (#191) Old
Guru
 
Posts: 1,744
Join Date: Sep 2008
Location: Olalla, WA
Send a message via AIM to UnaClocker Send a message via Yahoo to UnaClocker
Default Re: SD Card slot - Creating/Developing the driver/kext - 01-03-2009, 03:27 AM

Outstanding! Thanks for sharing that awesome tip. Very useful.


Tired of wondering if your Mini9 is doing ANYTHING? - Add a HDD Activity LED
Reply With Quote
  (#192) Old
Expert Member
 
Posts: 962
Join Date: Dec 2008
Default Re: SD Card slot - Creating/Developing the driver/kext - 01-03-2009, 03:44 AM

Quote:
Originally Posted by UnaClocker
Outstanding! Thanks for sharing that awesome tip. Very useful.
I was hoping a similar trick would fix the Audio problem after sleep but no luck so far.


Dell Mini 9
8GB SSD, 1GB RAM
OS X 10.5.6
Reply With Quote
  (#193) Old
Guru
 
Posts: 1,744
Join Date: Sep 2008
Location: Olalla, WA
Send a message via AIM to UnaClocker Send a message via Yahoo to UnaClocker
Default Re: SD Card slot - Creating/Developing the driver/kext - 01-03-2009, 03:48 AM

Yeah, we've tried manually loading and unloading that kext.. It's a very odd bug that is keeping the audio off after sleep.


Tired of wondering if your Mini9 is doing ANYTHING? - Add a HDD Activity LED
Reply With Quote
  (#194) Old
km9 km9 is offline
Member
 
Posts: 36
Join Date: Dec 2008
Default Re: SD Card slot - Creating/Developing the driver/kext - 01-03-2009, 11:23 AM

Quote:
Originally Posted by Type11
fgodfrey and km9,

I checked in my initial work on power management. I think it is real close but does not appear to work right now. I am going to busy the next couple days so I thought I would get it in and you can look it at. It doesn't break anything else.
I have modified the code so that it will work correctly (the point was not to try to unload the driver, but only to reinitialize the SD card slot upon resume).

The remaining problem is to notify the OS when a user exchanges the SD card to a different one during sleep (I have already added necessary code for detection). IMHO the notification is mandatory, since if not implemented, would lead to silent data corruption on the exchanged card.
Reply With Quote
  (#195) Old
Expert Member
 
Posts: 962
Join Date: Dec 2008
Default Re: SD Card slot - Creating/Developing the driver/kext - 01-03-2009, 11:57 AM

Quote:
Originally Posted by km9
Quote:
Originally Posted by Type11
fgodfrey and km9,

I checked in my initial work on power management. I think it is real close but does not appear to work right now. I am going to busy the next couple days so I thought I would get it in and you can look it at. It doesn't break anything else.
I have modified the code so that it will work correctly (the point was not to try to unload the driver, but only to reinitialize the SD card slot upon resume).

The remaining problem is to notify the OS when a user exchanges the SD card to a different one during sleep (I have already added necessary code for detection). IMHO the notification is mandatory, since if not implemented, would lead to silent data corruption on the exchanged card.
I can live with that risk as I never change SD card during sleep. Could it be made available as a separate build in a different download location so only users that understand the risk can get it? This would spare the umount of the disk before sleep and all the nasty side effect of sleeping Applications running off the SDHC card...

I can certainly accept the risk of corrupting my card to get a fully functioning sleep resistant SDHC card kernel extension.


Dell Mini 9
8GB SSD, 1GB RAM
OS X 10.5.6
Reply With Quote
  (#196) Old
Senior Member
 
Posts: 218
Join Date: Oct 2008
Default Re: SD Card slot - Creating/Developing the driver/kext - 01-03-2009, 02:09 PM

km9, ok I see I have not looked at the code so on resume do you just do a cardinit? that was what I was going to try next.

So I see the detect function, I assume we could just add it to the call back first before the card init right?

cheers
Reply With Quote
  (#197) Old
km9 km9 is offline
Member
 
Posts: 36
Join Date: Dec 2008
Default Re: SD Card slot - Creating/Developing the driver/kext - 01-03-2009, 06:07 PM

Attached kext is an updated version of the SD card slot driver with sleep support. Please note that if you eject media before unmounting it from Mac OS X (whether while in sleep or not), the SD card slot will become unusable until next reboot.

Quote:
Originally Posted by Type11
km9, ok I see I have not looked at the code so on resume do you just do a cardinit? that was what I was going to try next.

So I see the detect function, I assume we could just add it to the call back first before the card init right?

cheers
Yes, it basically doing a cardInit. While it is easy to detect card changes, the problem is how to notify the OS of the card removal. Since the changeMediaState function is not called by the driver while a card is mounted, there is no way to notify the OS of unexpected card removal unless we switch to push model for handling state changes (using the message function).

Current version (the kext and the source code on sf.net) marks the card slot as 'not present' when it detects card removal (or when it detects that a card has been swapped to another). If the OS (IOBlockDeviceDriver) could poll media state while the card is mounted, everything should work fine, however...
Attached Files
File Type: zip IOSDHCIBlockDevice-w-Sleep.zip (29.7 KB, 543 views)
Reply With Quote
  (#198) Old
Member
 
Posts: 88
Join Date: Nov 2008
Default Re: SD Card slot - Creating/Developing the driver/kext - 01-03-2009, 06:24 PM

km9 - That is probably good enough for now. I'd thought of the card swap problem awhile back but since forgotten it. Glad you thought of it again! (Silent data corruption is *not* a good thing!)
I won't have time to do a release of it until tomorrow evening, but maybe Type11 can if he gets to it before then. I'd call this one Release Candidate 1.
Reply With Quote
  (#199) Old
Expert Member
 
Posts: 962
Join Date: Dec 2008
Default Re: SD Card slot - Creating/Developing the driver/kext - 01-03-2009, 07:14 PM

km9, great work! I can finally sleep the mini and wakeup and SDHC still work! I vote for the integretion in the current 7.5 beta.


Dell Mini 9
8GB SSD, 1GB RAM
OS X 10.5.6
Reply With Quote
  (#200) Old
Junior Member
 
Posts: 6
Join Date: Jan 2009
Default Re: SD Card slot - Creating/Developing the driver/kext - 01-03-2009, 08:16 PM

WOW! I take a month vacation and come back to see a working SD Card (also after sleep) and sleep working on Dell HD to boot! Amazing work people! Now to wipe the drive and help out with the beta testing...
Reply With Quote
Reply

« Trimmer Program? | iMovie work on mini 9? What apps are you using? »
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Copyright © 2008-2011 MyDellMini.com.