There were pennaceous-feathered, long-bony-tailed primitive birds.
The most basal were flying (eg. scansoriopterygids, tetrapterygids).
Some later ones became secondarily flightless (eg. oviraptors, eudromaeosaurids etc).
These primitive birds have a great deal in common with pterosaurs. They evolved from pterosaurs.
These primitive birds have almost nothing in common with dinosaurs.
Oviraptor (secondarily flightless)