set kernel compiling env & fix some errors