This is the Mons Meg, a super cannon forged in the 15th century as a gift from Philip the Good, Duke of Burgundy to the James II, King of Scotland. The history of this cannon is actually clouded and there are several competing stories about it. Some historians claim it was used to lay siege to the Threave Castle, occupied by the MacClellan Clan. The six ton 406 cm muzzle loading cannon could only be fired a dozen or so times a day due to both the difficulty in loading it and the heat caused by the blast. It was fired for over three centuries mostly in ceremonies and finally left to sit. The wooden undercarriage rotted out and had to be replaced several times.
The cannon was fired just a few years ago, in Edinburgh Castle. It was ignited with a car battery.