C Programming Cheatsheet

Total Page:16

File Type:pdf, Size:1020Kb

C Programming Cheatsheet C Programming Cheatsheet String Format Specifiers Character Escapes %[flags][width][.precision][length]specifier • \0 - NULL Constructs %c char • \b - backspace Do-While Loop • \f - form feed (new page) %hhd||%hhi signed char i=0; • \n - newline do { printf("%d\n", i); ++i;} %hhu unsigned char • \r - carriage return while(i<10); • \t - tab %hhn signed char* For Loop • \v - vertical tab for (i=0; i<10; ++i) { %lc wint_t Arithmetic Operators printf("%d\n", i); %ls wchar_t* + Addition } While Loop %s string - Subtraction register int i=0; %d || %i signed int * Multiplication while (i<10) { ++i; } If, else if, else %u unsigned int / Division if (0 == 1) { %hi short int % Modulus/Remainder register signed int ZERO = 0; } else if (8 <= 4) { %hu unsigned short int ++ Increment by 1 const float PIf = 3.14F; %hn short int* -- Decrement by 1 } else { static char SYM[3] = "π\0"; %l signed long int ++> Pre-increment and compare } %ln long int* --> Pre-decrement and compare Macros if #ifdef __linux__ %ll signed long long int Equality Operators # include "custom_header.h" %lln long long int* == Equal to # include <system_header.h> #endif %llu unsigned long long int != Not equal to Switch-case %f || %F float or double (%F is uppercase) < Less than switch (INPUT) { case 0: break; %Lf || %Le long double > Greater than default: break; %e || %E scientific notation (mantissa/exponent) <= Less than or equal to } Ternary Operator >= Greater than or equal to %g || %G shortest representation of %e||%E int out = (input == 7 ? 5 : 3); %o octal unsigned int Logical Operators Goto Operand Meaning Example label: %x lowercase hex unsigned int goto label; %X uppercase hex unsigned int && And (x && y) Define Datatype typedef struct { int x, y; } point_t; %a || %A hexadecimal float-point || Or (x || y) typedef union __number { %ji intmax_t ! Not !(x < y) int i; double d; } number_t; %ju uintmax_t Bitwise Operators Define Enum %jn intmax_t* enum cardsuit { & AND %zi || %zu size_t || ssize_t CLUBS = 0, | OR DIAMONDS, HEARTS, SPADES %zn size_t* }; ^ Exclusive OR (XOR) %ti || %tu ptrdiff_t Variable Aliases and Constants ~ Ones Complement (NOT) const double PI = 3.14159; %tn ptrdiff_t* << Left-shift const double *ARCHIMEDES_NUM = &PI; %p pointer address extern const double PI; // In Header >> Right-shift char PI_SYM[3] = "π\0"; // Unicode %n NULL Assignment Operators char PI_UTF8[] = u8"π\0"; %% literal % char16_t PI_UTF16[] = u"π\0"; Operand Meaning Equivalent char32_t PI_UTF32[] = U"π\0"; Width and Precision = Assign None Arrays %.3f float precision of 3 (like 3.141) double num[2] = { 3.14, 5.0 }; += Add X = X + Y %4d 4 digit wide int (like 2015) unsigned int LargeArray[2][4] = { -= Subtract X = X - Y { 0, 1, 2, 3 }, { 4, 5, 6, 7 } }; %2.2f 2 digits wide and 2 precise (19.95) char words[2][] = { "BSD", "AIX" }; *= Multiply X = X * Y Flags Order of Operations /= Divide X = X / Y - Left-justify () [] -> . :: ! ~ - + * & ++ -- %= Modulus X = X % Y + Right-justify * / % + - <<= Left-shift X = X << Y SPACE Blank space << >> < <= > >= >>= Right-shift X = X >> Y # Preceded hex & octal with "0x" || "0" != == & (Bitwise) &= AND X = X & Y 0 Left-pad with zeros ^ (Bitwise) | (Bitwise) Integer from variable - printf("%d", num); |= OR X = X | Y && || (Logical) Ternary operator Save integer to variable - scanf("%d", &num); ^= XOR X = X ^ Y Save string to variable - scanf("%s", str_var); Assignment Comma Operator Created by Devyn Collier Johnson <[email protected]> (2017) More cheatsheets at DCJTech.info C Programming Cheatsheet Datatypes int_fast16_t uint_fast16_t Literal Constant Prefixes NULL void int_fast32_t uint_fast32_t Octal 0 _Bool bool - <stdbool.h> int_fast64_t uint_fast64_t Binary 0b char16_t - <uchar.h> char32_t - <uchar.h> intptr_t uintptr_t Hexadecimal 0x char double <stdfix.h> char \u enum EOF - <stdio.h> _Fract _Accum wchar_t string L FILE - <stdio.h> fpos_t - <stdio.h> _Sat _Fract _Sat _Accum UTF-8 string u8 float imaxdiv_t - <inttypes.h> <decimal.h> UTF-16 string u int long _Decimal32 _Decimal64 UTF-32 string U long double long int _Decimal128 _Complex _Decimal32 Raw literal string R"delimiter(STRING)delimiter" long long long long int Literal Constant Suffixes Storage Classes • auto - Default specifier; Local-scope nullptr_t - <stddef.h> ptrdiff_t - <stddef.h> unsigned U || u • extern - Lasts the whole program, block, or sig_atomic_t - <signal,h> short unsigned long long ULL compilation unit; globally visible short char short int long L • register - Stored in stack or CPU-register during the code block size_t - <stddef.h> ssize_t - <stddef.h> float F • static - Lasts the whole program, block, or struct union double D compilation unit; private in program • typedef - Specifies a new datatype wctrans_t - <wchar.h> wctype_t - <wctype.h> long double L • _Thread_local - Thread-local-storage; one wchar_t - <wchar.h> __ibm128 __float80 W || w instance per thread Type Qualifiers WEOF - <wchar.h> wint_t - <wchar.h> __float128 Q || q • const - Value does not change; read-only signed unsigned __ibm128 W • restrict - For the lifetime of the pointer, the object can only be accessed via the pointer signed char unsigned char _Imaginary i • volatile - Optimizing-compilers must not signed int unsigned int _Complex128 KC change • _Atomic - Objects free from data races signed long unsigned long exponent E Function Specifiers signed long int unsigned long int __Decimal32 df || DF • inline - Inline the function when compiling signed long long unsigned long long __Decimal64 dd || DD • _Noreturn - The function does not return signed long long int unsigned long long int __Decimal128 dl || DL Function Attributes (__attribute__(())) GNU-GCC only signed short unsigned short short _Fract || _Sat short _Fract HR || hr Use in function declaration (header) https://gcc.gnu.org/onlinedocs/gcc/Function- signed short int unsigned short int _Fract || _Sat _Fract R || r Attributes.html __float80 __float128 long _Fract || _Sat long _Fract lr || LR https://gcc.gnu.org/onlinedocs/gcc/Common- Function-Attributes.html <complex.h> long long _Fract || _Sat long long llr || LLR _Fract • alias - The function is an alias for another; complex _Complex Example: void f () __attribute__ unsigned short _Fract || _Sat unsigned uhr || float complex float _Complex ((weak, alias ("__f"))); short _Fract UHR • aligned - Set alignment double complex double _Complex unsigned _Fract || _Sat unsigned ur || UR • always_inline - Inline the function long double complex long double _Complex _Fract • cold - Unlikely to execute; used for optimizations imaginary _Imaginary unsigned long _Fract and _Sat ulr || ULR unsigned long _Fract • constructor - Call function before main() float imaginary float _Imaginary • destructor - Call function after main() unsigned long long _Fract || _Sat ullr || • deprecated - Emit warning msg when called double imaginary double _Imaginary unsigned long long _Fract ULLR • error - Emit error message when called long double imaginary long double _Imaginary short _Accum || _Sat short _Accum hk || HK • flatten - Inline all functions in the function; __attribute__((flatten)) _Complex80 _Complex128 Accum || _Sat _Accum k || K • hot - Very likely to execute; used for <stdint.h> long _Accum || _Sat long _Accum lk || LK optimizations • nonnull - None of the input pointers are NULL intmax_t uintmax_t long long _Accum || _Sat long long llk || LLK • nothrow - The function is guaranteed not to _Accum int8_t uint8_t throw an exception unsigned short _Accum || _Sat uhk || • optimize - Set specific optimization options for int16_t uint16_t unsigned short _Accum UHK the function int32_t uint32_t unsigned _Accum || _Sat unsigned uk || UK • pure - The function accepts arguments, has single return, and has no other effects int64_t uint64_t _Accum • returns_twice - Returns two separate values int_least8_t uint_least8_t unsigned long _Accum || _Sat ulk || ULK • simd - Create multiple functions that can unsigned long _Accum process arguments using SIMD instructions int_least16_t uint_least16_t unsigned long long _Accum || _Sat ullk || • warning - Emit warning message when called int_least32_t uint_least32_t unsigned long long _Accum ULLK https://gcc.gnu.org/onlinedocs/gcc/Fixed-Point.html int_least64_t uint_least64_t int_fast8_t uint_fast8_t Created by Devyn Collier Johnson <[email protected]> (2017) More cheatsheets at DCJTech.info C Programming Cheatsheet Type Attributes complex float-point • <locale.h> - Category macros GNU-GCC only • HC - Half Complex; 2 byte half-precision complex • <math.h> - Mathematical and trigonometric functions float-point <monetary.h> - Monetary unit string formatting https://gcc.gnu.org/onlinedocs/gcc/Type- • • SC - Single Complex; 4 byte single-precision complex• <mqueue.h> - Message queue Attributes.html float-point • <ndbm.h> - NDBM database operations • aligned - Set alignment • DC - Double Complex; 8 byte double-precision • <net/if.h> - List local network interfaces • deprecated - Emit warning msg when called complex float-point • <netdb.h> - Translating protocol and hostnames into • mode - Set type mode. Example: typedef • XC - Extended Complex; 12 byte extended-precision numeric addresses _Complex float complex float-point • <netinet/in.h> - Internet protocol and address family __attribute((mode(TC))) _Complex128; • TC - Tetra Complex; 16 byte tetra-precision complex definitions float-point • <netinet/tcp.h> - Additional TCP control options packed - Members of a struct or union are • • QQ - Quarter-Fractional; 1-byte • <nl_types.h> - Localization message catalog
Recommended publications
  • Concurrent Cilk: Lazy Promotion from Tasks to Threads in C/C++
    Concurrent Cilk: Lazy Promotion from Tasks to Threads in C/C++ Christopher S. Zakian, Timothy A. K. Zakian Abhishek Kulkarni, Buddhika Chamith, and Ryan R. Newton Indiana University - Bloomington, fczakian, tzakian, adkulkar, budkahaw, [email protected] Abstract. Library and language support for scheduling non-blocking tasks has greatly improved, as have lightweight (user) threading packages. How- ever, there is a significant gap between the two developments. In previous work|and in today's software packages|lightweight thread creation incurs much larger overheads than tasking libraries, even on tasks that end up never blocking. This limitation can be removed. To that end, we describe an extension to the Intel Cilk Plus runtime system, Concurrent Cilk, where tasks are lazily promoted to threads. Concurrent Cilk removes the overhead of thread creation on threads which end up calling no blocking operations, and is the first system to do so for C/C++ with legacy support (standard calling conventions and stack representations). We demonstrate that Concurrent Cilk adds negligible overhead to existing Cilk programs, while its promoted threads remain more efficient than OS threads in terms of context-switch overhead and blocking communication. Further, it enables development of blocking data structures that create non-fork-join dependence graphs|which can expose more parallelism, and better supports data-driven computations waiting on results from remote devices. 1 Introduction Both task-parallelism [1, 11, 13, 15] and lightweight threading [20] libraries have become popular for different kinds of applications. The key difference between a task and a thread is that threads may block|for example when performing IO|and then resume again.
    [Show full text]
  • User's Manual
    rBOX610 Linux Software User’s Manual Disclaimers This manual has been carefully checked and believed to contain accurate information. Axiomtek Co., Ltd. assumes no responsibility for any infringements of patents or any third party’s rights, and any liability arising from such use. Axiomtek does not warrant or assume any legal liability or responsibility for the accuracy, completeness or usefulness of any information in this document. Axiomtek does not make any commitment to update the information in this manual. Axiomtek reserves the right to change or revise this document and/or product at any time without notice. No part of this document may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of Axiomtek Co., Ltd. Trademarks Acknowledgments Axiomtek is a trademark of Axiomtek Co., Ltd. ® Windows is a trademark of Microsoft Corporation. Other brand names and trademarks are the properties and registered brands of their respective owners. Copyright 2014 Axiomtek Co., Ltd. All Rights Reserved February 2014, Version A2 Printed in Taiwan ii Table of Contents Disclaimers ..................................................................................................... ii Chapter 1 Introduction ............................................. 1 1.1 Specifications ...................................................................................... 2 Chapter 2 Getting Started ......................................
    [Show full text]
  • Cg 2015 Huong Vu Thanh
    c 2015 Huong Vu Thanh Luu OPTIMIZING I/O PERFORMANCE FOR HIGH PERFORMANCE COMPUTING APPLICATIONS: FROM AUTO-TUNING TO A FEEDBACK-DRIVEN APPROACH BY HUONG VU THANH LUU DISSERTATION Submitted in partial fulfillment of the requirements for the degree of Doctor of Philosophy in Computer Science in the Graduate College of the University of Illinois at Urbana-Champaign, 2015 Urbana, Illinois Doctoral Committee: Professor Marianne Winslett, Chair Professor William Gropp, Director of Research Professor Marc Snir Dr Robert Ross, Argonne National Laboratory ABSTRACT The 2014 TOP500 supercomputer list includes over 40 deployed petascale systems, and the high performance computing (HPC) community is working toward developing the first exaflop system by 2023. Scientific applications on such large-scale computers often read and write a lot of data. With such rapid growth in computing power and data intensity, I/O continues to be a challenging factor in determining the overall performance of HPC applications. We address the problem of optimizing I/O performance for HPC applica- tions by firstly examining the I/O behavior of thousands of supercomputing applications. We analyzed the high-level I/O logs of over a million jobs rep- resenting a combined total of six years of I/O behavior across three leading high-performance computing platforms. Our analysis provides a broad por- trait of the state of HPC I/O usage. We proposed a simple and e↵ective analysis and visualization procedure to help scientists who do not have I/O expertise to quickly locate the bottlenecks and inefficiencies in their I/O ap- proach. We proposed several filtering criteria for system administrators to find application candidates that are consuming system I/O resources ineffi- ciently.
    [Show full text]
  • Shared Memory Programming
    Outline •" Parallel Programming with Threads Shared Memory Programming: •" Parallel Programming with OpenMP •" See parlab.eecs.berkeley.edu/2012bootcampagenda •" 2 OpenMP lectures (slides and video) by Tim Mattson Threads and OpenMP •" openmp.org/wp/resources/ •" computing.llnl.gov/tutorials/openMP/ •" portal.xsede.org/online-training Lecture 6 •" www.nersc.gov/assets/Uploads/XE62011OpenMP.pdf •" Slides on OpenMP derived from: U.Wisconsin tutorial, which in turn were from LLNL, NERSC, U. Minn, and OpenMP.org James "Demmel •" See tutorial by Tim Mattson and Larry Meadows presented at www.cs.berkeley.edu/~demmel/cs267_Spr16/! SC08, at OpenMP.org; includes programming exercises ! •" (There are other Shared Memory Models: CILK, TBB…) •" Performance comparison •" Summary CS267 Lecture 6! 1! 02/04/2016 CS267 Lecture 6! 2! Recall Programming Model 1: Shared Memory •" Program is a collection of threads of control. •" Can be created dynamically, mid-execution, in some languages •" Each thread has a set of private variables, e.g., local stack variables •" Also a set of shared variables, e.g., static variables, shared common Parallel Programming blocks, or global heap. with Threads" •" Threads communicate implicitly by writing and reading shared variables. •" Threads coordinate by synchronizing on shared variables Shared memory s s = ... y = ..s ... i: 2 i: 5 Private i: 8 memory P0 P1 Pn CS267 Lecture 6! 3! 02/04/2016 CS267 Lecture 6! 4! CS267 Lecture 2 1 Shared Memory Programming Common Notions of Thread Creation Several Thread Libraries/systems
    [Show full text]
  • Embedded Multicore: an Introduction
    Embedded Multicore: An Introduction EMBMCRM Rev. 0 07/2009 How to Reach Us: Home Page: www.freescale.com Web Support: http://www.freescale.com/support Information in this document is provided solely to enable system and software USA/Europe or Locations Not Listed: implementers to use Freescale Semiconductor products. There are no express or Freescale Semiconductor, Inc. implied copyright licenses granted hereunder to design or fabricate any integrated Technical Information Center, EL516 circuits or integrated circuits based on the information in this document. 2100 East Elliot Road Tempe, Arizona 85284 Freescale Semiconductor reserves the right to make changes without further notice to +1-800-521-6274 or any products herein. Freescale Semiconductor makes no warranty, representation or +1-480-768-2130 www.freescale.com/support guarantee regarding the suitability of its products for any particular purpose, nor does Freescale Semiconductor assume any liability arising out of the application or use of Europe, Middle East, and Africa: Freescale Halbleiter Deutschland GmbH any product or circuit, and specifically disclaims any and all liability, including without Technical Information Center limitation consequential or incidental damages. “Typical” parameters which may be Schatzbogen 7 provided in Freescale Semiconductor data sheets and/or specifications can and do 81829 Muenchen, Germany vary in different applications and actual performance may vary over time. All operating +44 1296 380 456 (English) +46 8 52200080 (English) parameters, including “Typicals” must be validated for each customer application by +49 89 92103 559 (German) customer’s technical experts. Freescale Semiconductor does not convey any license +33 1 69 35 48 48 (French) under its patent rights nor the rights of others.
    [Show full text]
  • LTIB Build Host Setup
    LTIB Build Host Setup Setting up a Linux host for LTIB builds We support building using Ubuntu 9.04 (Jaunty) installed from the 32 or 64 bit Desktop Ubuntu install cd. Other versions of Ubuntu are not currently supported and may have build issues. Sudoers Run 'sudo visudo' so you can edit the sudoer's file. Add the following line to the end of the sudoers file. This is needed for people to be able to use LTIB. This assumes that all your developers have administrator priviledges on this host. If that is not the case, a similar line can be added for each user. %admin ALL = NOPASSWD: /usr/bin/rpm, /opt/freescale/ltib/usr/bin/rpm Update to the latest packages Open up System -> Administration -> Update Manager Click on Settings Open the Updates Tab Set 'Release upgrade' to 'Never'. That makes the option to upgrade to Karmic go away. Close the settings dialog box. Click on 'Check' to check for upgraded packages. It will look for packages that are upgraded from the version that is installed on your box. Choose to install the upgrades. This will take a while on a freshly installed box. Install host packages needed by LTIB This document assumes you are using Ubuntu. Not a requirement, but the packages may be named differently and the method of installing them may be different. sudo aptitude -y install gettext libgtk2.0-dev rpm bison m4 libfreetype6-dev sudo aptitude -y install libdbus-glib-1-dev liborbit2-dev intltool sudo aptitude -y install ccache ncurses-dev zlib1g zlib1g-dev gcc g++ libtool sudo aptitude -y install uuid-dev liblzo2-dev sudo aptitude -y install tcl Packages required for 64-bit Ubuntu If you don't know whether you have 64-bit Ubuntu installed, do "uname -a" and see if the word "x86_64" shows up.
    [Show full text]
  • Scala Native Documentation Release 0.3.2
    Scala Native Documentation Release 0.3.2 Denys Shabalin Aug 08, 2017 Contents 1 Community 3 2 Documentation 5 2.1 User’s Guide...............................................5 2.2 Libraries................................................. 15 2.3 Contributor’s Guide........................................... 31 2.4 Changelog................................................ 48 2.5 FAQ.................................................... 49 i ii Scala Native Documentation, Release 0.3.2 Scala Native is an optimizing ahead-of-time compiler and lightweight managed runtime designed specifically for Scala. It features: • Low-level primitives. type Vec = CStruct3[Double, Double, Double] val vec = stackalloc[Vec] // allocate c struct on stack !vec._1 = 10.0 // initialize fields !vec._2 = 20.0 !vec._3 = 30.0 length(vec) // pass by reference Pointers, structs, you name it. Low-level primitives let you hand-tune your application to make it work exactly as you want it to. You’re in control. • Seamless interop with native code. @extern object stdlib { def malloc(size: CSize): Ptr[Byte] = extern } val ptr = stdlib.malloc(32) Calling C code has never been easier. With the help of extern objects you can seamlessly call native code without any runtime overhead. • Instant startup time. > time hello-native hello, native! real 0m0.005s user 0m0.002s sys 0m0.002s Scala Native is compiled ahead-of-time via LLVM. This means that there is no sluggish warm-up phase that’s common for just-in-time compilers. Your code is immediately fast and ready for action. Contents 1 Scala Native Documentation, Release 0.3.2 2 Contents CHAPTER 1 Community • Want to follow project updates? Follow us on twitter. • Want to chat? Join our Gitter chat channel.
    [Show full text]
  • PLAN 9 from BELL LABS PROGRAMMER's MANUAL
    PLAN 9 from BELL LABS PROGRAMMER’S MANUAL First Edition Computing Science Research Center AT&T Bell Laboratories Murray Hill, New Jersey -- Copyright © 1993 AT&T Unpublished and not for publication All Rights Reserved PostScript and ThinkJet are registered trademarks. PERMUTED INDEX Manual pages for all sections are accessible on line through m a n(1). To save space, neighboring references to the same page have been collapsed into a single reference. This should cause no difficulty in cases like ‘atan’ and ‘atan2’, but is somewhat obscure in the case of ‘strcat’ and ‘strchr’. Disclabel – / . home, 40meg, 80meg, 100meg, newkernel, personalize, update, . home(8) floyd, halftone, hysteresis – create 1-bit images by dithering . floyd(9.1) hp – emulate an HP 2621 terminal . hp(1) 2a, 6a, 8a, ka, va, za – assemblers . 2a(1) 2c, 6c, 8c, kc, vc, zc – C compilers . 2c(1) 2l, 6l, 8l, kl, vl, zl – loaders . 2l(1) c++/2c, c++/kc, c++/vc, c++/8c, c++/zc, c++/ 2l, c++/kl, c++/vl, c++/8l, c++/zl – C++/ . c++(1) picture color compression . 3to1, mcut, improve, quantize, dither – . quantize(9.1) update, Disclabel – administration for/ . home, 40meg, 80meg, 100meg, newkernel, personalize, . home(8) smiley, life, fsim, clock, catclock,/ . 4s, 5s, ana, gnuchess, juggle, mandel, plumb, quiz, . games(1) 2a, 6a, 8a, ka, va, za – assemblers . 2a(1) 2c, 6c, 8c, kc, vc, zc – C compilers . 2c(1) 2l, 6l, 8l, kl, vl, zl – loaders . 2l(1) 8½ – window system files . 8½(4) 8½, label, window, wloc – window system . 8½(1) Disclabel – administration for/ . home, 40meg, 80meg, 100meg, newkernel, personalize, update, .
    [Show full text]
  • ELC 2008 Agenda
    Embedded Linux Conference, 2008 Program Agenda Mountain View, California, April 15-17 Table of Contents Agenda...............................................................................................................................2 Tuesday...........................................................................................................................2 Wednesday......................................................................................................................3 Thursday.........................................................................................................................4 Keynote List........................................................................................................................5 Keynote Descriptions.........................................................................................................5 Session List........................................................................................................................7 Session Descriptions..........................................................................................................9 BOF List............................................................................................................................30 BOF Descriptions.............................................................................................................30 Agenda Tuesday Session Schedule - Tuesday, April 15 Time Room A - Hahn Room B - Boole Room C - Noyce 8:00 - 900 Registration 9:00 - 9:50 Keynote:
    [Show full text]
  • VAB-800 Linux BSP 1.4
    DEVELOPMENT GUIDE VAB-800 Linux BSP 1.4 1.4-09222014-165700 Copyright Copyright © 2014-VIA Technologies Incorporated. All rights reserved. No part of this document may be reproduced, transmitted, transcribed, stored in a retrieval system, or translated into any language, in any form or by any means, electronic, mechanical, magnetic, optical, chemical, manual or otherwise without the prior written permission of VIA Technologies, Incorporated. Trademarks All brands, product names, company names, trademarks and service marks are the property of their respective holders. Disclaimer VIA Technologies makes no warranties, implied or otherwise, in regard to this document and to the products described in this document. The information provided in this document is believed to be accurate and reliable as of the publication date of this document. However, VIA Technologies assumes no responsibility for the use or misuse of the information in this document and for any patent infringements that may arise from the use of this document. The information and product specifications within this document are subject to change at any time, without notice and without obligation to notify any person of such change. VIA Technologies, Inc. reserves the right the make changes to the products described in this manual at any time without prior notice. VABVAB----8080808000 Linux BSP V1.V1.4444 Development Guide Revision History Version DateDateDate Remarks 1.0 12/24/2012 Initial external release 1.1 4/2/2013 Added the eMMC evaluation kit process in Appendix A Modified Micro SD/eMMC partition method in Chapter 4 1.2 4/19/2013 Added the ADI ADV7511W in Step 10 of 3.2.2 Run Ltib to build VAB-800 BSP 1.3 8/14/2014 Modified the necessary packages and patch of Ltib for Ubuntu 12.04 64bit host development PC 1.4 9/17/2014 Added Xrandr dual display setting in Appendix.E iii VABVAB----8080808000 Linux BSP V1.V1.4444 Development Guide Table of Contents 1.1.1.
    [Show full text]
  • In the Beginning
    The Embedded Linux Quick Start Guide In the Beginning... Chris Simmonds Embedded Linux Conference Europe 2010 Copyright © 2010, 2net Limited Embedded Linux Quick Start Guide 1 In the beginning Overview ● Genesis of a Linux project ● The four elements ● Tool chain; boot loader; kernel; user space ● Element 1: Tool chain ● Element 2: Boot loader Embedded Linux Quick Start Guide 2 In the beginning “I've just had this great idea...” ● “…our next product will run Linux” ● This workshop will take a look at ● Board bring-up ● Development environment ● Deployment Embedded Linux Quick Start Guide 3 In the beginning The four elements Toolchain (air) Boot loader (earth) Kernel (fire) User space (water) Embedded Linux Quick Start Guide 4 In the beginning First element: the toolchain ● You can't do anything until you can produce code for your platform ● A tool chain consists of at least ● binutils: GNU assembler, linker, etc. ● gcc: GNU C compiler ● C library (libc): the interface to the operating system ● gdb: debugger Embedded Linux Quick Start Guide 5 In the beginning Types of toolchain ● Native: run compiler on target board ● If your target board is not fast enough or doesn't have enough memory or storage, use an emulator e.g. qemu ● Cross: compile on one machine, run on another ● Most common option Embedded Linux Quick Start Guide 6 In the beginning The C library ● Gcc is built along side the C library ● Hence, the C library is part of the tool chain ● Main options are ● GNU glibc – big but fully functional ● GNU eglibc – glibc but more configurable; embedded-friendly ● uClibc – small, lacking up-to-date threads library and other POSIX functions Embedded Linux Quick Start Guide 7 In the beginning Criteria for selecting a toolchain ● Good support for your processor ● e.g.
    [Show full text]
  • Embedded.Linux.Syste
    Embedded Linux system development Embedded Linux system development Free Electrons Gr´egory Cl´ement,Michael Opdenacker, Maxime Ripard, Thomas Petazzoni Embedded Linux Free Electrons Developers c Copyright 2004-2012, Free Electrons. Creative Commons BY-SA 3.0 license. Latest update: October 8, 2012. Document updates and sources: http://free-electrons.com/doc/training/embedded-linux Corrections, suggestions, contributions and translations are welcome! Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 1/528 Rights to copy c Copyright 2004-2012, Free Electrons License: Creative Commons Attribution - Share Alike 3.0 http://creativecommons.org/licenses/by-sa/3.0/legalcode You are free: I to copy, distribute, display, and perform the work I to make derivative works I to make commercial use of the work Under the following conditions: I Attribution. You must give the original author credit. I Share Alike. If you alter, transform, or build upon this work, you may distribute the resulting work only under a license identical to this one. I For any reuse or distribution, you must make clear to others the license terms of this work. I Any of these conditions can be waived if you get permission from the copyright holder. Your fair use and other rights are in no way affected by the above. Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 2/528 Electronic copies of these documents I Electronic copies of your particular version of the materials are available on: http://free-electrons.com/doc/training/embedded- linux I Open the corresponding documents and use them throughout the course to find explanations given earlier by the instructor.
    [Show full text]