# Use method \_STA

{% hint style="info" %}
Trước hết chúng ta cần biết method `_STA` là gì? Đây là method thể hiện tình trạng của devices&#x20;

> `Enable` hoặc `Disable`

Từ khái niệm trên chúng ta có thể dễ dàng suy nghĩ đến mình có thể force `Enable` hoặc `Disable` một device bất kì. Vậy chúng ta hãy cùng nhau tiến hành thôi nào
{% endhint %}

> Ở bài này mình sẽ lấy ví dụ là force on `controller` của `I2c Device`

## Xác định `ACPI Path`

B1: Chuột phải vào logo `Windows` và chọn `Device manager`&#x20;

<figure><img src="/files/OmSY3W4FhodWOqa5Y2Of" alt=""><figcaption></figcaption></figure>

B2: Tìm đến device cần `Disable` hoặc `Enable`&#x20;

B3: Chuột phải và chọn `Properties --> Details --> Bios Device Name --> Value`

> Hoặc `Properties --> location path --> Bios Device Name --> Value`

<figure><img src="/files/ax1hwLtzYFFk7LbIZrjS" alt=""><figcaption></figcaption></figure>

> Ở đây ta sẽ có ACPI Path là `\_SB.PCI0.I2C0.TPL0`&#x20;

## Tiến hành sửa SSDT

