We establish connections between two objects, naturally arising in the theory of the Kadomtsev-Petviashvily equation: totally positive Grassmannians and rational degenerations of the M-curves (Riemann surfaces with an anitiholomorphic involutuin and the maximal possible number of real ovals) with a collection of marked points. More precisely, we show that, at least all points from the principal cell of the Grassmannian can be obtained from degenerate M-curves. (Joint work with Simonetta Abenda (Universita degli Studi di Bologna).)