transplant non-os ddc code to khsd linux platform