Information on shareholder basis can be found in the instructions for Schedule K-1 (Form 1120-S) and Form 7203.
Per IRS Shareholder's Instructions for Schedule K-1 (Form 1120-S) Shareholder's Share of Income, Deductions, Credits, etc. (For Shareholder's Use Only), page 2:
Generally, the deduction for your share of aggregate losses and deductions reported on Schedule K-1 is limited to the basis of your stock and loans from you to the corporation. For details and exceptions, see section 1366(d). The basis of your stock is generally figured at the end of the corporation's tax year. Any losses and deductions not allowed this year because of the basis limit can be carried forward indefinitely and deducted in a later year subject to the basis limit for that year.
You are responsible for keeping the information needed to figure the basis of your stock in the corporation. Schedule K-1 provides information to help you figure your stock basis at the end of each corporate tax year. The basis of your stock (generally, its cost) is adjusted annually as follows and, except as noted, in the order listed. In addition, basis may be adjusted under other provisions of the Internal Revenue Code. You should generally use Form 7203, S Corporation Shareholder Stock and Debt Basis Limitations, to figure your aggregate stock and debt basis.
To navigate to the Form 7203 for Figuring a Shareholder's Stock and Debt Basis:
Note that any link in the information above is updated each year automatically and will take you to the most recent version of the webpage or document at the time it is accessed.