Search This Blog

Monday, June 23, 2025

Pythagoras

From Wikipedia, the free encyclopedia
 
Pythagoras
Marble bust of a man with a long, pointed beard, wearing a tainia, a kind of ancient Greek headcovering in this case resembling a turban. The face is somewhat gaunt and has prominent, but thin, eyebrows, which seem halfway fixed into a scowl. The ends of his mustache are long a trail halfway down the length of his beard to about where the bottom of his chin would be if we could see it. None of the hair on his head is visible, since it is completely covered by the tainia.
Bust of Pythagoras of Samos in theCapitoline Museums, Rome

Pythagoras of Samos (Ancient Greek: Πυθαγόρας; c. 570 – c. 495 BC) was an ancient Ionian Greek philosopher, polymath, and the eponymous founder of Pythagoreanism. His political and religious teachings were well known in Magna Graecia and influenced the philosophies of Plato, Aristotle, and, through them, Western philosophy. Modern scholars disagree regarding Pythagoras's education and influences, but most agree that he travelled to Croton in southern Italy around 530 BC, where he founded a school in which initiates were allegedly sworn to secrecy and lived a communal, ascetic lifestyle.

In antiquity, Pythagoras was credited with mathematical and scientific discoveries, such as the Pythagorean theorem, Pythagorean tuning, the five regular solids, the theory of proportions, the sphericity of the Earth, the identity of the morning and evening stars as the planet Venus, and the division of the globe into five climatic zones. He was reputedly the first man to call himself a philosopher ("lover of wisdom"). Historians debate whether Pythagoras made these discoveries and pronouncements, as some of the accomplishments credited to him likely originated earlier or were made by his colleagues or successors, such as Hippasus and Philolaus.

The teaching most securely identified with Pythagoras is the "transmigration of souls" or metempsychosis, which holds that every soul is immortal and, upon death, enters into a new body. He may have also devised the doctrine of musica universalis, which holds that the planets move according to mathematical ratios and thus resonate to produce an inaudible symphony of music. Following Croton's decisive victory over Sybaris in around 510 BC, Pythagoras's followers came into conflict with supporters of democracy, and their meeting houses were burned. Pythagoras may have been killed during this persecution, or he may have escaped to Metapontum and died there.

Pythagoras influenced Plato whose dialogues (especially Timaeus) exhibit Pythagorean ideas. A major revival of his teachings occurred in the first century BC among Middle Platonists, coinciding with the rise of Neopythagoreanism. Pythagoras continued to be regarded as a great philosopher throughout the Middle Ages and Pythagoreanism had an influence on scientists such as Nicolaus Copernicus, Johannes Kepler, and Isaac Newton. Pythagorean symbolism was also used throughout early modern European esotericism, and his teachings as portrayed in Ovid's Metamorphoses would later influence the modern vegetarian movement.

Life

No authentic writings of Pythagoras have survived, and almost nothing is known for certain about his life. The earliest sources on Pythagoras's life, from Xenophanes, Heraclitus, Empedocles, Ion of Chios, and Herodotus are brief, ambiguous, and often satirical. The major sources on Pythagoras's life are three biographies from late antiquity written by Diogenes Laërtius, Porphyry, and Iamblichus, all of which are filled primarily with myths and legends and which become longer and more fantastic in their descriptions of Pythagoras's achievements the more removed they are from Pythagoras's times. However, Porphyry and Iamblichus also used some material taken from earlier writings in the 4th century BC by Aristotle's students Dicaearchus, Aristoxenus, and Heraclides Ponticus, which, when it can be identified, is generally considered to be the most reliable.

Early life

There is not a single detail in the life of Pythagoras that stands uncontradicted. But it is possible, from a more or less critical selection of the data, to construct a plausible account.

— Walter Burkert, 1972

Herodotus and Isocrates agree that Pythagoras was the son of Mnesarchus, and that he was born on the Greek island of Samos in the eastern Aegean. Mnesarchus is said to have been a gem-engraver or a wealthy merchant but his ancestry is disputed and unclear. Apollonius of Tyana writes that Pythagoras's mother was Pythaïs, who was said to be a descendant of Ancaeus, the mythical founder of Samos. Iamblichus tells the story that the Pythia prophesied to her while she was pregnant with him that she would give birth to a man supremely beautiful, wise, and beneficial to humankind. As to the date of his birth, Aristoxenus stated that Pythagoras left Samos in the reign of Polycrates, at the age of 40, which would give a date of birth around 570 BC. Pythagoras's name led him to be associated with Pythian Apollo (Pūthíā); Aristippus of Cyrene in the 4th century BC explained his name by saying, "He spoke [ἀγορεύω, agoreúō] the truth no less than did the Pythian [πυθικός puthikós]".

During Pythagoras's formative years, Samos was a thriving cultural hub known for its feats of advanced architectural engineering, including the building of the Tunnel of Eupalinos, and for its riotous festival culture. It was a major center of trade in the Aegean where traders brought goods from the Near East. According to Christiane L. Joost-Gaugier, these traders almost certainly brought with them Near Eastern ideas and traditions. Pythagoras's early life also coincided with the flowering of early Ionian natural philosophy. He was a contemporary of the philosophers Anaximander, Anaximenes, and the historian Hecataeus, all of whom lived in Miletus, across the sea from Samos.

Reputed travels

Modern scholarship has shown that the culture of Archaic Greece was heavily influenced by those of Levantine and Mesopotamian cultures, which appears to have been recognized by authors later in the Classical and Hellenistic periods, who attributed many of Pythagoras' unusual and unconventional beliefs to invented travels to far off lands, where he learned from those people himself. The doctrine of metempsychosis, or reincarnation of the soul after death, which Herodotus had mistakenly attributed to the Egyptians, led to an elaborate tale where Pythagoras learned the Egyptian language from the Pharaoh Amasis II himself, and then traveled to study with the Egyptian priests at Diospolis (Thebes), where he was the only foreigner ever to be granted the privilege of taking part in their worship. Other ancient writers, however, claimed that Pythagoras had learned these teachings from the Magi in Persia or even from Zoroaster himself. The Phoenicians are also reputed to have taught Pythagoras arithmetic and the Chaldeans to have taught him astronomy. By the third century BC, Pythagoras was already reported to have studied under the Jews as well. By the third century AD, Pythagoras was also reported by Philostratus to have studied under sages or gymnosophists in India, and, according to Iamblichus, also with the Celts and Iberians.

Alleged Greek teachers

Ancient sources also record Pythagoras having studied under a variety of native Greek thinkers. Diogenes Laërtius asserts that Pythagoras later visited Crete, where he went to the Cave of Ida with Epimenides. Some identify Hermodamas of Samos as a possible tutor. Hermodamas represented the indigenous Samian rhapsodic tradition and his father Creophylos was said to have been the host of his rival poet Homer. Others credit Bias of Priene, Thales, or Anaximander (a pupil of Thales). Other traditions claim the mythic bard Orpheus as Pythagoras's teacher, thus representing the Orphic Mysteries. The Neoplatonists wrote of a "sacred discourse" Pythagoras had written on the gods in the Doric Greek dialect, which they believed had been dictated to Pythagoras by the Orphic priest Aglaophamus upon his initiation to the orphic Mysteries at Leibethra. Iamblichus credited Orpheus with having been the model for Pythagoras's manner of speech, his spiritual attitude, and his manner of worship. Iamblichus describes Pythagoreanism as a synthesis of everything Pythagoras had learned from Orpheus, from the Egyptian priests, from the Eleusinian Mysteries, and from other religious and philosophical traditions. Contradicting all these reports, the novelist Antonius Diogenes, writing in the second century BC, reports that Pythagoras discovered all his doctrines himself by interpreting dreams. Riedweg states that, although these stories are fanciful, Pythagoras's teachings were definitely influenced by Orphism to a noteworthy extent.

