made sync work on osx and ios
made sync work on osx and ios more
hal_open osx
implemented hal_open in ios