talk to the vendor of the mag stripe reader, for a start. additionally, many of them ship with a driver which redirects the mag stripe data to stdin. this will be a native driver, so moving your code from platform to platform will be trickier, but for an app. that's reading credit cards, this isn't often an issue anyway. not many people decide to suddenly port their PoS app to another OS halfway through a project! (but I've seen it done)