Of the various Greek sages claimed to have taught Pythagoras, Pherecydes of Syros is mentioned most often. Similar miracle stories were told about both Pythagoras and Pherecydes, including one in which the hero predicts a shipwreck, one in which he predicts the conquest of Messina, and one in which he drinks from a well and predicts an earthquake. Apollonius Paradoxographus, a paradoxographer who may have lived in the second century BC, identified Pythagoras's thaumaturgic ideas as a result of Pherecydes's influence. Another story, which may be traced to the Neopythagorean philosopher Nicomachus, tells that, when Pherecydes was old and dying on the island of Delos, Pythagoras returned to care for him and pay his respects. Duris, the historian and tyrant of Samos, is reported to have patriotically boasted of an epitaph supposedly penned by Pherecydes which declared that Pythagoras's wisdom exceeded his own. On the grounds of all these references connecting Pythagoras with Pherecydes, Riedweg concludes that there may well be some historical foundation to the tradition that Pherecydes was Pythagoras's teacher. Pythagoras and Pherecydes also appear to have shared similar views on the soul and the teaching of metempsychosis.

In Croton

Porphyry repeats an account from Antiphon, who reported that, while he was still on Samos, Pythagoras founded a school known as the "semicircle". Here, Samians debated matters of public concern. Supposedly, the school became so renowned that the brightest minds in all of Greece came to Samos to hear Pythagoras teach. Pythagoras himself dwelled in a secret cave, where he studied in private and occasionally held discourses with a few of his close friends. Christoph Riedweg, a German scholar of early Pythagoreanism, states that it is entirely possible Pythagoras may have taught on Samos, but cautions that Antiphon's account, which makes reference to a specific building that was still in use during his own time, appears to be motivated by Samian patriotic interest.

Around 530 BC, when Pythagoras was about forty years old, he left Samos. His later admirers claimed that he left because he disagreed with the tyranny of Polycrates in Samos; Riedweg notes that this explanation closely aligns with Nicomachus's emphasis on Pythagoras's purported love of freedom, but that Pythagoras's enemies portrayed him as having a proclivity towards tyranny. Other accounts claim that Pythagoras left Samos because he was so overburdened with public duties in Samos, because of the high estimation in which he was held by his fellow-citizens. He arrived in the Greek colony of Croton (today's Crotone, in Calabria) in what was then Magna Graecia. All sources agree that Pythagoras was charismatic and quickly acquired great political influence in his new environment. He served as an advisor to the elites in Croton and gave them frequent advice. Later biographers tell fantastical stories of the effects of his eloquent speeches in leading the people of Croton to abandon their luxurious and corrupt way of life and devote themselves to the purer system which he came to introduce.

Family and friends

Suda writes that Pythagoras had 4 children (Telauges, Mnesarchus, Myia and Arignote). The wrestler Milo of Croton was said to have been a close associate of Pythagoras and was credited with having saved the philosopher's life when a roof was about to collapse. This association may have been the result of confusion with a different man named Pythagoras, who was an athletics trainer.

Death

Pythagoras's emphasis on dedication and asceticism are credited with aiding in Croton's decisive victory over the neighboring colony of Sybaris in 510 BC. After the victory, some prominent citizens of Croton proposed a democratic constitution, which the Pythagoreans rejected. The supporters of democracy, headed by Cylon and Ninon, the former of whom is said to have been irritated by his exclusion from Pythagoras's brotherhood, roused the populace against them. Followers of Cylon and Ninon attacked the Pythagoreans during one of their meetings, either in the house of Milo or in some other meeting-place. Accounts of the attack are often contradictory and many probably confused it with the later anti-Pythagorean rebellions, such as the one in Metapontum in 454 BC. The building was apparently set on fire, and many of the assembled members perished; only the younger and more active members managed to escape.

Sources disagree regarding whether Pythagoras was present when the attack occurred and, if he was, whether or not he managed to escape. In some accounts, Pythagoras was not at the meeting when the Pythagoreans were attacked because he was on Delos tending to the dying Pherecydes. According to another account from Dicaearchus, Pythagoras was at the meeting and managed to escape, leading a small group of followers to the nearby city of Locris, where they pleaded for sanctuary, but were denied. They reached the city of Metapontum, where they took shelter in the temple of the Muses and died there of starvation after forty days without food. Another tale recorded by Porphyry claims that, as Pythagoras's enemies were burning the house, his devoted students laid down on the ground to make a path for him to escape by walking over their bodies across the flames like a bridge. Pythagoras managed to escape, but was so despondent at the deaths of his beloved students that he committed suicide. A different legend reported by both Diogenes Laërtius and Iamblichus states that Pythagoras almost managed to escape, but that he came to a fava bean field and refused to run through it, since doing so would violate his teachings, so he stopped instead and was killed. This story seems to have originated from the writer Neanthes, who told it about later Pythagoreans, not about Pythagoras himself.

Teachings

Metempsychosis

Although the exact details of Pythagoras's teachings are uncertain, it is possible to reconstruct a general outline of his main ideas. Aristotle writes at length about the teachings of the Pythagoreans, but without mentioning Pythagoras directly. One of Pythagoras's main doctrines appears to have been metempsychosis, the belief that all souls are immortal and that, after death, a soul is transferred into a new body. This teaching is referenced by Xenophanes, Ion of Chios, and Herodotus. The earliest source on Pythagoras's metempsychosis is a satirical poem probably written after his death by the Greek philosopher Xenophanes of Colophon (c. 570 – c. 478 BC), who had been one of his contemporaries, in which Xenophanes describes Pythagoras interceding on behalf of a dog that is being beaten, professing to recognize in its cries the voice of a departed friend. Nothing whatsoever, however, is known about the nature or mechanism by which Pythagoras believed metempsychosis to occur.

Empedocles alludes in one of his poems that Pythagoras may have claimed to possess the ability to recall his former incarnations. Diogenes Laërtius reports an account from Heraclides Ponticus that Pythagoras told people that he had lived four previous lives that he could remember in detail. The first of these lives was as Aethalides the son of Hermes, who granted him the ability to remember all his past incarnations. Next, he was incarnated as Euphorbus, a minor hero from the Trojan War briefly mentioned in the Iliad. He then became the philosopher Hermotimus, who recognized the shield of Euphorbus in the temple of Apollo. His final incarnation was as Pyrrhus, a fisherman from Delos. One of his past lives, as reported by Dicaearchus, was as a beautiful courtesan.

Numerology

Diagram showing the tetractys, an equilateral triangle made up of ten dots, with one dot in the top row, two in the second, three in the third, and four in the bottom.
Pythagoras is credited with having devised the tetractys, an important sacred symbol in later Pythagoreanism.

Another belief attributed to Pythagoras was that of the "harmony of the spheres", which maintained that the planets and stars move according to mathematical equations, which correspond to musical notes and thus produce an inaudible symphony. According to Porphyry, Pythagoras taught that the seven Muses were actually the seven planets singing together.

The so-called Pythagoreans applied themselves to mathematics, and were the first to develop this science; and through studying it they came to believe that its principles are the principles of everything.

— Aristot. Met. 1, 985b

Modern scholars typically ascribe these discoveries to the later Pythagorean philosopher Philolaus of Croton (c. 470 – c. 385 BC), whose extant fragments are the earliest texts to describe the numerological and musical theories that were later ascribed to Pythagoras. In his landmark study Lore and Science in Ancient Pythagoreanism, Walter Burkert argues that Pythagoras was a charismatic political and religious teacher, but that the number philosophy attributed to him was really an innovation by Philolaus. According to Burkert, Pythagoras never dealt with numbers at all, let alone made any noteworthy contribution to mathematics. Burkert argues that the only mathematics the Pythagoreans ever actually engaged in was simple, proofless arithmetic, but that these arithmetic discoveries did contribute significantly to the beginnings of mathematics. For the later Pythagoreans, Pythagoras was credited with devising the tetractys, the triangular figure of four rows which add up to the "perfect" number, ten. The Pythagoreans regarded the tetractys as a symbol of utmost mystical importance. Iamblichus, in his Life of Pythagoras, states that the tetractys was "so admirable, and so divinised by those who understood [it]," that Pythagoras's students would swear oaths by it.

This shouldn't be confused with a simplified version known today as "Pythagorean numerology", involving a variant of an isopsephic technique known – among other names – as pythmenes 'roots' or 'base numbers', by means of which the base values of letters in a word were mathematically reduced by addition or division, in order to obtain a single value from one to nine for the whole name or word.

Pythagoreanism

Communal lifestyle

