The artistic instrument that enables the ultimate art: coding, See also: Section "The art of programming".
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 occasional cosmic ray bit flips. Until they take over the world that is.
Video 1. A computer is the equivalent of a bicycle for our minds by Steve Jobs (1980) Source. Likely an excerpt from an interview done for a documentary in 1980. TODO exact source.
Video 2. Steve Jobs talking about the Internet (1995) Source.
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 Microsoft doesn't own it, and therefore there is a tremendous amount of innovation happening.
then he talks about the impending role for online sales. Amazon incoming.
Computers basically have two applications:
  • computation
  • communication. Notably, computers through the Internet 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. ENIAC 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 Glory of the Geeks. Full interview at: www.youtube.com/watch?v=TRZAJY23xio. It is apparently known as the "Lost Interview" and it was by Cringely himself: www.youtube.com/watch?v=bfgwCFrU7dI for his Triumph of the Nerds documentary.
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 compilers were perfect, no one optimizing software would have to know anything about microarchitecture. 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 closed source 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: Figure 1. "xkcd 378: Real Programmers".
First, the most important thing you should know about this subject: cirosantilli.com/linux-kernel-module-cheat/should-you-waste-your-life-with-systems-programming
Here's a summary from low-level to high-level:
Figure 1. xkcd 378: Real Programmers. Source.
Video 1. How low can you go video by Ciro Santilli (2017) Source. In this infamous video Ciro has summarized the computer hierarchy.
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 integrated circuit 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 operating system: at this point, you can just GDB step debug 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 bootloaders for example, you might want to use JTAG 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
  • emulation 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, QEMU's use of binary translation allows it to run orders of magnitude faster than gem5. 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.
Instrumentation is another technique that has can be considered to achieve greater observability.
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 emulation.
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.
The term loosely refers to certain layers of the computer abstraction layers hierarchy, usually high level hardware internals like CPU pipeline, caching and the memory system. Basically exactly what gem5 models.
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 "digital computer".
As of the 2010's and forward, with the limit of Moore's law and the rise of machine learning, 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 deep learning 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: dl.acm.org/doi/10.5555/3327757.3327866
As an example, the Lightmatter company was trying to implement silicon photonics-based matrix multiplication.
A general intuition behind this type of development is that the human brain, the holy grail of machine learning, is itself an analog computer.
Figure 1. Source.
Unsurprisingly the term "computer" became a synonym for this from the 1960s onwards!
Figure 1. Source.
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:
matrix product of two 128 × 128 matrices of double floats. Testing on 64 bit x86 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
This section is about companies that were primarily started as computer makers.
For companies that make integrated circuits, see also: Section "Semiconductor company".
Video 1. The Mapple Store and Steve Mobs from The Simpsons. Source.
Of course, this only made sense when Apple was more of an underdog to IBM, and Ciro Santilli greatly admires their defiance of the norm.
As of 2020 however, Apple is kind of on the top of the mobile world, and Think different simply makes no sense anymore, notably because it relies on closed source offline software used by millions.
This is a trap every company that prides itself on it's "alternative culture" sets for itself. If they succeed, they could become the norm.
Figure 2. 1976 Think different. 2011 Think mainstream. Cropped from wallpapersafari.com/w/RqYUEj.
Video 1. 1984 Macintosh advertisement by Apple (1984) Source. This ad suggests that Apple was the new thinker that would destroy IBM, as Steve Jobs said it himself when introducing the ad: www.youtube.com/watch?v=zlQvMp5rB6g. And then Apple became IBM in the 2000's starting with the launch of the iPod and then leading up to the iPhone.
Because the people who are crazy enough to think they can change the world are the ones who do.
Video 1. Source.
Was a direct tech predecessor to the iPhone.
Nice looking and expensive operating system by Apple. Ciro Santilli believes that:
  • if you want to be ripped off, just use Microsoft Windows which has more software available
  • or if you want to attain Enlightenment, just use Linux, which is free and open source
The story of how OS X was ported to x86 from PowerPC with large initial work up to boot by a single man in the year 2000, John Kullmann, is really worth reading: www.quora.com/Apple-company/How-does-Apple-keep-secrets-so-well/answer/Kim-Scheinberg on Quora, see also:
Video 1. The Sad Story of Apple's Third Co-Founder by ColdFusion (2022) Source.
Co-founder of Apple.
Is Jobs evil? Is he interesting? Undoubtedly.
Good quotes:
Evil deeds:
This idea also comes up in other sources of course.
Video 1. Margin Call (2011) bridge scene. Source.
TODO clear attribution source:
Some people say, "Give the customers what they want." But that's not my approach. Our job is to figure out what they're going to want before they do. I think Henry Ford once said, "If I'd asked customers what they wanted, they would have told me, 'A faster horse!'" People don't know what they want until you show it to them. That's why I never rely on market research. Our task is to read things that are not yet on the page.
Ciro Santilli likes Magic: The Gathering and he was pleased when he learned that Steve Wozniak does too, and has an expensive collection: redsunsoft.com/2019/03/how-a-post-to-play-magictg-turned-into-an-afternoon-with-the-woz/
Some have actually been preserved: en.wikipedia.org/wiki/File:Blue_Box_in_museum.jpg
The japanese name literally means:
  • 富士 fushi, from Mount Fuji, which itself has unknown origin
  • 通 tong: telecommunications
