Content deleted Content added
Release all held documents Tags: Reverted section blanking Mobile edit Mobile web edit |
Citation bot (talk | contribs) Removed URL that duplicated identifier. | Use this bot. Report bugs. | #UCB_CommandLine |
||
(3 intermediate revisions by 3 users not shown) | |||
Line 11:
{{see|Program lifecycle phase}}
Prior to execution, a program must first be written. This is generally done in [[source code]], which is then compiled at [[compile time]] (and statically linked at [[link time]]) to produce an executable. This executable is then invoked, most often by an operating system, which loads the program into memory ([[load time]]), possibly performs [[dynamic linking]], and then begins execution by moving control to the [[entry point]] of the program; all these steps depend on the [[Application Binary Interface]] of the operating system. At this point execution begins and the program enters [[run time (program lifecycle phase)|run time]]. The program then runs until it ends, either in a normal [[termination (computer science)|termination]] or a [[crash (computing)|crash]].
== Executable ==
{{main|Executable}}
''Executable code'', an ''executable file'', or an ''executable program'', sometimes simply referred to as an ''executable'' or
''binary'', is a list of instructions and data to cause a computer "to perform indicated tasks according to encoded [[instruction (computer science)|instructions]]",<ref>{{cite web |url=http://www.merriam-webster.com/dictionary/executable |title=executable |access-date=2008-07-19 |work=Merriam-Webster's Online Dictionary |publisher=[[Merriam-Webster]]}}</ref> as opposed to a [[Data (computing)|data file]] that must be interpreted ([[parser|parsed]]) by a program to be meaningful.
The exact interpretation depends upon the use. "Instructions" is traditionally taken to mean [[machine code]] instructions for a physical [[Central processing unit|CPU]].<ref>{{Cite web|url=https://www.geeksforgeeks.org/machine-instructions/|title=Machine Instructions|date=2015-11-03|website=GeeksforGeeks|language=en-US|access-date=2019-09-18}}</ref> In some contexts, a file containing scripting instructions (such as [[bytecode]]) may also be considered executable.
== Context of execution ==
Line 18 ⟶ 25:
{{Main|Context switch}}
In order for programs and [[interrupt handler]]s to work without interference and share the same hardware memory and access to the I/O system, in a [[Computer multitasking|multitasking operating system]] running on a digital system with a single CPU/MCU, it is required to have some sort of software and hardware facilities to keep track of an executing process's data (memory page addresses, registers etc.) and to save and recover them back to the state they were in before they were suspended. This is achieved by a context switching.<ref name=":0">{{Cite book |last=Bovet |first=Daniel P.
In Linux-based operating systems, a set of data stored in [[Processor register|registers]] is usually saved into a process descriptor in memory to implement switching of context.<ref name=":0" /> PCIDs are also used.
|