Painting showing a group of people dressed in white classical garb standing at the edge of a cliff overlooking the sea watching as the sun rises. The central figure, probably Pythagoras himself, is turned away from our view towards the sunrise. He has long braids and his long beard is partially visible from the side. Both of his arms are raised into the air. The three men closest to him, two on his left and one on his right, are kneeling and making frantic gestures, possibly weeping. Behind them, an older man plays a harp and two women play lyres. A young man without a beard and an middle-aged man with a beard play lyres as well, while another young man plays the aulos. A man in the foreground at the back of the group kneels prayerfully towards the sunrise. In the background, at the far left side of the painting, a woman, a girl, a boy, and a young, naked child watch the Pythagoreans. The woman and the girl are carrying pots, indicating they have been fetching water.
Pythagoreans Celebrate the Sunrise (1869) by Fyodor Bronnikov

Both Plato and Isocrates state that, above all else, Pythagoras was known as the founder of a new way of life. The organization Pythagoras founded at Croton was called a "school", but, in many ways, resembled a monastery. The adherents were bound by a vow to Pythagoras and each other, for the purpose of pursuing the religious and ascetic observances, and of studying his religious and philosophical theories. The members of the sect shared all their possessions in common and were devoted to each other to the exclusion of outsiders. Ancient sources record that the Pythagoreans ate meals in common after the manner of the Spartans. One Pythagorean maxim was "koinà tà phílōn" ("All things in common among friends"). Both Iamblichus and Porphyry provide detailed accounts of the organization of the school, although the primary interest of both writers is not historical accuracy, but rather to present Pythagoras as a divine figure, sent by the gods to benefit mankind. Iamblichus, in particular, presents the "Pythagorean Way of Life" as a pagan alternative to the Christian monastic communities of his own time. For Pythagoreans, the highest reward humans could attain was for their soul to join in the life of the gods and thus escape the cycle of reincarnation. Two groups existed within early Pythagoreanism: the mathematikoi ("learners") and the akousmatikoi ("listeners"). The akousmatikoi are traditionally identified by scholars as "old believers" in mysticism, numerology, and religious teachings; whereas the mathematikoi are traditionally identified as a more intellectual, modernist faction who were more rationalist and scientific. Gregory cautions that there was probably not a sharp distinction between them and that many Pythagoreans probably believed the two approaches were compatible. The study of mathematics and music may have been connected to the worship of Apollo. The Pythagoreans believed that music was a purification for the soul, just as medicine was a purification for the body. One anecdote of Pythagoras reports that when he encountered some drunken youths trying to break into the home of a virtuous woman, he sang a solemn tune with long spondees and the boys' "raging willfulness" was quelled. The Pythagoreans also placed particular emphasis on the importance of physical exercise; therapeutic dancing, daily morning walks along scenic routes, and athletics were major components of the Pythagorean lifestyle. Moments of contemplation at the beginning and end of each day were also advised.

Prohibitions and regulations

Old manuscript illustration showing a cloaked and hooded man labelled "Pythagoras" raising his arms and turning his face away from a fava bean plant, labelled "Fabe."
French manuscript from 1512/1514, showing Pythagoras turning his face away from fava beans in revulsion

Pythagorean teachings were known as "symbols" (symbola) and members took a vow of silence that they would not reveal these symbols to non-members. Those who did not obey the laws of the community were expelled and the remaining members would erect tombstones for them as though they had died. A number of "oral sayings" (akoúsmata) attributed to Pythagoras have survived, dealing with how members of the Pythagorean community should perform sacrifices, how they should honor the gods, how they should "move from here", and how they should be buried. Many of these sayings emphasize the importance of ritual purity and avoiding defilement. Other extant oral sayings forbid Pythagoreans from breaking bread, poking fires with swords, or picking up crumbs and teach that a person should always put the right sandal on before the left. The exact meanings of these sayings, however, are frequently obscure. Iamblichus preserves Aristotle's descriptions of the original, ritualistic intentions behind a few of these sayings, but these apparently later fell out of fashion, because Porphyry provides markedly different ethical-philosophical interpretations of them:

Pythagorean saying Original ritual purpose according to Aristotle/Iamblichus Porphyry's philosophical interpretation
"Do not take roads traveled by the public." "Fear of being defiled by the impure" "with this he forbade following the opinions of the masses, yet to follow the ones of the few and the educated".
"and [do] not wear images of the gods on rings" "Fear of defiling them by wearing them." "One should not have the teaching and knowledge of the gods quickly at hand and visible [for everyone], nor communicate them to the masses."
"and pour libations for the gods from a drinking cup's handle [the 'ear']" "Efforts to keep the divine and the human strictly separate" "thereby he enigmatically hints that the gods should be honored and praised with music; for it goes through the ears".

New initiates were allegedly not permitted to meet Pythagoras until after they had completed a five-year initiation period, during which they were required to remain silent. Sources indicate that Pythagoras himself was unusually progressive in his attitudes towards women and female members of Pythagoras's school appear to have played an active role in its operations. Iamblichus provides a list of 235 famous Pythagoreans, seventeen of whom are women. In later times, many prominent female philosophers contributed to the development of Neopythagoreanism.

Pythagoreanism also entailed a number of dietary prohibitions. It is more or less agreed that Pythagoras issued a prohibition against the consumption of fava beans and the meat of non-sacrificial animals such as fish and poultry. Both of these assumptions, however, have been contradicted. Pythagorean dietary restrictions may have been motivated by belief in the doctrine of metempsychosis; alternatively, they may be based on the genetic prevalence of favism, a type of enzyme deficiency anemia, in the Mediterranean. Some ancient writers present Pythagoras as enforcing a strictly vegetarian diet. Eudoxus of Cnidus, a student of Archytas, writes, "Pythagoras was distinguished by such purity and so avoided killing and killers that he not only abstained from animal foods, but even kept his distance from cooks and hunters." Other authorities contradict this statement. According to Aristoxenus, Pythagoras allowed the use of all kinds of animal food except the flesh of oxen used for ploughing, and rams. According to Heraclides Ponticus, Pythagoras ate the meat from sacrifices and established a diet for athletes dependent on meat.

Legends

Within his own lifetime, Pythagoras was already the subject of elaborate hagiographic legends. Aristotle described Pythagoras as a wonder-worker and somewhat of a supernatural figure. In a fragment, Aristotle writes that Pythagoras had a golden thigh, which he publicly exhibited at the Olympic Games and showed to Abaris the Hyperborean as proof of his identity as the "Hyperborean Apollo". Supposedly, the priest of Apollo gave Pythagoras a magic arrow, which he used to fly over long distances and perform ritual purifications. He was supposedly once seen at both Metapontum and Croton at the same time. When Pythagoras crossed the river Kosas (the modern-day Basento), "several witnesses" reported that they heard it greet him by name. In Roman times, a legend claimed that Pythagoras was the son of Apollo.

Pythagoras was said to have dressed all in white. He is also said to have borne a golden wreath atop his head and to have worn trousers after the fashion of the Thracians. Pythagoras was said to have had extraordinary success in dealing with animals. A fragment from Aristotle records that, when a deadly snake bit Pythagoras, he bit it back and killed it. Both Porphyry and Iamblichus report that Pythagoras once persuaded a bull not to eat fava beans and that he once convinced a notoriously destructive bear to swear that it would never harm a living thing again, and that the bear kept its word. Riedweg suggests that Pythagoras may have personally encouraged these legends, but Gregory states that there is no direct evidence of this.

Attributed discoveries

In mathematics

Diagram illustrating the Pythagorean theorem
The Pythagorean theorem: The sum of the areas of the two squares on the legs (a and b) equals the area of the square on the hypotenuse (c).

Although Pythagoras is most famous today for his alleged mathematical discoveries, classical historians dispute whether he himself ever actually made any significant contributions to the field. Many mathematical and scientific discoveries were attributed to Pythagoras, including his famous theorem, as well as discoveries in the fields of musicastronomy, and medicine. Since at least the first century BC, Pythagoras has commonly been given credit for discovering the Pythagorean theorem, a theorem in geometry that states that "in a right-angled triangle the square of the hypotenuse is equal [to the sum of] the squares of the two other sides"—that is, . According to a popular legend, after he discovered this theorem, Pythagoras sacrificed an ox, or possibly even a whole hecatomb, to the gods. Cicero rejected this story as spurious because of the much more widely held belief that Pythagoras forbade blood sacrifices. Porphyry attempted to explain the story by asserting that the ox was actually made of dough.

