Articles and Blogs

  • [blog] A Time-Triggered Cooperative Scheduler Pattern

    On a bare-metal system, if we have multiple periodic tasks to run we can choose to dedicate one hardware Timer to each. We may not have enough timers though. Another approach is to share a single Timer between multiple tasks by the means of a Scheduler [1]. Instead of triggering a specific task on a…

    Read more

  • [µblog] Generic pointers in C

    Arithmetic step size of a pointer A pointer is a variable that holds an address. So, if we declare int *ptr, we are saying that ptr is a variable that holds the address of an integer. Its arithmetic step size is the size of an integer. If we increment it as in ptr++ it would…

    Read more

  • [blog] Observer Pattern using Sleep/Wake synchronization mechanism

    The Observer Pattern (also known as Publish-Subscribe pattern) provides notification to a set of interested clients that relevant data have changed. The data-server does not need to have any a priori knowledge about its clients. Most commonly data are sent whenever new data arrive, but clients can also be updated periodically. It is a special…

    Read more

  • [blog] Monolithic Kernel and Microkernel

    Setting aside more exotic approaches, generally, two kernel models are described: monolithic and microkernel. The crucial difference between them is the amount of system resources that run in supervisor space and user space. Figure 1 conceptually illustrates the two approaches. In the microkernel a smaller set of processes run in kernel space. System programs, such as the file system,…

    Read more

  • Designing and implementing IPC mechanisms on an ARM Cortex-M3 Kernel (2/2)

    6. PROCESS COMMUNICATION Process communication refers to schemes or mechanisms that allow processes to exchange information. It can be accomplished in many different ways, all of which depend on process synchronization. [1] ITC or Inter-Task Communication is a common term used on the embedded domain. Now we have validated our semaphores are able to synchronize…

    Read more

  • Designing and implementing IPC mechanisms on an ARM Cortex-M3 kernel (1/2)

    1. INTRODUCTION I do think system programming is one of the nicest things to do: taking a computer board (I/O, CPU, Memory) and creating its system software from the scratch so it performs some work is awesome. I have presented a kernel implementation for an ARM Cortex-M3 microprocessor. So far, the features are: Just these…

    Read more

  • Separating user space from kernel space on ARM Cortex-M3

    1 . Introduction ARM Cortex-M processors are in SoCs of several application domains, especially in much of what we call smart devices. This publication continues the previous one, in which I had demonstrated the implementation of a minimum preemptive scheduling mechanism for an ARM Cortex-M3, taking advantage of the special hardware resources for context switching.…

    Read more

  • A first preemptive kernel on ARM Cortex-M3

    1. Introduction When it comes to operating systems for embedded software, they are generally thought to be an overkill for most solutions. However, between a completely “hosted” multiapplication system (which uses a multi thread and general purpose or real-time OS) and a completely “standalone/monolithic” or “bare-metal” application specific system, there are many variations we can…

    Read more

  • [blog] Synchronous versus asynchronous reset on ASIC Design

    Reset is about getting a system back to a known initial state. Temporary data is flushed. When I say data I mean 0s and 1s. Everything will be put to a known state so the circuit starts up. Sounds important. When we go for synchronous or asynchronous reset, active low, our HDL code will look…

    Read more

  • [blog] Essential Software Engineering

    Computer Science is a branch of Mathematics. Have you ever wondered how Mathematics is a tool that can tackle a great number of different problems, on different fields relying on the very same concepts? Perhaps part of the answer is because, as Poincaré once stated: “Mathematicians do not study objects, but the relations between objects;…

    Read more

  • [blog] Runtime polymorphism exploited

    In this post I will be showing a dynamic polymorphism implemented in C to take a look on what C++ implements under the hood. The idea is to have an abstract class Polygon which has a public method to calculate the area of a given general polygon. In C++ the implementation is straightforward. C++ does…

    Read more

  • [blog] C++ for C programmers #2

    Returning user-defined types In C, suppose we want to create a function that gets the position of a certain device. We usually would have created a Position type definition, and the functions to retrieve this position would look like one of these: In function 1 the called function would allocate the memory for the Position…

    Read more

  • [blog] C++ for C programmers #1

    C is everywhere on system-programming because it allows high-level abstraction keeping low-overhead. The strong type system is an example. It is used at compile time to check for program correctness. After compile time the types will have disappeared and the emitted assembly code will show no trace of the type system. C++ also takes zero-overhead…

    Read more

  • [blog] C variables and pointers: declarations and definitions

    It might sound naive, but it is a very common interview question, and I actually think the notation can be deceiving. And furthermore, it is essential. A few months off and you will be asking yourself “how is that again?”. Unless you get this rule: start reading from right to left. Question: Please read the…

    Read more

  • Low-power 3/3: microarquitetura e RTL

    6 Abordagens para redução de consumo em RTL As ferramentas de síntese e back-end detectam oportunidades para salvar energia diretamente do RTL, portanto a microarquitetura e, consequentemente o estilo de codificação tem um grande impacto no consumo. A medida que o fluxo avança, menores são as intervenções que podem ser feitas para reduzir a energia…

    Read more

  • Low-power 2/3: arquitetura

    (Um PDA da Nokia com acesso à internet, 1995. Fonte: gizmodo.com) 5 Abordagens low power no nível arquitetural Penso que desenhar a arquitetura de um projeto é, para todos os efeitos, definir como cada módulo do sistema se comunica com os outros módulos para trabalharem em conjunto, e através de análises, seja pela experiência do…

    Read more

  • Low-power 1/3: eficiência, sistema e software

    1 Eficiência Nesta publicação sugeri que a Compaq teria percebido a portabilidade como requisito mais que desejável para a computação pessoal. Apesar de os primeiros computadores da companhia terem ~12 kg (!) e serem considerados “portáteis” simplesmente por serem apresentados em uma maleta com alças, ainda precisavam de uma tomada de corrente para funcionar. Um…

    Read more

  • [blog] O Amplificador Diferencial

    Comentários básicos sobre este workhorse em eletrônica. O conceito de amplificador diferencial é elemento-chave em uma infinidade de aplicações analógicas: buffers, filtros, osciladores, reguladores de tensão, referências de tensão/corrente, processamento de sinais, PLLs, etc., devido às suas características. As figuras foram retiradas do livro CMOS Circuit, Design, Layout and Simulation (Baker). O Par diferencial O…

    Read more

  • [blog] NASA’s Ten Principles of Safety-Critical Code

    These are the NASAs ten principles for safety-critical code. It is interesting to note that they were published later than MISRA-C that already covers it naturally. I have never worked on safety-critical systems (never made systems which a fail could kill people), but my comments on that: Besides, to strictly achieve all 10 points, it…

    Read more

  • SOA para diminuição da hardware-dependência em C

    1. Impacto do software hardware-dependente (HdS) É dito na literatura que o custo do software embarcado tem dominado o projeto de sistemas eletrônicos [1]. Sistemas embarcados, tradicionalmente limitados em memória e processamento, conseguem hoje rodar aplicações mais complexas fruto do avanço no projeto e fabricação de circuitos integrados. Ora, a introdução de hardware mais complexo…

    Read more

  • [blog] “Silicon Cowboys”, a história da Compaq

    Nesta semana assisti ao documentário (disponível no Netflix) “Silicon Cowboys” que conta a história da fundação da Compaq. A Compaq parece ser uma história de sucesso que juntou algum brilhantismo técnico com um gerenciamento todo brilhante.“Não era sobre criarmos um computador ou ficarmos ricos. Era sobre criarmos uma empresa boa para se trabalhar” disse Rod, um…

    Read more

  • Construindo números negativos em computadores

    1. “Tudo é número” (Pitágoras) Os autores costumam dizer que a Matemática é desenvolvida conforme o homem necessita. Assim, podemos imaginar que os humanos primitivos faziam risquinhos para representar uma coleção de objetos (cabras, peles, filhos…). Constatada sua ineficiência, criaram-se símbolos que representavam tamanhos de coleções diferentes, depois símbolos que representavam uma coleção de outros…

    Read more