They died so completely, Googling "ICL" now has higher hits such as Imperial College London.
Video 1. Why the UK's IBM Failed by Asianometry (2022) Source. 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 TSMC's success.
As of the 2020's, a slumbering giant.
But the pre-Internet impact of IBM was insane! Including notably:
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.
This was the first major commercial computer hit. Stlil vacuum tube-based.
Video 1. Learning how to program on the IBM 650 Donald Knuth interview by Web of Stories (2006) Source. It was decimal!
Video 1. The IBM 1401 compiles and runs Fortran II by CuriousMarc (2018) Source.
Borrow from the Internet Archive for free: archive.org/details/supermenstory00murr
Initial chapters put good clarity on the formation of the military-industrial complex. Being backed by the military, especially just after World War II, was in itself enough credibility to start and foster a company.
It is funny to see how the first computers were very artisanal, made on a one-off basis.
Amazing how Control Data Corporation raised capital IPO style as a startup without a product. The dude was selling shares at dinner parties in his home.
Very interesting mention on page 70 of how Israel bought CDC's UNIVAC 1103 which Cray contributed greatly to design, and everyone knew that it was to make thermonuclear weapons, since that was what the big American labs like this mention should be added to: en.wikipedia.org/wiki/Nuclear_weapons_and_Israel but that's Extended Protected... the horrors of Wikipedia.
Another interesting insight is how "unintegrated" computers were back then. They were literally building computers out of individual vacuum tubes, then individual semiconducting transistors, a gate at a time. Then things got more and more integrated as time went. That is why the now outdated word "microprocessor" existed. When processors start to fit into a single integrated circuit, they were truly micro compared to the monstrosities that existed previously.
Also, because integration was so weak initially, it was important to more manually consider the length of wire signals had to travel, and try to put components closer together to reduce the critical path to be able to increase clock speeds. These constraints are also of course present in modern computer design, but they were just so much more visible in those days.
The book does unfortunately not give much detail in Crays personal life as mentioned on this book review: www.goodreads.com/review/show/1277733185?book_show_action=true. His childhood section is brief, and his wedding is described in one paragraph, and divorce in one sentence. Part of this is because he was very private about his family most likely note how Wikipedia had missed his first wedding, and likely misattribute children to the second wedding; en.wikipedia.org/wiki/Talk:Seymour_Cray section "Weddings and Children".
Crays work philosophy is is highlighted many times in the book, and it is something worthy to have in mind:
  • if a design is not working, start from scratch
  • don't be the very first pioneer of a technology, let others work out the problems for you first, and then come second and win