The Pythagorean theorem was known and used by the Babylonians and Indians centuries before Pythagoras, and Burkert rejects the suggestion that Pythagoras had anything to do with it, noting that Pythagoras was never credited with having proved any theorem in antiquity. Furthermore, the manner in which the Babylonians employed Pythagorean numbers implies that they knew that the principle was generally applicable, and knew some kind of proof, which has not yet been found in the (still largely unpublished) cuneiform sources.

In music

Woodcut showing four scenes. In the upper right scene, blacksmiths are pounding with hammers. In the upper left scene, a man labelled "Pitagora" is shown playing different-sized bells and glasses with different amounts of liquid in them. Both the bells and glasses are labelled. In the bottom left scene, "Pitagora" is striking chords of different length laid out across a table, once again, all of which have numbers labels. In the bottom right scene, "Pitagora" and another man labeled "Phylolavs" are shown playing auloi.
Late medieval woodcut from Franchino Gafurio's Theoria musice (1492), showing Pythagoras with bells and other instruments in Pythagorean tuning

According to legend, Pythagoras discovered that musical notes could be translated into mathematical equations when he passed blacksmiths at work one day and heard the sound of their hammers clanging against the anvils. Thinking that the sounds of the hammers were beautiful and harmonious, except for one, he rushed into the blacksmith shop and began testing the hammers. He then realized that the tune played when the hammer struck was directly proportional to the size of the hammer and therefore concluded that music was mathematical.

In astronomy

In ancient times, Pythagoras and his contemporary Parmenides of Elea were both credited with having been the first to teach that the Earth was spherical, the first to divide the globe into five climatic zones, and the first to identify the morning star and the evening star as the same celestial object (now known as Venus). Of the two philosophers, Parmenides has a much stronger claim to having been the first and the attribution of these discoveries to Pythagoras seems to have possibly originated from a pseudepigraphal poem. Empedocles, who lived in Magna Graecia shortly after Pythagoras and Parmenides, knew that the earth was spherical. By the end of the fifth century BC, this fact was universally accepted among Greek intellectuals.

Later influence in antiquity

On Greek philosophy

Sizeable Pythagorean communities existed in Magna Graecia, Phlius, and Thebes during the early fourth century BC. Around the same time, the Pythagorean philosopher Archytas was highly influential on the politics of the city of Tarentum in Magna Graecia. According to later tradition, Archytas was elected as strategos ("general") seven times, even though others were prohibited from serving more than a year. Archytas was also a renowned mathematician and musician. He was a close friend of Plato and he is quoted in Plato's Republic. Aristotle states that the philosophy of Plato was heavily dependent on the teachings of the Pythagoreans. Cicero repeats this statement, remarking that Platonem ferunt didicisse Pythagorea omnia ("They say Plato learned all things Pythagorean"). According to Charles H. Kahn, Plato's middle dialogues, including Meno, Phaedo, and The Republic, have a strong "Pythagorean coloring", and his last few dialogues (particularly Philebus and Timaeus) are extremely Pythagorean in character.

The poet Heraclitus of Ephesus (fl.c. 500 BC), who was born a few miles across the sea from Samos and may have lived within Pythagoras's lifetime, mocked Pythagoras as a clever charlatan, remarking that "Pythagoras, son of Mnesarchus, practiced inquiry more than any other man, and selecting from these writings he manufactured a wisdom for himself—much learning, artful knavery." Alcmaeon of Croton (fl.c. 450 BC), a doctor who lived in Croton at around the same time Pythagoras lived there, incorporates many Pythagorean teachings into his writings and alludes to having possibly known Pythagoras personally. The Greek poets Ion of Chios (c. 480 – c. 421 BC) and Empedocles of Acragas (c. 493 – c. 432 BC) both express admiration for Pythagoras in their poems.

According to R. M. Hare, Plato's Republic may be partially based on the "tightly organised community of like-minded thinkers" established by Pythagoras at Croton. Additionally, Plato may have borrowed from Pythagoras the idea that mathematics and abstract thought are a secure basis for philosophy, science, and morality. Plato and Pythagoras shared a "mystical approach to the soul and its place in the material world" and both were probably influenced by Orphism. The historian of philosophy Frederick Copleston states that Plato probably borrowed his tripartite theory of the soul from the Pythagoreans.

A revival of Pythagorean teachings occurred in the first century BC when Middle Platonist philosophers such as Eudorus and Philo of Alexandria hailed the rise of a "new" Pythagoreanism in Alexandria. At around the same time, Neopythagoreanism became prominent. The first-century AD philosopher Apollonius of Tyana sought to emulate Pythagoras and live by Pythagorean teachings. The later first-century Neopythagorean philosopher Moderatus of Gades expanded on Pythagorean number philosophy and probably understood the soul as a "kind of mathematical harmony". The Neopythagorean mathematician and musicologist Nicomachus likewise expanded on Pythagorean numerology and music theory. Numenius of Apamea interpreted Plato's teachings in light of Pythagorean doctrines.

On art and architecture

Painting showing a massive room with a high, domed ceiling. A hole is open at the top of the dome. Columns and statues line the walls.
Hadrian's Pantheon in Rome, depicted in this eighteenth-century painting by Giovanni Paolo Panini, was built according to Pythagorean teachings.

The oldest known building designed according to Pythagorean teachings is the Porta Maggiore Basilica, a subterranean basilica which was built during the reign of the Roman emperor Nero as a secret place of worship for Pythagoreans. The basilica was built underground because of the Pythagorean emphasis on secrecy and also because of the legend that Pythagoras had sequestered himself in a cave on Samos. The basilica's apse is in the east and its atrium in the west out of respect for the rising sun. It has a narrow entrance leading to a small pool where the initiates could purify themselves. The building is also designed according to Pythagorean numerology, with each table in the sanctuary providing seats for seven people. Three aisles lead to a single altar, symbolizing the three parts of the soul approaching the unity of Apollo. The apse depicts a scene of the poet Sappho leaping off the Leucadian cliffs, clutching her lyre to her breast, while Apollo stands beneath her, extending his right hand in a gesture of protection, symbolizing Pythagorean teachings about the immortality of the soul. The interior of the sanctuary is almost entirely white because the color white was regarded by Pythagoreans as sacred.

The emperor Hadrian's Pantheon in Rome was also built based on Pythagorean numerology. The temple's circular plan, central axis, hemispherical dome, and alignment with the four cardinal directions symbolize Pythagorean views on the order of the universe. The single oculus at the top of the dome symbolizes the monad and the sun-god Apollo. The twenty-eight ribs extending from the oculus symbolize the moon, because twenty-eight was the same number of months on the Pythagorean lunar calendar. The five coffered rings beneath the ribs represent the marriage of the sun and moon.

In early Christianity

Many early Christians had a deep respect for Pythagoras. Eusebius (c. 260 – c. 340 AD), bishop of Caesarea, praises Pythagoras in his Against Hierokles for his rule of silence, his frugality, his "extraordinary" morality, and his wise teachings. In another work, Eusebius compares Pythagoras to Moses. In one of his letters, the Church Father Jerome (c. 347 – c. 420 AD) praises Pythagoras for his wisdom and, in another letter, he credits Pythagoras for his belief in the immortality of the soul, which he suggests Christians inherited from him. Augustine of Hippo (354–430 AD) rejected Pythagoras's teaching of metempsychosis without explicitly naming him, but otherwise expressed admiration for him. In On the Trinity, Augustine lauds the fact that Pythagoras was humble enough to call himself a philosophos or "lover of wisdom" rather than a "sage". In another passage, Augustine defends Pythagoras's reputation, arguing that Pythagoras certainly never taught the doctrine of metempsychosis.

Influence after antiquity

In the Middle Ages

Medieval carving of a man with long hair and a long beard hunched over a musical instrument he is working on
Pythagoras appears in a relief sculpture on one of the archivolts over the right door of the west portal at Chartres Cathedral.

