What is Bootstrapping? - Computerphile

preview_player
Показать описание
A little bit of magic - bootstrapping, allows the separation of code and machine, allowing one single piece of code to run on many different machines. Professor Tom Rodden introduces the idea.

Reverse Polish and Stacks: Coming Soon

This video by Sean Riley and Brady Haran.

Рекомендации по теме
Комментарии
Автор

"there come a time when you understand you can't understand everything about computers" - man, the feels. That's been my life's quest, and I've reluctantly come to the same conclusion :(

SteveSalstrand
Автор

The quintessential instance of bootstrapping occurred when we needed to create the first compilers (actually, "assemblers") which would allow programmers to write native machine code in a textual format. Before you could write 6502 assembly language, someone first had to write a 6502 compiler in pure machine language, or do the translation from assembler to machine code by hand. Of course it's even possible that the first 6502 compiler was written on a Z80 or any other existing architecture. Once the 6502 compiler existed, it could then be improved, writing the next version using that initial hand-compiled version.

Taking the Atari 6502 computers as an example, their first 6502 assembler was probably a reference assembler that had been hand-coded by the chip-maker. But they quickly used that tool to build a better assembler, and used that first Atari-based program to write the core Atari OS, the code to read and write to its memory-mapped custom chips, to handle tape and disk I/O, keyboard polling, etc. They used that first assembler to create a better Macro Assembler (one which allows coders to combine blocks of assembly code into reusable units) as a full Integrated Development Environment (IDE) combining file management, editing, assembly, debugging, etc. They used this tool to write AtariBASIC, a simple high-level language. And other developers used the assembler to write the "Deep Blue C" compiler, one of the earliest C compilers. The "B Key" compiler (which turns AtariBASIC into small and efficient bytecode that runs much faster) was itself written in AtariBASIC, then used to compile itself, so it's a bootstrap within a bootstrap.

So very quickly the bare 6502 chip became a computer with innovative audiovisual hardware and a multi-language code platform, all bootstrapped from that first early reference assembler. Today we don't need to bootstrap new chips, because we can just make a GCC or Clang plugin that spits out the right machine code. But we can always get a similar experience by building 3D printers that make new 3D printers, robots that construct newer and better robots, tools that allow us to make better tools...

ScottLahteine
Автор


The article also cleared up some questions I had after watching this video.

unvergebeneid
Автор

This video answers one of the most common questions people new to programming or computers in general ask. Thanks a lot!

Автор

Though it is also important to understand how the low level stuff works because their restrictions and limitations doesn't vanish when using high level language.
For example CPU cache. An algorithm can be correct and run slowly because it isn't optimized to fit in the CPU cache.

YoniBlogspot
Автор

Our bootstrap in 1973 was a punched card with 40 pairs of numbers (80 column total).  It consisted of <memory location to start loading card><memory location to start executing> <Hex number pairs to load into computer> and FF to mark the end.  The instructions on the boot card read 1 block from the disk, which then executed code to read more from the disk.  Our line printer in the morning printed the 1'st few lines very uneven, so the same boot process was used to create a card that printed rows of E's on the printer to warm it up.  That was machine coding.

ForbinKid
Автор

The way he says it sounds like you need different code for each individual computer, only later (when Brady gets confused) is it made clear that it's about different architectures

onesandzeroes
Автор

Java and C++ were both bootstrapped in C

TopShelfization
Автор

You should do a video on Operating Systems!

Virtual Address Space (and translation), Processes/Threads, Program memory etc.

I think that the OS is often just viewed as "Something I can boot, which lets me click things and access files". A more in-depth view of the OS would hopefully clear up many of the misconceptions.

Galakhor
Автор

This reminded me of Ken Thompson's talk Reflections on Trusting Trust which demonstrates the most insidious hack I can imagine, where an exploited compiler adds a vulnerability to the compiled binaries of itself which can be potentially impossible to detect. You guys should definitely do a video on it.

Jebusankel
Автор

Great video! As a web designer I'm constantly baffled how my html and css code gets interpreted by computers, smartphones, tablets and TV's and somehow looks everywhere how I wanted it to look. Just imagine all the calculations that have to be done to convert the code into a color-matrix which can be sent over to the display!

alsifjlasieflooo
Автор

But the egg obviously came before the chicken by millions of years.

There was no first chicken, but if there was it would have been inside a non-chicken egg (if you define a chicken egg as an egg laid by a chicken) or it would have been inside a chicken egg (if you define a chicken egg as an egg with a chicken in it).

In all cases the chicken could never have come before the egg.

The chicken had to be bootstrapped by a non-chicken :-)


Tupster
Автор

Years ago it was possible to use 6502 machine code directly on my Acorn machine. "LDA"=Load value A. "JSR" Jump to Subroutine in register. and Many others all followed by a memory address or pointer to the Hi byte or Lo byte of said address. I forget now it was years ago, but it could be done if you had the patience and inspiration!!!

stuartthegrant
Автор

For everyone out there wondering. The Egg came first. At some point way back in time some creature that wasn’t a chicken laid an egg that hatched Into a chicken. That’s how evolution works.

jabbawok
Автор

No one has bootstrapped compilers in the *decades* since cross-compilers were invented.  But every day, people bootstrap their computers when they push the power button.

RonJohn
Автор

"There comes a moment when you can’t understand it all, you can’t understand the thing that your building is so complex it doesn't all fit in your head."
And this is precisely why I still program Apple II computers, I CAN understand the whole system. I don't need a compiler, don't really need an assembler - I know the 6502 op codes, where everything is in memory, exactly what the program is going to do at any given time.

rowhsv
Автор

Computerphile - Thanks much for the reminder of the joys of writing our own bootstrap programs for the Honeywell 2000 and having to get the entire program on a single 80 column card or hand entering it through the console keyboard, if the cardreader was down for some reason.   And having to run the bootstrap every time the machine was turned on.  No such thing as a Load N Go Program at that time.

ktcd
Автор

I must be getting old because that is not how understood bootstrapping at all. I thought the bootstrap was the firmware installed of the motherboard that exposed the hardware of the machine and a device on which could run, so the incoming operating system which one was trying to install could do its stuff. As I say I'm old School and things probably move on with out consulting me.

SteveGouldinSpain
Автор

Wow! That's advanced bootstrapping! Many early machines didn't have a ROM. Bootstrapping was the sequence of instructions that were individually (manually) set into RAM address by address via a sequence of switches. This allowed a tape to be read which loaded the drivers and operating system when the computer was switched on or rebooted. Have a look at a PDP 11 for example.#

On a lighter note of course the rooster came first.

daveturner
Автор

The title of this video is misleading.  Most of it is really about compilers not about bootstrapping.  Bootstrapping is the process of initiating the machine code - the operating system within the operating system.  It is often responsible for the switch from physical addressing to virtual addressing.  The bootstrap process in DEC's VMS operating system is one of the most elegant pieces of code I ever saw.

nickjhowe
join shbcf.ru