Back in the days of film cameras, we would take a photo of star-trails by taking a single long time exposure of a dark sky. I cant remember the exposure times used, but may have been of the order of 30 mins to an hour or perhaps longer. As long as the sky was dark enough, then we would make the exposure as long as possible. Now in the days of digital cameras it is preferable to take a large number of shorter exposures and stack them all together to form a single image. I believe there are also advantages of better S/N in the final image by stacking numerous shorter exposures, instead of taking one single long exposure.
The way a star-trail stacking algorithm works is very simple. First we select one image as the reference and copy that entire image into an empty stack. Then we take the next image and on a pixel by pixel basis, compare the intensities. If the intensity of a pixel on the new image is greater than the intensity of a pixel on the stack image, then swap that pixel to the stack image. We may also include a threshold to exclude the darker areas. We do this comparison for every pixel, then move on to the next image and repeat the process.
Software can be found on the internet to do this, but I have also incorporated this feature into the StarView software. In fact this feature is the simplest option available in the Starview software. Star-trail tracking is described in the StarView documentation, but in summary, all you have to do is load all the images under "Load Image Files", select the check-boxes on all the photos to be stacked, then go to the Stacking Menu and Select a "star-trail stack" and click stack.