Surgery

A man presented with fractures of 4th to 10 th ribs and paradoxical respiration after RTA. He is diagnosed to have flail chest and a PaO2 of <70%. Management is