Connect your iPhone 2G to iTunes 7.7 and option-click on "Check for Update" and navigate to the firmware image that you downloaded.
Apple offers this warning:
Normally if you choose to update, the iPhone or iPod touch software is updated but your settings and media are not affected. If your device currently has a software version prior to 2.0 (1.x) and you are updating to software version 2.0 or later, all data on your device will be erased in order to perform install the new software. In this case, iTunes will offer to create a one-time media backup of your device depending on what content is on your device and what content is stored in the iTunes Library you are connected to. You should ensure that you have enough free space on your Mac or PC to accommodate a backup that matches the capacity of your iPhone or iPod touch (4 GB, 8 GB, 16 GB, or 32 GB) if you proceed with the this backup.