works in progress based on illumos