As caperjack said. Linux is FOSS (Free and Open Source Software). All source code as well as binary code for most any hardware is available on line free for you to download, install, modify, and use to your heart's content. If you cannot download it, some providers will send you CD's or DVD's with all that you need for free, or for a little $$ to pay for production and mailing.
in my experience the ubuntu extreme was the best a few years ago, and be aware that you have to burn your program to a cd and install it that way, so you will need a burning program as well, burnaware free or some similar will do that job no worries