notes and "what is" topics
This commit is contained in:
parent
63a58108d9
commit
255b5b51ef
1 changed files with 314 additions and 169 deletions
483
README_pt.md
483
README_pt.md
|
|
@ -1,230 +1,375 @@
|
|||
# Universidade de Programação de Baixo-Nível
|
||||
# Universidade de Programação em Baixo Nível
|
||||
|
||||
Nota 1: Por favor, não copie o conteúdo dessa página para o seu blog. Você pode compartilhar essa página, mas, por favor, compartilhe com o link original. Essa é a forma que nós elogiamos os autores de bons documentos e projetos open source.
|
||||
|
||||
Nota 2: Por favor, note que programação de baixo nível está fora de moda e atualente não há muitas companhias contratando desenvolvedores de baixo nível. Está ficando mais difícil para eu encontrar um trabalho.
|
||||
Se você ainda não começou a sua carreira profissional, eu recomendaria considerar outros campos cuidadosamente.
|
||||
|
||||
Nota 3: Se você quer ir direto ao ponto, vá para [Como começar?](#How-to-start).
|
||||
|
||||
## Sumário
|
||||
|
||||
* [O que é esse repositório?](#What-is-it)
|
||||
* [O que é programação de "baixo-nível?"](#What-Is-the-Low-Level)
|
||||
* [A Teoria](#Theory)
|
||||
* [Linguagens](#Languages)
|
||||
* [O que é programação de baixo nível?](#What-Is-the-Low-Level)
|
||||
* [Teoria](#Theory)
|
||||
* [Linguagens](#Languages)
|
||||
* [Assembly](#Assembly)
|
||||
* [Linguagem C](#C-language)
|
||||
* [Aplicações](#Applications)
|
||||
* [Hardware & Firmware](#Hardware-Firmware)
|
||||
* [Kernel Linux e drivers de dispositivos](#Linux-kernel-and-device-driver)
|
||||
* [Leia Cuidadosamente](#Read-carefully)
|
||||
* [Referências](#References)
|
||||
* [Outras Aplicações](#Other-applications)
|
||||
* [O Futuro da programação de "baixo-nível"](#Future-of-low-level-programming)
|
||||
* [Sobre a Tradução](#Translation)
|
||||
* [C](#C-language)
|
||||
* [Rust](#Rust-language)
|
||||
* [Aplicações](#Applications)
|
||||
* [Hardware e Firmware](#Hardware-Firmware)
|
||||
* [Kernel Linux e Driver de Dispositivo](#Linux-kernel-and-device-driver)
|
||||
* [Referências](#References)
|
||||
* [Outras aplicações](#Other-applications)
|
||||
* [Futuro da programação em baixo nível](#Future-of-low-level-programming)
|
||||
* [Como começar?](#How-to-start)
|
||||
* [Traduções](#Translation)
|
||||
* [Quem eu sou?](#who-am-i)
|
||||
|
||||
## <a name="What-is-it"></a>O que é esse repositório?
|
||||
|
||||
Esta página é para iniciantes que querem ser programadores de baixo nível (low-level).
|
||||
Eu me inspirei na [google-interview-university](https://github.com/jwasham/coding-interview-university). Eu gostaria de compartilhar minha experiência e um roteiro de como se tornar um programador de baixo nível porque acredito que essas habilidades não são tão comuns quanto antigamente. Além disso, muitos iniciantes e estudantes me perguntam como poderiam se tornar desenvolvedores de baixo nível e engenheiros do kernel Linux.
|
||||
|
||||
Eu me inspirei no [google-interview-university](https://github.com/jwasham/google-interview-university). Gostaria de compartilhar minha experiência e mostrar um roteiro para se tornar um programador de baixo nível, pois descobri que essas habilidades não são tão comuns como eram antigamente. Além disso, muitos estudantes e principiantes me perguntam como poderiam se tornar programadores de baixo nível e engenheiros de kernel Linux.
|
||||
Essa página não inclui todos os links, livros ou cursos. Por exemplo, essa página introduz Arduino, mas não tem informações detalhados sobre Arduino de sistemas embarcados. Você deve se aprofundar por si mesmo. Você tem a palavra-chave "Arduino" para começar, então seu próximo passo é provalmente pesquisar sobre Arduino, comprar um kit e fazer alguma coisa você mesmo, e não colecionar links e livros. Por favor, lembre que essa página é apenas um roteiro para iniciantes.
|
||||
|
||||
Esta página pode não incluir todos links/livros/cursos. Por exemplo, esta página apresenta o Arduino, mas não há informações detalhadas sobre Arduino e sistemas embarcados. Você deve ir mais longe buscando se aprofundar no assunto. Você tem a palavra-chave "Arduino" no qual você pode iniciar. Então, o próximo passo é provavelmente pesquisar no google por Arduino, comprar um kit e **fazer algo** para si mesmo. Lembre-se que esta página é apenas um roteiro.
|
||||
Programação de baixo nível é uma parte de Ciências da Computação, de tal forma que, é certamente muito melhor ter esse conhecimento primeiro.
|
||||
|
||||
Para mais informações, Eu tenho mais de 10 anos de experiência como programador de baixo nível:
|
||||
* Programação com linguagem Assembly para x8086
|
||||
* Dispositivo de hardware com chip Atmel e firmware
|
||||
* Programação de sistemas Unix com linguagem C
|
||||
* Drivers de dispositivos Linux
|
||||
* Kernel Linux: Paginação
|
||||
* Kernel Linux: Block Device Driver(Driver de dispositivo de bloco) e Módulo md
|
||||
* [Caminho para uma educação autodidata gratuita em Ciências da Computação!](https://github.com/ossu/computer-science)
|
||||
|
||||
## <a name="What-Is-the-Low-Level"></a>O que é programação de "baixo-nível"?
|
||||
|
||||
Classifiquei a programação de baixo nível (low-level programming language) como uma programação muito próxima da linguagem de máquina, usando uma linguagem de programação de nível inferior como C ou Assembly. Isto está em contraste com a programação de alto nível, típica de aplicações de espaço de usuário (user space), usando linguagens de alto nível (por exemplo, Python, Java).
|
||||
* `En` [Wikipédia: Low-level programming language](https://en.wikipedia.org/wiki/Low-level_programming_language)
|
||||
* `PT` [Wikipédia: Linguagem de programação de baixo nível
|
||||
](https://pt.wikipedia.org/wiki/Linguagem_de_programa%C3%A7%C3%A3o_de_baixo_n%C3%ADvel)
|
||||
## <a name="What-Is-the-Low-Level"></a>O que é programação de baixo nível?
|
||||
|
||||
Eu classifico programação de baixo nível como uma programação que é muito próxima da máquina. Usa-se uma linguagem de programação de mais baixo nível, como C ou assembly, diferentimente de linguagens de programação de alto nível, típicas de aplicações do espaço de usuário, como Python ou Java.
|
||||
|
||||
* [Wikipedia: linguagem de programação de baixo nível](https://pt.wikipedia.org/wiki/Linguagem_de_programa%C3%A7%C3%A3o#Quanto_ao_grau_de_abstra%C3%A7%C3%A3o)
|
||||
|
||||
Sim, o conceito de programação de sistemas é bem próximo do de programação de baixo nível. Esse roteiro inclui o desenvolvimento de hardware e firmware que não estão inclusos no desenvolvimento de sistemas.
|
||||
|
||||
Sim, a programação de sistemas (system programming) é um conceito muito próximo da programação de baixo nível. Esta página inclui o design de hardware e o desenvolvimento de firmware que não está incluído na programação do sistema.
|
||||
* [Wikipedia: System programming](https://en.wikipedia.org/wiki/System_programming)
|
||||
|
||||
Finalmente, esta página inclui tópicos que vão desde componentes de hardware até o kernel do Linux. Essa é uma enorme variedade de camadas. Um documento de uma página nunca pode cobrir os detalhes de todas as camadas, de modo que o objetivo deste documento é servir de ponto de partida para a programação de baixo nível.
|
||||
Finalmente, esse roteiro inclui tópicos indo de componentes de hardware até o kernel Linux. Isso é uma variedade enorme de camadas. Um documento de uma página nunca conseguiria cobrir detalhadamente todas elas, então o foco deste é servir de ponto inicial para programação de baixo nível.
|
||||
|
||||
## <a name="Theory"></a>A Teoria
|
||||
## <a name="Theory"></a>Teoria
|
||||
|
||||
Existem duas áreas de estudo para programação de baixo nível:
|
||||
* [Wikipédia: Arquitetura de Computadores](https://pt.wikipedia.org/wiki/Arquitetura_de_computadores)
|
||||
* [Wikipédia: Sistemas Operacionais](https://pt.wikipedia.org/wiki/Sistema_operativo)
|
||||
There are two background theories to low-level programming:
|
||||
* Computer Architecture
|
||||
* Operating Systems
|
||||
|
||||
Você pode encontrar muitos cursos online bons de universidades, como por exemplo, [Coursera.org](https://www.coursera.org/) e [Edx.org](https://www.edx.org/).
|
||||
Teoria é teoria. Eu não acho que você precisa tirar 10 (ou conceito A), você precisa apenas entender boa parte do curso.
|
||||
Você irá melhorar com tempo de experiência e muita prática.
|
||||
I think the best way to learn theory is by taking a course. Reading books is not bad but takes too much time and effort. You can find many good classes on online universities, for instance, Coursera.org and edx.org.
|
||||
Theory is theory. I don't think you need to get an A+ in the class, just understand the big picture.
|
||||
You'll get better and better with experience.
|
||||
|
||||
Deixe-me apresentar vários livros que eu li. Eles são normalmente usados como livros para leitura nas universidades. Se estes não forem indicados em suas aulas da universidade, vale a pena gastar algum tempo com eles. Recomendo a leitura em inglês desses livros.
|
||||
|
||||
* Arquitetura de Computadores
|
||||
Let me introduce several books that I've read. They are commonly used as textbooks in universities. If there is no class with these books in your university, it's worth spending some time reading them.
|
||||
* Computer Architecture
|
||||
* Computer Architecture, Fifth Edition: A Quantitative Approach
|
||||
* Computer Systems: A Programmer's Perspective
|
||||
* Computer Organization and Design, Fourth Edition: The Hardware/Software Interface
|
||||
* Sistema Operacionais
|
||||
* Operating Systems
|
||||
* The Magic Garden Explained: The Internals of UNIX System V Release 4 an Open Systems Design
|
||||
* The Design of the UNIX Operating System
|
||||
* Operating Systems: Internals and Design Principles by William Stallings
|
||||
* Recommended Courses
|
||||
* [CS401: Operating Systems from saylor.org](https://learn.saylor.org/course/view.php?id=94)
|
||||
* General Programming Skill
|
||||
* [Structure and Interpretation of Computer Programs](https://en.wikipedia.org/wiki/Structure_and_Interpretation_of_Computer_Programs)
|
||||
* It's about how to be a good Software programmer. You need not only theory but only technique because programming is a kind of craftwork.
|
||||
* If you learn Lisp/Scheme, you should be able to learn any other language quickly.
|
||||
* [I've solved about 80% exercises. It should be worth to try every single exercise.](https://github.com/gurugio/sicp_exercise)
|
||||
* Hardware Design
|
||||
* Build Your Own 8086 Microprocessor Kit
|
||||
* If you don't build your HW board, you don't understand what physical memory mapped device is.
|
||||
* Modern APs includes so many IPs. So you don't have a chance to understand how CPU core and peripheral devices are connected.
|
||||
* When you build your own 8086 kit, you have a chance to locate each peripheral devices on the physical memory. And you can set how the main HW components (BUS, IRQ, Clock, Power and etc) works with your own eyes.
|
||||
* I built the 8086 kit in my University. It was one of the most valuable courses I've ever taken. Try to build your own HW kit. It would be better if the HW is older ans simpler because you should do more for yourself.
|
||||
* Google "8086 kit". You would be able to find some web-sites you can buy a HW scheme, parts and manuals.
|
||||
|
||||
Há uma lista infinita de bons livros. Eu não quero dizer que você deve ler muitos livros. Basta ler cada livro cuidadosamente. Sempre que você aprender uma teoria, implemente o código de teste. **Implementar é a melhor maneira de conhecer a fundo a teoria.**
|
||||
There is an infinite list of good books. I don't want to say that you should read many books. Just read one book carefully. Whenever you learn a theory, implement simulation code of it. **Implementing one thing is better than knowing one hundred theories.**
|
||||
|
||||
## <a name="Languages"></a>Linguagens
|
||||
## <a name="Languages"></a>Languages
|
||||
|
||||
### <a name="Assembly"></a>Assembly
|
||||
|
||||
Escolha entre x86 e ARM. Não precisa saber os dois. Isso não importa para aprender a linguagem Assembly. O essencial é conhecer a arquitetura da CPU e do computador. Então você não precisa aprender o Assembly da arquitetura da CPU mais recente que existe. Selecione a arqutetura x8086 ou Corex-M.
|
||||
Choose one between x86 or ARM. No need to know both. It doesn't matter to know assembly language. The essential thing is understanding the internals of a CPU and computer. So you don't need to practice the assembly of the latest CPU. Select 8086 or Corex-M.
|
||||
|
||||
* `EN` [Programação com linguagem Assembly para x8086 com emu8086](https://github.com/gurugio/book_assembly_8086)
|
||||
* Conceitos básicos de CPU e arquitetura de computadores
|
||||
* Conceitos básicos de linguagem de programação C
|
||||
* `EN` [Programação com linguagem Assembly para 64 bits (Tradução em andamento)](https://github.com/gurugio/book_assembly_64bit)
|
||||
* Conceitos básicos de uma CPU moderna e arquitetura de computadores
|
||||
* Conceitos básicos de `desmontagem` (disassembling) and `depuração` (debugging) de código em C
|
||||
* `EN` [ARM Architecture - Manual de Referência, 2ª Edição](http://www.mypearsonstore.ca/bookstore/arm-architecture-reference-manual-9780201737196)
|
||||
* Referência completa de programação em arquiteturas ARM
|
||||
* Organização e design de computadores
|
||||
* [Edição MIPS](https://www.amazon.ca/Computer-Organization-Design-MIPS-Interface/dp/0124077269/)
|
||||
* [Edição ARM](https://www.amazon.ca/Computer-Organization-Design-ARM-Interface/dp/0128017333/)
|
||||
* Livros acadêmicos que explicam como cada componente de um computador trabalha.
|
||||
* Explica com detalhes os diferentes conceitos que compõem a arquitetura de computadores.
|
||||
* Eles não são destinados a se tornar proficiente em na linguagem Assembly para uma arquitetura específica.
|
||||
* A edição MIPS e ARM cobrem os mesmos tópicos, mas aprofundando arquiteturas diferentes.
|
||||
* Ambas as edições contêm exemplos no mundo x8086.
|
||||
* [8086 assembly programming with emu8086](https://github.com/gurugio/book_assembly_8086)
|
||||
* basic concepts of CPU and computer architecture
|
||||
* basic concepts of C programming language
|
||||
* [64bit assembly programming(translation in progress)](https://github.com/gurugio/book_assembly_64bit)
|
||||
* basic concepts of modern CPU and computer architecture
|
||||
* basic concepts of disassembling and debugging of C code
|
||||
* _need help for translation_
|
||||
* [Learning assembly for linux-x64](https://github.com/0xAX/asm)
|
||||
* pure 64-bit assembly programming with NASM and inline assembly with GCC
|
||||
* [ARM Architecture Reference Manual, 2nd Edition](http://www.mypearsonstore.ca/bookstore/arm-architecture-reference-manual-9780201737196)
|
||||
* Complete reference on ARM programming
|
||||
* Computer Organization and Design
|
||||
* [MIPS Edition](https://www.amazon.ca/Computer-Organization-Design-MIPS-Interface/dp/0124077269/)
|
||||
* [ARM Edition](https://www.amazon.ca/Computer-Organization-Design-ARM-Interface/dp/0128017333/)
|
||||
* [RISC-V Edition](https://www.amazon.com/Computer-Organization-Design-RISC-V-Architecture/dp/0128122757)
|
||||
* Academic books that explain how every component of a computer work from the ground up.
|
||||
* Explains in detail the different concepts that make up computer architecture.
|
||||
* They are not targeted at readers who wish to become 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
|
||||
|
||||
### <a name="C-language"></a>Linguagem C
|
||||
### <a name="C-language"></a>C language
|
||||
|
||||
Não há atalho. Basta ler os livros e resolver todos os exercícios (Muita prática...).
|
||||
There is no shortcut. Just read the entire book and solve all the exercises.
|
||||
|
||||
* `EN` [Programação C: Uma abordagem moderna, 2ª edição](https://www.amazon.com/C-Programming-Modern-Approach-2nd/dp/0393979504)
|
||||
* `EN` [A Linguagem de Programação C, 2ª Edição](https://www.amazon.com/Programming-Language-Brian-W-Kernighan/dp/0131103628/ref=pd_sbs_14_t_0?_encoding=UTF8&psc=1&refRID=60R1D2CHBA8DHYT6JNMN)
|
||||
* `EN` [Linguagem C Moderna](http://icube-icps.unistra.fr/img_auth.php/d/db/ModernC.pdf)
|
||||
* Para o novo padrão C
|
||||
* `EN` [A Programação paralela é difícil e, nesse caso, o que você pode fazer?](https://www.kernel.org/pub/linux/kernel/people/paulmck/perfbook/perfbook.html)
|
||||
* Implementação de sincronização paralela com linguagem C
|
||||
* Essencial para programação em C em larga escala (especialmente para programação de kernel)
|
||||
* `EN` [Desafio de programação C?](https://github.com/gurugio/lowlevelprogramming-university/blob/master/c-language-challenge.md)
|
||||
* Plano de estudos similar ao `EN` [O desafio de Eudyptula](http://eudyptula-challenge.org/)
|
||||
* Apenas uma ideia no momento...
|
||||
* Se você conseguir fazer todos os pequenos desafios dessa página, provavelmente você estará apto para começar projetos maiores.
|
||||
* `EN` [Black Book de programação gráfica de Michael Abrash, edição especial](http://www.jagregory.com/abrash-black-book/)
|
||||
* Referencia em otimização usando linguagem C e um pouco de linguagem Assembly para x8086
|
||||
* Começa a partir de x8088 até as arquiteturas mais atuais
|
||||
* Foco especial na otimização de gráficos de baixo nível
|
||||
* [C Programming: A Modern Approach, 2nd Edition](https://www.amazon.com/C-Programming-Modern-Approach-2nd/dp/0393979504)
|
||||
* [The C Programming Language 2nd Edition](https://www.amazon.com/Programming-Language-Brian-W-Kernighan/dp/0131103628/ref=pd_sbs_14_t_0?_encoding=UTF8&psc=1&refRID=60R1D2CHBA8DHYT6JNMN)
|
||||
* Modern C: Jens Gustedt. Modern C. Manning, 2019, 9781617295812. ffhal-02383654f
|
||||
* For new standard of C
|
||||
* [Is Parallel Programming Hard, And, If So, What Can You Do About It?](https://www.kernel.org/pub/linux/kernel/people/paulmck/perfbook/perfbook.html)
|
||||
* raw implementation of synchronization with C
|
||||
* Essential for large scale C programming (especially for kernel programming)
|
||||
* [C Project Based Tutorials?](https://www.reddit.com/r/C_Programming/comments/872rlt/c_project_based_tutorials/)
|
||||
* If you finish reading one or two C programming books, then you MUST make something.
|
||||
* Choose whatever you like.
|
||||
* First make on your own and then compare with someone else's source code. It is very important to compare your source and others. You can improve your skill only when you read the other's source and learn better methods. Books are dead and source is live.
|
||||
* [C and other languages based projects](https://github.com/danistefanovic/build-your-own-x)
|
||||
* find more interesting projects
|
||||
* [Michael Abrash’s Graphics Programming Black Book, Special Edition](http://www.jagregory.com/abrash-black-book/)
|
||||
* Reference on optimization using C and a bit of x86 assembly
|
||||
* Starts from the 8088 up to today
|
||||
* Special focus on low-level graphics optimization
|
||||
* [Framework and plugin design in C](https://github.com/gurugio/book_cprogramming)
|
||||
* How to develop framework and plugin in C for large scale software
|
||||
* Very basic programming tips for Linux kernel source reading
|
||||
|
||||
Se você quer ser um especialista em linguagem C, acesse https://leetcode.com/. Boa sorte!
|
||||
If you want to be expert of C programming, visit https://leetcode.com/. Good luck!
|
||||
|
||||
## <a name="Applications"></a>Aplicações
|
||||
### <a name="Rust-language"></a>Rust language
|
||||
|
||||
### <a name="Hardware-Firmware"></a>Hardware & Firmware
|
||||
I am sure that the next language for the systems programming would be Rust.
|
||||
I will make a list what I did to learn Rust.
|
||||
|
||||
Se você quiser ser um engenheiro de sistemas embarcados, seria melhor começar a partir de um kit de hardware simples, ao invés de começar com o mais recente chipset ARM.
|
||||
[Linus Torvalds said "Unless something odd happens, it [Rust] will make it into 6.1."](https://www.zdnet.com/article/linus-torvalds-rust-will-go-into-linux-6-1/)
|
||||
|
||||
* `EN` [Arduino Start Kit](https://www.arduino.cc/)
|
||||
* Existem várias séries de Arduino, mas o "Arduino Start Kit" tem o processador mais simples (Atmega328P) e guia de livros
|
||||
* Atmega328P tem um microcontrolador de 8 bits que é o bom para ser usado como base de "design de circuitos digitais" e "desenvolvimento de firmware".
|
||||
* Você não precisa saber como desenhar esquemas e layout, e construir os chips.
|
||||
* Mas você precisa saber como ler esquemas e entender como os chips estão conectados.
|
||||
* Os desenvolvedores de firmware devem ser capazes de ler os esquemas e descobrir como enviar dados para o dispositivo de destino.
|
||||
* Siga o "guide book"!
|
||||
* `EN` [x8086 manual](https://edge.edx.org/c4x/BITSPilani/EEE231/asset/8086_family_Users_Manual_1_.pdf)
|
||||
* Se você é um novato para a arquitetura x8086, também é muito bom para aprender a arquitetura do processador e a linguagem Assembly para x8086
|
||||
* `EN` [80386 manual](http://css.csail.mit.edu/6.858/2015/readings/i386.pdf)
|
||||
* Melhor guia para modo protegido e mecanismo de paginação do processador x8086
|
||||
* `EN` Versão web: https://pdos.csail.mit.edu/6.828/2011/readings/i386/toc.htm
|
||||
* [The Rust Programming Language](https://doc.rust-lang.org/book/)
|
||||
* Great introduction, but lack of examples and exercises.
|
||||
* [Rust by Example](https://doc.rust-lang.org/rust-by-example/)
|
||||
* While reading "The Rust Programming Language", you can find examples and exercises here.
|
||||
* But there are not many exercises you can do something for yourself. Only some examples includes "do-this" exercises and they are very simple.
|
||||
* [Programming Rust, 2nd](https://www.oreilly.com/library/view/programming-rust-2nd/9781492052586/)
|
||||
* Deeper introduction, but still lack of examples and exercises.
|
||||
* [Exercism](https://exercism.org/tracks/rust)
|
||||
* Good exercises to practice indivisual features of RUST.
|
||||
* I am not sure Mentors are working actively but it would be enough to compare your solution with others.
|
||||
* After submitting your solution, you can see other's solutions with "Community solutions" tab (since Exercism V3).
|
||||
* Many easy level exercises are for functional feature such as map/filter/any and etc.
|
||||
* [Easy rust](https://dhghomon.github.io/easy_rust/)
|
||||
* A book written in easy English.
|
||||
* Youtube materials provided: https://www.youtube.com/playlist?list=PLfllocyHVgsRwLkTAhG0E-2QxCf-ozBkk
|
||||
* [Let's get rusty](https://www.youtube.com/c/LetsGetRusty)
|
||||
* There are many Youtubers uploading Rust course but I enjoyed this course most.
|
||||
* He has been uploading the latest news for Rust. It's worth subscribing.
|
||||
* [Rust for Linux](https://github.com/Rust-for-Linux)
|
||||
* See the example sources and check how Rust will get into the Linux kernel
|
||||
|
||||
Este ponto, você deve ser bom para começar com uma versão mais recente de um processador ARM ou x8086.
|
||||
* `EN` https://www.raspberrypi.org/
|
||||
* `EN` https://beagleboard.org/
|
||||
* `EN` https://www.arduino.cc/en/ArduinoCertified/IntelEdison
|
||||
## <a name="Applications"></a>Applications
|
||||
|
||||
Por exemplo, a placa Raspberry Pi tem um processador Cortex-A53 que suporta um conjunto de instruções de 64 bits.
|
||||
Isso permite que você experimente uma arquitetura de processador moderna com rPi.
|
||||
Sim, você pode comprá-lo ... mas ... o que você vai fazer com ele?
|
||||
Se você não tem nenhum projeto em mente, você provavelmente jogaria a placa em uma gaveta e iria esquecê-la como outros gadgets que você comprou.
|
||||
### <a name="Hardware-Firmware"></a>Hardware && Firmware
|
||||
|
||||
Então, eu recomendo um projeto para você
|
||||
* `EN` [Criando seu próprio kernel](http://wiki.osdev.org/Getting_Started)
|
||||
* `EN` Boas referências: https://www.reddit.com/r/osdev/
|
||||
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.
|
||||
|
||||
Eu fiz um ["toy kernel"](https://github.com/gurugio/caos) que suporta 64 bits long mode, paginação e comutação muito simples de contexto. Fazer um "toy kernel" é uma boa maneira de entender arquitetura de computadores moderna e controle de hardware.
|
||||
* [Arduino Start Kit](https://www.arduino.cc/)
|
||||
* There are many series of Arduinos but "Arduino Start Kit" has the most simple processor(Atmega328P) and guide book
|
||||
* Atmega328P has an 8-bit core which is a good place to start digital circuit design and firmware development.
|
||||
* You don't need to know how to draw schematics and layouts and assemble the chips.
|
||||
* But you do 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](https://edge.edx.org/c4x/BITSPilani/EEE231/asset/8086_family_Users_Manual_1_.pdf)
|
||||
* If you're a beginner to x86 architecture, 8086 is also very good guide for processor architecture and 80x86 assembly
|
||||
* [80386 manual](http://css.csail.mit.edu/6.858/2015/readings/i386.pdf)
|
||||
* Best guide for protected mode and paging mechanism of 80x86 processor
|
||||
* Web version: https://pdos.csail.mit.edu/6.828/2011/readings/i386/toc.htm
|
||||
|
||||
Na verdade, você já possui o processador mais recente e os dispositivos de hardware mais recentes.
|
||||
Seu notebook! Seu PC! Você já tem tudo para começar!
|
||||
Você não precisa comprar nada mais.
|
||||
O emulador qemu pode simular a mais recente arquitetura de processadores ARM e Intel.
|
||||
Então tudo o que você precisa já está à mão.
|
||||
Existem muitos "toy kernel" e documentos que você pode consultar.
|
||||
Basta instalar o emulador qemu e criar um pequeno kernel que apenas inicialize e ative a paginação e imprima algumas mensagens.
|
||||
At this point, you should be good to start the latest ARM or x86 processor.
|
||||
* https://www.raspberrypi.org/
|
||||
* https://beagleboard.org/
|
||||
* https://www.arduino.cc/en/ArduinoCertified/IntelEdison
|
||||
|
||||
Outros "toy kernels":
|
||||
* `EN` [Little OS Book]https://littleosbook.github.io/
|
||||
* `EN` [Tuhdo]https://tuhdo.github.io/os01/
|
||||
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.
|
||||
|
||||
### <a name="Linux-kernel-and-device-driver"></a>Kernel Linux e drivers de dispositivos
|
||||
So, I recommend one project for you.
|
||||
* [Making your own kernel](http://wiki.osdev.org/Getting_Started)
|
||||
* Good references: https://www.reddit.com/r/osdev/
|
||||
* [Learning operating system development using Linux kernel and Raspberry Pi](https://github.com/s-matyukevich/raspberry-pi-os)
|
||||
* (description of the project) This repository contains a step-by-step guide that teaches how to create a simple operating system (OS) kernel from scratch...(skip)...Each lesson is designed in such a way that it first explains how some kernel feature is implemented in the RPi OS, and then it tries to demonstrate how the same functionality works in the Linux kernel.
|
||||
|
||||
Você não precisa fazer um sistema operacional completo.
|
||||
Junte-se à comunidade Linux e participe do desenvolvimento.
|
||||
I've made [a toy kernel](https://github.com/gurugio/caos) that supports 64-bit long mode, paging and very simple context switching. Making a toy kernel is good way to understand modern computer architecture and hardware control.
|
||||
|
||||
#### <a name="Read-carefully"></a>Leia Cuidadosamente
|
||||
In fact, you have already the latest processor and the latest hardware devices.
|
||||
Your laptop! Your desktop! You already have all that you need in order 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 many toy kernels and documents you can refer to.
|
||||
Just install qemu emulator and make a tiny kernel that just boots, turns on paging, and prints some messages.
|
||||
|
||||
* Livros: Leia os seguintes em ordem:
|
||||
* `EN` [O design do sistema operacional Unix](https://www.amazon.com/Design-UNIX-Operating-System/dp/0132017997)
|
||||
* Os conceitos básicos do Unix são aplicados em qualquer o sistema operacional.
|
||||
* Este livro é muito bom para obter os conceitos de sistema operacional.
|
||||
* `EN` [Drivers de dispositivo Linux](https://www.amazon.com/Linux-Device-Drivers-Jonathan-Corbet/dp/0596005903/ref=sr_1_4?ie=UTF8&qid=1483650712&sr=8-4&keywords=understanding+linux+kernel)
|
||||
* Faça todos os exemplos
|
||||
* `EN` [Desenvolvimento de Kernel Linux](https://www.amazon.com/Linux-Kernel-Development-Robert-Love/dp/0672329468/ref=sr_1_2?ie=UTF8&qid=1483650712&sr=8-2&keywords=understanding+linux+kernel)
|
||||
* Compreenda a arquitetura do kernel do Linux
|
||||
* `EN` [Compreendendo o kernel do Linux](https://www.amazon.com/Understanding-Linux-Kernel-Third-Daniel/dp/0596005652/ref=sr_1_1?ie=UTF8&qid=1483650712&sr=8-1&keywords=understanding+linux+kernel)
|
||||
* Leia este livro e o código fonte do kernel v2.6 ao mesmo tempo
|
||||
* Nunca comece com a versão mais recente, v2.6 é suficiente!
|
||||
* Use qemu e gdb para executar a fonte do kernel linha por linha
|
||||
* `EN` http://stackoverflow.com/questions/11408041/how-to-debug-the-linux-kernel-with-gdb-and-qemu
|
||||
* `EN` https://github.com/gurugio/linuxdeveloptip/blob/master/qemu-gdb-kdump.md
|
||||
* Use o busybox para fazer um sistema de arquivos mais simples que leva apenas 1 segundo para inicializar
|
||||
* `EN` https://github.com/gurugio/linuxdeveloptip/blob/master/minikernelwithbusybox.md
|
||||
* `EN` [O desafio de Eudyptula](http://eudyptula-challenge.org/)
|
||||
* Isto é como um excelente professor particular que te orienta no que fazer.
|
||||
* Se você não sabe o que fazer, basta iniciar isso.
|
||||
* `EN` [Camada de bloco e driver de dispositivo (Tradução em andamento)](https://github.com/gurugio/book_linuxkernel_blockdrv)
|
||||
* Inicie a partir de um exemplo de bloco e driver de dispositivo (block device driver) (Ramdisk) com modo multi-queue
|
||||
* Avance para (camada de bloco) block layer
|
||||
* `EN` [Driver MD do kernel do Linux (Tradução em andamento)](https://github.com/gurugio/book_linuxkernel_md)
|
||||
* Como funciona a ferramenta `mdadm` e como ela chama o `md driver`
|
||||
* Como o `md driver` funciona
|
||||
Other toy kernels:
|
||||
* https://littleosbook.github.io/
|
||||
* https://tuhdo.github.io/os01/
|
||||
|
||||
#### <a name="References"></a>Referências
|
||||
### <a name="Linux-kernel-and-device-driver"></a>Linux kernel and device driver
|
||||
|
||||
Verifique quando precisar de algo
|
||||
You don't need to make a complete operating system.
|
||||
Join the Linux community and participate in development.
|
||||
|
||||
* `EN` [Free-electrons](http://free-electrons.com/docs/)
|
||||
* Muitos arquivos de slides introduzindo bons tópicos, especialmente ARM-linux
|
||||
* `EN` [Postagem de Julia Evans: Você pode ser um hacker de kernel!](http://jvns.ca/blog/2014/09/18/you-can-be-a-kernel-hacker/)
|
||||
* Guia para iniciar a programação do kernel
|
||||
Some resources for Linux kernel and device driver development from beginner to advanced.
|
||||
* Books: Read the following in order
|
||||
* [The Design of the Unix Operating System](https://www.amazon.com/Design-UNIX-Operating-System/dp/0132017997)
|
||||
* The basic concepts of Unix are applied into all operating systems.
|
||||
* This book is a very good place to learn the core concepts of operating systems.
|
||||
* [Linux Device Drivers](https://www.amazon.com/Linux-Device-Drivers-Jonathan-Corbet/dp/0596005903/ref=sr_1_4?ie=UTF8&qid=1483650712&sr=8-4&keywords=understanding+linux+kernel)
|
||||
* Make all examples for yourself
|
||||
* [Linux Kernel Development](https://www.amazon.com/Linux-Kernel-Development-Robert-Love/dp/0672329468/ref=sr_1_2?ie=UTF8&qid=1483650712&sr=8-2&keywords=understanding+linux+kernel)
|
||||
* Understand the design of the Linux Kernel
|
||||
* [Understanding the Linux Kernel](https://www.amazon.com/Understanding-Linux-Kernel-Third-Daniel/dp/0596005652/ref=sr_1_1?ie=UTF8&qid=1483650712&sr=8-1&keywords=understanding+linux+kernel)
|
||||
* Read this book and the kernel source v2.6 at the same time
|
||||
* Never start with the latest version, v2.6 is enough!
|
||||
* Use qemu and gdb to run the kernel source line by line
|
||||
* http://stackoverflow.com/questions/11408041/how-to-debug-the-linux-kernel-with-gdb-and-qemu
|
||||
* https://github.com/gurugio/linuxdeveloptip/blob/master/qemu-gdb-kdump.md
|
||||
* Use busybox to make the simplest filesystem that takes only one second to boot
|
||||
* https://github.com/gurugio/linuxdeveloptip/blob/master/minikernelwithbusybox.md
|
||||
* Other resources: Free resources I recommend
|
||||
* [Linux device driver labs](https://linux-kernel-labs.github.io/)
|
||||
* Practical guide and excellent exercises making Linux device drivers with essential kernel APIs
|
||||
* I think this document introduces almost all essential kernel APIs.
|
||||
* [The Eudyptula Challenge](http://eudyptula-challenge.org/)
|
||||
* _Sadly, this challenge does not accept new challengers because there is no challenge anymore._ The maintainer said he/she is planning a new format. I hope it comes back ASAP.
|
||||
* But you can find the questions of the challenge with Google. Some people already uploaded what they did. Find the questions and try to solve them on your own, and compare your solution with others.
|
||||
* This is like an awesome private teacher who guides you on what to do.
|
||||
* If you don't know what to do, just start this.
|
||||
* [Learning operating system development using Linux kernel and Raspberry Pi](https://github.com/s-matyukevich/raspberry-pi-os)
|
||||
* This project is not completed yet.
|
||||
* I always think making a kernel similar to the Linux kernel is the best way to understand the Linux kernel.
|
||||
* [Block layer and device driver](https://github.com/gurugio/book_linuxkernel_blockdrv)
|
||||
* start from a simple block device driver example (Ramdisk) with multi-queue mode
|
||||
* go forward to block layer
|
||||
* I completed translation into English. Please send me your feedback.
|
||||
* [md driver of Linux kernel(Korean)](https://github.com/gurugio/book_linuxkernel_md)
|
||||
* how mdadm tool works and how it calls md driver
|
||||
* how md driver works
|
||||
* [A Heavily Commemted Linux Kernel Source Code](http://www.oldlinux.org/)
|
||||
* Heavy comments for the ancient Linux v0.12.
|
||||
* It would be good to start with old and simple OS.
|
||||
* Unix version: [Lions' Commentary on UNIX 6th Edition, with Source Code](https://en.wikipedia.org/wiki/Lions%27_Commentary_on_UNIX_6th_Edition,_with_Source_Code)
|
||||
|
||||
### <a name="Other-applications"></a>Outras aplicações
|
||||
#### <a name="References"></a>References
|
||||
|
||||
Sim, talvez você não esteja interessado em desenvolvimento Linux ou firmware. Se não, você pode encontrar outras aplicações:
|
||||
* Programação do sistema Windows e drivers de dispositivo
|
||||
* Segurança
|
||||
* Engenharia reversa
|
||||
Check when you need something
|
||||
|
||||
Eu não tenho nenhum conhecimento sobre essas aplicações. Por favor, me envie qualquer informação para iniciantes.
|
||||
* [Free-electrons homepage](http://free-electrons.com/docs/)
|
||||
* many slide files introducing good topics, specially ARM-linux
|
||||
* [Julia Evans's posting: You can be a kernel hacker!](http://jvns.ca/blog/2014/09/18/you-can-be-a-kernel-hacker/)
|
||||
* guide to start kernel programming
|
||||
|
||||
## <a name="Future-of-low-level-programming"></a>O Futuro da programação "baixo-nível"
|
||||
### <a name="Other-applications"></a>Other application
|
||||
|
||||
Eu não sei o futuro, mas fico atento na linguagem RUST.
|
||||
* `EN` https://hacks.mozilla.org/2016/11/rust-and-the-future-of-systems-programming/
|
||||
Yes, you might not be interested in Linux or firmware. If so, you can find other applications:
|
||||
* Windows systems programming & device drivers
|
||||
* Security
|
||||
* Reverse engineering
|
||||
|
||||
Se eu tivesse uma semana livre, sozinho, conseguiria aprender `RUST`.
|
||||
Isso é porque `RUST` é a linguagem de programação mais recente com que eu posso desenvolver um driver de dispositivo Linux.
|
||||
I don't have any knowledge about those applications. Please send me any information for beginners.
|
||||
|
||||
IoT é uma nova tendência, por isso vale a pena verificar quais OS são para IoT.
|
||||
ARM, Samsung e algumas empresas tem seu próprio sistema operacional em tempo real, mas infelizmente são privados.
|
||||
Entretanto, a Linux Foundation também tem uma solução: Zephyr
|
||||
* `EN` [Zephyr Project]https://www.zephyrproject.org/
|
||||
**Kernels and drivers are not all of low-level programming.** One more important application of low-level programming is the software-defined storage or distributed filesystem. Detailed descriptions of them is beyond the scope of this document but there is an excellent course where you can try a simple distributed filesystem.
|
||||
* Course: https://pdos.csail.mit.edu/archive/6.824-2012/
|
||||
* reference Source: https://github.com/srned/yfs
|
||||
|
||||
Um servidor de nuvem tem muitas camadas, como por exemplo, `host OS`, `Driver kvm`, `qemu process`, `Guest OS` e `Service application`. Assim, o contêiner foi desenvolvido para fornecer uma virtualização mais leve. Em um futuro próximo, um novo conceito de SO, chamado de `library OS` ou `Unikernel`, poderá substituir a típica stack de SW para virtualização.
|
||||
* `EN` [Uni Kernel]http://unikernel.org/
|
||||
## <a name="Future-of-low-level-programming"></a>Future of low-level programming
|
||||
|
||||
## <a name="Translation"></a>Sobre a Tradução
|
||||
I do not know the future, but I keep my eye on Rust.
|
||||
* https://hacks.mozilla.org/2016/11/rust-and-the-future-of-systems-programming/
|
||||
|
||||
Por favor, me envie um pull request se você quiser traduzir ou fazer uma correção nesta página. Vou listá-lo no documento em inglês.
|
||||
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 drivers.
|
||||
* https://github.com/tsgates/rust.ko
|
||||
|
||||
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 closed source.
|
||||
But Linux Foundation also has a solution: Zephyr
|
||||
* https://www.zephyrproject.org/
|
||||
|
||||
Typical cloud servers have many layers; for instance, host OS, kvm driver, qemu process, guest OS and service application. A container has been developed to provide light virtualization. In the near future, a new concept of OS, a so-called library OS or Unikernel, would replace the typical stack of SW for virtualization.
|
||||
* http://unikernel.org/
|
||||
|
||||
Big data and cloud computing require bigger and bigger storage. Some disks directly attached to server machines cannot satisfy the required capacity, stability and performance. Therefore there has been research to make huge storage systems with many storage machines connected by a high speed network. It used to be focused on making one huge storage volume. But currently they are providing many volumes dedicated for many virtual machines.
|
||||
* https://en.wikipedia.org/wiki/Software-defined_storage
|
||||
* https://en.wikipedia.org/wiki/Clustered_file_system
|
||||
* https://en.wikipedia.org/wiki/Ceph_(software)
|
||||
|
||||
## <a name="How-to-start"></a>How to start?
|
||||
|
||||
I received an email asking how to start. There are many information about books, courses and projects in this page. It is my mistake to forget to write how to start. Unfortunately, there is no King's Road to [King's Landing](https://gameofthrones.fandom.com/wiki/King%27s_Landing). I will just write what I did in order. If you have already done something, please skip it. AGAIN, this is just an example that you could do in order, just in case if you do not know how to start or what to do.
|
||||
|
||||
* Reading OS theory books: at least "The Design of the UNIX Operating System by Maurice J. Bach"
|
||||
* Learn assembly and C
|
||||
* [8086 assembly programming with emu8086](https://github.com/gurugio/book_assembly_8086)
|
||||
* It is enough if you understand the concept of assembly programming. You do not need to do something practical.
|
||||
* [The C Programming Language 2nd Edition](https://www.amazon.com/Programming-Language-Brian-W-Kernighan/dp/0131103628/ref=pd_sbs_14_t_0?_encoding=UTF8&psc=1&refRID=60R1D2CHBA8DHYT6JNMN)
|
||||
* DO YOUR BEST TO solve every single exercise!
|
||||
* [C Programming: A Modern Approach, 2nd Edition](https://www.amazon.com/C-Programming-Modern-Approach-2nd/dp/0393979504)
|
||||
* Do something practical with C
|
||||
* [C Project Based Tutorials?](https://www.reddit.com/r/C_Programming/comments/872rlt/c_project_based_tutorials/): Find one or two interesting projects and make your own project.
|
||||
* [leetcode.com](https://leetcode.com/): If you cannot find an interesting project, it would be also good to focus on data structure and algorithm.
|
||||
* Do a hardware project
|
||||
* Raspberrypi or Arduino does not matter. You need experience to control a hardware directly with only C. ONLY C!
|
||||
* I recommend to buy a Atmega128 kit and make a firmware to turn on/off LEDs, detect switch input and display message on the text LCD. Motor control program is also a very good project: for instance, the line tracer.
|
||||
* DO NOT use any library. You should make everything on your own, except program downloader.
|
||||
* Basic of the Linux kernel
|
||||
* Low-level programming is very close to the operating system. You should know inside of the OS.
|
||||
* Start with drivers
|
||||
* Read [Linux Device Drivers](https://www.amazon.com/Linux-Device-Drivers-Jonathan-Corbet/dp/0596005903/ref=sr_1_4?ie=UTF8&qid=1483650712&sr=8-4&keywords=understanding+linux+kernel)
|
||||
* [Linux device driver labs](https://linux-kernel-labs.github.io/)
|
||||
* [The Eudyptula Challenge](http://eudyptula-challenge.org/)
|
||||
* Read [Linux Kernel Development](https://www.amazon.com/Linux-Kernel-Development-Robert-Love/dp/0672329468/ref=sr_1_2?ie=UTF8&qid=1483650712&sr=8-2&keywords=understanding+linux+kernel) to understand the internal of Linux kernel.
|
||||
* Go to the professional field
|
||||
* If you want to be a professional Linux Kernel Developer
|
||||
* must read [Understanding the Linux Kernel](https://www.amazon.com/Understanding-Linux-Kernel-Third-Daniel/dp/0596005652/ref=sr_1_1?ie=UTF8&qid=1483650712&sr=8-1&keywords=understanding+linux+kernel)
|
||||
* Then try to make a toy kernel
|
||||
* [Learn operating system development using Linux kernel and Raspberry Pi](https://github.com/s-matyukevich/raspberry-pi-os)
|
||||
* [Making your own kernel](http://wiki.osdev.org/Getting_Started)
|
||||
* Write the github link to your kernel on your resume (Don't forget to write the detailed description in commit message)
|
||||
* Check the latest issues at https://lwn.net/ and join it.
|
||||
* Check "Recent kernel patches" at "https://lwn.net/Kernel/" or direct link https://lwn.net/Kernel/Patches
|
||||
* Find an interesting patch to you. Try to understand the source code. Of course it would be really difficult but try. You will be closer and closer whenever you try.
|
||||
* Build kernel and test it on your system. For example, performance test, stability test with LTP(https://linux-test-project.github.io/) or static code analysis tools inside of kernel.
|
||||
* Report any problem if you find any: compile warnings/errors, performance drop, kernel panic/oops or any problem
|
||||
* If it works well, report that with the spec of your system. The patch owner would write a "Reviewed-by" tag with your name.
|
||||
* Find your name in kernel git log
|
||||
* Or find other topics
|
||||
* There are many fields where the low-level engineer can work: security, Compiler, Firmware, robot/car and so on
|
||||
|
||||
# <a name="Translation"></a>Translation
|
||||
|
||||
Please send me the pull request if you'd like to translate this page. I'll list it here.
|
||||
|
||||
* [Chinese(Traditional)](https://github.com/gurugio/lowlevelprogramming-university/blob/master/README_tw.md)
|
||||
* [Chinese(Simplified)](https://github.com/gurugio/lowlevelprogramming-university/blob/master/README_cn.md)
|
||||
* [Portuguese (Brazilian)](https://github.com/gurugio/lowlevelprogramming-university/blob/master/README_pt.md)
|
||||
* [Italian](https://github.com/gurugio/lowlevelprogramming-university/blob/master/README_it.md)
|
||||
* [Czech](https://github.com/gurugio/lowlevelprogramming-university/blob/master/README_cz.md)
|
||||
* [Russian](https://github.com/gurugio/lowlevelprogramming-university/blob/master/README_ru.md)
|
||||
* [Turkish](https://github.com/gurugio/lowlevelprogramming-university/blob/master/README_tr.md)
|
||||
* [Persian](https://github.com/gurugio/lowlevelprogramming-university/blob/master/README_fa.md)
|
||||
* [Spanish](https://github.com/gurugio/lowlevelprogramming-university/blob/master/README_es.md)
|
||||
|
||||
# <a name="who-am-i"></a>Who am I?
|
||||
|
||||
I'm inspired by [google-interview-university](https://github.com/jwasham/google-interview-university). I'd like to share my experience and show a roadmap to becoming a low-level programmer because I have found that these skills are not as common as they once were. In addition, many students and beginners ask me how they could become low-level programmers and Linux kernel engineers.
|
||||
|
||||
FYI, I have over 10 years of experience as a low-level programmer:
|
||||
* 80x86 Assembly programming
|
||||
* Hardware device with Atmel chip and firmware
|
||||
* C language system programming for Unix
|
||||
* Device driver in Linux
|
||||
* Linux kernel: page allocation
|
||||
* Linux kernel: block device driver and md module
|
||||
|
|
|
|||
Loading…
Reference in a new issue