Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Tuesday, April 30, 2024

Generate cross compile toolchain in Gentoo

Gentoo crossdev

Table of Contents

1. Introcution

Crosstool-ng is commonly used to build a cross-compiler toolchain in various Linux distributions. In Gentoo, the cross-compiler environment generator, crossdev, has been made for our convinience. It is a set of bash scripts that utilize emerge to provide a system integrated cross-compilation capability.

In this article, we are going to walk through building cross-compiler toolchain for an operating system and the embedded target (bare matel).

Emerge to install crossdev.

$ sudo emerge --ask sys-devel/crossdev

Sunday, April 14, 2024

Install and run Docker on Gentoo Linux

Install and run docker on gentoo linux

1 Introduction

Docker is a container virtualization environment that can establish development or runtime environments without modifying the host operating system. It is faster and lighter than full hardware virtualization.

This article will guide you through the steps required to install and run Docker on Gentoo Linux.

2 Installtion

The official sys-kernel/gentoo-kernel-bin package supports running Docker.

For the customized kernel, refer to Docker: Kernel to configure the proper kernel options.

Default USE flags can be utilized. It is recommended to read the messages for the package app-containers/docker when emerging Docker and recompile the kernel based on what is not set but should be.

To check the kernel configuration compatibility, run:

$ /usr/share/docker/contrib/check-config.sh

Install the app-containers/docker and app-containers/docker-cli packages.

$ sudo emerge --ask --verbose app-containers/docker app-containers/docker-cli

Thursday, April 11, 2024

Connect USB device to WSL

Connect USB device to WSL

Connect USB device to WSL

1 Introduction

This article will guide you through the steps required to connect a USB device to Linux running on Windows Subsystem for Linux (WSL).

2 Prerequisites

  • Install WSL and ensure it is updated to the latest version.

For installation guidance, refer to How to install Linux on Windows with WSL

  • Install a Linux distribution configured to WSL 2.

Friday, April 24, 2015

Modify the initial ramfs (initramfs) archive

1 Introduction

Just a tiny note about modifying the initrd image on Debian, Unbuntu, or other Linux distributions. For glossaries about initial RAM disk, initial RAM filesystem, Root filesystem, etc, please reference the links listed in the end of the article.

Sunday, May 4, 2014

uGFX Notepad on STM32F429I Discovery FreeRTOS

1 Introduction

FreeRTOS 8.0.0 on 32F429IDISCOVERY board that demostrates uGFX notepad.

Tuesday, April 22, 2014

FreeRTOS 8.0.0 porting on STM32F429I Discovery Board on Linux

1 Introduction

FreeRTOS 8.0.0 porting on 32F429IDISCOVERY board using GCC on linux.

Friday, March 14, 2014

STM32F429I Discovery SMS Emulator on Linux

1 Introduction

Alessandro Rocchegiani released some interesting projects on STM32 series MCUs. This article introduces the adding support to be built and burned under Linux, with the project STM32F429 Discovery Sega Master System Emulator as an example.

Tuesday, August 6, 2013

Kernel menuconfig to move in VIM ways

Specially for VIM fans. The following is a patch to current (GIT) linux kernel lxdialog that allows you to move with h,j,k,l keys in menuconfig. Please click HERE to download the whole patch file.

Sunday, July 7, 2013

Python Print String Descriptors for the USB HID Devices

1 Inctroduction

In this tutorial, we are going to write two small python programs that prints the String Descriptors for all the USB HID devices in the system. To do this, there are many choices of libraries for assistence. I will introduce two of them - PyUSB and PyWin32. PyUSB supports both Linux and Windows, and PyWin32 supports Windows only.

Friday, September 28, 2012

Writing Your First PyQt4 OpenGL Program

1 Introduction

In this tutorial, we are going to have a glimpse of OpenGL programming in Python. I will introduce several simple Qt GUI applications and show you basic OpenGL programs.
Python is a programming language that lets you work more quickly and integrate your systems more effectively. PyQt is a Python wrapper for the C++ GUI framework Qt. Qt is a framework that uses the native widgets to draw its user interfaces.
PyOpenGL is a cross-platform open source Python binding to the standard OpenGL API. OpenGL is an application program interface that is used to define 2D and 3D computer graphics.
The article is written under Debian Linux. Packages that are required will be installed using powerful APT tool. If you are not a Linux user, however, don't worry. Since Python is a cross-platform language, Qt is a cross-platform framework, OpenGL is also a cross-platform interface, all the programs in this article also work for you. Just 'translate' the package installations according to your system and have fun.

Thursday, December 29, 2011

GDB Debugging ARM U-Boot on QEMU

1 Introduction


QEMU is a generic and open source machine emulator and virtualizer. In this article, we will use it as a machine emulator and run the U-Boot on top of it. It will also be demonstrated about how to debug U-Boot with GDB.

Wednesday, April 6, 2011

MIPS Exceptions Initialization and Handling on Linux

Exceptions and interrupts are un-expected events that disrupt the normal flow of execution. Interrupts are unexpected events from outside the CPU core. Exceptions are from within the CPU, including memory translation exceptions, cache misses, unusual program conditions such as unaligned loads, system calls and traps, and so on.

MIPS architecture adopts precise exception mechanisms, and make it easy for the software to deal with the exceptions. After any exception, CP0 EPC register points to the correct place to restart execution after the exception is dealt with.

Friday, March 4, 2011

Learning the Linux Boot Memory Allocator (MIPS)

Do you ever look at the report of 'cat /proc/meminfo' and wonder why the reported MemTotal is not equal to the amount of memory you have for the system? The followed is an example report from one of my systems. It shows the total memory is 60860kB (59.4MB) from line 2:

1 # cat /proc/meminfo
2 MemTotal:          60860 kB
3 MemFree:           47448 kB
4 Buffers:               0 kB
5 Cached:             7180 kB
6 SwapCached:            0 kB
7 ... 

which is different from the amount of memory that bootloader gave to kernel, 64MB.
1 ...
2 ## Transferring control to Linux (at address 800042f0) ...
3 ## Giving linux memsize in MB, 64 

Thursday, July 17, 2008

inotify Usage

wikipedia: inotify is a Linux Kernel subsystem that provides file system event notification. It was written by John McCutchan with help from Robert Love and later Amy Griffis to replace dnotify. It was included in the mainline kernel from release 2.6.13 (2005-06-18).