Within the Forework is a courtyard known as the Outer Close. To the south-east are Georgian military buildings; the late 18th-century Main Guard House, and the early 19th-century Fort Major's House. The early North Gate, giving access to the Nether Bailey, contained the original castle kitchens, which were probably linked to the Great Hall.
The Great Kitchen which is now visible was constructed later, against the east wall of the castle. However, in 1689 these rooms were infilled to provide gun emplacements. Excavations in the 1920s ascertained the extent of the surviving rooms, and the vaults were reconstructed in 1929.
The small building above the North Gate is traditionally said to have been a mint, known in Scots as the Cunzie Hoose or "coining house". To the west of the Outer Close, the main parts of the castle are arranged around the quadrangular Inner Close: the Royal Palace to the south, the King's Old Building on the west, the Chapel Royal to the north, and the Great Hall to the east.