
Scanport is a quick little hack that scans i/o space from 0x100 to 0x3ff
looking for installed ISA devices.

I wrote this because I get quite a few e-mails from people asking how to
"find" their ethernet card when they don't have jumper setting
documentation or some such similar situation.

		************** WARNING: **************

	Reading i/o ports of unknown hardware devices can be risky
	in that it may cause your machine to lock up.

		**************************************

Any devices that have been detected by the kernel already, and registered
their i/o space in /proc/ioports are skipped over and left undisturbed.

Note to module users: If you use a modular device driver, and it isn't
currently loaded, then it won't have an entry in /proc/ioports, and hence
it will be probed by this program. So it is probably wise to load all your 
modules before running this program.

The program also has an internal table of common hardware i/o ports
and provides a guess for a non-vacant i/o port. (A vacant i/o port will
return an 0xff value upon an inb() read of it.)

There is also a DOS binary in the ./dos/ directory, but it doesn't have
the /proc/ioports feature (of course!) and hence ends up reading and
guessing on all ports from 0x100 to 0x3ff, which has more chance of 
hanging your machine.

ELF and a.out binaries are in ./bin-elf and ./bin-a.out repectively.
You need to be root for the iopl() call that allows access to the
i/o ports. The source is in ./src (Whoa, what a surprise...)

The following is sample output from the program. In this case, it
"discovers" the game port and the printer port, as I didn't build
the printer driver into the kernel.

Happy Hardware Probing!
Paul.

---------------------- sample output ------------------------

The following devices are registered above 0x100:
	0x170 -> 0x177		ide1
	0x1f0 -> 0x1f7		ide0
	0x240 -> 0x25f		WD8003
	0x2f8 -> 0x2ff		serial(auto)
	0x330 -> 0x333		aha1542
	0x376 -> 0x376		ide1
	0x3c0 -> 0x3df		vga+
	0x3f0 -> 0x3f5		floppy
	0x3f6 -> 0x3f6		ide0
	0x3f7 -> 0x3f7		floppy DIR
	0x3f8 -> 0x3ff		serial(auto)
and their i/o ports will not be scanned.


	WARNING: Reading i/o ports of some hardware may hang your machine
	You have 5 seconds to hit ^C (control+c) to abort...

Scanning for non 0xff values from 0x100 to 0x400....

Skipping 0x170 -> 0x177		[ ide1 ]
Skipping 0x1f0 -> 0x1f7		[ ide0 ]
Port 0x201 has value 0xfc 	[ maybe: joystick/game port? ]
Skipping 0x240 -> 0x25f		[ WD8003 ]
Skipping 0x2f8 -> 0x2ff		[ serial(auto) ]
Skipping 0x330 -> 0x333		[ aha1542 ]
Skipping 0x376 -> 0x376		[ ide1 ]
Port 0x378 has value 0x0 	[ maybe: 1st printer port? ]
Port 0x379 has value 0x7f 	[ maybe: 1st printer port? ]
Port 0x37a has value 0xe0 	[ maybe: 1st printer port? ]
Port 0x37c has value 0x0 	[ maybe: 1st printer port? ]
Port 0x37d has value 0x7f 	[ maybe: 1st printer port? ]
Port 0x37e has value 0xe0 	[ maybe: 1st printer port? ]
Skipping 0x3c0 -> 0x3df		[ vga+ ]
Skipping 0x3f0 -> 0x3f5		[ floppy ]
Skipping 0x3f6 -> 0x3f6		[ ide0 ]
Skipping 0x3f7 -> 0x3f7		[ floppy DIR ]
Skipping 0x3f8 -> 0x3ff		[ serial(auto) ]

Done.
