Port low level

Most important functions added & working
what is TaskFunctionType ? unclear cast and bit shift.