Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround for module errors on macOS #184

Merged
merged 1 commit into from
Mar 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions chipsec/helper/oshelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ def is_windows( self ):
def is_win8_or_greater( self ):
win8_or_greater = self.is_windows() and ( self.os_release.startswith('8') or ('2008Server' in self.os_release) or ('2012Server' in self.os_release) )
return win8_or_greater
def is_macos( self ):
return ('darwin' == self.os_system.lower())


#################################################################################################
Expand Down
40 changes: 37 additions & 3 deletions chipsec/helper/osx/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,14 +197,48 @@ def decompress_file( self, CompressedFileName, OutputFileName, CompressionType )
return chipsec.file.read_file( OutputFileName )



def get_tool_info( self, tool_type ):
raise NotImplementedError()

def read_io_port(self):
#########################################################
# EFI Runtime API
#########################################################

# @TODO: macOS helper doesn't support EFI runtime API yet
def EFI_supported(self):
return False

# Placeholders for EFI Variable API

def delete_EFI_variable(self, name, guid):
raise NotImplementedError()
def native_delete_EFI_variable(self, name, guid):
raise NotImplementedError()

def list_EFI_variables(self):
raise NotImplementedError()
def native_list_EFI_variables(self):
raise NotImplementedError()

def get_EFI_variable(self, name, guid, attrs=None):
raise NotImplementedError()
def native_get_EFI_variable(self, name, guid, attrs=None):
raise NotImplementedError()

def set_EFI_variable(self, name, guid, data, datasize, attrs=None):
raise NotImplementedError()
def native_set_EFI_variable(self, name, guid, data, datasize, attrs=None):
raise NotImplementedError()


#########################################################
# Port I/O
#########################################################

def read_io_port(self, io_port, size):
raise NotImplementedError()

def write_io_port(self):
def write_io_port(self, io_port, value, size):
raise NotImplementedError()

def read_cr(self, cpu_thread_id, cr_number):
Expand Down
5 changes: 4 additions & 1 deletion chipsec/modules/common/bios_smi.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ def __init__(self):
self.iobar = iobar.IOBAR(self.cs)

def is_supported(self):
return (self.cs.get_chipset_id() not in chipsec.chipset.CHIPSET_FAMILY_ATOM)
# @TODO: currently, this module cannot run on macOS
if self.cs.helper.is_macos(): return False

return (not self.cs.is_atom())

def check_SMI_locks(self):

Expand Down
6 changes: 4 additions & 2 deletions chipsec/modules/common/ia32cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ def __init__(self):
self.res = ModuleResult.PASSED

def is_supported(self):
if self.cs.is_atom(): return False
else: return True
# @TODO: currently, this module cannot run on macOS
if self.cs.helper.is_macos(): return False

return (not self.cs.is_atom())

def check_ia32feature_control(self):
self.logger.start_test( "IA32 Feature Control Lock" )
Expand Down
2 changes: 2 additions & 0 deletions chipsec/modules/common/smrr.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ def __init__(self):
BaseModule.__init__(self)

def is_supported(self):
# @TODO: currently, this module cannot run on macOS
if self.cs.helper.is_macos(): return False
return True

#
Expand Down
2 changes: 2 additions & 0 deletions chipsec/modules/smm_dma.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ def __init__(self):
BaseModule.__init__(self)

def is_supported(self):
# @TODO: currently, this module cannot run on macOS
if self.cs.helper.is_macos(): return False
if self.cs.is_atom(): return False
if self.cs.is_server(): return False
else: return True
Expand Down