From 51b7bb60212dbe13c2c513e410a617d8e48386a6 Mon Sep 17 00:00:00 2001 From: jslegendre Date: Mon, 3 Jun 2019 02:34:40 -0400 Subject: [PATCH] Initial commit --- LICENSE | 339 ++++++++++++++++++ README.md | 31 ++ TOSMotionSensor.xcodeproj/project.pbxproj | 335 +++++++++++++++++ .../contents.xcworkspacedata | 7 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../UserInterfaceState.xcuserstate | Bin 0 -> 20798 bytes .../UserInterfaceState.xcuserstate | Bin 0 -> 18524 bytes .../xcschemes/TOSMotionSensor.xcscheme | 80 +++++ .../xcschemes/TOSMotionSensor.xcscheme | 80 +++++ .../xcschemes/xcschememanagement.plist | 22 ++ .../xcschemes/xcschememanagement.plist | 22 ++ TOSMotionSensor/Info.plist | 60 ++++ TOSMotionSensor/TOSMotionSensor.cpp | 185 ++++++++++ TOSMotionSensor/TOSMotionSensor.hpp | 86 +++++ TOSMotionSensor/TOSMotionSensorClient.cpp | 79 ++++ TOSMotionSensor/ToshibaHAPS.cpp | 112 ++++++ TOSMotionSensor/ToshibaHAPS.hpp | 57 +++ Test/test | Bin 0 -> 9016 bytes Test/test.c | 72 ++++ 19 files changed, 1575 insertions(+) create mode 100644 LICENSE create mode 100644 README.md create mode 100644 TOSMotionSensor.xcodeproj/project.pbxproj create mode 100644 TOSMotionSensor.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 TOSMotionSensor.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 TOSMotionSensor.xcodeproj/project.xcworkspace/xcuserdata/j.xcuserdatad/UserInterfaceState.xcuserstate create mode 100644 TOSMotionSensor.xcodeproj/project.xcworkspace/xcuserdata/xord.xcuserdatad/UserInterfaceState.xcuserstate create mode 100644 TOSMotionSensor.xcodeproj/xcshareddata/xcschemes/TOSMotionSensor.xcscheme create mode 100644 TOSMotionSensor.xcodeproj/xcuserdata/j.xcuserdatad/xcschemes/TOSMotionSensor.xcscheme create mode 100644 TOSMotionSensor.xcodeproj/xcuserdata/j.xcuserdatad/xcschemes/xcschememanagement.plist create mode 100644 TOSMotionSensor.xcodeproj/xcuserdata/xord.xcuserdatad/xcschemes/xcschememanagement.plist create mode 100644 TOSMotionSensor/Info.plist create mode 100644 TOSMotionSensor/TOSMotionSensor.cpp create mode 100644 TOSMotionSensor/TOSMotionSensor.hpp create mode 100644 TOSMotionSensor/TOSMotionSensorClient.cpp create mode 100644 TOSMotionSensor/ToshibaHAPS.cpp create mode 100644 TOSMotionSensor/ToshibaHAPS.hpp create mode 100755 Test/test create mode 100644 Test/test.c diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d159169 --- /dev/null +++ b/LICENSE @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/README.md b/README.md new file mode 100644 index 0000000..b466a35 --- /dev/null +++ b/README.md @@ -0,0 +1,31 @@ +##TOSMotionSensor +TOSMotionSensor is an accelerometer driver for Toshiba hackintosh devices. It has been designed to use the built-in accelerometer in any Toshiba device sporting one and should be compatible with any supported device. + +TOSMotionSensor also kinda-sorta emulates the built in accelerometer HDD MacBook and MacBook Pros used to come with by publishing the same IOService and can be queried by user-space applications in the same way. + +tldr: This is compatible with native macOS applications that use SMS (SMCMotionSensor/Sudden Motion Sensor) data. No proprietary software/patches/hacks necessary. + +**NOTE: This driver does NOT offer HDD protection. A lot more testing and research needs to be done in order for that to happen.** I did not include this in the first release as I don't feel this is as important as it used to be. Most of us are using solid state storage these days. Would still be cool to get working though. + +## Usage +I have tested this kext on High Sierra and Mojave in Clover's 'kexts/Other', SLE, and LE. All seem to be working. + +If you do not want to build it yourself you can **[Download the latest release here](https://github.com/jslegendre/TOSMotionSensor)** + +## Development +If you would like to get started developing motion-based applications you can check out [SMSLib](http://suitable.com/smslib.html), a library made especially for grabbing accelerometer data on Apple hardware or check out my own display autorotation app [Displace](https://github.com/jslegendre/Displace) for a real-world example. + +## Future +I am really excited about iOS apps (supposedly) coming to macOS and the possibilities this opens up. Possible uses include: + +- Gaming. Playing motion-based iOS games "natively" on a bigger screen. +- Testing for iOS motion-based app developers. + +## Contributing +I am very open to pull requests. This is my first kext release and I'm sure that I have some areas to improve upon. + +- Development. Check out the source, there are comments, questions, and todos all over the place. +- Testing. If you have a Toshiba device with an accelerometer, please try this out alongside [Displace](https://github.com/jslegendre/Displace) and let me know how it worked for you. +- Financially. Yeeeeessshh, okay, this is where I get uncomfortable. This and other projects take time and something I've come to learn since having a child is that time isn't free. Especially (and ironically) free time. The only thing I have up right now is a [Patreon](https://www.patreon.com/jslegendre) account if you are interested. \*cue Sarah McLachlan* Even $1/month is a huge help and allows me to dedicate more time to Hackintosh projects as well as access to more devices to make drivers for. + +I cannot thank you enough for even reading this far let alone helping out in any way you can. \ No newline at end of file diff --git a/TOSMotionSensor.xcodeproj/project.pbxproj b/TOSMotionSensor.xcodeproj/project.pbxproj new file mode 100644 index 0000000..3d4da41 --- /dev/null +++ b/TOSMotionSensor.xcodeproj/project.pbxproj @@ -0,0 +1,335 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + 090B57D42293B9BE00879B1B /* TOSMotionSensor.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 090B57D32293B9BE00879B1B /* TOSMotionSensor.hpp */; }; + 090B57D62293B9BE00879B1B /* TOSMotionSensor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 090B57D52293B9BE00879B1B /* TOSMotionSensor.cpp */; }; + 09288B22229656F10061881A /* TOSMotionSensorClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 09288B21229656F10061881A /* TOSMotionSensorClient.cpp */; }; + 09288B2522965BAA0061881A /* ToshibaHAPS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 09288B2322965BAA0061881A /* ToshibaHAPS.cpp */; }; + 09288B2622965BAA0061881A /* ToshibaHAPS.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 09288B2422965BAA0061881A /* ToshibaHAPS.hpp */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 090B57D02293B9BE00879B1B /* TOSMotionSensor.kext */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TOSMotionSensor.kext; sourceTree = BUILT_PRODUCTS_DIR; }; + 090B57D32293B9BE00879B1B /* TOSMotionSensor.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = TOSMotionSensor.hpp; sourceTree = ""; }; + 090B57D52293B9BE00879B1B /* TOSMotionSensor.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TOSMotionSensor.cpp; sourceTree = ""; }; + 090B57D72293B9BE00879B1B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 09288B21229656F10061881A /* TOSMotionSensorClient.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TOSMotionSensorClient.cpp; sourceTree = ""; }; + 09288B2322965BAA0061881A /* ToshibaHAPS.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ToshibaHAPS.cpp; sourceTree = ""; }; + 09288B2422965BAA0061881A /* ToshibaHAPS.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = ToshibaHAPS.hpp; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 090B57CC2293B9BE00879B1B /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 090B57C62293B9BE00879B1B = { + isa = PBXGroup; + children = ( + 090B57D22293B9BE00879B1B /* TOSMotionSensor */, + 090B57D12293B9BE00879B1B /* Products */, + ); + sourceTree = ""; + }; + 090B57D12293B9BE00879B1B /* Products */ = { + isa = PBXGroup; + children = ( + 090B57D02293B9BE00879B1B /* TOSMotionSensor.kext */, + ); + name = Products; + sourceTree = ""; + }; + 090B57D22293B9BE00879B1B /* TOSMotionSensor */ = { + isa = PBXGroup; + children = ( + 09288B2422965BAA0061881A /* ToshibaHAPS.hpp */, + 09288B2322965BAA0061881A /* ToshibaHAPS.cpp */, + 090B57D32293B9BE00879B1B /* TOSMotionSensor.hpp */, + 090B57D52293B9BE00879B1B /* TOSMotionSensor.cpp */, + 09288B21229656F10061881A /* TOSMotionSensorClient.cpp */, + 090B57D72293B9BE00879B1B /* Info.plist */, + ); + path = TOSMotionSensor; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 090B57CD2293B9BE00879B1B /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 090B57D42293B9BE00879B1B /* TOSMotionSensor.hpp in Headers */, + 09288B2622965BAA0061881A /* ToshibaHAPS.hpp in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 090B57CF2293B9BE00879B1B /* TOSMotionSensor */ = { + isa = PBXNativeTarget; + buildConfigurationList = 090B57DA2293B9BE00879B1B /* Build configuration list for PBXNativeTarget "TOSMotionSensor" */; + buildPhases = ( + 090B57CB2293B9BE00879B1B /* Sources */, + 090B57CC2293B9BE00879B1B /* Frameworks */, + 090B57CD2293B9BE00879B1B /* Headers */, + 090B57CE2293B9BE00879B1B /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = TOSMotionSensor; + productName = TOSMotionSensor; + productReference = 090B57D02293B9BE00879B1B /* TOSMotionSensor.kext */; + productType = "com.apple.product-type.kernel-extension"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 090B57C72293B9BE00879B1B /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0940; + ORGANIZATIONNAME = j; + TargetAttributes = { + 090B57CF2293B9BE00879B1B = { + CreatedOnToolsVersion = 9.4; + }; + }; + }; + buildConfigurationList = 090B57CA2293B9BE00879B1B /* Build configuration list for PBXProject "TOSMotionSensor" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 090B57C62293B9BE00879B1B; + productRefGroup = 090B57D12293B9BE00879B1B /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 090B57CF2293B9BE00879B1B /* TOSMotionSensor */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 090B57CE2293B9BE00879B1B /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 090B57CB2293B9BE00879B1B /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 090B57D62293B9BE00879B1B /* TOSMotionSensor.cpp in Sources */, + 09288B2522965BAA0061881A /* ToshibaHAPS.cpp in Sources */, + 09288B22229656F10061881A /* TOSMotionSensorClient.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 090B57D82293B9BE00879B1B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + }; + name = Debug; + }; + 090B57D92293B9BE00879B1B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + }; + name = Release; + }; + 090B57DB2293B9BE00879B1B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + CODE_SIGN_STYLE = Manual; + COMBINE_HIDPI_IMAGES = YES; + CURRENT_PROJECT_VERSION = 1.0.0d1; + DEVELOPMENT_TEAM = ""; + INFOPLIST_FILE = TOSMotionSensor/Info.plist; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MODULE_NAME = com.github.jslegendre.TOSMotionSensor; + MODULE_VERSION = 1.0.0d1; + OTHER_CPLUSPLUSFLAGS = ( + "$(OTHER_CFLAGS)", + "-Wno-inconsistent-missing-override", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.github.jslegendre.TOSMotionSensor; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + WRAPPER_EXTENSION = kext; + }; + name = Debug; + }; + 090B57DC2293B9BE00879B1B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + CODE_SIGN_STYLE = Manual; + COMBINE_HIDPI_IMAGES = YES; + CURRENT_PROJECT_VERSION = 1.0.0d1; + DEVELOPMENT_TEAM = ""; + INFOPLIST_FILE = TOSMotionSensor/Info.plist; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MODULE_NAME = com.github.jslegendre.TOSMotionSensor; + MODULE_VERSION = 1.0.0d1; + OTHER_CPLUSPLUSFLAGS = ( + "$(OTHER_CFLAGS)", + "-Wno-inconsistent-missing-override", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.github.jslegendre.TOSMotionSensor; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + WRAPPER_EXTENSION = kext; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 090B57CA2293B9BE00879B1B /* Build configuration list for PBXProject "TOSMotionSensor" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 090B57D82293B9BE00879B1B /* Debug */, + 090B57D92293B9BE00879B1B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 090B57DA2293B9BE00879B1B /* Build configuration list for PBXNativeTarget "TOSMotionSensor" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 090B57DB2293B9BE00879B1B /* Debug */, + 090B57DC2293B9BE00879B1B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 090B57C72293B9BE00879B1B /* Project object */; +} diff --git a/TOSMotionSensor.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/TOSMotionSensor.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..0b9aa04 --- /dev/null +++ b/TOSMotionSensor.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/TOSMotionSensor.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/TOSMotionSensor.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/TOSMotionSensor.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/TOSMotionSensor.xcodeproj/project.xcworkspace/xcuserdata/j.xcuserdatad/UserInterfaceState.xcuserstate b/TOSMotionSensor.xcodeproj/project.xcworkspace/xcuserdata/j.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000000000000000000000000000000000000..a50519cd43a1870ba12d397910bb1903f3cf50d4 GIT binary patch literal 20798 zcmdsf33yY*7Vykn(v$*C+N5pTrcIMBbWNJ3P0}r0!9sybO4$i%o6$(@-q=bSln z=FB-~rn;%Y>1o#K4k3&vL?Z^VNF*9Asu~$P)#3IyU5z7SUDcBuHO-z;v37S&y%Szn z#x}c}f)KuYAeLY$mSH&# z#fdlxC*u^Hiqo(b>u@?Y<7}LRb8#Nd#{=;oT#g6hA$S-bg-7Etcr32P4qT6&xCKwe z)9`fMif7_EcrLyh&%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pPCPv zkC=Zk|7t#AK^DfsSq52REUA`Ui{4_gSS|UMQI=9mxn;EFe9JhC$Fk0{)3Vp{fn~qt z6U%3oZ!AAsj#-XdPFVi1{AG=>%B@OktW{%8v?g0qtVZhyYlXGaI?g)5T4SANooT($ z+F*5CTdd2iw_9Jcerx^3dffWE^-tSin_yGeqHVFZc$?amWy`baZ6=%D=CBpnM%c#L zrq~*6Zrd!|99x@hzHOmxvF&1;Xj^96Yrgo~jw*-8afxG%W4+@l$F+{@9k)8}aNOm%*Kxn&F~^gRU5@7* zyB$9iBo&-rP+Ksyz*8`3~UB!#OAFE6~Mu&eNa!Y2!N6+T<|eBr*rw+r7b{Gf1u;eo=h z3co4*uJDJ#Sa*Fbb3`OQ5TTy;dSy4sNn4+;o>xynF zy18g`QFqZ@MfVi#EP7yg + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TOSMotionSensor.xcodeproj/xcuserdata/j.xcuserdatad/xcschemes/TOSMotionSensor.xcscheme b/TOSMotionSensor.xcodeproj/xcuserdata/j.xcuserdatad/xcschemes/TOSMotionSensor.xcscheme new file mode 100644 index 0000000..6ffdbaf --- /dev/null +++ b/TOSMotionSensor.xcodeproj/xcuserdata/j.xcuserdatad/xcschemes/TOSMotionSensor.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TOSMotionSensor.xcodeproj/xcuserdata/j.xcuserdatad/xcschemes/xcschememanagement.plist b/TOSMotionSensor.xcodeproj/xcuserdata/j.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..8aab346 --- /dev/null +++ b/TOSMotionSensor.xcodeproj/xcuserdata/j.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + TOSMotionSensor.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 090B57CF2293B9BE00879B1B + + primary + + + + + diff --git a/TOSMotionSensor.xcodeproj/xcuserdata/xord.xcuserdatad/xcschemes/xcschememanagement.plist b/TOSMotionSensor.xcodeproj/xcuserdata/xord.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..d8b900a --- /dev/null +++ b/TOSMotionSensor.xcodeproj/xcuserdata/xord.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + TOSMotionSensor.xcscheme_^#shared#^_ + + orderHint + 0 + + + SuppressBuildableAutocreation + + 090B57CF2293B9BE00879B1B + + primary + + + + + diff --git a/TOSMotionSensor/Info.plist b/TOSMotionSensor/Info.plist new file mode 100644 index 0000000..1608caa --- /dev/null +++ b/TOSMotionSensor/Info.plist @@ -0,0 +1,60 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + KEXT + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + IOKitPersonalities + + HCI Method Interface + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + IOClass + SMCMotionSensor + IONameMatch + TOS1900 + IOProviderClass + IOACPIPlatformDevice + IOUserClientClass + SMCMotionSensorClient + + HD Protection Scheme + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + IOClass + ToshibaHAPS + IONameMatch + TOS620A + IOProviderClass + IOACPIPlatformDevice + + + NSHumanReadableCopyright + Copyright © 2019 jslegendre. All rights reserved. + OSBundleLibraries + + com.apple.iokit.IOACPIFamily + 1.0d1 + com.apple.kpi.iokit + 9.0.0 + com.apple.kpi.libkern + 9.0.0 + + + diff --git a/TOSMotionSensor/TOSMotionSensor.cpp b/TOSMotionSensor/TOSMotionSensor.cpp new file mode 100644 index 0000000..77f98ed --- /dev/null +++ b/TOSMotionSensor/TOSMotionSensor.cpp @@ -0,0 +1,185 @@ +/* + * Copyright (c) 2019 jslegendre / Xord. All rights reserved. + * + * Released under "The GNU General Public License (GPL-2.0)" + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +/* + Credits: + https://github.com/torvalds/linux/blob/master/drivers/platform/x86/toshiba_acpi.c + */ + +#include "TOSMotionSensor.hpp" + +#ifdef DEBUG +#define DPRINT(fmt, ...) \ +IOLog("TOSMotionSensor::%s:%d(): " fmt, __func__, __LINE__, ##__VA_ARGS__); +#else +#define DPRINT(fmt, ...) do {} while (0) +#endif + +#define HCI_GET 0xfe00 +#define HCI_ACCEL 0x6d +#define HCI_ACCEL_SUPPORT 0xa6 +#define HCI_ACCEL_MASK 0x7fff +#define HCI_ACCEL_DIRECTION_MASK 0x8000 +#define HCI_ACCEL_Y_SHIFT 0x10 +#define HCI_UNSUPPORTED 0x8000 +#define HCI_SUCCESSS 0x0 + +UInt32 getUnsignedIntFromArray(OSArray * array, UInt8 index); + +#define super IOService +OSDefineMetaClassAndStructors(SMCMotionSensor, IOService) + +bool TOSMotionSensor::init(OSDictionary *dict) +{ + DPRINT("Initializing\n"); + + bool result = super::init(dict); + TVAP = NULL; + hci_method = NULL; + _axes = { 0, 0, 0 }; + HCI_OUT = NULL; + axes = NULL; + + for(UInt8 i = 0; i < 6; i++) { + HCI_IN[i] = OSNumber::withNumber((unsigned long long)0, 32); + } + + return result; +} + +const OSSymbol * TOSMotionSensor::findHCI() { + if(!TVAP->validateObject("SPFC")) { + DPRINT("Found HCI method SPFC"); + return OSSymbol::withCString("SPFC"); + } + + if(!TVAP->validateObject("GHCI")) { + DPRINT("Found HCI method GHCI"); + return OSSymbol::withCString("GHCI"); + } + + return NULL; +} + +bool TOSMotionSensor::isAccelSupported() { + HCI_IN[0] = OSDynamicCast(OSObject, OSNumber::withNumber(HCI_GET, 32)); + HCI_IN[1] = OSDynamicCast(OSObject, OSNumber::withNumber(HCI_ACCEL_SUPPORT, 32)); + + TVAP->evaluateObject(hci_method, &HCI_OUT, HCI_IN, 6); + + if(HCI_OUT && (OSTypeIDInst(HCI_OUT) == OSTypeID(OSArray))) { + if(getUnsignedIntFromArray(OSDynamicCast(OSArray, HCI_OUT), 0) != HCI_UNSUPPORTED) { + DPRINT("Accelerometer supported"); + return true; + } + } + + return false; +} + +bool TOSMotionSensor::start(IOService *provider) +{ + DPRINT("TOSMotionSensor::start: called\n"); + + TVAP = OSDynamicCast(IOACPIPlatformDevice, provider); + if (NULL == TVAP || !super::start(provider)) + return false; + + /* + * Make sure the accelerometer is activated + * Sidenote: Not sure if SSD only Toshiba machines have this device. If they do + * not, how to make sure devices shipped with HDD have activated the sensor hub + * before continuing? + */ + IOService *haps_service = waitForMatchingService(serviceMatching("ToshibaHAPS")); + if(!haps_service->getProperty("ProtectionLevel")) { + DPRINT("Accelerometer not activated"); + haps_service->release(); + return false; + } + haps_service->release(); + + hci_method = findHCI(); + if(!hci_method) { + DPRINT("Could not find HCI method"); + return false; + } + + if(!isAccelSupported()) { + DPRINT("Accelerometer not supported"); + return false; + } + + //Setup for HCI method to get accelerometer values as default + HCI_IN[1] = OSNumber::withNumber(HCI_ACCEL, 32); + HCI_IN[3] = OSNumber::withNumber(0x01, 32); + + registerService(); + return true; +} + +//Should this be locking? Specifically access to _axes? +IOReturn TOSMotionSensor::getAxes(void *iBuf, void *oBuf) { + DPRINT("getAxes Called"); + TVAP->evaluateObject(hci_method, &HCI_OUT, HCI_IN, 6); + if(HCI_OUT && (OSTypeIDInst(HCI_OUT) == OSTypeID(OSArray))) { + axes = OSDynamicCast(OSArray, HCI_OUT); + if(getUnsignedIntFromArray(axes, 0) != (UInt32)HCI_SUCCESSS){ //One more check + DPRINT("HCI method did not return with HCI_SUCCESS"); + return kIOReturnError; + } + _axes.z = (SInt16)getUnsignedIntFromArray(axes, 4); + _axes.z = _axes.z & HCI_ACCEL_DIRECTION_MASK ? + -(_axes.z & HCI_ACCEL_MASK) : _axes.z & HCI_ACCEL_MASK; + + UInt32 xy = getUnsignedIntFromArray(axes, 2); + _axes.x = xy & HCI_ACCEL_DIRECTION_MASK ? + -(xy & HCI_ACCEL_MASK) : xy & HCI_ACCEL_MASK; + + _axes.y = (xy >> HCI_ACCEL_Y_SHIFT) & HCI_ACCEL_DIRECTION_MASK ? + -((xy >> HCI_ACCEL_Y_SHIFT) & HCI_ACCEL_MASK) : + (xy >> HCI_ACCEL_Y_SHIFT) & HCI_ACCEL_MASK; + } + + if(!HCI_OUT) { + DPRINT("HCI_OUT is NULL"); + return kIOReturnError; + } + + memcpy((char*)oBuf, &_axes, sizeof(struct s_axes)); + return kIOReturnSuccess; +} + +void TOSMotionSensor::stop(IOService *provider) +{ + DPRINT("called\n"); + super::stop(provider); +} + +UInt32 getUnsignedIntFromArray(OSArray * array, UInt8 index) { + OSObject * obj = array->getObject(index); + if(obj && (OSTypeIDInst(obj) == OSTypeID(OSNumber))) { + OSNumber * num = OSDynamicCast(OSNumber, obj); + return num->unsigned32BitValue(); + } + + return -1; +} diff --git a/TOSMotionSensor/TOSMotionSensor.hpp b/TOSMotionSensor/TOSMotionSensor.hpp new file mode 100644 index 0000000..20d63fe --- /dev/null +++ b/TOSMotionSensor/TOSMotionSensor.hpp @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2019 jslegendre / Xord. All rights reserved. + * + * Released under "The GNU General Public License (GPL-2.0)" + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef TOSMotionSensor_hpp +#define TOSMotionSensor_hpp + +#include +#include +#include + +#define TOSMotionSensor SMCMotionSensor +#define TOSMotionSensorClient SMCMotionSensorClient + +class TOSMotionSensor : public IOService +{ + OSDeclareDefaultStructors(TOSMotionSensor); + friend class TOSMotionSensorClient; + +public: + virtual bool init(OSDictionary *dictionary = 0); + virtual bool start(IOService *provider); + virtual void stop(IOService *provider); + + const OSSymbol * findHCI(); + bool isAccelSupported(); + IOReturn getAxes(void *iBuf, void *oBuf); +protected: + struct s_axes { SInt16 x; SInt16 y; SInt16 z; }; +private: + IOACPIPlatformDevice* TVAP; + + OSObject* HCI_IN[6]; + OSObject* HCI_OUT; + OSArray* axes; + const OSSymbol* hci_method; //HCI: Hardware Configuration Interface + + struct s_axes _axes; +}; + +class TOSMotionSensorClient : public IOUserClient +{ + OSDeclareDefaultStructors(SMCMotionSensorClient); +public: + virtual bool start(IOService* provider); + virtual void stop(IOService* provider); + virtual bool initWithTask(task_t owningTask, void *securityToken, UInt32 type, OSDictionary *properties); + virtual IOReturn clientClose(); + virtual IOExternalMethod * getTargetAndMethodForIndex(IOService **targetP, UInt32 index); +protected: + TOSMotionSensor* p_provider; + task_t p_task; +private: + IOSimpleLock *axes_lock; + +}; + +static const IOExternalMethod external_methods[1] = +{ + { + NULL, + (IOMethod)&TOSMotionSensor::getAxes, + kIOUCStructIStructO, + 40, + 40 + } +}; + +#endif diff --git a/TOSMotionSensor/TOSMotionSensorClient.cpp b/TOSMotionSensor/TOSMotionSensorClient.cpp new file mode 100644 index 0000000..4b597ac --- /dev/null +++ b/TOSMotionSensor/TOSMotionSensorClient.cpp @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2019 jslegendre / Xord. All rights reserved. + * + * Released under "The GNU General Public License (GPL-2.0)" + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#include "TOSMotionSensor.hpp" + +#ifdef DEBUG +#define DPRINT(fmt, ...) \ +IOLog("TOSMotionSensorClient::%s:%d(): " fmt, __func__, __LINE__, ##__VA_ARGS__); +#else +#define DPRINT(fmt, ...) do {} while (0) +#endif + +#define super IOUserClient +OSDefineMetaClassAndStructors(SMCMotionSensorClient, IOUserClient); + +bool TOSMotionSensorClient::initWithTask(task_t owningTask, void *securityToken, UInt32 type, OSDictionary *properties) { + DPRINT("TOS1900 initwithtask"); + + if(!super::initWithTask(owningTask, securityToken, type)) { + DPRINT("TOS1900: could not initWithTask"); + return false; + } + + p_task = owningTask; + return true; +} + +IOReturn TOSMotionSensorClient::clientClose() { + p_task = NULL; + p_provider = NULL; + + if(terminate()) + return kIOReturnSuccess; + + return kIOReturnError; +} + +IOExternalMethod * TOSMotionSensorClient::getTargetAndMethodForIndex(IOService **targetP, UInt32 index) { + DPRINT("called"); + *targetP = p_provider; + + if(index == 5) //Index 5 is the orginal SMCMotionSensor selector to get accelerometer data + index = 0; + + return (IOExternalMethod*)&external_methods[index]; +} + +bool TOSMotionSensorClient::start(IOService* provider) { + DPRINT("called"); + if (!super::start(provider)) + return false; + + p_provider = OSDynamicCast(TOSMotionSensor, provider); + registerService(); + return true; +} + +void TOSMotionSensorClient::stop(IOService* provider) { + DPRINT("called"); + super::stop(provider); +} diff --git a/TOSMotionSensor/ToshibaHAPS.cpp b/TOSMotionSensor/ToshibaHAPS.cpp new file mode 100644 index 0000000..7912d18 --- /dev/null +++ b/TOSMotionSensor/ToshibaHAPS.cpp @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2019 jslegendre / Xord. All rights reserved. + * + * Released under "The GNU General Public License (GPL-2.0)" + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#include "ToshibaHAPS.hpp" + +#ifdef DEBUG +#define DPRINT(fmt, ...) \ + IOLog("ToshibaHAPS::%s:%d(): " fmt, __func__, __LINE__, ##__VA_ARGS__); +#else +#define DPRINT(fmt, ...) do {} while (0) +#endif + +#define super IOService +OSDefineMetaClassAndStructors(ToshibaHAPS, IOService); + +IOReturn ToshibaHAPS::resetHaps() { + UInt32 dummy; //Throwaway - Avoid NULL (de)referencing + + //ACPI method 'RSSS' does not return anything + return haps->evaluateInteger(RSSS, &dummy); +} + +IOReturn ToshibaHAPS::setCurrentPTLV(UInt32 level) { + DPRINT("Setting protection level: %d", level); + IOReturn ret = kIOReturnSuccess; + + /* Some models that ship with built in SSD have a HAPS device + with no methods other than _STA (which unconditionally + returns zero). In this case we set IORegistry protection level + entry to 2 (default) return success, and move on. */ + ret = haps->validateObject(PTLV); + if(ret != kIOReturnSuccess) { + setProperty(ptlv_io_reg_property, OSNumber::withNumber(2, 32)); + return kIOReturnSuccess; + } + + UInt32 dummy; + OSObject* ptlv = OSDynamicCast(OSObject, OSNumber::withNumber(level, 32)); + + //ACPI method 'PTLV' does not return anything + ret = haps->evaluateInteger(PTLV, &dummy, &ptlv, 1); + if(ret == kIOReturnSuccess) { + DPRINT("Setting protection level successful"); + setProperty(ptlv_io_reg_property, ptlv); + } else { + DPRINT("Setting protection level failed with error: %d", ret); + return ret; + } + + ret = resetHaps(); + if (ret != kIOReturnSuccess) { + DPRINT("Could not activate HAPS device"); + } + return ret; +} + +bool ToshibaHAPS::init(OSDictionary* properties) { + DPRINT("ToshibaHAPS init"); + + if (!super::init(properties)) + return false; + + haps = NULL; + ptlv_io_reg_property = "ProtectionLevel"; + + RSSS = OSSymbol::withCStringNoCopy("RSSS"); + PTLV = OSSymbol::withCStringNoCopy("PTLV"); + + setProperty(ptlv_io_reg_property, (UInt32)0); + return true; +} + +void ToshibaHAPS::free() { + super::free(); +} + +bool ToshibaHAPS::start(IOService* provider) { + DPRINT("ToshibaHAPS starting"); + haps = OSDynamicCast(IOACPIPlatformDevice, provider); + + if (!super::start(provider)) + return false; + + //PT_LEVEL_MED: Enables accelerometers, no shock protection + if(setCurrentPTLV(PT_LEVEL_MED) != kIOReturnSuccess) + return false; + + this->registerService(); + return true; +} + +void ToshibaHAPS::stop(IOService* provider) { + super::stop(provider); +} diff --git a/TOSMotionSensor/ToshibaHAPS.hpp b/TOSMotionSensor/ToshibaHAPS.hpp new file mode 100644 index 0000000..19b58e3 --- /dev/null +++ b/TOSMotionSensor/ToshibaHAPS.hpp @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2019 jslegendre / Xord. All rights reserved. + * + * Released under "The GNU General Public License (GPL-2.0)" + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef ToshibaHAPS_hpp +#define ToshibaHAPS_hpp + +#include +#include + +//Various HD protection levels +enum PT_LEVELS { + PT_LEVEL_NONE, // Off + PT_LEVEL_LOW, + PT_LEVEL_MED, + PT_LEVEL_HIGH // Do not use! Causes KP +}; + +class ToshibaHAPS : public IOService { + OSDeclareDefaultStructors(ToshibaHAPS); +public: + bool init(OSDictionary* properties); + void free(); + bool start(IOService* provider); + void stop(IOService* provider); + + IOReturn resetHaps(); + IOReturn setCurrentPTLV(UInt32 level); + OSObject* getCurrentPTLV(); + +protected: +private: + IOACPIPlatformDevice* haps; + const char* ptlv_io_reg_property; + const OSSymbol* RSSS; // Reset - ACPI Method + const OSSymbol* PTLV; // Protection Level - ACPI Method +}; + + +#endif /* ToshibaHAPS_hpp */ diff --git a/Test/test b/Test/test new file mode 100755 index 0000000000000000000000000000000000000000..7c7234d248aac0f266a6bee0d72d13934dd133fc GIT binary patch literal 9016 zcmeHNUuYaf7@td8jcILCD{85gO(9Z6dZ`o)Md4y{?S|%>=p`kHWqP@r>m9kf4ZC}7 z(|S-$TZl&?6cO?15D_UsD)gZRNn5QZZytRrB}gBl-hnOpBBd1L@0*=X?lx(B6NLR> z=KDLpo%v=qH#?J`9^U)=NyY+=jGb;^jBQ3KuV?Hm(;zXn6-7tke4uN8_`UGE{ba4D zK)t%EMmV<-$oXJ+c(6W1wr{PsF{Pt#4Be51A~?6j37aH`ym+OJ7z|u@RHsN^=LQpB z$4=L(oLhE A_W@lI}X@H$k4tGf-F6y6ic;NbC;$czaSHZR_^!aJhkNvFIo(Te`X zE!#}zj;a7J-o_TEeClwYQ=dj!>#e`h>_uAwh4W8JQs%62eo&J^55ht;G7>d zYL>|gyjHZQ{<(Ohd-0m<@G`Nr`ll(pkZMDEEgp>*OL2*o->bgfg9pMrz3w}qdGZFG zs8fLvj?AmHGPVQnZ3oGkGyW#<0n!x>Ym8lj+|u(Qrixy zjHP(;J&sz@{@GQWSk}}fIp$#AGJ~1)NH8&;NvPOu;M9+Eqld0-cxi9^LSj!c`u^1q zUWZLX381h|m;n@$%hgXzN z^X-$L0Y3wN2K)^88Th|sU`U_*MW6V6Y&QIex;$BUpik!i(9gfsk6-o5P5jpCli`X! zQK+z%v)d5?R}Wm5Smg&e(F`@43}3EJP;7DiHtZy3!}A1I?9_|-N@X05$?*I{VSX86 zs{`?2EySg22-PkLLMHwnrX5pD3&p|<|qId|p`k8cnT%{eNj)sVz1D|WT z*5R;$28ZkG(CAI4k&un1sK1qnY*@Hb>4D%pfp$hJ{Z-nvsu?VXAL$b}#}0qL*j@t8 zV*BT^{zBGY%K9r=UzGKI_NeNV-hY1(Gh3R3fPaDH`dH7_|3`ikxMbtlP+E5?ao%wIsfnG)tJr(s9wu z4jNiQIO1}MF(z`WnB%cbM#C3eK5lDSVW*5lGmGZqaba1_U0@ku8n6pfGes>FEA6fFs^VJ-eG zu&BY0ikB6?qxgd2_Z5Gjc!Tb*qc?c4bXCQ2fnLA}b)Hzhy zFYHLnj;C+{qAV2BQ5)j=$uYxO~oe$=BMb98n4%h(x@{*foX+8y?*m zrt?1&bb3hl>U4TXcj0soOs9IFP!p=BQ2s4m!_E83oMJs8r)#VaxE{YUmYqv$V%a2D cL;X5%R>11(d&SCzK`s$@ajaP9G +#include +#include + +typedef struct { + short x; + short y; + short z; +} axes; + +int main(int argc, const char * argv[]) { + CFMutableDictionaryRef dict = IOServiceMatching("SMCMotionSensor"); + if(!dict) { + printf("Could not find service\n"); + return 1; + } + + kern_return_t result; + io_connect_t connection; + io_service_t device = 0; + + device = IOServiceGetMatchingService(kIOMasterPortDefault, dict); + if(!device) { + printf("No device\n"); + return 1; + } + + + if(IOServiceOpen(device, mach_task_self(), 0, &connection) != KERN_SUCCESS) { + printf("Could not open device\n"); + return 1; + } + + size_t smc_arg_size = 40; + axes *out_struct = NULL; + + void* smc_in = malloc(smc_arg_size); + memset(smc_in, 1, smc_arg_size); + + void* smc_out = malloc(smc_arg_size); + memset(smc_out, 0, smc_arg_size); + + result = IOConnectCallStructMethod(connection, + 5, + smc_in, + 40, + smc_out, + &smc_arg_size); + if(result != KERN_SUCCESS) { + printf("Could not call struct method\n"); + goto end; + } + + out_struct = (axes*)smc_out; + printf("Success\nAccelerometer reading: { x: %d, y: %d, z: %d }\n", out_struct->x, out_struct->y, out_struct->z); + +end: + free(smc_in); + free(smc_out); + + if(result != KERN_SUCCESS) + return 1; + + return 0; +} +