B1: Tải `SSDT-STA` [tại đây](https://www.mediafire.com/file/haon4nf7yb8yun8/SSDT-STA.dsl/file)

> Link Backup [tại đây](https://drive.heavietnam.com/d/s/zGcShelhOjqxjQXGNi8ZFYEFqpau6K66/tOlzTFGWeAddtpAszUDkH9d58Gr_Jiug-eLrgAuWWggs)

B2: Thay các mục như ảnh bằng `ACPI Path` của các bạn&#x20;

<figure><img src="/files/SpngbHFp40G0XEydlAwL" alt=""><figcaption><p>Before</p></figcaption></figure>

<figure><img src="/files/YqTyPyzBRuqAmsakbq2U" alt=""><figcaption><p>After</p></figcaption></figure>

> Bây h chúng ta sẽ chú ý đến mục mình đánh dấu số `1`&#x20;
>
> * `Return (0x0F)`:  Enable
>   * Dùng để Force `enable` Devices
> * `Return (Zero)`: Disable
>   * Dùng để Force `disable` Devices

B3: Save lại và convert từ `.aml` sang `.dsl`  theo hướng dẫn chi tiết [tại đây](/acpi-advance/patch-dsdt-phan-1.md)

B4: Bỏ file `SSDT-STA` vào `EFI --> OC --> ACPI` và snapshot

> Hoặc `EFI --> Clover --> ACPI --> Patched`

## Patch Rename

B1: Cài đặt [Python](https://www.python.org/)

B2: Dump `DSDT` theo hướng dẫn [tại đây](/acpi-advance/patch-dsdt-phan-1.md)

B3: Mở `DSDT` và search `Controller` của device cần `Enable` hoặc `Disable`

B4: Xem trong `Device` vừa search được có `Method (_STA` hay không

> Nếu có thì các bạn xem tiếp bên dưới nếu như không có `Method (_STA`  thì các bạn có thể bỏ qua phần này và chỉ việc tận hưởng

<figure><img src="/files/nfIyB7QDJOUtqcmJbCll" alt=""><figcaption></figcaption></figure>

B5: Ấn chọn `Find` và `Replace` tất cả

* Find: điền `// _STA: Status`
* Replace: điền  &#x20;

<figure><img src="/files/RxqFx1Xg8BGGiovfn6pI" alt=""><figcaption></figcaption></figure>

> Mục đích là để xoá dòng `// _STA: Status`

B6: Tải tool sau đây [về](https://drive.heavietnam.com/d/s/zGcWWnUTnRNFghvYg4WXcE7pQAPynBxE/kTAAD8efqtUTkzPaevgrLBmy42hyTSoW-sroAmhiXggs)

> Link Backup [tại đây](https://www.mediafire.com/file/x4phqtgx6u8n03w/Count_tool.rar/file)

B7: Extract tool ra

B8: Copy toàn bộ nội dung file `DSDT.dsl` vào file `DSDT.txt` trong folder vừa được extract

> Hoặc copy file `DSDT.aml` thay cho `DSDT.dsl` cũng được

B9: Tìm trong file `DSDT.txt` bạn vừa copy nội dung `Method (_STA` đã xác định ở bước 4

B10: Gõ chữ `here` vào trước `Method (_STA`&#x20;

> Hoặc bất cứ chữ gì mà bạn thích&#x20;
>
> Nhưng đảm bảo rằng đó là một chuỗi kí tự chưa từng xuất hiện trong `DSDT`

<figure><img src="/files/rjsjCG1ph8ok2S5jvoGu" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/icKyZsSb8iGfbWPVcRCK" alt=""><figcaption></figcaption></figure>

B11: Save lại

B12: Chạy `cmd` lên gõ lênh sau vào cmd `cd + [Kéo folder vừa extract được vào]`

<figure><img src="/files/hU24S3YAM03C6Ye9Ovve" alt=""><figcaption></figcaption></figure>

B13: Tiếp tục gõ lệnh sau `python count_sta_method.py`

B14: Gõ chữ `here`

> Hoặc chữ trước đó bạn đã nhập vào ở bước 10

<figure><img src="/files/U4SgtCWcRazF9ufCaBd5" alt=""><figcaption></figcaption></figure>

> Ở đây ta có biến `_STA` có `125` lần xuất hiện từ đầu cho đến chữ `here`

{% hint style="info" %}
Ở đây ta sẽ giải thích 1 tí tool này dùng để đếm số biến `_STA` đã xuất hiện từ đầu cho đến `Method (_STA` mà bạn cần rename

> Nó dựa vào vị trị chữ `here` hoặc các chuỗi ký tự mà bạn đã nhập vào ở bước 10
> {% endhint %}

B15: Tải patch [sau](https://www.mediafire.com/file/kdc1qefurrxunn5/HeaVN-Patch-rename.plist/file) về

> Link Backup [tại đây](https://drive.heavietnam.com/d/s/zGcYWKPFR1ivbbMTPrujUWaRDn5Pv8bn/-tkC-gWS64DgEjoXrJGZj1vcX_axLRBL-5LqgpjKXggs)

B16: Mở file Patch vừa tải về bằng [propertree](https://github.com/corpnewt/ProperTree)

B17: Thay thế mục `Skip` thành số lần xuất hiện của biến `_STA`

> Như ở đây là `125`

<figure><img src="/files/8FxEybxZa4ZnWbsywtmh" alt=""><figcaption></figcaption></figure>

B18: Copy mục `Root --> ACPI --> Patch` vào file `config.plist --> Root --> ACPI --> Patch`

B19: Save lại

B20: Reboot và tận hưởng thôi

## Check Patch Rename

{% hint style="info" %}
Một số trường hợp tính Skip bị sai thì sẽ kéo theo rename sai các bạn có thể check rename bằng cách như sau
{% endhint %}

B1: Tải [hackintool](https://github.com/benbaker76/Hackintool/releases)

B2: Mở hackintool ra vào `tab --> Utilites --> Dump ACPI`

B3: Mở file `DSDT.dsl` bằng [Maciasl](https://github.com/acidanthera/MaciASL/releases)

B4: Search `XSTA`

<figure><img src="/files/tGGmBQA6c1WIJ4Qoml83" alt=""><figcaption></figcaption></figure>

> Ở đây nó sẽ cho bạn biết bạn add patch rename là rename `Method (_STA` ở vị trị thứ bao nhiêu
>
> Như ở đây minh đã rename đúng `Method (_STA`

> Nội dung bài này bản quyền thuộc Heavietnam.&#x20;
>
> Vui lòng tôn trọng và trích dẫn source nếu có rewrite bài viết.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://advance.heavietnam.com/acpi-advance/use-method-_sta.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