Cray's final downfall was when he opted to try to use a promising but hard to work with material gallium arsenide instead of silicon as his way to try and speed up computers, see also: gallium arsenide vs silicon. Also, he went against the extremely current of the late 80's early 90's pointing rather towards using massively parallel systems based on silicon off-the-shelf Intel processors, a current that had DARPA support, and which by far the path that won very dramatically as of 2020, see: Intel supercomputer market share.
Official demos: github.com/KhronosGroup/glTF-Sample-Assets These are visible at: github.khronos.org/glTF-Sample-Viewer-Release/ with a JavaScript viewer present at: github.com/KhronosGroup/glTF-Sample-Viewer TODO can you load models on the web?
gltf-viewer.donmccurdy.com/ is based on doesn't work with those examples because they have separate asset files.
f3d just worked for it.
To test it, let's get two computers on the same local area network, e.g. connected to Wi-Fi on the same home modem router.
On computer B:
On computer A, run on terminal 1:
sudo tcpdump ip src 192.168.1.102 or dst 192.168.1.102
Then on terminal 2 make a test request:
curl 192.168.1.102:8000
Output on terminal 1:
17:14:22.017001 IP ciro-p14s.55798 > 192.168.1.102.8000: Flags [S], seq 2563867413, win 64240, options [mss 1460,sackOK,TS val 303966323 ecr 0,nop,wscale 7], length 0
17:14:22.073957 IP 192.168.1.102.8000 > ciro-p14s.55798: Flags [S.], seq 1371418143, ack 2563867414, win 65160, options [mss 1460,sackOK,TS val 171832817 ecr 303966323,nop,wscale 7], length 0
17:14:22.074002 IP ciro-p14s.55798 > 192.168.1.102.8000: Flags [.], ack 1, win 502, options [nop,nop,TS val 303966380 ecr 171832817], length 0
17:14:22.074195 IP ciro-p14s.55798 > 192.168.1.102.8000: Flags [P.], seq 1:82, ack 1, win 502, options [nop,nop,TS val 303966380 ecr 171832817], length 81
17:14:22.076710 IP 192.168.1.102.8000 > ciro-p14s.55798: Flags [P.], seq 1:80, ack 1, win 510, options [nop,nop,TS val 171832821 ecr 303966380], length 79
17:14:22.076710 IP 192.168.1.102.8000 > ciro-p14s.55798: Flags [.], ack 82, win 510, options [nop,nop,TS val 171832821 ecr 303966380], length 0
17:14:22.076727 IP ciro-p14s.55798 > 192.168.1.102.8000: Flags [.], ack 80, win 502, options [nop,nop,TS val 303966383 ecr 171832821], length 0
17:14:22.077006 IP ciro-p14s.55798 > 192.168.1.102.8000: Flags [F.], seq 82, ack 80, win 502, options [nop,nop,TS val 303966383 ecr 171832821], length 0
17:14:22.077564 IP 192.168.1.102.8000 > ciro-p14s.55798: Flags [F.], seq 80, ack 82, win 510, options [nop,nop,TS val 171832821 ecr 303966380], length 0
17:14:22.077578 IP ciro-p14s.55798 > 192.168.1.102.8000: Flags [.], ack 81, win 502, options [nop,nop,TS val 303966384 ecr 171832821], length 0
17:14:22.079429 IP 192.168.1.102.8000 > ciro-p14s.55798: Flags [.], ack 83, win 510, options [nop,nop,TS val 171832824 ecr 303966383], length 0
TODO understand them all! Possibly correlate with Wireshark, or use -A option to dump content.
Amazing tool that captures packets and disassembles them. Allows you to click an interactive tree that represents Ethernet, TCP/IP and application layer like HTTP.
Start capture immediately from CLI, capture packets to/from 192.168.1.102:
sudo wireshark -f 'host 192.168.1.102' -k
Capture by instead:
sudo wireshark -f http -k
sudo wireshark -f icmp -k
Filter by both protocol and host:
sudo wireshark -f 'host 192.168.1.102 and icmp' -k
For application layer capture filtering, the best you can do is by port:
sudo wireshark -f 'tcp port 80'
There is an http filter but only for as a wireshark display filter
Sample usage:
sudo tshark -f 'host 192.168.1.102
This produces simple one liners for each request.
What you likely want is the -V option which fully disassembles each frame much as you can do in the GUI Wireshark:
sudo tshark -V -f 'host 192.168.1.102
TODO didn't manage to get it working with TP Link ARCHER VR2800 even though it shows DHCP as enabled and it also shows MAC addresses and corresponding hostnames in the router management interface.
For IP-level communication, askubuntu.com/questions/22835/how-to-network-two-ubuntu-computers-using-ethernet-without-a-router/116680#116680 just worked between P51 and P14s both on Ubuntu 23.10 connected with a regular Cat 5e cable.
On both machines, first we found the Ethernet cable interface name with the ip CLI tool:
ip a
which outputs on the P41s:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp1s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether fc:5c:ee:24:fb:b4 brd ff:ff:ff:ff:ff:ff
3: wlp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 04:7b:cb:cc:1b:10 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.123/24 brd 192.168.1.255 scope global dynamic noprefixroute wlp2s0
       valid_lft 61284sec preferred_lft 61284sec
    inet6 fe80::3597:15d8:74ff:e112/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
so the interface was enp1s0f0, because wlp is wireless and lo is localhost.
So on the P14s we assign an IP of 10.0.0.10 to the P51:
sudo ip address add 10.0.0.10/24 dev enp1s0f0
Then on the P51 analogously, giving IP of 10.0.0.20 to the P14s:
sudo ip address add 10.0.0.20/24 dev enp0s31f6
And after that, P14s can:
ping 10.0.0.10
and P51 can:
ping 10.0.0.20
TODO after a few seconds, the settings appear to be forgotten, and ping stops working unless you do sudo ip address add on the local machine again. This seems to happen after a popup appears saying "Activation of network connection failed" as it fails to obtain Internet from the cable.
TODO list and delete such manual assignments we've made.
E.g. to give Compueter 2 Internet in a setup like:
Internet --- Wi-Fi --- Computer 1 --- Ethernet --- Computer 2
Can be tested e.g. by turning off Wi-Fi from Computer 2 if it has one.
This one is not generally seen by software, which mostly operates starting from OSI layer 2.
A good project to see UARTs at work in all their beauty is to connect two Raspberry Pis via UART, and then:
Part of the beauty of this is that you can just connect both boards directly manually with a few wire-to-wire connections with simple jump wire. Its simplicity is just quite refreshing. Sure, you could do something like that for any physical layer link presumably...
Remember that you can only have one GNU screen connected at a time or else they will mess each other up: unix.stackexchange.com/questions/93892/why-is-screen-is-terminating-without-root/367549#367549
On Ubuntu 22.04 you can screen without sudo by adding yourself to the dialout group with:
sudo usermod -a -G dialout $USER
The frequency range of Wi-Fi, which falls in the microwave range, is likely chosen to allow faster data transfer than say, FM broadcasting, while still being relatively transparent to walls (though not as much).
This can be seen with Wireshark very clearly for example, just make a ping and disssemble it.
Video 1. Are YOU Ready for the INTERNET? by BBC (1994) Source.
Bibliography: