The os-dependent code has been splitted into different files

Signed-off-by: Davide Madrisan <davide.madrisan@gmail.com>