Answer 1)
If your current system has 8250 driver built as module, just unload it:
$ lsmod | grep 8250
# rmmod 8250-driver-name
(I don't checked the exact name of the driver)
If your current system has 8250 driver built within the kernel (or you are building the Linux kernel for a new system), you must compile the kernel. You must edit your current configuration end remove the driver. You can use:
$ make xconfig
or
$ make menuconfig
for a graphic interface (run one on these commands inside the Linux kernel source).
You can also manually edit the .config
file and remove the driver
CONFIG_SERIAL_8250=n
or compile it as module by setting:
CONFIG_SERIAL_8250=m
(it is not recommended for this driver, read the documentation with xconfig or menuconfig)
If you already have a working configuration file, you can copy it in your kernel source as .config
cp /path/to/you/config/file /path/to/your/kernel/source/.config
then, edit the field CONFIG_SERIAL_8250 as above.
Answer 2) The best example that I can link is the 8250.c driver. But if you want learn how to develop Linux driver, you can read Linux Device Driver