2010年1月27日 星期三

OpenSSL compile error with timeb.h

I could build openssl-0.9.8i and 0.9.8l with adding UCLIBC_SUSV3_LEGACY and UCLIBC_SUSV3_LEGACY_MACROS to uClibc config
http://old.nabble.com/OpenSSL-compile-problems-td20915267.html

/mnt/buildroot/buildroot/build_i686/staging_dir/usr/bin/i686-linux-uclibc-gcc
-DMONOLITH -I.. -I../include -fPIC -DOPENSSL_PIC -DZLIB_SHARED -DZLIB
-DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DTERMIO -O3
-fomit-frame-pointer -Wall -c -o speed.o speed.c
speed.c:147:23: sys/timeb.h: No such file or directory
speed.c: In function `Time_F':
speed.c:445: error: storage size of 'tstart' isn't known
speed.c:445: error: storage size of 'tend' isn't known
speed.c:451: warning: implicit declaration of function `ftime'
speed.c:445: warning: unused variable `tstart'
speed.c:445: warning: unused variable `tend'
make[2]: *** [speed.o] Error 1

(.......................)

If you're using uclibc-0.9.30 (or new-ish snapshot) you need to enable SUSV3_LEGACY support in it (UCLIBC_SUSV3_LEGACY & UCLIBC_SUSV3_LEGACY_MACROS).

2010年1月11日 星期一

Week-day names

[wiki] Week-day names
http://en.wikipedia.org/wiki/Day_of_the_week

星期中的日子
http://zh.wikipedia.org/wiki/%E6%98%9F%E6%9C%9F%E4%B8%AD%E7%9A%84%E6%97%A5%E5%AD%90

Some information regarding Linux Community

How to Participate in the Linux Community
http://ldn.linuxfoundation.org/how-participate-linux-community

What is RFC/PATCH

RFC is an abbreviation of "Request For Comments" and PATCH is just that. When you've discovered a kernel problem and have implemented a solution for that problem which works for you but are otherwise unsure if it is the proper fix, it is customary to submit an e-mail to the relevant mailing list where the subject line is prefixed with [RFC/PATCH] followed by a brief subject line which summarises the problem, e.g. "Fix serial8250_backup_timeout() SMP/Preempt race". Make sure to thorougly describe the problem and how you propose to fix it in your patch header. Then close by requesting feeback and comments on possible alternative solutions for the problem.

2010年1月5日 星期二

Building cross toolchains

Building and Testing gcc/glibc cross toolchains
http://www.kegel.com/crosstool/

Crosstool build results
http://www.kegel.com/crosstool/crosstool-0.43/buildlogs/

Building a GNU/Linux ARM Toolchain (from scratch)
http://frank.harvard.edu/~coldwell/toolchain/

Russell King: ARM Linux big endian support
http://lists.arm.linux.org.uk/lurker/message/20011127.103750.cc579bcd.html

First thing I'd say is don't be confused by "Big Endian" on ARM. There
aren't 2 endian-nesses available with ARM, there's 4:

1. little endian with devices connected little endian
2. little endian with devices connected big endian
3. big endian with devices connected little endian
4. big endian with devices connected big endian

(...................)

In LE mode with devices connected as LE, you need to access the first byte.
In BE mode with devices connected as LE, you need to access the forth byte.
In LE mode with devices connected as BE, you need to access the forth byte.
In BE mode with devices connected as BE, you need to access the first byte.

http://scottshulinux.blogspot.com/2010/04/howto-build-arm-cross-compiler.html

Magic SysRq key

CONFIG_MAGIC_SYSRQ
SUPPORT_SYSRQ
drivers/char/sysrq.c
sysrq_key_table
struct sysrq_key_op

ENTRY_ARMV_S -> asm_do_IRQ -> handle_level_irq -> handle_IRQ_event -> serial8250_interrupt -> serial8250_handle_port -> uart_handle_sysrq_char -> __handle_sysrq -> (sysrq handling function)

show_interrupts
fs/proc/interrupts.c



Documentation/sysrq.txt

Magic SysRq Key
http://www.linuxhowtos.org/Tips%20and%20Tricks/sysrq.htm

[wiki] Magic SysRq key
http://en.wikipedia.org/wiki/Magic_SysRq_key

[Linux][Kerne][Tips] 在 minicom 下送出 SysRq
http://blog.richliu.com/2007/09/20/514/comment-page-1/
按 ctrl+a f 就是送出 break key


Linux Shortcuts and Commands
http://linux.about.com/od/linux101/l/blnewbie5_1.htm

Fix a Frozen System with the Magic SysRq Keys
http://fosswire.com/post/2007/9/fix-a-frozen-system-with-the-magic-sysrq-keys/
  1. Hold down the Alt and SysRq (Print Screen) keys.
  2. While holding those down, type the following in order. Nothing will appear to happen until the last letter is pressed: REISUB
  3. Watch your computer reboot magically.

(...............)

REISUB - Raising Elephants Is So Utterly Boring.

otg 線買不到

USB Type A Female to mini-A male

http://item.eachnet.com/prd/1244522642672533_prd.html

http://www.amazon.co.uk/OTG-Cable-Adapter-plug-Socket/dp/B000EORX7U

http://cgi.ebay.com.hk/USB-Host-Cable-mini-a-male-to-USB-A-female-OTG-adaptor_W0QQitemZ250557023232QQcategoryZ42322QQcmdZViewItemQQ_trksidZp4340.m263QQ_trkparmsZalgo%3DSI%26its%3DI%26itu%3DUCI%26otn%3D10%26ps%3D63

2010年1月3日 星期日

Linux Serial Console

8250.c的interrupt handler

serial8250_interrupt


On booting
console_init -> con_init -> serial8250_console_init -> register_console -> release_console_sem


Kernel mode
release_console_sem 會把要印的東西直接丟進serial port,而printk也會呼叫release_console_sem,所以每次呼叫printk都會直接的把結果印到console上

printk -> vprintk -> release_console_sem -> __call_console_driver -> (tty) vt_console_print -> ... -> (ttyS) serial8250_console_write -> uart_console_write -> serial8250_console_putchar
-> serial_out ----> mem_serial_out
-> serial_in ----> mem_serial_in


run_timer_softirq -> __run_timers -> serial8250_backup_timeout

User mode
沒追
user mode要印的訊息應該是由/dev/ttyS寫進來然後 (.....) 最後在serial8250_interrupt -> serial8250_handle_port -> transmit_chars裡被印出來



Serial Drivers
http://www.linux.it/~rubini/docs/serial/serial.html

Interfacing the Serial / RS232 Port
http://www.beyondlogic.org/serial/serial.htm

Serial Programming HOWTO
http://tldp.org/HOWTO/Serial-Programming-HOWTO/

Linux Serial Console HOWTO
http://www.vanemery.com/Linux/Serial/serial-console.html

河馬工作室: Linux Serial Driver 系統架構 (ref to other articles)
http://riverhippo.blogspot.com/2007/06/linux-serial-driver.html

河馬工作室: Linux Serial Port Programming (ref to other articles)
http://riverhippo.blogspot.com/2007/06/linux-serial-port-programming.html