GithubHelp home page GithubHelp logo

Comments (7)

williambj1 avatar williambj1 commented on May 31, 2024

@Teacher-c

非常有意思的方法,利用序列化调用覆盖 Package 里的值。妙哉

不过我有几个问题,恳请大佬解答

  1. hotpatch重命名ZUPC为XPUC

    这里的 ZUPC 指的是 GUPC?

    XPUC 指的是 XUPC?

  2. 有考虑过其他操作系统的兼容性吗?比如在 _UPC 通过 If (_OSI("Darwin")){} 判断并返回被重命名的 XUPC()

  3. 重写的 GUPC 收了一个参数,调用的时候也给了一个 One,但是我没看出来这个参数的用途,新的函数里也没使用过 Arg0

  4. 然后任一端口的_UPC Method均调用序列化GUPC方法

    据我所知,每个接口都有个 _UPC 方法,任意端口放一个等于是只调用了一次?

from oc-little.

Teacher-c avatar Teacher-c commented on May 31, 2024

@williambj1

  1. 是的,笔误。应该是hotpatch重命名GUPC为XUPC
    2.当然可以,这一点很简单。
    3.我只是举了一个调用的例子而已,这个参数是Zero还是One在原始的ssdt调用GUPC方法的时候已经写好,对应着USB端口是否启用。但是我们可以拦截改写。Arg0是可以不用,我只是偷懒,因为我的本机SSDT里关于USB端口是否启用的配置都是正确的,所以用传入的Arg0做判断而已。另外我自己屏蔽了HS04端口。
    4.根据我在自己的电脑的测试,确实是这样的。

from oc-little.

Teacher-c avatar Teacher-c commented on May 31, 2024

@williambj1
考虑操作系统的兼容性的话可以这样处理:

        Name (USBP, Zero)
        Method (GUPC, 1, Serialized)
        {
            If (_OSI ("Darwin"))
            {
                Name (PCKG, Package (0x04)
                {
                    0xFF, 
                    0x03, 
                    Zero, 
                    Zero
                })
                USBP += One
                If (((USBP == 0x04) || (Arg0 == Zero)))
                {
                    PCKG [Zero] = Zero
                }

                If ((((USBP == 0x04) || (USBP == 0x05)) || (USBP == 0x06)))
                {
                    PCKG [One] = 0xFF
                }

                Return (PCKG) 
            }
            Else
            {
                Local0 = XUPC (Arg0)
                Return (Local0)
            }
        }

from oc-little.

athlonreg avatar athlonreg commented on May 31, 2024

能否上传一份啰嗦模式下开机时的日志看一下有没有相关的ACPI报错呢

from oc-little.

Teacher-c avatar Teacher-c commented on May 31, 2024

@athlonreg 我早已反复确认过了,不存在acpi错误

from oc-little.

GZXiaoBai avatar GZXiaoBai commented on May 31, 2024

已经将本方法具体写为教程了,链接如下
https://blog.gzxiaobai.cn/post/利用GUPC以热补丁定制USB端口

from oc-little.

athlonreg avatar athlonreg commented on May 31, 2024

issue18

from oc-little.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.