Skip to main content

QEMU Emulate Raspberry Pi 3 and 4

ยท 9 min read
Frank Chen
Backend & Applied ML Engineer

In this blog, QEMU is employed to emulate Raspberry Pi 3/4 in mac M1 host(it's also supposed to work in Windows/Linux with a little tweak). I will demonstrate two different ways to emulate Raspberry Pi 3 and Raspberry Pi 4 in respect. These two ways are different by using different QEMU machines as you would like to use:

  1. -machine raspi3b: raspberry pi 3b machine to emulate Raspberry Pi 3.
  2. -machine virt: general arm machine to emulate Raspberry Pi 4.
note

In mac M1 with setting -machine virt, I use the hardware acceleration by -accel hvf. In Windows(x86_64), the hardware acceleration for aarch64 is not available, so removing the hardware acceleration will work as well in Windows.

For both of these two, we still need prepare some common steps before running QEMU:

  • Extract the appropriate kernel, device tree or root filesystem

Exploring cross compilation: ARM on x86_64

ยท 3 min read
Frank Chen
Backend & Applied ML Engineer

Cross Compilation Anatomyโ€‹

Cross-Compilation ecosystem involves the following components:

  • host system
    • cross-Compilation toolchain
      • cross compiler
      • cross linker
      • cross debugger
      • sysroot
        • target system library files
        • target system header files
        • target system other files
  • target system

Installing FFmpeg on Nvidia CUDA container

ยท 2 min read
Frank Chen
Backend & Applied ML Engineer

This documentation describes to install FFmpeg on nvidia/cuda container to use the Nvidia GPU to accelerate encoding.

If you want to know how to install FFmpeg with NVIDIA GPU on Linux, go to see that.

FFmpeg can support hardware-based decoding and encoding for Nvidia GPU card. With the help of Nvidia GPU, h264_nvenc can lead encoding speed with 5x faster than libx264 in GTX1080 card.

Let's see how to install everything one by one on the Nvidia CUDA Docker container nvidia/cuda:12.2.0-devel-ubuntu20.04, in which CUDA toolkit and GPU driver are already included.

Playing with unicode in deep

ยท 6 min read
Frank Chen
Backend & Applied ML Engineer

The smallest unit of all texts we see on the screen is one character. But you may wonder about:

  1. How one character is displayed on the screen?
  2. How one character is kept in memory or disk in binary format(0 or 1)?

Let's dive into the Unicode to solve these questions.

In Unicode, a character maps to something called code point which is a magic number written as hex like: U+20AC and is still just a abstract layer.

LayerRepresentation
screenglyph
abstractionunicode character
abstractionunicode code point
diskvariable-length bytes(1 to 4 bytes)

How that code point is represented in memory or on disk?

UTF-8, UTF-16, and UTF-32 help translate unicode code point into binary data in 8-bit bytes which can be saved in disk or be transported in network.

UTF-8 is character-to-bytes(1 to 4 bytes) encoding standard across almost all system and application.

Discovering QEMU

ยท 4 min read
Frank Chen
Backend & Applied ML Engineer

Learning and using the QEMU help me understand how the linux operating system works including fields:

  1. Linux boot process.
  2. Cross compile for target system(such as arm64) on host system(such as x86_64), and test the binary.

Managing RAID on ubuntu

ยท 7 min read
Frank Chen
Backend & Applied ML Engineer

What is RAID?

The Redundant Array of Independent Disks, commonly known as RAID, is a technology used to combine multiple physical disk drives into a single logical unit for the purpose of data storage and performance improvement.

This blog will demonstrate to set up software RAID on Ubuntu(It should also work on other Linux).

Configuring WiFi AutoSwitch in Windows

ยท One min read
Frank Chen
Backend & Applied ML Engineer

If autoSwitch is turned on, it allows Windows to continue looking for other auto-connected wireless networks while connected to the current wireless network. If a higher priority auto-connected wireless network than the currently connected wireless network comes in range, Windows will automatically connect to it instead.

It also needs to work along with priority setting.