Linux Kernel boot sequence

Execution in Assembly Entry point for Kernel uncompressed – arch/arm/kernel/head.S Read processor ID in coprocessor and obtain proc_info_list pointer Lookup machine type based on mach-id passed by bootloader (R1), get the mach_desc pointer and save mach-id Determine vailidity of ATAGS pointer (R2) and save Setup minimal pagetable to get Kernel running on virtual address, also setup one-to-one mapping for the page that turns on MMU Initialize TLB, caches, setup MMU […]

Sieve of Eratosthenes

In mathematics, the sieve of Eratosthenes, one of a number of prime number sieves, is a simple, ancient algorithm for finding all prime numbers up to any given limit. It does so by iteratively marking as composite (i.e. not prime) the multiples of each prime, starting with the multiples of 2. The multiples of a given prime are generated starting from that prime, as a sequence of numbers with the same […]

Mapped Memory

Mapped memory permits different processes to communicate via a shared file. To map an ordinary file to a process’s memory, use the mmap (“Memory MAPped,” pronounced “em-map”) call. The first argument is the address at which you would like Linux to map the file into your process’s address space; the value NULL allows Linux to choose an available start address. The second argument is the length of the map in bytes. The third […]

Memory Usage with /proc/meminfo

The entries in the /proc/meminfo can help explain what’s going on with your memory usage, if you know how to read it. Example of  ‘cat /proc/meminfo’: total: used: free: shared: buffers: cached: Mem: 1050001408 1012899840 37101568 0 113672192 420950016 Swap: 2097434624 217985024 1879449600 MemTotal: 1025392 kB MemFree: 36232 kB MemShared: 0 kB Buffers: 111008 kB Cached: 279304 kB SwapCached: 131780 kB Active: 677908 kB ActiveAnon: 487272 kB ActiveCache: 190636 kB […]