During the Middle Ages, Pythagoras was revered as the founder of mathematics and music, two of the Seven Liberal Arts. He appears in numerous medieval depictions, in illuminated manuscripts and in the relief sculptures on the portal of the Cathedral of Chartres. The Timaeus was the only dialogue of Plato to survive in Latin translation in western Europe, which led William of Conches (c. 1080–1160) to declare that Plato was Pythagorean. A large-scale translation movement emerged during the Abbasid Caliphate, translating many Greek texts into Arabic. Works ascribed to Pythagoras included the "Golden Verses" and snippets of his scientific and mathematical theories. By translating and disseminating Pythagorean texts, Islamic scholars ensured their survival and wider accessibility. This preserved knowledge that might have otherwise been lost through the decline of the Roman Empire and the neglect of classical learning in Europe. In the 1430s, the Camaldolese friar Ambrose Traversari translated Diogenes Laërtius's Lives and Opinions of Eminent Philosophers from Greek into Latin and, in the 1460s, the philosopher Marsilio Ficino translated Porphyry and Iamblichus's Lives of Pythagoras into Latin as well, thereby allowing them to be read and studied by western scholars. In 1494, the Greek Neopythagorean scholar Constantine Lascaris published The Golden Verses of Pythagoras, translated into Latin, with a printed edition of his Grammatica, thereby bringing them to a widespread audience. In 1499, he published the first Renaissance biography of Pythagoras in his work Vitae illustrium philosophorum siculorum et calabrorum, issued in Messina.

On modern science

In his preface to his book On the Revolution of the Heavenly Spheres (1543), Nicolaus Copernicus cites various Pythagoreans as the most important influences on the development of his heliocentric model of the universe, deliberately omitting mention of Aristarchus of Samos, a non-Pythagorean astronomer who had developed a fully heliocentric model in the fourth century BC, in effort to portray his model as fundamentally Pythagorean. Johannes Kepler considered himself to be a Pythagorean. He believed in the Pythagorean doctrine of musica universalis and it was his search for the mathematical equations behind this doctrine that led to his discovery of the laws of planetary motion. Kepler titled his book on the subject Harmonices Mundi (Harmonics of the World), after the Pythagorean teaching that had inspired him. He also called Pythagoras the "grandfather" of all Copernicans.

Albert Einstein believed that a scientist may also be "a Platonist or a Pythagorean insofar as he considers the viewpoint of logical simplicity as an indispensable and effective tool of his research." The English philosopher Alfred North Whitehead argued that "In a sense, Plato and Pythagoras stand nearer to modern physical science than does Aristotle. The two former were mathematicians, whereas Aristotle was the son of a doctor". By this measure, Whitehead declared that Einstein and other modern scientists like him are "following the pure Pythagorean tradition."

On vegetarianism

Painting showing Pythagoras on the far left quizzically stroking his beard as he gazes upon a massive pile of fruits and vegetables. Two followers stand behind him, fully clothed. A man with a greying beard sits at the base of a tree gesturing to the pile of produce. Next to him, a fleshy, nude woman with blonde hair plucks fruits from it. Slightly behind her, two other women, one partially clothed and the other nude but obscured by the tree branch, are also plucking fruits. At the far right end of the painting, two nude, faun-like men with beards and pointed ears hurl more fruits upon the pile.
Pythagoras Advocating Vegetarianism (1618–1630) by Peter Paul Rubens was inspired by Pythagoras's speech in Ovid's Metamorphoses. The painting portrays the Pythagoreans with corpulent bodies, indicating a belief that vegetarianism was healthful and nutritious.

A fictionalized portrayal of Pythagoras appears in Book XV of Ovid's Metamorphoses, in which he delivers a speech imploring his followers to adhere to a strictly vegetarian diet. It was through Arthur Golding's 1567 English translation of Ovid's Metamorphoses that Pythagoras was best known to English-speakers throughout the early modern period. John Donne's Progress of the Soul discusses the implications of the doctrines expounded in the speech, and Michel de Montaigne quoted the speech no less than three times in his treatise "Of Cruelty" to voice his moral objections against the mistreatment of animals. John Dryden included a translation of the scene with Pythagoras in his 1700 work Fables, Ancient and Modern, and John Gay's 1726 fable "Pythagoras and the Countryman" reiterates its major themes, linking carnivorism with tyranny. Lord Chesterfield records that his conversion to vegetarianism had been motivated by reading Pythagoras's speech in Ovid's Metamorphoses. Until the word vegetarianism was coined in the 1840s, vegetarians were referred to in English as "Pythagoreans".

On Western esotericism

Early modern European esotericism drew heavily on the teachings of Pythagoras. The German humanist scholar Johannes Reuchlin (1455–1522) synthesized Pythagoreanism with Christian theology and Jewish Kabbalah, arguing that Kabbalah and Pythagoreanism were both inspired by Mosaic tradition and that Pythagoras was therefore a kabbalist. In his dialogue De verbo mirifico (1494), Reuchlin compared the Pythagorean tetractys to the ineffable divine name YHWH, ascribing each of the four letters of the tetragrammaton a symbolic meaning according to Pythagorean mystical teachings.

Heinrich Cornelius Agrippa's popular and influential three-volume treatise De Occulta Philosophia cites Pythagoras as a "religious magi" and advances the idea that Pythagoras's mystical numerology operates on a supercelestial level, a religious term used to describe a high heavenly realm used during his time. The freemasons deliberately modeled their society on the community founded by Pythagoras at Croton. Rosicrucianism used Pythagorean symbolism, as did Robert Fludd (1574–1637), who believed his own musical writings to have been inspired by Pythagoras. John Dee was heavily influenced by Pythagorean ideology, particularly the teaching that all things are made of numbers.

On literature

The Transcendentalists read the ancient Lives of Pythagoras as guides on how to live a model life. Henry David Thoreau was impacted by Thomas Taylor's translations of Iamblichus's Life of Pythagoras and Stobaeus's Pythagoric Sayings and his views on nature may have been influenced by the Pythagorean idea of images corresponding to archetypes. The Pythagorean teaching of musica universalis is a recurring theme throughout Thoreau's magnum opus, Walden.

Operating system

From Wikipedia, the free encyclopedia

An operating system (OS) is system software that manages computer hardware and software resources, and provides common services for computer programs.

Time-sharing operating systems schedule tasks for efficient use of the system and may also include accounting software for cost allocation of processor time, mass storage, peripherals, and other resources.

For hardware functions such as input and output and memory allocation, the operating system acts as an intermediary between programs and the computer hardware, although the application code is usually executed directly by the hardware and frequently makes system calls to an OS function or is interrupted by it. Operating systems are found on many devices that contain a computer – from cellular phones and video game consoles to web servers and supercomputers.

As of September 2024, Android is the most popular operating system with a 46% market share, followed by Microsoft Windows at 26%, iOS and iPadOS at 18%, macOS at 5%, and Linux at 1%. Android, iOS, and iPadOS are mobile operating systems, while Windows, macOS, and Linux are desktop operating systems. Linux distributions are dominant in the server and supercomputing sectors. Other specialized classes of operating systems (special-purpose operating systems), such as embedded and real-time systems, exist for many applications. Security-focused operating systems also exist. Some operating systems have low system requirements (e.g. light-weight Linux distribution). Others may have higher system requirements.

Some operating systems require installation or may come pre-installed with purchased computers (OEM-installation), whereas others may run directly from media (i.e. live CD) or flash memory (i.e. a LiveUSB from a USB stick).

Definition and purpose

An operating system is difficult to define, but has been called "the layer of software that manages a computer's resources for its users and their applications". Operating systems include the software that is always running, called a kernel—but can include other software as well. The two other types of programs that can run on a computer are system programs—which are associated with the operating system, but may not be part of the kernel—and applications—all other software.

There are three main purposes that an operating system fulfills:

  • Operating systems allocate resources between different applications, deciding when they will receive central processing unit (CPU) time or space in memory. On modern personal computers, users often want to run several applications at once. In order to ensure that one program cannot monopolize the computer's limited hardware resources, the operating system gives each application a share of the resource, either in time (CPU) or space (memory). The operating system also must isolate applications from each other to protect them from errors and security vulnerabilities in another application's code, but enable communications between different applications.
  • Operating systems provide an interface that abstracts the details of accessing hardware details (such as physical memory) to make things easier for programmers. Virtualization also enables the operating system to mask limited hardware resources; for example, virtual memory can provide a program with the illusion of nearly unlimited memory that exceeds the computer's actual memory.
  • Operating systems provide common services, such as an interface for accessing network and disk devices. This enables an application to be run on different hardware without needing to be rewritten. Which services to include in an operating system varies greatly, and this functionality makes up the great majority of code for most operating systems.

