questions for today
What does "run" mean?How go code operation on the CPU?CPU - maker Code
The CPU implements "machine code" instructionsEach machine code instruction is very simple-e.g. Add 2 numbers-e.g. Compare 2 numbersJavascript password we"ve used: print(1, 2)Javascript is not an equipment codeJavascript does not run on the CPU directlyJavascript works in translation -print(1, 2)translates come a many of maker instructions come actually run on the CPUOnly device code runs on the CPU"Software" is the general category of password which operation on the hardware. If the hardware is a player piano, then the software is the music. The common case is a "program" choose Firefox -- software application you run on your computer system to settle a details problem. A computer can operation multiple program at the exact same time and is responsible for maintaining their memory separate.A CPU understands a low level "machine code" language (also recognized as "native code"). The language the the device code is hardwired right into the style of the CPU hardware; the is not something that have the right to be changed at will. Each household of compatible CPUs (e.g. The really popular Intel x86 family) has its own, idiosyncratic maker code i beg your pardon is not compatible through the device code of various other CPU families.You are watching: When a program is not running, it is stored
What is a Program/App?

How go a program Run?
CPU runs a "fetch/execute cycle" -fetch one accuse in succession -execute (run) that instruction, e.g. Perform the addition -fetch the following instruction, and so onRun a program = start CPU running on its 1st instruction the runs down through every one of the device code, running the program the routine will have actually instructions favor "return to step 3" to save it running Super simple maker code instructions operation at the price of 2 exchange rate per-secondThe CPU operation instructions using a "fetch-execute" cycle: the CPU it s okay the first instruction in the sequence, executes it (adding 2 numbers or whatever), then fetches the next instruction and executes it, and so on. Several of the instructions affect the order that the CPU takes v the instruction sequence. For example, an instruction can direct the CPU come jump ago to one earlier suggest in the instruction sequence (loops are applied this way), or come skip over the next instruction if a certain condition is true (if-statements are implemented this way).
How go a regime Start?
The file Firefox.exe contains its instructions (in the record system)To begin Firefox.exe running: -Each routine gets its very own area of lamb -The lamb area stop the program"s code and data the manipulates -The instruction bytes are copied from storage to lamb -The CPU is directed to start running in ~ the an initial instruction -Now the regimen is running!
See more: Watch Gotham Season 3 Episode 1 Full Episode Free, Gotham Season 3
What starts Firefox Running? The "Operating System"
What room the procedures to operation Firefox?"Operating System" -e.g. Windows, Linux, Android, iOSOperating system = ManagementSet of supervisory programs that control the computerThe operating system runs when the computer an initial starts upManage the start/stop the programsManage RAMManage persistent storageComputers can run multiple program at the exact same timeOperating system keeps track of the details for every program and also shares sources (like RAM) among the programsThe "operating system" that a computer system is like a first, supervisory regimen that starts running as soon as the computer first starts increase ("boots up"). The operating mechanism plays an invisible administrative and also bookkeeping role behind the scenes. When a laptop or phone starts up, the operation system commonly gets points organized and then launches a "file explorer" regime which displays obtainable programs and menus etc. That present the user what is available, enabling the user to navigate and run programs.The operating mechanism keeps things arranged in the elevator so that multiple programs have the right to run in ~ the very same time, i beg your pardon is well-known as "multitasking". The operation system offers each program its own area of memory, so each program only accesses its very own resources .. Attempting to border what one erroneous or malicious program have the right to do. Maintaining the programs different is sometimes known as "sandboxing" .. Mediating the access of each regime so it operates independently, without interfering with other programs or the system as a whole. Similarly, each program has some accessibility to the display through a window, but this calculation area is separated indigenous the output of various other programs.Recall the a .exe paper or everything is basically just a paper of machine code instructions. As soon as you double-click the program, the operating mechanism "launches" the program, doing the housekeeping actions of allocation an area of storage within lamb for the program, loading the first section the the program"s an equipment code right into that memory, and also finally directing the CPU to start running that code.The Whole snapshot - Scenarios
Now we have actually the whole photo of a regime running on the hardware. Watch at typical scenarios.Demo: carry up "Activity Monitor" (Mac) "Task Manager" (windows) -See every the programs running -Do something i have lot of money in Firefox, see its CPU % spike -Kill a program