Ported block i/o routines from netbsd 1.0.