Types of operating systems

Multicomputer operating systems

With multiprocessors multiple CPUs share memory. A multicomputer or cluster computer has multiple CPUs, each of which has its own memory. Multicomputers were developed because large multiprocessors are difficult to engineer and prohibitively expensive; they are universal in cloud computing because of the size of the machine needed. The different CPUs often need to send and receive messages to each other; to ensure good performance, the operating systems for these machines need to minimize this copying of packets. Newer systems are often multiqueue—separating groups of users into separate queues—to reduce the need for packet copying and support more concurrent users. Another technique is remote direct memory access, which enables each CPU to access memory belonging to other CPUs. Multicomputer operating systems often support remote procedure calls where a CPU can call a procedure on another CPU, or distributed shared memory, in which the operating system uses virtualization to generate shared memory that does not physically exist.

Distributed systems

A distributed system is a group of distinct, networked computers—each of which might have their own operating system and file system. Unlike multicomputers, they may be dispersed anywhere in the world. Middleware, an additional software layer between the operating system and applications, is often used to improve consistency. Although it functions similarly to an operating system, it is not a true operating system.

Embedded

Embedded operating systems are designed to be used in embedded computer systems, whether they are internet of things objects or not connected to a network. Embedded systems include many household appliances. The distinguishing factor is that they do not load user-installed software. Consequently, they do not need protection between different applications, enabling simpler designs. Very small operating systems might run in less than 10 kilobytes, and the smallest are for smart cards. Examples include Embedded Linux, QNX, VxWorks, and the extra-small systems RIOT and TinyOS.

Real-time

A real-time operating system is an operating system that guarantees to process events or data by or at a specific moment in time. Hard real-time systems require exact timing and are common in manufacturing, avionics, military, and other similar uses. With soft real-time systems, the occasional missed event is acceptable; this category often includes audio or multimedia systems, as well as smartphones. In order for hard real-time systems be sufficiently exact in their timing, often they are just a library with no protection between applications, such as eCos.

Hypervisor

A hypervisor is an operating system that runs a virtual machine. The virtual machine is unaware that it is an application and operates as if it had its own hardware. Virtual machines can be paused, saved, and resumed, making them useful for operating systems research, development, and debugging. They also enhance portability by enabling applications to be run on a computer even if they are not compatible with the base operating system.

Library

A library operating system (libOS) is one in which the services that a typical operating system provides, such as networking, are provided in the form of libraries and composed with a single application and configuration code to construct a unikernel:  a specialized (only the absolute necessary pieces of code are extracted from libraries and bound together ), single address space, machine image that can be deployed to cloud or embedded environments.

The operating system code and application code are not executed in separated protection domains (there is only a single application running, at least conceptually, so there is no need to prevent interference between applications) and OS services are accessed via simple library calls (potentially inlining them based on compiler thresholds), without the usual overhead of context switches,  in a way similarly to embedded and real-time OSes. Note that this overhead is not negligible: to the direct cost of mode switching it's necessary to add the indirect pollution of important processor structures (like CPU caches, the instruction pipeline, and so on) which affects both user-mode and kernel-mode performance.

History

IBM System/360 Model 50 operator's console and CPU; the operator's console is a terminal used by the operating system to communicate with the operator.

The first computers in the late 1940s and 1950s were directly programmed either with plugboards or with machine code inputted on media such as punch cards, without programming languages or operating systems. After the introduction of the transistor in the mid-1950s, mainframes began to be built. These still needed professional operators who manually do what a modern operating system would do, such as scheduling programs to run, but mainframes still had rudimentary operating systems such as Fortran Monitor System (FMS) and IBSYS. In the 1960s, IBM introduced the first series of intercompatible computers (System/360). All of them ran the same operating system—OS/360—which consisted of millions of lines of assembly language that had thousands of bugs. The OS/360 also was the first popular operating system to support multiprogramming, such that the CPU could be put to use on one job while another was waiting on input/output (I/O). Holding multiple jobs in memory necessitated memory partitioning and safeguards against one job accessing the memory allocated to a different one.

Around the same time, teleprinters began to be used as terminals so multiple users could access the computer simultaneously. The operating system MULTICS was intended to allow hundreds of users to access a large computer. Despite its limited adoption, it can be considered the precursor to cloud computing. The UNIX operating system originated as a development of MULTICS for a single user. Because UNIX's source code was available, it became the basis of other, incompatible operating systems, of which the most successful were AT&T's System V and the University of California's Berkeley Software Distribution (BSD). To increase compatibility, the IEEE released the POSIX standard for operating system application programming interfaces (APIs), which is supported by most UNIX systems. MINIX was a stripped-down version of UNIX, developed in 1987 for educational uses, that inspired the commercially available, free software Linux. Since 2008, MINIX is used in controllers of most Intel microchips, while Linux is widespread in data centers and Android smartphones.

Microcomputers

Command-line interface of the MS-DOS operating system
Graphical user interface of a Macintosh

The invention of large scale integration enabled the production of personal computers (initially called microcomputers) from around 1980. For around five years, the CP/M (Control Program for Microcomputers) was the most popular operating system for microcomputers. Later, IBM bought the DOS (Disk Operating System) from Microsoft. After modifications requested by IBM, the resulting system was called MS-DOS (MicroSoft Disk Operating System) and was widely used on IBM microcomputers. Later versions increased their sophistication, in part by borrowing features from UNIX.

Apple's Macintosh was the first popular computer to use a graphical user interface (GUI). The GUI proved much more user friendly than the text-only command-line interface earlier operating systems had used. Following the success of Macintosh, MS-DOS was updated with a GUI overlay called Windows. Windows later was rewritten as a stand-alone operating system, borrowing so many features from another (VAX VMS) that a large legal settlement was paid. In the twenty-first century, Windows continues to be popular on personal computers but has less market share of servers. UNIX operating systems, especially Linux, are the most popular on enterprise systems and servers but are also used on mobile devices and many other computer systems.

On mobile devices, Symbian OS was dominant at first, being usurped by BlackBerry OS (introduced 2002) and iOS for iPhones (from 2007). Later on, the open-source Android operating system (introduced 2008), with a Linux kernel and a C library (Bionic) partially based on BSD code, became most popular.

Components

The components of an operating system are designed to ensure that various parts of a computer function cohesively. With the de facto obsoletion of DOS, all user software must interact with the operating system to access hardware.

Kernel

A kernel connects the application software to the hardware of a computer.

The kernel is the part of the operating system that provides protection between different applications and users. This protection is key to improving reliability by keeping errors isolated to one program, as well as security by limiting the power of malicious software and protecting private data, and ensuring that one program cannot monopolize the computer's resources. Most operating systems have two modes of operation: in user mode, the hardware checks that the software is only executing legal instructions, whereas the kernel has unrestricted powers and is not subject to these checks. The kernel also manages memory for other processes and controls access to input/output devices.

Program execution

The operating system provides an interface between an application program and the computer hardware, so that an application program can interact with the hardware only by obeying rules and procedures programmed into the operating system. The operating system is also a set of services which simplify development and execution of application programs. Executing an application program typically involves the creation of a process by the operating system kernel, which assigns memory space and other resources, establishes a priority for the process in multi-tasking systems, loads program binary code into memory, and initiates execution of the application program, which then interacts with the user and with hardware devices. However, in some systems an application can request that the operating system execute another application within the same process, either as a subroutine or in a separate thread, e.g., the LINK and ATTACH facilities of OS/360 and successors.

Interrupts

An interrupt (also known as an abort, exception, fault, signal, or trap) provides an efficient way for most operating systems to react to the environment. Interrupts cause the central processing unit (CPU) to have a control flow change away from the currently running program to an interrupt handler, also known as an interrupt service routine (ISR). An interrupt service routine may cause the central processing unit (CPU) to have a context switch. The details of how a computer processes an interrupt vary from architecture to architecture, and the details of how interrupt service routines behave vary from operating system to operating system. However, several interrupt functions are common. The architecture and operating system must:

  1. transfer control to an interrupt service routine.
  2. save the state of the currently running process.
  3. restore the state after the interrupt is serviced.
Software interrupt

A software interrupt is a message to a process that an event has occurred. This contrasts with a hardware interrupt — which is a message to the central processing unit (CPU) that an event has occurred. Software interrupts are similar to hardware interrupts — there is a change away from the currently running process. Similarly, both hardware and software interrupts execute an interrupt service routine.

