Memory card data access control method and computer system
By detecting the communication protocol version of the memory card and using the driver and disk configuration service to set the disk attributes, the problem of the inability to provide write protection in the prior art is solved, and effective write protection of the memory card is achieved.
Patent Information
- Application Number
- CN202510115254.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2024-11-01
- Filing Date
- 2025-01-24
- Publication Date
- 2025-09-26
AI Technical Summary
In the prior art, compatible drivers cannot identify the position of the mechanical sliding member of the secure digital card, resulting in the computer system being unable to provide a write protection function.
By detecting whether the memory card supports the first and second communication protocol versions, using the first driver to store access protection settings, and setting disk properties in the operating system through the disk configuration service, write protection is achieved.
Provides write protection for memory cards supporting specific protocol versions without changing the computer system hardware architecture, ensuring that access protection settings are correctly applied.
Smart Images

Figure CN120704590A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a data storage technology, and in particular, to a memory card data access control method and a computer system. Background Art
[0002] A mechanical switch is provided on Secure Digital (SD) cards to provide write-protection functionality as defined by the Secure Digital Association. Users can operate a mechanical slider on the side of the SD card to indicate whether the card is write-protected or not. Compatible drivers recognize the slider in the locked position and set the disk attribute to "read-only." However, if other drivers do not recognize the slider's position, the computer system will not be able to write-protect the disk associated with the SD card, even if the slider is in the locked position. Summary of the Invention
[0003] The present invention is directed to a memory card data access control method and a computer system, which can solve the problem that the existing mechanism cannot provide a write protection function.
[0004] According to an embodiment of the present invention, a memory card data access control method is applicable to a computer system accessing a memory card. The memory card data access control method includes the following steps: the computer system detects whether the memory card supports a first communication protocol version and a second communication protocol version; when the memory card supports the second communication protocol version, the computer system stores an access protection setting for the memory card via a first driver program based on the first communication protocol version, wherein the access protection setting is used to restrict access to the memory card; the computer system unmounts the first driver program; and, via a disk configuration service within the computer system, configures a disk corresponding to the memory card in an operating system within the computer system based on the access protection setting, wherein the disk configuration service runs on the operating system, and the disk is configured with the access protection setting.
[0005] According to an embodiment of the present invention, a computer system includes a memory, a control circuit, and a processor. The memory is used to store one or more program codes corresponding to a first driver and a disk configuration service, wherein the disk configuration service runs on an operating system. The control circuit is used to electrically connect a memory card and detect the communication protocol version of the memory card. The processor is coupled to the memory and is configured to load the program code and the operating system to execute: detecting whether the memory card supports the first communication protocol and the second communication protocol through the control circuit; when the memory card supports the second communication protocol version, storing the access protection setting of the memory card according to the first communication protocol version through the first driver, wherein the access protection setting is used to restrict access to the memory card; uninstalling the first driver; and configuring a disk corresponding to the memory card in the operating system according to the access protection setting through the disk configuration service, wherein the disk configuration service runs on the operating system, and the disk is configured with the access protection setting. BRIEF DESCRIPTION OF THE DRAWINGS
[0006] The accompanying drawings are included to provide a further understanding of the present invention and are incorporated in and constitute a part of this specification. The drawings illustrate embodiments of the present invention and together with the description serve to explain the principles of the present invention.
[0007] Figure 1 is a block diagram of components of a memory card and a computer system according to an embodiment of the present invention;
[0008] Figure 2 is a flow chart of a memory card data access control method according to an embodiment of the present invention;
[0009] Figure 3 is a schematic diagram of the operation of the first communication protocol version according to an embodiment of the present invention;
[0010] Figure 4 is a flow chart of the interaction between software and hardware of the first communication protocol version according to an embodiment of the present invention;
[0011] Figure 5 is a schematic diagram of the operation of the second communication protocol version according to an embodiment of the present invention;
[0012] Figure 6 is a flow chart of the interaction between software and hardware of the second communication protocol version according to an embodiment of the present invention;
[0013] Figure 7 is a flow chart illustrating software interaction for memory card insertion and removal according to an embodiment of the present invention.
[0014] Explanation of Figure Numbers
[0015] 5: Memory card;
[0016] 10: Computer system;
[0017] 11: transmission interface;
[0018] 12: control circuit;
[0019] 13: memory;
[0020] 131A, 131B: driver;
[0021] 132: disk configuration service;
[0022] 14: processor;
[0023] 141: operating system;
[0024] 121: first controller;
[0025] 122: second controller;
[0026] 123: multiplexing module;
[0027] 124: first multiplexer;
[0028] 125: second multiplexer;
[0029] 15: system interface circuit;
[0030] 151: third controller;
[0031] L1, L2, L3: connection;
[0032] S210-S240, S405-S440, S605-S650, S701-S713: steps;
[0033] 701: operating system event;
[0034] 702: Root Port;
[0035] 703: Secure digital host. DETAILED DESCRIPTION
[0036] Reference will now be made in detail to exemplary embodiments of the present invention, examples of which are illustrated in the accompanying drawings. Whenever possible, the same reference numerals are used in the drawings and the description to refer to the same or like parts.
[0037] Figure 1 FIG is a block diagram of a memory card 5 and a computer system 10 according to an embodiment of the present invention. Figure 1, the memory card 5 can be a Secure Digital (SD) memory card or a memory card that supports the standard defined by the Secure Digital Association (SD Association). The memory card 5 includes a mechanical switch. The mechanical switch includes a movable sliding member. The sliding member can move between a first position and a second position. The first position is, for example, a lock position. The lock position corresponds to access restriction (for example, write protection or read only). The second position is, for example, an unlock position. The unlock position corresponds to access permission (for example, writable and readable). The computer system 10 can be a desktop computer, a laptop computer, an all-in-one computer, a tablet computer, an intelligent assistant device, a smart home appliance, a vehicle system, a wearable device or other electronic device. The computer system 10 includes (but is not limited to) a transmission interface 11, a control circuit 12, a memory 13 and a processor 14.
[0038] The transmission interface 11 is used to connect to the memory card 5. The transmission interface 11 can be an interface that complies with the Secure Digital memory card protocol. For example, it can be a Secure Digital memory card slot. Examples of Secure Digital memory card protocols include, but are not limited to, Secure Digital Ultra High Speed 1 (UHS 1) (also known as version 3), UHS 2 (UHS II) (also known as version 4), SD-UHS III, or Secure Digital Express (SD Express) (also known as version 7 or later).
[0039] The control circuit 12 is electrically connected to the memory card 5 via the transmission interface 11. The control circuit 12 can be a chip, a programmable controller, a general-purpose or special-purpose microprocessor, an application-specific integrated circuit (ASIC), or a digital circuit.
[0040] The control circuit 12 includes a first controller 121, a second controller 122, and a multiplexing module 123. The first controller 121 is, for example, a Secure Digital host controller, or a host-side controller that supports / complies with Secure Digital version 2 (SD 2), Secure Digital version 3 (SD 3), or Secure Digital version 4 (SD 4). The second controller 122 is, for example, a Peripheral Component Interconnect Express (PCIe) controller, a Non-Volatile Memory Express (NVMe) controller, or a host-side controller that supports / complies with PCIe or NVMe. The multiplexing module 123 is coupled to the transmission interface 11. In one embodiment, the multiplexing module 123 can selectively connect to the first controller 121, the second controller 122, and / or the system interface circuit 15. In one embodiment, the multiplexing module 123 includes a first multiplexer 124 and a second multiplexer 125. The first multiplexer 124 is controlled by the first controller 121 , and the second multiplexer 125 is controlled by the second controller 122 .
[0041] In one embodiment, the transmission interface 11 and the control circuit 12 are built into the computer system 10. In another embodiment, the transmission interface 11 and the control circuit 12 can be independently formed into a single hardware device, such as a card reader.
[0042] The memory 13 may be any type of fixed or removable random access memory (RAM), read-only memory (ROM), flash memory, a hard disk drive (HDD), a solid-state drive (SSD), or the like. The memory 13 may be used to store program code (e.g., program code for the first driver 131A, the second driver 131B, and the disk configuration service 132), software modules, configurations, data, and / or files (e.g., access protection settings or protection configurations, which will be described in detail in subsequent embodiments).
[0043] The processor 14 is coupled to the control circuit 12 and the memory 13. The processor 14 can be a central processing unit (CPU), a graphics processing unit (GPU), or other programmable general-purpose or special-purpose microprocessor, a digital signal processor (DSP), a programmable controller, a field programmable gate array (FPGA), an application-specific integrated circuit (ASIC), a neural network accelerator, or other similar components or a combination of these components. In one embodiment, the processor 14 is used to perform all or part of the operations of the computer system 10 and can load and execute various program codes, software modules, files, and / or data stored in the memory 13. In one embodiment, the processor 14 can load and execute an operating system (OS) 141. The operating system can be, for example, Windows, MAC OS, Linux, or other systems.
[0044] The first driver 131A and the second driver 131B of this embodiment are, for example, drivers for the control circuit 12. The processor 14 can load the program code of the first driver 131A or the second driver 131B and execute the first driver 131A or the second driver 131B to control all or part of the operations of the control circuit 12. The disk configuration service 132 is a software service, component, or process running on the operating system 141. The processor 14 can load the program code of the disk configuration service 132 and execute the disk configuration service 132. The method described in the embodiment of the present invention will be described below in conjunction with the memory card 5 and various devices, components, and modules in the computer system 10. The various processes of this method can be adjusted according to the implementation scenario and are not limited thereto.
[0045] Figure 2 This is a flow chart of a memory card data access control method according to an embodiment of the present invention. Figure 2, the processor 14 of the computer system 10 detects whether the memory card 5 supports the first communication protocol version and the second communication protocol version. When the memory card 5 is connected to the transmission interface 11, the control circuit 12 detects the communication protocol version running on the memory card through command inquiries, pins and / or power characteristics. In one embodiment, the communication protocol version can be a first communication protocol version, and this first communication protocol version can be a protocol version corresponding to the Secure Digital Express (SD Express) mode or a protocol version corresponding to the Secure Digital Ultra Capacity (SDUC) format. In another embodiment, the communication protocol version can be a second communication protocol version, and this second communication protocol version can be a protocol version corresponding to the Secure Digital mode, a protocol version corresponding to the Secure Digital eXtended Capacity (SDXC), a protocol version corresponding to the Secure Digital High Capacity (SDHC), or a protocol version corresponding to the Secure Digital Standard Capacity (SDSC) format.
[0046] Figure 3 This is a schematic diagram of the operation of a first communication protocol version of an embodiment of the present invention. Figure 3 The communication protocol version of the memory card 5 complies with the first communication protocol version. The first communication protocol version is the Secure Digital version 3 (SD 3) or the Secure Digital version 4 (SD 4) defined by the Secure Digital protocol. Figure 1 and Figure 3 The processor 14 can control the Figure 3 In addition, the processor 14 can control the operation of the first controller 121 by executing the second driver 131B. Figure 3 The system interface circuit 15 may be a system bus processing chip or circuit. In one embodiment, the system interface circuit 15 is coupled to the Figure 1 In another embodiment, the processor 14 includes a system interface circuit 15. The system interface circuit 15 includes a third controller 151. The third controller 151 is, for example, a Peripheral Component Interconnect express Root Complex component.
[0047] Figure 4 This is a flow chart of the interaction between software and hardware of the first communication protocol version of an embodiment of the present invention. Figure 3 and Figure 4 , as in step S405, insert the memory card of the first communication protocol version. When the memory card 5 of the first communication protocol version is inserted into the slot of the transmission interface 11, the first controller 121 executes an initialization program (for example, the Secure Digital Express Initialization (SD Express Initialization, SDEI) program). The initialization program is, for example, the control circuit 12 providing the memory card 5 with the power required for operation, and / or the control circuit 12 transmitting an operation instruction or an access instruction to the memory card 5 to establish two-way communication between the control circuit 12 and the memory card 5. In the boot procedure of the computer system 10, the processor 14 can load the program code of the driver corresponding to the first controller 121. Furthermore, the processor 14 can operate the first controller 121 by executing the first driver 131A. As Figure 3 As shown, the multiplexing module 123 can establish a connection L1 between the transmission interface 11 and the first controller 121, and can establish a connection L2 between the second controller 122 and the system interface circuit 15. Thus, a connection and communication between the memory card 5 and the computer system is established.
[0048] After step S405, steps S410 and S420 may be executed to create a disk and a disk volume. The service running on the operating system 141 may create a disk or disk object corresponding to the memory card 5 in the computer system 10 (step S410) and a corresponding disk volume or disk volume object (step S420). It is worth noting that the first controller 121 may determine the position of the slider in the mechanical switch of the memory card 5 through command inquiries, pins, and / or power characteristics. When the first controller 121 detects that the slider is in the locked position, the first controller 121 may report the position via a Small Computer System Interface (SCSI) SENSE data query from the operating system 141. The processor 14 may set the disk to a read-only attribute or a write-protect attribute. Therefore, when receiving a write command triggered by the operating system 141, the first controller 121 may report an access error. When the memory card 5 of the first communication protocol version is removed from the slot of the transmission interface 11 (step S425), the service running on the operating system 141 can release the disk corresponding to the memory card 5 (step S430) and release the corresponding disk volume (step S440).
[0049] Figure 5 FIG. 4 is a schematic diagram of the operation of a second communication protocol version according to an embodiment of the present invention. Figure 6This is a flow chart of the interaction between software and hardware of the second communication protocol version of one embodiment of the present invention. It is assumed that the communication protocol version of the memory card 5 complies with the second communication protocol version. This second communication protocol version is Secure Digital Version 7 (SD 7) defined by the Secure Digital protocol, or a higher / later version. Please refer to Figure 5 and Figure 6 , as in step S605, a memory card with a second communication protocol version is inserted. This second communication protocol version may be version 7 of Secure Digital. When the memory card 5 with a second communication protocol version is inserted into the slot of the transmission interface 11, a step of switching the connection is performed (step S610). In this embodiment, after the memory card 5 with a second communication protocol version is inserted, a connection L1 between the transmission interface 11 and the first controller 121 may be established via the multiplexing module 123 (e.g., Figure 3 As shown in FIG, the first controller 121 executes the above steps of determining the position of the sliding member in the mechanical switch of the memory card 5 through command query, pin and / or power characteristics. Afterwards, bidirectional communication is established between the processor 14 and the memory card 5. For example, the multiplexing module 123 switches the control / transmission connection to Figure 5 The link L3 shown is from the memory card 5 directly to the system interface circuit 15 via the transmission interface 11. For example, PCIe retrains the link (i.e., the link from the memory card 5 to the first controller 121 is switched to the link L3 from the memory card 5 directly to the system interface circuit 15).
[0050] During the retraining process, the processor 14, for example, uninstalls the first driver 131A and loads the driver of the second controller 122 or the NVMe controller. This driver is, for example, the second driver 131B. In a preferred embodiment, the transmission bandwidth of the link L3 is, for example, greater than Figure 3 The transmission bandwidth of the link L1 / L2 is shown. The above embodiment uses the example of loading the second driver 131B after uninstalling the first driver 131A. In other preferred embodiments, the first driver 131A may be uninstalled after loading the second driver 131B. The present invention does not impose any limitation on this.
[0051] It is worth noting that after the first driver 131A is uninstalled, the second controller 122 or the NVMe controller will not identify / determine / detect the position of the slider in the mechanical switch of the memory card 5, and the second controller 122 or the NVMe controller will not record whether the memory card 5 has been indicated as write-protected or read-only. Therefore, when the present invention determines that the memory card 5 supports the second communication protocol version, the computer system 10 stores the access protection settings of the memory card 5 through the first driver 131A according to the first communication protocol version, and uses the disk configuration service 132 to configure the disk corresponding to the memory card 5 in the operating system 141 within the computer system 10 according to the access protection settings, so that the disk is subject to the configured access protection settings. The above operations will be explained in detail below.
[0052] After step S610, steps S620 and S630 can be executed to create a disk and a disk volume. In detail, in response to the behavior of the software service / program / component, the service running on the operating system 141 of the processor 14 can create a disk corresponding to the memory card 5 (step S620) and create a corresponding disk volume (step S630). The disk corresponding to the memory card 5 is then subject to the configured access protection setting. For example, when the access protection is set to read-only or write-protected, the disk corresponding to the memory card 5 is configured to be read-only or write-protected. When the memory card 5 of the second communication protocol version (for example, Secure Digital version 7) is removed from the slot of the transmission interface 11 (step S635), the service running on the operating system 141 can release the disk corresponding to the memory card 5 (step S640) and release the corresponding disk volume (step S650).
[0053] Please refer to Figure 2 When the memory card 5 supports the second communication protocol version, the processor 14 of the computer system 10 stores the access protection setting of the memory card 5 through the first driver 131A according to the first communication protocol version (step S220). Specifically, the access protection setting is used to restrict access to the memory card 5. The access protection setting is, for example, read-only, write-protected, or read-and-write allowed. In one embodiment, the control circuit 12 can detect the access protection setting of the memory card 5 through command inquiries, pins and / or power characteristics. For example, when the slider in the mechanical switch of the memory card is in the locked position, the control circuit 12 can report the access protection setting as read-only or write-protected. When the slider in the mechanical switch of the memory card is in the released position, the control circuit 12 can report the access protection setting as read-only or write-protected.
[0054] In one embodiment, a register (not shown) of the control circuit 12 can store and read access protection settings from the register. In a preferred embodiment, the access protection settings are read from the register using a first driver 131A, such as the driver for the first controller 121 described above. The control circuit 12 can then report the access protection settings to the processor 14, which then stores the access protection settings in the memory 13.
[0055] In a preferred embodiment, the control circuit 12 of this embodiment can report the access protection setting to the processor 14, allowing the processor 14 to read the access protection setting from the register via the first driver 131A and then store the access protection setting in the memory 13. The above description is only one embodiment of the present invention. Any configuration in which the register of the control circuit 12 stores the access protection setting and the processor 14 stores the access protection setting in the memory 13 is within the spirit and scope of the present invention and is not intended to be limiting.
[0056] In one embodiment, the processor 14 corresponds the protection configuration to the access protection setting through the first driver 131A, for example. This protection configuration is stored in the configuration database of the operating system 141. The configuration database is, for example, the registry of the Windows system, the "plist" system or "daemons" of the MAC system, or the database of other operating systems. The protection configuration can be in the form of a number or text. For example, a value of "0" represents that reading and writing are allowed, and a value of "1" represents write protection or read-only, but is not limited to this. In another embodiment, the protection configuration is stored in the system protection space in the file system or other file locations in the user space.
[0057] The processor 14 of the computer system 10 uninstalls the first driver 131A (step S230). Specifically, when the communication protocol version of the memory card 5 is determined to be a protocol version corresponding to the Express Secure Digital mode or a protocol version corresponding to the SDUC format, the connection between the first controller 121 and the system bus is disconnected, and a connection is established, such as Figure 5 The connection L3 shown (the connection L3 does not pass through the first controller 121), and the processor 14 can uninstall the first driver 131A. That is, when the communication protocol version of the memory card 5 is the protocol version corresponding to the Express Secure Digital mode or the protocol version corresponding to the SDUC format (the second communication protocol version), the processor 14 will use the first driver 131A to set the protection configuration to the access protection setting. Then, the processor 14 will uninstall the first driver 131A according to the communication protocol version. Correspondingly, for example, Figure 3 or Figure 5 The first controller 121 shown can be disabled or deactivated according to actual circumstances.
[0058] The processor 14 of the computer system 10 configures the disk corresponding to the memory card 5 in the operating system 141 according to the access protection setting through the disk configuration service 132 (step S240). Specifically, the disk configuration service 132 runs on the operating system 141, and the disk corresponding to the memory card 5 is configured with the access protection setting. For example, when the access protection setting is read-only or write-protected, the disk corresponding to the memory card 5 is configured as read-only or write-protected. The processor 14 can also read the access protection setting through the disk configuration service 132. For example, the protection configuration corresponding to the access protection setting is read from a configuration database or other file location. The processor 14 can set the disk attributes of the disk corresponding to the memory card 5 to correspond to the access protection setting through the disk configuration service 132. For example, when creating a disk (object) or disk volume (object) corresponding to the memory card 5, the disk configuration service 132 can set or change the disk attributes of this disk to read-only or write-protected.
[0059] In one embodiment, the processor 14 may determine, through the disk configuration service 132, whether the disk attributes of the disk corresponding to the memory card 5 correspond to the access protection settings. For example, when creating a disk volume (object) corresponding to the memory card 5, the disk configuration service 132 may set or change the disk volume attributes of the disk volume to read-only or write-protected. Furthermore, the disk configuration service 132 may determine whether the disk volume attributes of the disk match the read-only or write-protected attributes. If the disk volume attributes of the disk do not match the read-only or write-protected attributes, the disk configuration service 132 may set or change the disk attributes of the disk to read-only or write-protected. If the disk attributes of the disk match the read-only or write-protected attributes, the disk configuration service 132 may disable / stop / not reset the disk attributes. Furthermore, when the disk (object) corresponding to the memory card 5 is released from the operating system 141, the processor 14 may remove the stored access protection settings through the disk configuration service 132. For example, the protection settings may be deleted or reset from the configuration database or modified to be invalid.
[0060] Thus, without changing the hardware architecture of the computer system 10, the present invention can retain the access protection settings of the memory card 5 through the corresponding driver, and configure the disk (object) and / or disk volume (object) based on the retained access protection settings through the disk configuration service 132, thereby implementing a write protection function for the memory card 5 that supports a specific protocol version (e.g., the protocol version corresponding to the Express Secure Digital mode or the protocol version corresponding to the SDUC format). To help readers understand the spirit of the invention, the following application scenario is used to illustrate.
[0061] Figure 7 This is a flowchart illustrating the software interaction of inserting and removing the memory card 5 according to an embodiment of the present invention. Figure 7 , assuming that the communication protocol version of the memory card 5 is the protocol version corresponding to the Quick Secure Digital mode or the protocol version corresponding to the SDUC format (i.e., the second communication protocol version mentioned above), and the sliding member in its mechanical switch is in the locked position. Operating system events (OS events) 701 are system events of the operating system 141. Root Port 702 corresponds to Figure 3 or Figure 5 The third controller 151 is shown. The secure digital host (SD Host) 703 corresponds to the control circuit 12.
[0062] After the memory card 5 is inserted into the transmission interface 11 (step S701), the first driver 131A starts the Secure Digital Express Initialization (SDEI) process (step S702). The first driver 131A may correspond to Figure 3 or Figure 5 The driver of the first controller 121 transmits a transaction layer packet (TLP) containing a memory write request to the secure digital host 703. The control circuit 12 automatically initiates the secure digital environment (SDE) (step S703). Furthermore, the access protection setting is stored (step S704) to retain the write protection status corresponding to the locked position. The storage of the access protection setting is performed, for example, by the first driver 131A.
[0063] like Figure 5 As shown, PCIe is retrained. In the case where the communication protocol version of the memory card 5 is the second communication protocol version, the connection between the first controller 121 and PCIe is interrupted, and the first driver 131A can be uninstalled (step S705). On the other hand, Figure 5 After establishing the L3 link, the processor 14 mounts the driver corresponding to the third controller 151 (e.g., the NVMe controller / driver) (step S706). NVMe is then initialized. In this embodiment, the second driver 131B is mounted after the first driver 131A is uninstalled. In other preferred embodiments, the first driver 131A may be uninstalled after the second driver 131B is mounted.
[0064] Operating system event 701 indicates that a disk (object) corresponding to memory card 5 has been created (step S707). Disk configuration service 132 detects this event and examines information about the disk, such as the PCIe device node, the NVMe device type, and access protection settings. Based on this information, disk configuration service 132 modifies the disk's attributes to read-only or write-protected (step S708).
[0065] The operating system event 701 occurs to establish an event for the disk area (object) corresponding to the disk established in step S707 (or one or more partitions (partitions) or disk letters corresponding to the disk established in step S707) (step S709). The disk configuration service 132 detects this event and (again) checks whether the disk attributes of the disk match the read-only attribute or the write-protected attribute (step S710). For example, whether the disk attributes are the same as the protection configuration of the configuration database. If the disk attributes do not match the read-only attribute or the write-protected attribute, the disk configuration service 132 modifies the disk attributes of the disk to the read-only attribute or the write-protected attribute. The order of steps S707 and S709 is not limited to Figure 7 As shown, it is also possible that the event of the disk area (object) corresponding to the established disk appears first.
[0066] Then, the memory card 5 removes the transmission interface 11 (step S711). For example, the detection pin of the transmission interface 11 is pulled low / pulled high or is not in an invalid (de-assert) state. Then, since the connection between the third controller 151 and PCIe is interrupted, the NVMe controller / driver can be removed (step S712). On the other hand, the processor 14 can re-mount the driver corresponding to the first controller 121 (for example, the first driver 131A) (step S713). The mounting of the driver corresponding to the first controller 121 can be performed, for example, as follows Figure 3 After or before the connection L1 is established.
[0067] In another preferred embodiment, please refer to Figure 5 When the memory card 5 uses the second communication protocol version, the direct connection between the first multiplexer 121 and the second multiplexer 122 is interrupted under the control of the first controller 121 and the second controller 122. The computer system 10 of this embodiment first establishes a connection between the transmission interface 11, the first multiplexer 124, the first controller 121, the second controller 122, the second multiplexer 125, and the system interface circuit 15, and then allows the computer system 10 to store the access protection setting of the memory card 5 through the first driver 131A according to the first communication protocol version.
[0068] As described above, after completing the access protection settings for the storage memory card 5, the computer system 10 uninstalls the first driver 131A. The computer system 10 also controls the first multiplexer 124 and the second multiplexer 125 via the first controller 121 and the second controller 122, respectively, thereby establishing a direct connection between the first multiplexer 124 and the second multiplexer 125. The switching operation via the first multiplexer 124 and the second multiplexer 125 can, for example, establish a link L3 between the transmission interface 11, the first multiplexer, the second multiplexer, and the system interface circuit 15. The second driver 131B can then be loaded, allowing the computer system to access the memory card via the link L3. Furthermore, in this embodiment, the disk configuration service 132 within the computer system 10 can configure a disk corresponding to the memory card 5 in the operating system 141 within the computer system 10 based on the access protection settings. In this way, the disk can be configured with the access protection setting. The transmission bandwidth of the link L3 is, for example, greater than the transmission bandwidth of L1 and L2.
[0069] In summary, in the access control method and computer system of the present invention, when the mechanical switch of a memory card is set to write protection or read-only, the corresponding access protection setting is retained. Even if the Secure Digital host controller is removed, the disk configuration service running on the operating system can still retrieve this retained access protection setting and configure the disk corresponding to the memory card to conform to the disk properties of this access protection setting. This allows write protection to be provided for memory cards using the protocol version corresponding to the Express Secure Digital mode or the SDUC format within the original computer system's hardware architecture.
[0070] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A memory card data access control method, applicable to a computer system accessing a memory card, the memory card data access control method comprising: The computer system detects whether the memory card supports a first communication protocol version and a second communication protocol version; When the memory card supports the second communication protocol version, the computer system stores an access protection setting of the memory card through a first driver according to the first communication protocol version, wherein the access protection setting is used to restrict access to the memory card; The computer system uninstalls the first driver; as well as The disk configuration service in the computer system configures the disk corresponding to the memory card according to the access protection setting in the operating system in the computer system, wherein the disk configuration service runs on the operating system and the disk is configured with the access protection setting.
2. The memory card data access control method according to claim 1 , further comprising: The computer system loads a second driver and accesses the memory card through the second driver according to the second communication protocol version.
3. The memory card data access control method according to claim 1 , wherein when the memory card supports the second communication protocol version, the computer system detects the access protection setting of the memory card via the first controller of the control circuit through the first driver according to the first communication protocol version, stores the access protection setting, and controls the multiplexing module of the control circuit by the control circuit to establish a link between the memory card and the computer system.
4. The memory card data access control method according to claim 3, wherein the control circuit further comprises a second controller, and the multiplexing module comprises a first multiplexer and a second multiplexer, and when the memory card supports the second communication protocol version, the first controller and the second controller respectively control the first multiplexer and the second multiplexer, allowing the memory card to be connected to the computer system through the first multiplexer and the second multiplexer.
5. The memory card data access control method according to claim 1 , wherein the step of storing the access protection setting of the memory card comprises: A protection configuration is assigned to the access protection setting, wherein the protection configuration is stored in a configuration database of the operating system.
6. The memory card data access control method according to claim 1 , wherein the step of setting the disk corresponding to the memory card in the operating system comprises: Reading the access protection settings via the disk configuration service; as well as The disk attribute of the disk is set by the disk configuration service to correspond to the access protection setting.
7. The memory card data access control method according to claim 1 , further comprising: determining whether a disk attribute of the disk corresponds to the access protection setting; as well as When the disk attribute of the disk does not correspond to the access protection setting, the disk attribute of the disk is set to correspond to the access protection setting by the disk configuration service.
8. The memory card data access control method according to claim 1 , further comprising: When the disk corresponding to the memory card is released from the operating system, the stored access protection setting is removed by the disk configuration service.
9. The memory card data access control method according to claim 1, wherein the access protection is set to write protection.
10. The memory card data access control method according to claim 1, wherein the second communication protocol version is a protocol version corresponding to the Secure Digital Express mode or a protocol version corresponding to the Secure Digital Over-Capacity format.
11. A computer system comprising: a memory for storing at least one program code corresponding to a first driver and a disk configuration service, wherein the disk configuration service runs on an operating system; A control circuit for electrically connecting to a memory card and detecting a communication protocol version of the memory card; as well as a processor, coupled to the memory, and configured to load the program code and the operating system to execute: detecting, by the control circuit, whether the memory card supports a first communication protocol version and a second communication protocol version; When the memory card supports the second communication protocol version, storing, by the first driver, an access protection setting of the memory card according to the first communication protocol version, wherein the access protection setting is used to restrict access to the memory card; uninstalling the first driver; as well as The disk configuration service is used to configure a disk corresponding to the memory card in the operating system according to the access protection setting, wherein the disk configuration service runs on the operating system, and the disk is configured with the access protection setting.
12. The computer system of claim 11 , wherein the processor further executes: A second driver is loaded, and the memory card is accessed through the second driver according to the second communication protocol version.
13. The computer system according to claim 11, wherein the controller includes a first controller and a multiplexing module, and when the memory card supports the second communication protocol version, the processor further executes: detecting the access protection setting of the memory card through the first controller via the first driver according to the first communication protocol version, and storing the access protection setting, and controlling the multiplexing module by the control circuit to establish a link between the memory card and the computer system.
14. The computer system according to claim 13, wherein the control circuit further comprises a second controller, and the multiplexing module comprises a first multiplexer and a second multiplexer, and when the memory card supports the second communication protocol version, the first controller and the second controller respectively control the first multiplexer and the second multiplexer, allowing the memory card to be connected to the computer system through the first multiplexer and the second multiplexer.
15. The computer system of claim 11 , wherein the processor further performs: A protection configuration is assigned to the access protection setting, wherein the protection configuration is stored in a configuration database of the operating system.
16. The computer system of claim 11, wherein the processor further performs: Reading the access protection settings via the disk configuration service; and The disk attribute of the disk is set by the disk configuration service to correspond to the access protection setting.
17. The computer system of claim 11, wherein the processor further performs: determining whether a disk attribute of the disk corresponds to the access protection setting; and When the disk attribute of the disk does not correspond to the access protection setting, the disk attribute of the disk is set to correspond to the access protection setting by the disk configuration service.
18. The computer system of claim 11, wherein the processor further performs: When the disk corresponding to the memory card is released from the operating system, the stored access protection setting is removed by the disk configuration service.
19. The computer system according to claim 11, wherein the access protection is set to write protection.
20. The computer system according to claim 11, wherein the second communication protocol version is a protocol version corresponding to the Express Secure Digital mode or a protocol version corresponding to the Secure Digital Super Capacity format.