Renamed os_sync to os and added os.h template file. Also fixed some errors with calling the semaphore functions