Software interrupts may be normally occurring events. It is expected that a time slice will occur, so the kernel will have to perform a context switch. A computer program may set a timer to go off after a few seconds in case too much data causes an algorithm to take too long.

Software interrupts may be error conditions, such as a malformed machine instruction. However, the most common error conditions are division by zero and accessing an invalid memory address.

Users can send messages to the kernel to modify the behavior of a currently running process. For example, in the command-line environment, pressing the interrupt character (usually Control-C) might terminate the currently running process.

To generate software interrupts for x86 CPUs, the INT assembly language instruction is available. The syntax is INT X, where X is the offset number (in hexadecimal format) to the interrupt vector table.

Signal

To generate software interrupts in Unix-like operating systems, the kill(pid,signum) system call will send a signal to another process. pid is the process identifier of the receiving process. signum is the signal number (in mnemonic format) to be sent. (The abrasive name of kill was chosen because early implementations only terminated the process.)

In Unix-like operating systems, signals inform processes of the occurrence of asynchronous events. To communicate asynchronously, interrupts are required. One reason a process needs to asynchronously communicate to another process solves a variation of the classic reader/writer problem. The writer receives a pipe from the shell for its output to be sent to the reader's input stream. The command-line syntax is alpha | bravo. alpha will write to the pipe when its computation is ready and then sleep in the wait queue. bravo will then be moved to the ready queue and soon will read from its input stream. The kernel will generate software interrupts to coordinate the piping.

Signals may be classified into 7 categories. The categories are:

  1. when a process finishes normally.
  2. when a process has an error exception.
  3. when a process runs out of a system resource.
  4. when a process executes an illegal instruction.
  5. when a process sets an alarm event.
  6. when a process is aborted from the keyboard.
  7. when a process has a tracing alert for debugging.
Hardware interrupt

Input/output (I/O) devices are slower than the CPU. Therefore, it would slow down the computer if the CPU had to wait for each I/O to finish. Instead, a computer may implement interrupts for I/O completion, avoiding the need for polling or busy waiting.

Some computers require an interrupt for each character or word, costing a significant amount of CPU time. Direct memory access (DMA) is an architecture feature to allow devices to bypass the CPU and access main memory directly. (Separate from the architecture, a device may perform direct memory access to and from main memory either directly or via a bus.)

Input/output

Interrupt-driven I/O

When a computer user types a key on the keyboard, typically the character appears immediately on the screen. Likewise, when a user moves a mouse, the cursor immediately moves across the screen. Each keystroke and mouse movement generates an interrupt called Interrupt-driven I/O. An interrupt-driven I/O occurs when a process causes an interrupt for every character or word transmitted.

Direct memory access

Devices such as hard disk drives, solid-state drives, and magnetic tape drives can transfer data at a rate high enough that interrupting the CPU for every byte or word transferred, and having the CPU transfer the byte or word between the device and memory, would require too much CPU time. Data is, instead, transferred between the device and memory independently of the CPU by hardware such as a channel or a direct memory access controller; an interrupt is delivered only when all the data is transferred.

If a computer program executes a system call to perform a block I/O write operation, then the system call might execute the following instructions:

  • Set the contents of the CPU's registers (including the program counter) into the process control block.
  • Create an entry in the device-status table. The operating system maintains this table to keep track of which processes are waiting for which devices. One field in the table is the memory address of the process control block.
  • Place all the characters to be sent to the device into a memory buffer.
  • Set the memory address of the memory buffer to a predetermined device register.
  • Set the buffer size (an integer) to another predetermined register.
  • Execute the machine instruction to begin the writing.
  • Perform a context switch to the next process in the ready queue.

While the writing takes place, the operating system will context switch to other processes as normal. When the device finishes writing, the device will interrupt the currently running process by asserting an interrupt request. The device will also place an integer onto the data bus. Upon accepting the interrupt request, the operating system will:

  • Push the contents of the program counter (a register) followed by the status register onto the call stack.
  • Push the contents of the other registers onto the call stack. (Alternatively, the contents of the registers may be placed in a system table.)
  • Read the integer from the data bus. The integer is an offset to the interrupt vector table. The vector table's instructions will then:
  • Access the device-status table.
  • Extract the process control block.
  • Perform a context switch back to the writing process.

When the writing process has its time slice expired, the operating system will:

  • Pop from the call stack the registers other than the status register and program counter.
  • Pop from the call stack the status register.
  • Pop from the call stack the address of the next instruction, and set it back into the program counter.

With the program counter now reset, the interrupted process will resume its time slice.

Memory management

Among other things, a multiprogramming operating system kernel must be responsible for managing all system memory which is currently in use by the programs. This ensures that a program does not interfere with memory already in use by another program. Since programs time share, each program must have independent access to memory.

Cooperative memory management, used by many early operating systems, assumes that all programs make voluntary use of the kernel's memory manager, and do not exceed their allocated memory. This system of memory management is almost never seen anymore, since programs often contain bugs which can cause them to exceed their allocated memory. If a program fails, it may cause memory used by one or more other programs to be affected or overwritten. Malicious programs or viruses may purposefully alter another program's memory, or may affect the operation of the operating system itself. With cooperative memory management, it takes only one misbehaved program to crash the system.

Memory protection enables the kernel to limit a process' access to the computer's memory. Various methods of memory protection exist, including memory segmentation and paging. All methods require some level of hardware support (such as the 80286 MMU), which does not exist in all computers.

In both segmentation and paging, certain protected mode registers specify to the CPU what memory address it should allow a running program to access. Attempts to access other addresses trigger an interrupt, which causes the CPU to re-enter supervisor mode, placing the kernel in charge. This is called a segmentation violation or Seg-V for short, and since it is both difficult to assign a meaningful result to such an operation, and because it is usually a sign of a misbehaving program, the kernel generally resorts to terminating the offending program, and reports the error.

Windows versions 3.1 through ME had some level of memory protection, but programs could easily circumvent the need to use it. A general protection fault would be produced, indicating a segmentation violation had occurred; however, the system would often crash anyway.

Virtual memory

Many operating systems can "trick" programs into using memory scattered around the hard disk and RAM as if it is one continuous chunk of memory, called virtual memory.

The use of virtual memory addressing (such as paging or segmentation) means that the kernel can choose what memory each program may use at any given time, allowing the operating system to use the same memory locations for multiple tasks.

If a program tries to access memory that is not accessible memory, but nonetheless has been allocated to it, the kernel is interrupted (see § Memory management). This kind of interrupt is typically a page fault.

When the kernel detects a page fault it generally adjusts the virtual memory range of the program which triggered it, granting it access to the memory requested. This gives the kernel discretionary power over where a particular application's memory is stored, or even whether or not it has been allocated yet.

In modern operating systems, memory which is accessed less frequently can be temporarily stored on a disk or other media to make that space available for use by other programs. This is called swapping, as an area of memory can be used by multiple programs, and what that memory area contains can be swapped or exchanged on demand.

Virtual memory provides the programmer or the user with the perception that there is a much larger amount of RAM in the computer than is really there.

Concurrency

Concurrency refers to the operating system's ability to carry out multiple tasks simultaneously. Virtually all modern operating systems support concurrency.

Threads enable splitting a process' work into multiple parts that can run simultaneously. The number of threads is not limited by the number of processors available. If there are more threads than processors, the operating system kernel schedules, suspends, and resumes threads, controlling when each thread runs and how much CPU time it receives. During a context switch a running thread is suspended, its state is saved into the thread control block and stack, and the state of the new thread is loaded in. Historically, on many systems a thread could run until it relinquished control (cooperative multitasking). Because this model can allow a single thread to monopolize the processor, most operating systems now can interrupt a thread (preemptive multitasking).

Threads have their own thread ID, program counter (PC), a register set, and a stack, but share code, heap data, and other resources with other threads of the same process. Thus, there is less overhead to create a thread than a new process. On single-CPU systems, concurrency is switching between processes. Many computers have multiple CPUs. Parallelism with multiple threads running on different CPUs can speed up a program, depending on how much of it can be executed concurrently.

File system

File systems allow users and programs to organize and sort files on a computer, often through the use of directories (or folders).

