This function calculates the basic environment for OS scripts in API version 10. Reviewed-by: iustinp