On the mechanism of porous silicon formation