Permanent storage devices used in twenty-first century computers, unlike volatile dynamic random-access memory (DRAM), are still accessible after a crash or power failure. Permanent (non-volatile) storage is much cheaper per byte, but takes several orders of magnitude longer to access, read, and write. The two main technologies are a hard drive consisting of magnetic disks, and flash memory (a solid-state drive that stores data in electrical circuits). The latter is more expensive but faster and more durable.

File systems are an abstraction used by the operating system to simplify access to permanent storage. They provide human-readable filenames and other metadata, increase performance via amortization of accesses, prevent multiple threads from accessing the same section of memory, and include checksums to identify corruption. File systems are composed of files (named collections of data, of an arbitrary size) and directories (also called folders) that list human-readable filenames and other directories. An absolute file path begins at the root directory and lists subdirectories divided by punctuation, while a relative path defines the location of a file from a directory.

System calls (which are sometimes wrapped by libraries) enable applications to create, delete, open, and close files, as well as link, read, and write to them. All these operations are carried out by the operating system on behalf of the application. The operating system's efforts to reduce latency include storing recently requested blocks of memory in a cache and prefetching data that the application has not asked for, but might need next. Device drivers are software specific to each input/output (I/O) device that enables the operating system to work without modification over different hardware.

Another component of file systems is a dictionary that maps a file's name and metadata to the data block where its contents are stored. Most file systems use directories to convert file names to file numbers. To find the block number, the operating system uses an index (often implemented as a tree). Separately, there is a free space map to track free blocks, commonly implemented as a bitmap. Although any free block can be used to store a new file, many operating systems try to group together files in the same directory to maximize performance, or periodically reorganize files to reduce fragmentation.

Maintaining data reliability in the face of a computer crash or hardware failure is another concern. File writing protocols are designed with atomic operations so as not to leave permanent storage in a partially written, inconsistent state in the event of a crash at any point during writing. Data corruption is addressed by redundant storage (for example, RAID—redundant array of inexpensive disks) and checksums to detect when data has been corrupted. With multiple layers of checksums and backups of a file, a system can recover from multiple hardware failures. Background processes are often used to detect and recover from data corruption.

Security

Security means protecting users from other users of the same computer, as well as from those who seeking remote access to it over a network. Operating systems security rests on achieving the CIA triad: confidentiality (unauthorized users cannot access data), integrity (unauthorized users cannot modify data), and availability (ensuring that the system remains available to authorized users, even in the event of a denial of service attack). As with other computer systems, isolating security domains—in the case of operating systems, the kernel, processes, and virtual machines—is key to achieving security. Other ways to increase security include simplicity to minimize the attack surface, locking access to resources by default, checking all requests for authorization, principle of least authority (granting the minimum privilege essential for performing a task), privilege separation, and reducing shared data.

Some operating system designs are more secure than others. Those with no isolation between the kernel and applications are least secure, while those with a monolithic kernel like most general-purpose operating systems are still vulnerable if any part of the kernel is compromised. A more secure design features microkernels that separate the kernel's privileges into many separate security domains and reduce the consequences of a single kernel breach. Unikernels are another approach that improves security by minimizing the kernel and separating out other operating systems functionality by application.

Most operating systems are written in C or C++, which create potential vulnerabilities for exploitation. Despite attempts to protect against them, vulnerabilities are caused by buffer overflow attacks, which are enabled by the lack of bounds checking. Hardware vulnerabilities, some of them caused by CPU optimizations, can also be used to compromise the operating system. There are known instances of operating system programmers deliberately implanting vulnerabilities, such as back doors.

Operating systems security is hampered by their increasing complexity and the resulting inevitability of bugs. Because formal verification of operating systems may not be feasible, developers use operating system hardening to reduce vulnerabilities, e.g. address space layout randomization, control-flow integrityaccess restrictions, and other techniques. There are no restrictions on who can contribute code to open source operating systems; such operating systems have transparent change histories and distributed governance structures. Open source developers strive to work collaboratively to find and eliminate security vulnerabilities, using code review and type checking to expunge malicious code. Andrew S. Tanenbaum advises releasing the source code of all operating systems, arguing that it prevents developers from placing trust in secrecy and thus relying on the unreliable practice of security by obscurity.

User interface

A user interface (UI) is essential to support human interaction with a computer. The two most common user interface types for any computer are

For personal computers, including smartphones and tablet computers, and for workstations, user input is typically from a combination of keyboard, mouse, and trackpad or touchscreen, all of which are connected to the operating system with specialized software. Personal computer users who are not software developers or coders often prefer GUIs for both input and output; GUIs are supported by most personal computers. The software to support GUIs is more complex than a command line for input and plain text output. Plain text output is often preferred by programmers, and is easy to support.

Operating system development as a hobby

A hobby operating system may be classified as one whose code has not been directly derived from an existing operating system, and has few users and active developers.

In some cases, hobby development is in support of a "homebrew" computing device, for example, a simple single-board computer powered by a 6502 microprocessor. Or, development may be for an architecture already in widespread use. Operating system development may come from entirely new concepts, or may commence by modeling an existing operating system. In either case, the hobbyist is her/his own developer, or may interact with a small and sometimes unstructured group of individuals who have like interests.

Examples of hobby operating systems include Syllable and TempleOS.

Diversity of operating systems and portability

If an application is written for use on a specific operating system, and is ported to another OS, the functionality required by that application may be implemented differently by that OS (the names of functions, meaning of arguments, etc.) requiring the application to be adapted, changed, or otherwise maintained.

This cost in supporting operating systems diversity can be avoided by instead writing applications against software platforms such as Java or Qt. These abstractions have already borne the cost of adaptation to specific operating systems and their system libraries.

Another approach is for operating system vendors to adopt standards. For example, POSIX and OS abstraction layers provide commonalities that reduce porting costs.

As of September 2024, Android (based on the Linux kernel) is the most popular operating system with a 46% market share, followed by Microsoft Windows at 26%, iOS and iPadOS at 18%, macOS at 5%, and Linux at 1%. Android, iOS, and iPadOS are mobile operating systems, while Windows, macOS, and Linux are desktop operating systems.

Linux

Layers of a Linux system

Linux is a free software distributed under the GNU General Public License (GPL), which means that all of its derivatives are legally required to release their source code. Linux was designed by programmers for their own use, thus emphasizing simplicity and consistency, with a small number of basic elements that can be combined in nearly unlimited ways, and avoiding redundancy.

Its design is similar to other UNIX systems not using a microkernel. It is written in C and uses UNIX System V syntax, but also supports BSD syntax. Linux supports standard UNIX networking features, as well as the full suite of UNIX tools, while supporting multiple users and employing preemptive multitasking. Initially of a minimalist design, Linux is a flexible system that can work in under 16 MB of RAM, but still is used on large multiprocessor systems. Similar to other UNIX systems, Linux distributions are composed of a kernel, system libraries, and system utilities. Linux has a graphical user interface (GUI) with a desktop, folder and file icons, as well as the option to access the operating system via a command line.

Android is a partially open-source operating system closely based on Linux and has become the most widely used operating system by users, due to its popularity on smartphones and, to a lesser extent, embedded systems needing a GUI, such as "smart watches, automotive dashboards, airplane seatbacks, medical devices, and home appliances". Unlike Linux, much of Android is written in Java and uses object-oriented design.

Microsoft Windows

Security descriptor for a file that is read-only by default, specified no access for Elvis, read/write access for Cathy, and full access for Ida, the owner of the file

Windows is a proprietary operating system that is widely used on desktop computers, laptops, tablets, phones, workstations, enterprise servers, and Xbox consoles. The operating system was designed for "security, reliability, compatibility, high performance, extensibility, portability, and international support"—later on, energy efficiency and support for dynamic devices also became priorities.

Windows Executive works via kernel-mode objects for important data structures like processes, threads, and sections (memory objects, for example files). The operating system supports demand paging of virtual memory, which speeds up I/O for many applications. I/O device drivers use the Windows Driver Model. The NTFS file system has a master table and each file is represented as a record with metadata. The scheduling includes preemptive multitasking. Windows has many security features; especially important are the use of access-control lists and integrity levels. Every process has an authentication token and each object is given a security descriptor. Later releases have added even more security features.

Timeline of the universe

From Wikipedia, the free encyclopedia https://en.wikipedia.org/wiki/Timeline_of_the_universe   Diagram of Evol...