Patent ID: 9223739
Filing Date: 2015-12-29
Classification: G06F

Abstract:
1. A method for detecting hot-swapping of a Secure Digital (SD) card in a Linux® operating system, comprising: detecting whether a card reader is plugged to the Linux® operating system; activating a Linux® operating system kernel mode polling thread corresponding to the card reader on a one-on-one basis and transmitting an inquiry command to the SD card in the card reader at a predetermined frequency when it is detected that the card reader is plugged to the Linux® operating system; receiving a current command return message replied in response to the inquiry command, wherein the current command return message comprises information indicating whether the SD card is present; determining whether the SD card has been newly removed or newly plugged in since the prior cycle of said predetermined frequency according to a comparison of a previous command return message and the current command return message; when the previous command return message indicates the presence of the SD card and the current command return message indicates the absence of the SD card, determining that the SD card is newly removed and clearing information associated with the SD card from the procfs process filesystem and sysfs system filesystem of the Linux® operating system and transmitting KOBJ_REMOVE event through a uevent file; and when the previous command return message indicates the absence of the SD card and the current command return message indicates the presence of the SD card, determining that the SD card is newly plugged in and recording the information associated with the SD card in the procfs process filesystem and sysfs system filesystem of the Linux® operating system and transmitting a KOBJ_ADD event.