more changes for compiling under kernel