Acer Chromebook Linux Installation

Chrombooks are becoming popular. It makes a decent netbook if installed with a mainstream Linux distribution. The Acer C7 is just a rebranded Aspire One AO756-2461. Because Chromebooks use a special BIOS that can’t boot a normal Linux, a special version of Linux shall be required such as an ChrUbuntu for a modified Ubuntu. Continue reading

Advertisements
Posted in All, Desktop, Hardware | Tagged , , , , | 6 Comments

ARM C/C++ Software Stack Back Trace

Printing stack trace pragmatically from C/C++ code is an efficient way to speed up troubleshooting and debugging. Since testing, debugging, and sustaining cost more than half of software total cost, printing backtrace is very important to producing quality software quickly. The problem is, in some versions of kernel/toolchain combination, it works. Only when you upgrade to a later version, you find out it breaks. To make things worse, you cannot downgrade or upgrade again to another version. Continue reading

Posted in All, C/C++, Hardware | Tagged , , , , , , | 3 Comments

Freedom Logic Analyzer with DMA

From mcuoneclipse dot com: The FRDM-KL25Z Open Source Logic Analyzer based on SUMP presented here was already very useful with the added trigger support. But it was not capable to do a sampling rate above a few hundred kHz. That’s ok for slower probing, but not for anything with a higher speed. Using DMA (Direct Memory Access) instead of timer based sampling can remove that limitation. Continue reading

Posted in Uncategorized | Leave a comment

ARM Cache Flush on mmap’d Buffers with __clear_cache()

Memory mapped operation from user space on devices is a powerful technique to improve runtime performance. Some ARM processors use caches keyed to virtual addresses, instead of normally to physical addresses. The problem, is that if the kernel maps the region to one virtual address and the userspace the another, changes made on one side won’t reliably be flushed to the other side. At best the other side sees delayed content change. In the worst case, data will be lost. Continue reading

Posted in All, C/C++, Hardware | Tagged , , , , , , , | 2 Comments

ARM MMU Theory and Practice

In his blog “Turning on an ARM MMU” Andrew Murry listed the schemes: a memory manager would use in their combination form:

  • Split the entire virtual range into pages and point them all to one same physical page. This is often used as zero-pages, and copy on write.
  • Map multiple areas of physical memory into the same virtual area, but only one at a time.
  • Don’t map the virtual address to anything, just use it. This is known as demand paging.
  • Map the entire virtual address range to the entire physical address range.

Continue reading

Posted in All, C/C++, Hardware | Tagged , , , , , , , , | 2 Comments

Mapping DMA Buffers to User Space on Linux with mmap

Memory mapped operation from user space on devices is a powerful technique to improve runtime performance of a user space application. The technique, conceptually is simple, yet is often hard to do correctly. Continue reading

Posted in All, C/C++, Hardware | Tagged , , , , , , | 2 Comments

C++ Scoped Lock with RAII

Resource Acquisition Is Initialization (RAII)[1] is a programming idiom used in several object-oriented languages like C++, D, Ada and Vala. The technique was invented by Bjarne Stroustrup[2] to deal with resource allocation and deallocation in C++. In this language, the only code that can be guaranteed to be executed after an exception is thrown are the destructors of objects residing on the stack. Resource management therefore needs to be tied to the lifespan of suitable objects in order to gain automatic allocation and reclamation. Resources are acquired during initialization, when there is no chance of them being used before they are available, and released with the destruction of the same objects, which is guaranteed to take place even in case of errors. Continue reading

Posted in All, C/C++ | Tagged , , | Leave a comment