Thread-safe Versions of POSIX.1 and C-language Functions

對許多作業系統的製造商而言,要加入 Pthreads 標準最花時間的就是使它們的函式庫及系統呼叫是 Threadsafe。在 Pthreads 的標準裡指定幾乎所有的 POSIX.1 的呼叫都必須是 Thread-safety。除了少部份的特例,如下所示。



Read More »
邱小新 on May 7th, 2009 | File Under pthreads | No Comments -

pthreads vs errno

傳統的 UNIX 和 POSIX.1 系統呼叫常常會使用一個全域變數 errno。當程式在執行這些系統呼叫並且發生錯誤時,系統就會自動幫你設定 errno 這個全域變數,來表示一個錯誤代號。這個全域變數在一般程式裏並沒有任何問題,但是在 multi-threads 程式中使用則會有很大的問題。



Read More »
邱小新 on May 7th, 2009 | File Under pthreads | No Comments -

add USB mouse supported

make linux-config 進入 kernel 選單。

  1. Input core support
    1. Mouse support 打勾。



  2. Read More »
    邱小新 on May 4th, 2009 | File Under kernel | No Comments -

調整 bootloader 大小

  1. 原本整個 flash 的配置如下。
    1. 0x000000 ~ 0x00FFFF -- Firt Boot ROM
    2. 0x010000 ~ 0x02FFFF -- Second Boot ROM
    3. 0x030000 ~ 0x3eFFFF -- ROMFS
    4. 0x3F0000 ~ 0x3FFFFF -- User



  2. Read More »
    邱小新 on May 4th, 2009 | File Under kernel | No Comments -

arm data structure alignment

struct 預設的 data alignment 一般滿足三個準則:
  1. struct 變數的起始位址能夠被其最寬基本類型成員的大小所整除。
  2. struct 每個成員相對于 struct 起始位址的偏移量 (offset) 都是成員自身大小的整數倍,如有需要編譯器會在成員之間加上填充位元組 (internal adding)。
  3. struct 的總大小為 struct 最寬基本類型成員大小的整數倍,如有需要編譯器會在最末一個成員之後加上填充位元組 (trailing padding)。


Read More »
邱小新 on April 28th, 2009 | File Under arm | No Comments -