SD Card lock question - General Discussion and Assistance - CHDK Forum

SD Card lock question

  • 1 Replies
  • 3111 Views
*

Offline jeff666

  • ****
  • 181
  • A720IS
SD Card lock question
« on: 30 / December / 2007, 06:16:19 »
Advertisements
I don't understand (yet) how the card lock is fixed in VxWorks cameras. The CHDK sources weren't verbose on that.

The only thing I noticed was the hook for "task_InitFileModules" which does nothing more than remounting the filesystem (according to the function names) and it uses original firmware functions to do that.

How does remounting the card solve the lock-problem?
Is there any particular location in the boot process that reads the lock state and remounting overwrites that flag?

Since I can't hook tasks in dryos I can't try the remount-approach easily (I would also need to locate the mount/umount-fs functions). Details about what's going on are greatly appreciated.

Edit:
I just found out how it works.
For the record: In the keyboard-handler the SD-protect-Flag is cleared.
The responsible line of code is in platform/generic/kbd.c:my_kbd_read_keys()
physw_status[2] = physw_status[2] & ~SD_READONLY_FLAG;

Who would expect that the SD write protect is hidden in the keyboard-handler  :blink:

Cheers.
« Last Edit: 30 / December / 2007, 06:42:20 by jeff666 »

*

Offline GrAnd

  • ****
  • 916
  • [A610, S3IS]
    • CHDK
Re: SD Card lock question
« Reply #1 on: 30 / December / 2007, 15:57:13 »
Right. This array (physw_status[]) contains states of all physical buttons and switches, including battery/card doors, LCD display position and SD-card lock switch (as this switch is also just a button in SD-slot).
CHDK Developer.

 

Related Topics