added the basis of network autodetect code, and basic event handling in kernel