Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jslegendre committed Jun 3, 2019
0 parents commit 51b7bb6
Show file tree
Hide file tree
Showing 19 changed files with 1,575 additions and 0 deletions.
339 changes: 339 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
335 changes: 335 additions & 0 deletions TOSMotionSensor.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
@@ -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 = "<group>"; };
090B57D52293B9BE00879B1B /* TOSMotionSensor.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TOSMotionSensor.cpp; sourceTree = "<group>"; };
090B57D72293B9BE00879B1B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
09288B21229656F10061881A /* TOSMotionSensorClient.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TOSMotionSensorClient.cpp; sourceTree = "<group>"; };
09288B2322965BAA0061881A /* ToshibaHAPS.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ToshibaHAPS.cpp; sourceTree = "<group>"; };
09288B2422965BAA0061881A /* ToshibaHAPS.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = ToshibaHAPS.hpp; sourceTree = "<group>"; };
/* 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 = "<group>";
};
090B57D12293B9BE00879B1B /* Products */ = {
isa = PBXGroup;
children = (
090B57D02293B9BE00879B1B /* TOSMotionSensor.kext */,
);
name = Products;
sourceTree = "<group>";
};
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 = "<group>";
};
/* 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 */;
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 51b7bb6

Please sign in to comment.