[Work Notes] Experience Premium HD Entertainment — Stepping into the Digital Life

Recently I’ve been looking into the development of high-definition (HD) technology. What is HD? Those unfamiliar might not know — the first image that comes to my mind is… the God of Gamblers movie character! I think I’ve been brainwashed too thoroughly. The second thing that comes to mind is a company name. And then finally I understood: HD = High Definition, the same HD that appears in all those “HD high-quality digital TV” ads! ...

October 14, 2007 · 2 min · 296 words · Fran Kuo

[R&D Notes] Troubleshooting Busybox 1.7.2 taskset.c Compilation Errors

While compiling Busybox 1.7.2 using the default config (make defconfig) with a specific ARM toolchain, I encountered two specific compilation errors. One was related to the route applet, and the other was in taskset.c. I resolved the taskset.c issue by disabling it temporarily, but later found a proper fix. The root cause lies in a mismatch between uClibc (which Busybox is primarily designed for) and glibc. Specifically, the number of arguments for sched_getaffinity and sched_setaffinity differs between the two. ...

September 30, 2007 · 1 min · 206 words · Fran Kuo

[Work Notes] Ubuntu Dash vs Bash

To speed up the boot process, Ubuntu uses dash as the default shell instead of the traditional bash. You can verify this at /bin/sh → /bin/dash. If you want to switch back to the original bash, type the following at the prompt: sudo dpkg-reconfigure dash When the configuration window appears, select “No” to revert back to bash. Recommendation: If you’re doing software development on Ubuntu and write shell scripts, it’s safer to switch back to bash for compatibility. ...

September 25, 2007 · 1 min · 78 words · Fran Kuo

[R&D Notes] Implementing Linux Daemons in Embedded Systems

Implementing Daemons in Embedded Linux systems is a fundamental task for long-running services. Based on the excellent Linux Daemon Writing HOWTO by Devin Watson, I have refactored several processes in my current project to run as background services (daemons). By backgrounding these processes, we ensure they remain resident in the system without blocking the console or being tied to a specific session. Core Implementation Pattern The following C snippet demonstrates the standard procedure for “daemonizing” a process: fork() from the parent, create a new session with setsid(), change the working directory, and close standard file descriptors. ...

September 19, 2007 · 2 min · 245 words · Fran Kuo

[Work Notes] Patch vs. Embedded Systems Development Notes

Recently I was assigned to work on a streaming server. Working from the original development platform, we applied patches via shell scripts to transform source files — using patches on the original source code to generate modified files, then compiling those into the required libraries or executables. At first I didn’t think much about why this approach was used, but I’ve recently started to appreciate its advantages. The original source files we need are open-source packages downloadable from the internet. To track our modifications, we use the diff command to create patch files. When we combine multiple application components together, we end up with a collection of tarballs and patch files. We then manage them with shell scripts organized into three types: ...

September 19, 2007 · 2 min · 223 words · Fran Kuo

[Work Notes] Patch Files in Linux

Creating a Patch File diff -Naur old-dir-or-file new-dir-or-file > patchfile.patch How to Apply a Patch There are two common ways to apply a patch: # Method 1 cat new-patch | patch -p0 # Method 2 patch -p0 < new-patch Understanding the -p (strip) Parameter The -p parameter specifies how many leading directory components to strip from paths in the patch file. For example, if a patch file begins with: ...

September 14, 2007 · 1 min · 205 words · Fran Kuo

[Work Notes] Registering ActiveX Components on Windows

Registering an ActiveX Component regsvr32 mcscal.ocx Unregistering an ActiveX Component regsvr32 /u mcscal.ocx

September 13, 2007 · 1 min · 13 words · Fran Kuo

[Work Notes] Embedding an OCX Component in a Webpage

An .ocx component is provided by a third party and can be embedded in a webpage. This particular component has limited built-in functionality, so to extend its capabilities, the .ocx file needs to be wrapped in a wrapper function before adding the extra features we need. It’s always a bit challenging the first time you do something new. While I have a clear concept of what needs to be done, the tools themselves are quite unfamiliar — Windows application development is an area where I have very little experience. ...

September 12, 2007 · 1 min · 104 words · Fran Kuo