Initial backport of NEWCARD from FreeBSD 5.