Shabbos, Chapter 13, Mishnah 2. This mishnah enters into the fine details of the weaving process, so it is worth beginning with an understanding of how a loom actually works. In order to weave an item back and forth, one must first realize that two separate systems of threads operate on the loom:
The shesi (in English: warp) - the array of threads stretched across the loom before the weaving even begins, all of them running in one direction.
The erev (weft) - the threads that are passed back and forth through the warp threads.
The heddle mechanism:
The loom's mechanism is built of two frames. Along the length of each frame runs a thread or rod, and in the middle of each one is a fixed eyelet that holds every other thread of the warp. When the frame lifts, it raises every other thread with it, and one can then send the weft thread through between the threads and switch the frames. That is how weaving happens: in and out, in and out. The two separate frames operate against one another, each one holding every other thread of the warp.
"Ha'oseh shnei batei nirin b'nirin":
The halachah in the mishnah deals with someone who passes two of the warp threads through those holding threads within the frame - the threads that lift the warp threads. Passing these two threads through is the setting up of the loom, and doing even just two of them is counted among the thirty-nine melachos of Shabbos.
"BeKiros":
The mishnah goes on to include another part of the loom apparatus: passing the two threads through the keres. The keres was an additional item on the loom, a sort of comb. After the weft threads have been passed through in the course of the weaving and now sit between every other thread, up and down, up and down, they must be drawn in and pressed tight against the portion of the cloth that has already been woven. The keres was used for this drawing in, and passing the threads through it is likewise considered a melachah.
"B'nafah, b'chvarah, uv'sal":
The craft of weaving baskets is included as well. The sifter, the sieve and the basket are different types of plaited vessels made through a process of weaving, in which the reeds are interlaced in and out. One who does this is liable for the melachah of weaving.
"V'hatofer shtei tefiros, v'hakorea al menas litpor shtei tefiros":
The mishnah continues and lists further melachos: one who sews two stitches in a garment is liable. So too one who tears a garment - provided that he tore it in order to sew two stitches, meaning that he intends to sew after the tearing. In other words, this is not a tearing done purely to destroy, but a tearing with a constructive purpose, so that the garment can be resewn properly. This too is counted among the melachos.
In summary: in this mishnah we learned the details of the melachah of weaving: we became familiar with the warp and weft systems and with the heddle mechanism of the loom; we saw the liability for "shnei batei nirin" and for passing the threads through the keres; we saw that plaiting a sifter, a sieve and a basket are also included in the melachah of weaving; and we concluded with the melachah of sewing two stitches and of tearing in order to sew two stitches.