The Bill of Rights is patterned after the English Bill of Rights of 1689 and then adapted to the The Virginia Declaration of Rights. Those are the principal sources, and the right to bear arms is in both.
Those who lived through the Revolution had a deep aversion to a standing army because of the conditions imposed by the English before the Revolution with the assistance of a standing army in the Colonies. They supported the militia model, with citizens responding to threats by forming ad hoc units. This is the essentially the ‘posse’ that people see in cowboy movies. A lot of people were also suspicious of ‘select militias’, essentially today’s National Guard, as being too close to a standing army.
NTodd has covered this in posts like this, and has done a lot of research into the contemporary discussions that were taking place as the Constitution and Bill of Rights were being written.
What we have is a compromise in both the Constitution and the Bill of Rights, so there is no one meaning of anything you read in them. In some cases rants took place over single words, and changes were made to get something that would pass. The people involved had their opinions, and the states had their priorities, so many things are purposely vague to avoid offending people and/or states in many places.
Today everyone is talking about guns, but the Second Amendment doesn’t specify any particular type of ‘Arms’. People may have the ‘right to bear arms’, but there has been no outcry over the almost total ban on switchblades in the US. In most states non-lethal stun-guns and chemical sprays are either banned for most people, or heavily regulated. I don’t remember any great discussion over these laws.
All gun owners have done by refusing to negotiate is make it appear that they are on the same side as the whackoes who carry out these massacres, and that is not where you want to be.