programming
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
programming [2009/06/19 03:36] – memeruiz | programming [2011/11/08 21:59] – old revision restored memeruiz | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Programming ====== | ====== Programming ====== | ||
+ | |||
+ | [[bash]] | ||
+ | |||
===== C ===== | ===== C ===== | ||
* With GCC one can do inline functions (useful with microcontrollers). [[http:// | * With GCC one can do inline functions (useful with microcontrollers). [[http:// | ||
Line 112: | Line 115: | ||
* Variables used by implicit rules [[http:// | * Variables used by implicit rules [[http:// | ||
* pattern rules contain % in the target | * pattern rules contain % in the target | ||
+ | * List of automatic variables [[http:// | ||
+ | * Canceling implicit rules. | ||
+ | * study the following commands. Seem to be useful: cat cmp cp diff echo egrep expr false grep install-info ln ls mkdir mv pwd rm rmdir sed sleep sort tar test touch true | ||
+ | * Quick reference [[http:// | ||
+ | ===== Microcontrollers and GCC ===== | ||
+ | Programming and generating code for a system where Linux is already running usually involves just writing the source code for the program, some libraries and some Makefiles. One thing that is always happening, every time that some code is generated that can be useful to use in a system, is linking. During linking basically the code generated by the compiling process, called object code, from all the source files plus the code from library files gets " | ||
+ | The approach that I follow to deal with this was the following: | ||
+ | - Get an example of a project for a microcontroller that requires to set memory layouts by hand, I got an example for the stm32 Arm microcontrollers. | ||
+ | - Read the complete GCC users manual. This is important to know what is going on during the whole compilation process. | ||
+ | - Read the complete Makefile users manual. This is big but very important. Now I understand much more variations of Makefiles. | ||
+ | - Read the complete manual for ld the linker. This is where you will find the information for writing linker scripts. | ||
+ | You may wander why you don't have to do this in your linux i386 PC computer, this is because there is already a default ld script for your system and it gets used automatically. So you don't notice. But if you dare you can try to write your own ld script for your i386 and try to get your program running with it. | ||
programming.txt · Last modified: 2021/02/01 05:55 by 127.0.0.1