FlexCOS operating system and application logic