Fail Safe Port Allocation for Linux Device Drivers Writing a device driver is a challenging and an adventurous job. Once the device is registered in the driver's init_module routine, the resources for the device should be allocated. One of the main resources for the device is I/O port. The dynamically linked drivers, the developer should be careful to allocate unused range of port addresses for their device.
Compile your own Linux kernel This a really comprehensive article that teaches you how to download , configure, compile and install your own kernel.