add putchar API & change malloc,rand implementation