Add the weighting and mesurement.
Place the kernel-related source code into kernel dir.