How to be low-level programmer
Find a file
Simone Mario Lombardo 51881e5221 Update README.md
Inizio della traduzione
2017-04-17 15:55:08 +02:00
c-language-challenge.md Update c-language-challenge.md 2017-03-30 07:51:44 +02:00
LICENSE Initial commit 2017-01-01 18:13:04 +01:00
README.md Update README.md 2017-04-17 15:55:08 +02:00

Università della programmazione a basso livello

Che cos'è?

Questa pagina è per i principianti che vogliono essere programmatori a basso livello.

L'inspirazione proviene dalla pagina google-interview-university. Vorrei condividere la mia esperienza e mostrare un piano per diventare un programmatore a basso livello perchè mi sono reso conto che queste skill non sono così diffuse come una volta. Inoltre, molti studenti e principianti mi chiedono come possono diventare dei programmatori a basso livello e ingegneri del kernel di Linux.

Questa pagina non potrà mai includere ogni link/libro/corso a riguardo. Ad esempio, questa pagina introduce Arduino ma non sono presenti informazioni dettagliate riguardo ad esso e alla programmazione embedded. Il resto spetta a te. Hai letto la parola chiave "Arduino" dalla quale puoi partire; perciò il tuo prossimo passo sarà probabilmente ricercarla su Google, comprare il kit e sperimentare per te stesso, non collezionare libri gratuiti e link. Ricorda che questa pagina è solo un piano.

Per tua informazione, ho oltre 10 anni di esperienza come programmatore a basso livello:

  • Programmazione assembly 80x86
  • Driver per hardware con chip e firmware Atmel chip
  • Programmazione di sistema in linguaggio C per Unix
  • Driver di dispositivo per Linux
  • Kernel linux: allocazione di pagina
  • Kernel linux: dispostivi a blocchi e modulo md

Che cos'è il basso livello?

Identifico come programmazione a basso livello, quella programmazione che è molto vicina alla macchina, usando un linguaggio a basso come C o Assembly. Ciò è in contrasto la programmazione ad alto livello, tipica delle applicazioni denominate user-space, che utilizzano linguaggi ad alto livello (es. Python, Java).

TO DO

Yes, systems programming is a very close concept to low-level programming. This page includes the hardware design and firmware development that is not included in system programming.

Finally, this page includes topics ranging from hardware components to the Linux kernel. That is a huge range of layers. A one page document can never cover the details of all the layers, so the aim of this document is to serve as a starting point for low-level programming.

Theory

There are two background theories to low-level programming:

  • Computer Architecture
  • Operating Systems

You can find many good classes on online universities, for instance, Coursera.org and edx.org. Theory is theory. I don't think you should get A+ in the class, just understand the big picture in the class. You'll get better and better with experience.

Languages

Assembly

  • 8086 assembly programming with emu8086
    • basic concepts of CPU and computer architecture
    • basic concepts of C programming language
  • 64bit assembly programming(translation in progress)
    • basic concepts of modern CPU and computer architecture
    • basic concepts of disassembling and debugging of C code
    • need help for translation
  • ARM Architecture Reference Manual, 2nd Edition
    • Complete reference on ARM programming
  • Computer Organization and Design
    • MIPS Edition
    • ARM Edition
    • Academic books that explain how every component of a computer work from the ground up.
    • Explains in details the different concepts that make up computer architecture.
    • They are not for targeted to becoming proficient in a specific assembly language.
    • The MIPS and ARM edition cover the same topics but by dissecting a different architecture.
    • Both editions contain examples in the x86 world

C language

There is no short-cut. Just read the entire book and solve all the exercises.

Applications

Hardware && Firmware

If you want to be an embedded systems engineer, it would be best to start from a simple hardware kit, rather than starting with the latest ARM chipset.

  • Arduino Start Kit
    • There are various series of Arduino but "Arduino Start Kit" has the most simple processor(Atmega328P) and guide book
    • Atmega328P has 8bit core that is the good to start "Digital circuit design" and "Firware development".
    • You don't need to know how to draw schematics and layout, and assemble the chips.
    • But you need to know how to read schematics and understand how the chips are connected.
    • Firmware developers should be able to read the schematics and figure out how to send data to the target device.
    • Follow the guide book!
  • 8086 manual
    • If you're a beginner to x86 architecture, 8086 is also very good guide for processor architecture and 80x86 assembly
  • 80386 manual

At this point, you should be good to start the latest ARM or x86 processor.

For example, the Raspberry Pi board has a Cortex-A53 Processor that supports a 64-bit instruction set. This allows you to experience a modern processor architecture with rPi. Yes, you can buy it... but... what are you going to do with it? If you have no target project, you would be likely to throw the board into a drawer and forget it like other gadgets you may have bought before.

So, I recommend one project for you.

I've made a toy kernel that supports 64bit long mode, paging and very simple context switching. Making a toy kernel is good way to understand modern computer architecture and hardware control.

In fact, you have already the latest processor and the latest hardware devices. Your laptop! Your desktop! You already have all to start! You don't need to buy anything. The qemu emulator can emulate the latest ARM processors and Intel processors. So everything you need is already on hand. There are so many toy kernel and documents you can refer to. Just install qemu emulator and make a tiny kernel that just boots and turns on paging, and prints some messages.

Other toy kernels:

Linux kernel and device driver

You don't need to make a complete operating system. Join the Linux community and participate in development.

Read carefully

References

Check when you need something

Future of low-level programming

I do not know the future, but I keep my eye on RUST.

If I could have one week free and alone, I would learn RUST. That is because RUST is the latest language with which I can develop Linux device driver.

IoT is new trend, so it's worth to check what OSs are for IoT. ARM, Samsung and some companies has their own realtime OS but sadly many of them are close source. But Linux Foundation also has a solution: Zephyr

Typical cloud server has so many layers, for instance, host OS, kvm driver, qemu process, guest OS and service application. So container has been developed to provide light virtualization. In near future, a new concept of OS, so-called library OS or Unikernel, would be replace the typical stack of SW for virtualization.

Translation

Please send me the pull request if you'd like to translate this page. I'll list it here.