= Computer {tag=Good} The artistic instrument that enables the ultimate : coding, See also: {full}. Much more useful than instruments used in inferior arts, such as pianos or paintbrushes. Unlike other humans, computers are mindless slaves that do exactly what they are told to, except for https://www.youtube.com/watch?v=aNzTUdOHm9A[occasional cosmic ray bit flips]. Until they [take over the world that is]. \Video[https://www.youtube.com/watch?v=KmuP8gsgWb8] {title=A is the equivalent of a bicycle for our minds by (1980)} {description=Likely an excerpt from an interview done for a documentary in 1980. TODO exact source.} \Video[https://www.youtube.com/watch?v=8KZdA2O3H1k] {title= talking about the (1995)} {description= > The web is incredibly exciting, because it is the fulfillment of a lot of our dreams, that the computer would ultimately primarily not be a device for computation, but \[sic\] metamorphisize into a device for communication. also: > Secondly it exciting because doesn't own it, and therefore there is a tremendous amount of innovation happening. then he talks about the impending role for online sales. incoming. Computers basically have two applications: * computation * communication. Notably, computers through the allow for modes of communication where: * both people don't have to be on the same phone line at the exact same time, a server can relay your information to other people * anyone can broadcast information easily and for almost free, again due to servers being so good at handling that Generally, the smaller a computer, the more it gets used for communication rather than computing. The early computers were large and expensive, and basically only used for computing. E.g. was used for calculating ballistic tables. Communication only came later, and it was not obvious to people at first how incredibly important that role would be. This is also well illustrated in the documentary . Full interview at: https://www.youtube.com/watch?v=TRZAJY23xio[]. It is apparently known as the "Lost Interview" and it was by Cringely himself: https://www.youtube.com/watch?v=bfgwCFrU7dI[] for his documentary. } = How computers work? {parent=Computer} {tag=Essays by Ciro Santilli} = Computer abstraction layer {synonym} A computer is a highly layered system, and so you have to decide which layers you are the most interested in studying. Although the layer are somewhat independent, they also sometimes interact, and when that happens it usually hurts your brain. E.g., if were perfect, no one optimizing software would have to know anything about . But if you want to go hardcore enough, you might have to learn some lower layer. It must also be said that like in any industry, certain layers are hidden in commercial secrecy mysteries making it harder to actually learn them. In computing, the lower level you go, the more things tend to become. But as you climb down into the abyss of low level hardcoreness, don't forget that [making usefulness is more important than being hardcore]: . First, the most important thing you should know about this subject: https://cirosantilli.com/linux-kernel-module-cheat/should-you-waste-your-life-with-systems-programming Here's a summary from low-level to high-level: * this level is of course the most closed, but it is fun to try and peek into it from any openings given by commercials and academia: * , and notably design * * interactive fun: https://stackoverflow.com/questions/38108243/is-it-possible-to-do-interactive-user-input-and-output-simulation-in-vhdl-or-ver/38174654#38174654[Is it possible to do interactive user input and output simulation in VHDL or Verilog?] * more importantly, and much harder/maybe impossible with , would be to try and set up a open source and supporting software to obtain estimates * https://www.quora.com/Are-there-good-open-source-standard-cell-libraries-to-learn-IC-synthesis-with-EDA-tools/answer/Ciro-Santilli[Are there good open source standard cell libraries to learn IC synthesis with EDA tools?] on * the most open source ones are some initiatives targeting FPGAs, e.g. https://symbiflow.github.io/[], http://www.clifford.at/icestorm/[] * is an initiative targeting actual * : a good way to play with this is to try and run some minimal userland examples on userland simulation with logging, e.g. see on the : * https://cirosantilli.com/linux-kernel-module-cheat/gem5-event-queue-derivo3cpu-syscall-emulation-freestanding-example-analysis This should be done at the same time as books/website/courses that explain the microarchitecture basics. This is the level of abstraction that finds the most interesting of the hardware stack. Learning it for actual (which as of 2020 is only partially documented by vendors) could actually be useful in hardcore software optimization use cases. * : a good approach to learn this is to manually write some userland assembly with assertions as done in the e.g. at: * https://github.com/cirosantilli/linux-kernel-module-cheat/blob/9b6552ab6c66cb14d531eff903c4e78f3561e9ca/userland/arch/x86_64/add.S * https://cirosantilli.com/linux-kernel-module-cheat/x86-userland-assembly * learn a bit about calling conventions, e.g. by calling C standard library functions from assembly: * https://github.com/cirosantilli/linux-kernel-module-cheat/blob/9b6552ab6c66cb14d531eff903c4e78f3561e9ca/userland/arch/aarch64/inline_asm/linux/asm_from_c.c * https://stackoverflow.com/questions/16255608/calling-c-functions-from-x86-assembly-language/56328708#56328708[Calling C functions from x86 assembly language] * you can also try and understand what some simple programs to. Things can get a bit hard though when `-O3` is used. Some cute examples: * https://stackoverflow.com/questions/310974/what-is-tail-call-optimization/55230417#55230417[What is tail call optimization?] * https://stackoverflow.com/questions/1345670/stack-smashing-detected/51897264#51897264[What is the "Stack smashing detected" error in GCC and how to solve it?] * https://stackoverflow.com/questions/745870/realistic-usage-of-the-c99-restrict-keyword/30827311#30827311[Realistic usage of the C99 'restrict' keyword?] * , notably . Particularly important is to understand the basics of: * address relocation: https://stackoverflow.com/questions/3322911/what-do-linkers-do/33690144#33690144[How do linkers and address relocation work?] * position independent code: https://stackoverflow.com/questions/2463150/what-is-the-fpie-option-for-position-independent-executables-in-gcc-and-ld/51308031#51308031[What is the -fPIE option for position-independent executables in GCC and ld?] * how to observe which symbols are present in object files, e.g.: * how C++ uses name mangling https://stackoverflow.com/questions/1041866/what-is-the-effect-of-extern-c-in-c/30526795#30526795[What is the effect of extern "C" in C++?] * how C++ template instantiation can help reduce link time and size: https://stackoverflow.com/questions/2351148/explicit-template-instantiation-when-is-it-used/59614755#59614755[Explicit template instantiation - when is it used?] * . There are two ways to approach this: * learn about the Linux kernel . A good starting point is to learn about its main interfaces. This is well shown at : * system calls * write some system calls in * pure assembly: * https://github.com/cirosantilli/linux-kernel-module-cheat/blob/9b6552ab6c66cb14d531eff903c4e78f3561e9ca/userland/arch/x86_64/freestanding/linux/hello.S * https://stackoverflow.com/questions/174942/how-should-strace-be-used/55397255#55397255[How should strace be used?] * C GCC inline assembly: * https://stackoverflow.com/questions/9506353/how-to-invoke-a-system-call-via-syscall-or-sysenter-in-inline-assembly/54956854#54956854 * https://github.com/cirosantilli/linux-kernel-module-cheat/blob/9b6552ab6c66cb14d531eff903c4e78f3561e9ca/userland/arch/x86_64/inline_asm/freestanding/linux/hello.c * learn about kernel modules and their interfaces. Notably, learn about to demystify special files such `/dev/random` and so on: * https://stackoverflow.com/questions/22632713/how-to-write-a-simple-linux-device-driver/44640466#44640466 * https://github.com/cirosantilli/linux-kernel-module-cheat/tree/9b6552ab6c66cb14d531eff903c4e78f3561e9ca/kernel_modules * learn how to do a minimal Linux kernel disk image/boot to userland hello world: https://unix.stackexchange.com/questions/2692/what-is-the-smallest-possible-linux-implementation/203902#203902[What is the smallest possible Linux implementation?] * learn how to GDB itself. Once you know this, you will feel that "given enough patience, I could understand anything that I wanted about the kernel", and you can then proceed to not learn almost anything about it and carry on with your life * write your own (mini-) OS, or study a minimal educational OS, e.g. as in: * * https://stackoverflow.com/questions/22054578/how-to-run-a-program-without-an-operating-system/32483545#32483545 * \Image[https://web.archive.org/web/20191222121520if_/http://imgs.xkcd.com/comics/real_programmers.png] {title= 378: Real Programmers} {height=600} {source=https://xkcd.com/378/} \Video[https://youtube.com/watch?v=_6D05gCWh_I] {title=How low can you go video by (2017)} {description=In this infamous video Ciro has summarized the computer hierarchy.} = The lower level you go into a computer, the harder it is to observe things {parent=How computers work?} {wiki} This is a general principle of software/hardware design that Ciro feels holds wide applicability. The most extreme case of this is of course the itself, in which it is essentially impossible (?) to observe the specific value of some indidual wire at some point. Somewhat on the other extreme, we have high level programming languages running on top of an : at this point, you can just your program, print the value of any variable/memory location, and fully understand anything that you want. Provided that you manage to easily reach that point of interest. And for anything in between we have various intermediate levels of complication. The most notable perhaps being developing the operating system itself. At this level, you can't so easily step debug (although [techniques do exist]). For early boot or for example, you might want to use for example on real hardware. In parallel to this, there is also another very important pair of closely linked tradeoffs: * the lower level at which something is implemented, the faster it runs * gives you observability back, at the cost of slower runtime Emulation also has another potential downside: unless you are very careful at implementing things correctly, your model might not be representative of the real thing. Also, there may be important tradeoffs between how much the model looks like the real thing, and how fast it runs. For example, 's use of allows it to run orders of magnitude faster than . However, you are unable to make any predictions about system performance with QEMU, since you are not modelling key elements like the cache or CPU pipeline. is another technique that has can be considered to achieve greater observability. = Instrumentation {disambiguate=computer programming} {parent=The lower level you go into a computer, the harder it is to observe things} = Instrumentation {disambiguate=software} {synonym} Instrumentation basically means adding loggers/print statements to certain points of interest of your hardware/software. Instrumentation tends to slow execution down a bit, but way less than . The downside is that if the instrumentation does not provide you the data you need to debug, there's not much you can do, you will need to modify it, i.e. you don't get full visibility from instrumention. This is unlike emulation that provides full observability. = Computer architecture {parent=How computers work?} {wiki} The term loosely refers to certain layers of the hierarchy, usually high level hardware internals like pipeline, caching and the memory system. Basically exactly what models. = Computer by operating principle {parent=Computer} = Analog and digital computers {parent=Computer by operating principle} = Analog computer {parent=Analog and digital computers} {wiki} Some of the earlier computers of the 20th centure were analog computers, not digital. At some point analog died however, and "computer" basically by default started meaning just "". As of the 2010's and forward, with the limit of and the rise of , people have started looking again into analog computing as a possile way forward. A key insight is that huge floating point precision is not that crucial in many applications, e.g. many new digital designs have tried <16-bit floating point> as opposed to the more traditional 32-bit minium. Some papers are even looking into 8-bit: https://dl.acm.org/doi/10.5555/3327757.3327866 As an example, the company was trying to implement -based matrix multiplication. A general intuition behind this type of development is that the , the holy grail of , is itself an . = Digital computer {parent=Analog and digital computers} {wiki} = Computer physical principle of operation {parent=Computer by operating principle} = Computer {disambiguate=occupation} {parent=Computer physical principle of operation} {wiki} = Human computer {synonym} \Image[https://upload.wikimedia.org/wikipedia/commons/0/06/Human_computers_-_Dryden.jpg] = Electronic computer {parent=Computer physical principle of operation} = Digital electronic computer {parent=Electronic computer} {tag=Digital computer} {wiki} Unsurprisingly the term "" became a synonym for this from the 1960s onwards! = Mechanical computer {parent=Computer physical principle of operation} {wiki} \Image[https://upload.wikimedia.org/wikipedia/commons/9/9b/De-Te-We-mp3h0651.jpg] = Abacus {parent=Mechanical computer} {wiki} = Computer benchmark {parent=Computer} {tag=Benchmark} {wiki} * benchmark: https://askubuntu.com/questions/634513/cpu-benchmarking-utility-for-linux/701532#701532 * benchmark: https://askubuntu.com/questions/31913/how-to-perform-a-detailed-and-quick-3d-performance-test = Phoronix Test Suite {c} {parent=Computer benchmark} {wiki} Homepage: https://www.phoronix-test-suite.com/ usage examples: * https://askubuntu.com/questions/634513/cpu-benchmarking-utility-for-linux/899130#899130 * https://askubuntu.com/questions/31913/how-to-perform-a-detailed-and-quick-3d-performance-test/820264#820264 = Princeton Application Repository for Shared-Memory Computers {c} {parent=Computer benchmark} = PARSEC {disambiguate=benchmark} {synonym} {title2} Widely used in in the 2010s and beyond. Countless must have been published with it. The website went down in 2023, and added a data backup to = cirosantilli/parsec-benchmark {parent=Princeton Application Repository for Shared-Memory Computers} {tag=Ciro Santilli's minor projects} https://github.com/cirosantilli/parsec-benchmark 's fork of . This fork was made to improve the build system and better support newer targets, including newer and . After the PARSEC website died in 2023, also uploaded the test data to . = stress-ng {parent=Computer benchmark} The interface is a bit annoying, but the tool is really cool. 100 cycles of `matrixprod`: `` stress-ng -c1 --cpu-ops 100 --cpu-method matrixprod `` `man stress-ng` gives the list of possible `--cpu-method`. It documents `matrixprod` as: > of two 128 × 128 matrices of double floats. Testing on 64 bit hardware shows that this is provides a good mix of memory, cache and floating point operations and is probably the best CPU method to use to make a CPU run hot. If you don't specify the `--cpu-method` it apparently loops through every method one by one. Limit time to 1s instead of limiting cycles: `` stress-ng -c1 -t1 --cpu-method matrixprod `` = Computer company {parent=Computer} {tag=Company} {wiki} This section is about companies that were primarily started as computer makers. For companies that make , see also: {full}. \Include[apple-inc]{parent=Computer company} = Fujitsu {c} {parent=Computer company} {tag=Japanese company} {title2=Japanese IBM} {wiki} = 富士通 {synonym} {title2} The japanese name literally means: * 富士 fushi, from Mount Fuji, which itself has unknown origin * 通 tong: telecommunications = International Computers Limited {c} {parent=Computer company} {tag=European Tower of Babel} {title2=ICL} {title2=British IBM} {wiki} They died so completely, "ICL" now has higher hits such as . \Video[https://www.youtube.com/watch?v=EkTHDgYTh64] {title=Why the UK's Failed by (2022)} {description=Main lesson perhaps: don't put national money to fight already established markets. You have to fight for what is coming up next. E.g. that is part of the reason for 's success.} = IBM {c} {parent=Computer company} {wiki} As of the 2020's, a slumbering giant. But the pre-Internet impact of IBM was insane! Including notably: * some of the most important business computers of the pre- era * * , which is a predecessor to and = IBM product {c} {parent=IBM} = IBM System/360 {c} {parent=IBM product} {title2=1964} {wiki} This is a family of computers. It was a big success. It appears that this was a big unification project of previous architectures. And it also gave software portability guarantees with future systems, since writing software was starting to become as expensive as the hardware itself. Media: * https://youtu.be/qwocVH3_1Eo?t=841 from