Having an expired passport while outside of your home country is very bad! It might even cause problems for you to return to your home country! I would recommend initiating the passport renewal process between 6-12 months before the expiry date so that even with unexpected delays, you'll get a new passport months before the old one would have expired. Also, many countries might not let you visit if your passport is not valid for at least 6 months beyond your date of entry. So, don't leave the passport renewing until the last minute!
When I checked my forms, I never had to submit my passport number or any passport information to my school to get my DS-2019 (same form for I-20 though). But maybe your situation will be different.
If your passport will be expiring very soon (i.e. in the summer, before you start your new program) and you don't want to send it back to your home country for a renewal while you are in the US because you might need it to get a new I-20 etc. then you should really contact the International Office of your new school for advice. They will know exactly what to do and what you need. I would guess that even if you don't have the physical passport with you because you've sent it back to your home country for renewal, having photocopies of the important pages and passport numbers might be enough to process your I-20 paperwork.