2008年6月30日 星期一

[轉錄] Tracking down hardware exceptions on hardware

from http://www.newlc.com/tracking-down-hardware-exceptions-hardware

in Platforms:

Hardware exceptions are abnormal events triggered by the ARM instruction being executed. The sources of this can be accessing non-existing memory, accessing mis-aligned memory, writing to a read-only area of memory, jumping to invalid memory address, local stack overflow and so forth.

This tutorial is divided into following sections:

  1. Section 1, describes the classification of debugging techniques.
  2. Section 2, describes very briefly the ARM processor modes.
  3. Section 3, explains an algorithm for debugging hardware exceptions.

Tracking down hardware exceptions is a developer’s nightmare.

My device driver is working correctly giving the desired result with one sample test application, and when I use some other application the device is crashing and rebooting Sad. What wrong did I do:-(? How to find the culprit?

Let us look how to tackle this in the following sections.

1. Classification of Debugging Techniques


Debugging techniques can be classified broadly into the following four categories:

  1. Crash and Burn (Debug Trace)
  2. Debugger Monitor (aka ROM monitor)
  3. In-Circuit Emulator
  4. On Chip Debugger

Crash and Burn/Debug Trace


We sprinkle output messages at various parts of our code. Different tasks or
Routines can “announce” their execution by displaying a message on the output device. This is not necessarily a bad method but it can be extremely slow.
Moreover displaying a message on the output device can also affect the real time performance of the system.

Debugger Monitor


This is a small piece of code (that’s a relative statement) to help with debugging. It usually communicates via a serial interface/ JTAG interface to a host computer or some form of terminal. A basic monitor may allow download of code, reading and writing of memory and registers, and perhaps most importantly setting breakpoints, single stepping, and real-time execution.

In-Circuit Emulator


The in-circuit emulator (ICE) remains the most powerful debugging tool available. Nothing else approaches an ICE’s wide range of troubleshooting resources; no other tool so completely addresses problems stemming from hardware/software interaction.
Emulators traditionally provide many debug features that are common to all debugging tools: breakpoints, single stepping, and ways to display and alter registers and memory. Like similar tools, they link your source code to the debugging session—you break on a line of C code, not hex, and data is shown in its appropriate type.
Unlike other debugging tools though, an ICE includes features you’ll get only with a device packed with hardware. Real-time trace, emulation RAM, complex breakpoints, and other features assist in finding the more difficult problems associated with real-time issues or complicated interactions in the code.

On-Chip Debugging


In the general sense, on-chip debugging is a combination of hardware and software, both on and off the chip. The part that resides on the chip is implemented in various ways. It may be a microcode based monitor (Motorola CPU32) or hardware implemented resources (IBM PPC403/ARM).
A target system with an OCD processor is useless unless they have a host to communicate with. The host runs debugger software and interfaces to the OCD in various ways.

2. A brief introduction to ARM processor modes


Note: In this section the ARM processor register sets and details about the processor modes are not discussed. This contains a very very brief introduction to ARM modes. Please refer to ARM Architecture Reference Manual available at www.arm.com for more details about ARM architecture.

ARM processors support several modes. They are:

  1. User (usr)
  2. System (sys)
  3. Supervisor (svc)
  4. IRQ (irq)
  5. FIQ (fiq)
  6. Abort (abt)
  7. Undefined (und)

The processor modes are used for saving the context when handling an exception/interrupt, to restrict some instructions to privileged mode.

Processor modes and Symbian OS


In Symbian the processor is never put in sys mode.

The processor mode and Symbian OS execution:

  1. usr: The user mode code runs entirely in usr mode of ARM. It has access to only limited access to memory region.
  2. sys: This mode is not used in Symbian.
  3. svc: This mode is entered on a SWI instruction. Device drivers and kernel execute user side requests and DFC in this mode.
  4. irq: This mode is entered on occurrence of a normal interrupt (an interrupt on IRQ pin of ARM). The ISR’s of device drivers are executed in this processor mode. The IRQ dispatcher routine of kernel is executed in this mode.
  5. fiq: This mode is entered on occurrence of a fast interrupt. Kernel’s FIQ dispatched will execute in this mode.
  6. abt: This mode is entered due to hardware exceptions. The exceptions can be data abort or prefetch abort. (These are not detailed here). Symbian OS exception handler routine is executed in this mode.
  7. und: This mode is entered on execution of undefined ARM instruction. This is the least common mode of ARM processor. This can be used for emulating unsupported instructions. Symbian OS exception handler routine is executed in this mode.

Insight to FAR and FSR registers of ARM

Fault Status Register

This register contains abort source similar to Symbian error codes. This is updated after data abort only. There is also a IFSR (Instruction FSR) which will be updated after pre-fetch abort.
Here below find the meaning of the value in the FSR

FSR[3:0]source
0010 Terminal exception
0000 Vector exception
00x1 Alignment
1100 External abort on transation 1st level
1110 External abort on translation 2nd level
0101 Translation section
0111 Translation page
1001 Domain section
1011 Domain page
1101 Permission section
1111 Permission page
0100 External abort on linefetch section
0110 External abort on linefetch page
1000 External abort on non-linefetch section
1010 External abort on non-linefetch page

Fault Address Register

This register is updated after data abort only. It contains data address that triggered exception

CPSR (Current Program Status Register)

The Current Program Status Register is accessible in all processor modes. It contains condition code flags, Interrupt disable bits, the current processor modes, and other status and control information.
The bits [4:0] represent the current processor mode.

CPSR[4:0] Mode
10000 User
10001 FIQ
10010 IRQ
10011 Supervisor
10111 Abort
11011 Undefined
11111 System

Each exception mode also has a Saved Program Status Register (SPSR), that is used to preserve the value of CPSR when the associated exception occurs.

3. A brief introduction to debugging Hardware exceptions

Hardware exceptions are different than the “Panic” of Symbian. These are events triggered by ARM instruction being executed.

The aborts are triggered due to memory access failure. There are two kinds of abort Data abort and Pre-fetch abort.
Data Abort: Triggered while storing or loading data from memory. This may arise due to:

  1. Accessing non-existing memory
    TInt* p=NULL; *p = 123;
  2. Accessing misaligned memory
    HBufC8* des = …;
    TUint8* p = des->Ptr();
    TUint32* q = (TUint32*)(p+7);
    return *q;
  3. Writing to read only memory
    TUint8* p = ReadOnlyBuffer();
    *p = 42
  4. Prefetch abort: Triggered due to jumping to invalid address.
    void (*pfn)(void) = NULL; (*p)();
  5. Local buffer overflow.
    void F()
    {
    // overflow trashes saved return address on stack
    TUint buf[10]; for (TInt i=0; i<100; i++)
    { Function1(); buf[i] = 0;}
    }

Whenever an exception occurs, the PC (Program Counter) is changed to point to pre-defined address (the address table is known as exception vector table) and the execution starts from that address.

Below is the exception vector table:

                     Mode Normal @   High @
reset Svc 0x00000000 0xFFFF0000
Undefined instruction Und 0x00000004 0xFFFF0004
Software interrupt Svc 0x00000008 0xFFFF0008
Prefetch abort Abt 0x0000000C 0xFFFF000C
Data abort Abt 0x00000010 0xFFFF0010
IRQ Irq 0x00000018 0xFFFF0018
FIQ Fiq 0x0000001C 0xFFFF001C

The entries at the specified address contains one 32-bit instruction which generally will be a jump to handler ex: __ArmVectorSwi(), __ArmVectorAbortData(), …
FIQ is the last entry in the table. FIQ handler is concatenated to table address. i.e; the FIQ handler will be residing at the FIQ vector address. This is usually done to save one jump, from FIQ vector address to FIQ handler.

After the preamble of ARM processor mode and exception handling, now let us look at a few methods which can be used to bust a bug causing the exception.

When an exception occur the ARM CPU perform the following actions:

  1. Saves return link in R14_
  2. Saves CPSR (Current Processor State Register of ARM register set) in SPSR_ (Saved Processor State Register)
  3. Sets exception mode in CPSR
  4. Switches to ARM instruction set
  5. Disables IRQ if == irq
  6. Disables IRQ and FIQ if == fiq
  7. Jumps to exception handler thru vector table (explained earlier)

The Symbian Kernel on exception:

  1. Runs first half of exception handler (__ArmVectorAbortData()) (in exec mode)
  2. Runs second half of exception handler (Exc::Dispatch()) (supervisor mode) and ends up in Kern::Fault(). The Kernel faults and the phone reboots.
  3. If Kernel Debugger is present it is run after kernel fault. For information and available commands of kernel debugger refer to “Device Driver Guide for EKA2 versions of Symbian OS “

A sample Debugging Session


Now let us take an example and try to locate/solve the bug. In the example ROM debug monitor is present that will be run when the Kernel faults. In this document debug monitor is not explained.

After the addition of some application, the driver is crashing and causing a system reboot.

In this scenario, the output on the debug port will look like:
debug_monitor.jpg

Extracting information from Kernel register Dump

exception_details.jpg

In our example case the abort is data abort (Exc =1), FSR = 5 and FAR = 0.
Since it is a data abort FSR and FAR are valid.
FSR = 5 indicating that the error is “Translation Section”
FAR = 0 indicating the address that triggered the exception.
From this it looks like the problem occurred due to de-referencing a NULL pointer.

Now we know the reason why there is fault, what next?
Let us try to find the instruction that is de-referencing the NULL pointer.

Inspecting the ARM registers

Using Debug Monitor
When the Kernel faults Symbian Kernel Debugger will run. (This will not be present in production ROM’s. It is used for debugging purpose only.)
The command “r” dumps the content of ARM registers.

The contents of registers in the example scenario are:

MODE_USR:
R0=6571de54 R1=0000002a R2=00000002 R3=ffffffff
R4=0000002a R5=f8170414 R6=6571df14 R7=6403cba8
R8=00000001 R9=6403c41c R10=640002f8 R11=6571de70
R12=00000020 R13=00404e00 R14=f80818c0 R15=f800bfa8
CPSR=80000097
MODE_FIQ:
R8=00000000 R9=ffffffff R10=ffffffff R11=00000000
R12=00000000 R13=64000d0c R14=c080079c SPSR=e00000dc
MODE_IRQ:
R13=6400110c R14=00000013 SPSR=80000013
MODE_SVC:
R13=6571de54 R14=f80328bc SPSR=60000010
MODE_ABT:
R13=6400090c R14=f80818c8 SPSR=80000013
MODE_UND:
R13=6400090c R14=95221110 SPSR=f000009d

The register contents can also be obtained using IDE that supports on target debugging.

From the bits [4:0] in the CPSR it is clear that the current processor mode is abort and the SPSR of abort mode specifies the previous mode.
In our case it is “SPSR=80000013” it is indicating that the previous mode was supervisor (SVC). This indicates that a Kernel side component has dereferenced NULL pointer.

The Link Register R-14:
In case of data abort the link register R14_ABT points to faulty_inst + 8. For other exception pre-fetch abort this does not hold good.

In our case the value of R14_ABT is f827f2c8. So the instruction that generated this exception is at address “f80818c0”.

The information we have till now:

  1. The exception type: “Data Abort”
  2. Cause: due to de-referencing NULL pointer.
  3. A Kernel component has performed this activity.
  4. The (address of) instruction that caused the exception: f80818c0

How to proceed further

Restart the hardware and insert a break point at address “f827f2c0” and execute the application (If the IDE does not support un-winding of call stack after the occurrence of exception, insert two break points one at the faulty instruction and one at instruction prior to that).

When the execution breaks at the break point, unwinding the call stack will show the calling method. In 98% of the cases this will be a device driver not part of standard Symbian delivery.
Inspecting the source code of the method will reveal the exact location and instruction causing the exception. Most probably this will because of not checking the parameter/variable against NULL.

Footer:
One golden rule of thumb: “Always check the value of pointers against NULL before de-referencing them.”. This holds good for both user-side and kernel-side components.

References


  1. ARM Architecture Reference Manual
  2. Hardware debugging Presentation, Symbian,
  3. Device driver Guide for EKA2 Symbian Help manual, Symbian.

This tutorial is not of any help for debugging on emulator.
The basic knowledge of ARM architecture and knowledge of on target debugging are pre-requisite.

除權除息

名詞解釋
http://www.honsec.com.tw/financial/m1-4.htm

除息: 發行公司將現金股利發放給股東。
除權: 發行公司將股票股利發放給股東。
假除權: 除權交易日前六個營業日起,先行將權值與股價做換算,若計算後之整戶維持率低於120%,即通知投資人補繳差額。另89年1月1日起實施,無償配股2元以上(含2元)時,不適合前述假除權作業。
填息、貼息: 除息後、股價上漲,把除息的差價補回來就叫「填息」;反之除息後股價下跌,不但未能補回股息差價,還繼續下跌就叫「貼息」。
填權、貼權: 除權後,股價上漲,把除權的差價補回來,就叫作「填權」;反之除權後,股價下跌,未能除權的差價補回來,就叫作「貼權」。
除權除息基準日: 因公司股東名冊常會變動,所以當公司決定增資配股或分派股利、股息時,董事會需訂定某一日期,作為除息、除權基準日,並以該日的實際股東名冊作為配股與配息的參考依據。
最後過戶日: 除權除息基準日決定後,由基準日算起前五日為停止過戶日,以便公司整理股東名冊。通常是在除息(除權日)後的2天。投資人必須在這一天之前完成過戶,否則將領不到股利。
除息除權交易日: 為配發股利與股息,所以訂定停止過戶期間前 (停止股東辦理過戶)的第二個營業日為除權、除息交易日,在該日以後所買進的股票不能參加除息與除息。
有償配股: 公司通過現金增資案後,按一定比例配發股東股票,股東須繳清股款能獲得配股,稱為有償配股。
無償配股: 公司將盈餘的一部份轉增資發行股票並按若干比例配發給股東,股東無須另外繳交股款,稱為無償配股。
現金股利: 公司盈餘以現金方式分配給股東。
股票股利: 公司盈餘以股票方式分配給股東。


第三十二章 什麼是除權除息
http://fn.yam.com/school/fn_edu/article.php?cls=twstock&cat=dividend&id=113

除權
因應發放股票股利或現增而向下調整股價
除息
因應發放現金股利而向下調整股價



第三十四章 參加除權應注意事項
http://fn.yam.com/school/fn_edu/article.php?cls=twstock&cat=dividend&id=115

Memory Access Error

Unable to handle kernel paging request at virtual address fff09020
指的是沒辦法轉VA to PA
在map_desc的情況下通常是沒有相對應的entry

Unhandled fault: external abort on non-linefetch (0x01a) at 0xfffa3000
則是指硬體無法存取該register
可能是硬體沒被config好


[i2c] [PATCH] I2C: Fix unhandled fault in i2c-omap controller, take #2
http://lists.lm-sensors.org/pipermail/i2c/2008-March/003135.html


i2c-omap: Fix unhandled fault
http://kerneltrap.org/mailarchive/git-commits-head/2008/3/26/1257404


Tracking down hardware exceptions on hardware
http://www.newlc.com/tracking-down-hardware-exceptions-hardware

2008年6月26日 星期四

Buildroot note

apt-get install flex texinfo bison makeinfo



binutil needs makeinfo (texinfo, but apt-cache search makeinfo always return texi2htm). If the error is encountered while building,

toolchain/uClibc/uClibc-0.9.29.config
package/busybox/busybox.config

project_build_arm/uclibc/busybox-1.10.3
CONFIG_FEATURE_MOUNT_NFS
util-linux/mount.c:520:2: error: #error "You need to build uClibc with UCLIBC_HAS_RPC for NFS support."


rm toolchain_build_arm_nofpu/uClibc-0.9.29/.config project_build_arm/uclibc/busybox-1.10.3/.config;
make clean -C project_build_arm/uclibc/busybox-1.10.3/;
make clean -C toolchain_build_arm_nofpu/uClibc-0.9.29/;

cp toolchain/uClibc/uClibc-0.9.29.config toolchain_build_arm_nofpu/uClibc-0.9.29/.config;
cp package/busybox/busybox.config project_build_arm/uclibc/busybox-1.10.3/.config;

ABI/EABI/OABI

http://wiki.debian.org/ArmEabiPort
ArmEabiPort

(..............................)
Terminology

Strictly speaking, both the old and new ARM ABIs are subsets of the ARM EABI specification, but in everyday usage the term "EABI" is used to mean the new one described here and "OABI" or "old-ABI" to mean the old one. However, there are one or two programs that sometimes describe an old ABI binary as "EABI".
To add to the confusion, powerpc has also had an ABI called "EABI" for some, which has nothing to do with this one.
(..............................)
GCC view

New ABI is not only a new ABI field, it is also a new GCC target.

Legacy ABI
* ABI flags passed to binutils: -mabi=apcs-gnu -mfpu=fpa
* gcc -dumpmachine: arm-unknown-linux
* objdump -x for compiled binary:
private flags = 2: [APCS-32] [FPA float format] [has entry point]
* "file" on compiled Debian binary:
ELF 32-bit LSB executable, ARM, version 1 (ARM), for GNU/Linux 2.2.0, dynamically linked (uses shared libs), for GNU/Linux 2.2.0, stripped
* "readelf -h | grep Flags""
Flags: 0x0

Arm EABI:
* ABI flags passed by gcc to binutils: -mabi=aapcs-linux -mfloat-abi=soft -meabi=4
* gcc -dumpmachine: arm-unknown-linux-gnueabi
* objdump -x for compiled binary:
private flags = 4000002: [Version4 EABI] [has entry point]
* "file" on compiled binary (under Debian):
ELF 32-bit LSB executable, ARM, version 1 (SYSV), for GNU/Linux 2.4.17, dynamically linked (uses shared libs), for GNU/Linux 2.4.17, stripped
* "readelf -h | grep Flags""
Flags: 0x4000002, has entry point, Version4 EABI

Furthermore, as well as the usual __arm__ and maybe also __thumb__ symbols, the C preprocessor symbol __ARM_EABI__ is also defined when compiling into EABI.
(..............................)
Struct packing and alignment
With the new ABI, default structure packing changes, as do some default data sizes and alignment (which also have a knock-on effect on structure packing). In particular the minimum size and alignment of a structure was 4 bytes. Under the EABI there is no minimum and the alignment is determined by the types of the components it contains. This will break programs that know too much about the way structures are packed and can break code that writes binary files by dumping and reading structures.
(..............................)


http://en.wikipedia.org/wiki/Application_binary_interface
Application binary interface (ABI)

application binary interface (ABI) describes the low-level interface between an application program and the operating system, or the interface between an application and its libraries, or that between component parts of an application. An ABI is similar to an application programming interface (API); however, the latter defines a source code interface.[1] Simply put, ABIs enable binary compatibility, whereas APIs enable source code compatibility.

For example, the POSIX standard defines an API that allows a wide range of common computing functions to be written such that they may operate on many different systems (Mac OS X, various BSDs and Microsoft Windows all implement this interface); however, making use of this requires re-compilation for each platform. A compatible ABI, on the other hand, allows compiled object code to function without any changes, on any system implementing that ABI. This is advantageous to both software providers (where they may distribute existing software on new systems without producing/distributing upgrades) and users (where they may install older software on their new systems without purchasing upgrades), although this generally requires various software libraries implementing the necessary APIs too.

ABIs cover details such as the calling convention, which controls how functions' arguments are passed and return values retrieved; the system call numbers and how an application should make system calls to the operating system; and in the case of a complete operating system ABI, the binary format of object files, program libraries and so on. A complete ABI, such as the Intel Binary Compatibility Standard (iBCS),[2] allows a program from one operating system supporting that ABI to run without modifications on any other such system. Other ABIs standardize details such as the C++ name decoration,[3] exception propagation,[4] and calling convention between compilers on the same platform, but do not require cross-platform compatibility.

What is EABI and how do I use it?
http://www.applieddata.net/forums/topic.asp?TOPIC_ID=2305

What is EABI?

GNU EABI is a new application binary interface (ABI) for Linux. It is part of a new family of ABI's from ARM� Ltd. known in the arm-linux community as EABI (or sometimes Embedded ABI).

How do I use EABI?

To use EABI, you'll need:
  • A linux kernel that supports EABI. All BitsyG5 kernels and boards that run the latest 2.6 kernel are configured with EABI support enabled. You can boot these kernels from an ATA flash card or on-board flash just as you would our regular kernels.

  • An EABI root file system based on ADS' new Debian port which is available for download here.
    You can install this root on an NFS server or harddrive, just as you would our regular full Debian distribution.
The root file system includes an arm-linux-gnueabi toolchain which you can use to recompile your own source code.

Why switch to EABI?

According to Debian Wiki the new EABI:
  • Allows mixing softfloat and hardfloat code.

  • Uses a more efficient syscall convention.

  • Will be more compatible with future tools.
Furthermore, the GCC default for EABI will be to use softfloat instructions for floating point arithmetic.

Traditionally, GCC used hardfloat FPA [1] instructions in arm-linux software. Unfortunately, most ARM processors lack support for FPA and instead rely on the kernel for floating point emulation (FPE). They do this through illegal instruction faults which are rather inefficient. Emulating floating point instructions using softfloat is significantly faster than the standard NWFPE used in most arm-linux kernels and appreciably faster than the FastFPE we use in our kernels.

Like most root file systems for ARM computers, Debian uses GCC's default for floating point operations. Prior to the introduction of EABI, the only way to use softfloat was to recompile the entire root file system with softfloat enabled. Now, with an EABI root file system, softfloat instructions will be used by default and you'll be able to mix hard and soft float executables.

In the absence of FPA hardware, the switch to softfloat alone will offer appreciable performance improvement. Additionaly, if your system has some non-FPA floating point hardware, you can recompile critical software with the appropriate hardfloat instructions for an even greater improvement in performance and still be able to run it alongside software that uses softfloat.

Besides FPA, what other intruction sets are there ?

We have or will have systems that use VFP (Vector Floating Points), Maverick Crunch (Cirrus Logic), and iWMMXt (Intel) instructions. (The iWMMXt instructions are actually integer SIMD instructions but their opcodes overlap those for FPA).


http://unadventure.wordpress.com/2008/01/04/2-abi-translation/
2: ABI translation


Why ARM's EABI Matters
http://www.linuxdevices.com/articles/AT5920399313.html
http://www.chineselinuxuniversity.net/courses/embedded/introductions/6243.shtml
http://emqbit.com/eabi-oabi-benchmark
The ARM EABI (embedded application binary interface) improves the floating point performance. So, it's not striking if you read how your processor is wasting a lot of cycles now. From the Debian ARM-EABI wiki:

The current Debian port creates hardfloat FPA instructions. FPA comes from "Floating Point Accelerator". Since the FPA floating point unit was implemented only in very few ARM cores, these days FPA instructions are emulated in kernel via Illegal instruction faults. This is of course very inefficient: about 10 times slower that -msoftfloat for a FIR test program. The FPA unit also has the peculiarity of having mixed-endian doubles, which is usually the biggest grief for ARM porters, along with structure packing issues.

So, what does it mean? It means that the compilers usually generate inscructions for a piece of harware, namely a Floating Point Unit that is not actually there!

So, when you make a floating point operation, such at 3.58*x, the CPU runs into an illegal instruction, and it raises an exception.

The kernel catches this specific exception and performs the intended float point operation, and then resumes executing the program. And this is slow because it implies a context switch.


http://zh-kernel.org/pipermail/linux-kernel/2008-January/002793.html
Re: 关于kernel ARM_EABI

EABI是ARM公司后来推出的一个ABI 叫Embeded ABI 原来旧的就
被叫做 Old-ABI或者Legacy-ABI
在OABI下 这些函数都通过一个系统调用实现 sys_ipc 在EABI
下把它们拆开了 所以任何一种ABI下对功能都没影响
下面是两种ABI在系统调用时的区别
以 long ftruncate64(unsigned int fd, loff_t length) 为例:

legacy ABI:
- put fd into r0
- put length into r1-r2
- use "swi #(0x900000 + 194)" to call the kernel

new ARM EABI:
- put fd into r0
- put length into r2-r3 (skipping over r1)
- put 194 into r7
- use "swi 0" to call the kernel




http://www.oesf.org/index.php?title=Q3:_What_are_OABI_and_EABI%3F
Q3: What are OABI and EABI?

Q3: What are OABI and EABI?
A3: They are two kinds of ABI (Application Binary Interface). The ‘O’ stands for ‘Old’, and the ‘E’ means ‘Embedded’, a new approach to API for portable devices like the Zaurus.
GNU EABI is a new application binary interface (ABI) for Linux. It is part of a new family of ABI's from ARM® Ltd. known in the arm-linux community as EABI (or sometimes Embedded ABI).

According to Debian Wiki the new EABI:

* Allows mixing softfloat and hardfloat code.
* Uses a more efficient syscall convention.
* Will be more compatible with future tools.

Furthermore, the GCC default for EABI will be to use softfloat instructions for floating point arithmetic.

從u-boot傳bootargs給kernel

1. rebuild u-boot with CONFIG_CMDLINE_TAG defined in include/configs/XXX.h
2. in u-boot:

setenv bootargs xxx=xxx;
Refer to uImage + u-boot的啟動方式 任一方法,用go的不行
setenv flashaddr 10040000;setenv kfile uImage; setenv ramaddr 1500000;tftp $(ramaddr) $(kfile); bootm $(ramaddr);
結果

Star Dorado2 # setenv bootargs xxx=xxx;
Star Dorado2 # setenv flashaddr 10040000;setenv kfile uImage; setenv
ramaddr 1500000;tftp $(ramaddr) $(kfile); bootm $(ramaddr);
config VSC7385
MAC0 PHY Link Status : UP!
INIT VSC8601
VSC8601 Type B Chip
TFTP from server 172.20.5.185; our IP address is 172.20.150.151
Filename 'uImage'.
Load address: 0x1500000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
###################################################
done
Bytes transferred = 1590076 (18433c hex)
## Booting image at 01500000 ...
Image Name: Linux-2.6.16-star
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 1590012 Bytes = 1.5 MB
Load Address: 01500000
Entry Point: 01500040
Verifying Checksum ... OK
XIP Kernel Image ... OK

Starting kernel ...

Uncompressing
Linux................................................................................................ done, booting the kernel.
Linux version 2.6.16-star (root@test-laptop) (gcc version 3.4.6) #7 Tue Jun
3 14:41:53 CST 2008
CPU: FA526id(wb) [66015261] revision 1 (ARMv4)
Machine: STAR STR9100
Memory policy: ECC disabled, Data cache writeback
CPU0: D VIVT write-back cache
CPU0: I cache: 16384 bytes, associativity 2, 16 byte lines, 512 sets
CPU0: D cache: 16384 bytes, associativity 2, 16 byte lines, 512 sets
CPU clock at 250MHz
AHB clock at 125MHz
APB clock at 62MHz
Enable I-ScratchPad Address Start : c002c000
Built 1 zonelists
Kernel command line: xxx=xxx
(..............................................)





转载:非常不错的u-boot ppt
http://blog.chinaunix.net/u/22617/showart_466018.html



bootm命令浅析
http://blog.chinaunix.net/u1/47239/showart_377972.html

http://blog.csdn.net/menuconfig/archive/2008/04/09/2270429.aspx
http://www.sudu.cn/info/html/edu/linux/20070102/291441.html


使用initrd文件系统 U-boot引导Linux方法
http://linux.chinaitlab.com/administer/753535.html

bootm 0x100000 0x240000
(其中:0x100000是linux内核在flash中的地址,0x240000是initrd在flash中的地
址)

setenv bootargs console=ttyS0,115200n8 root=/dev/ram rw mem=32M
当u-boot使用上面的设置时,能够正常引导linux加载initrd !


http://www.hhcn.com/cgi-bin/topic.cgi?forum=3&topic=735
14.3.5. Linux Kernel Ignores my bootargs

Question:
Why doesn't the kernel use the command-line options I set in the "bootargs"
environment variable in U-Boot when I boot my target system?

Answer:
This problem is typical for ARM systems only. The following discussion is
ARM-centric:

First, check to ensure that you have configured your U-Boot build so that
CONFIG_CMDLINE_TAG is enabled. (Other tags like CONFIG_SETUP_MEMORY_TAGS or
CONFIG_INITRD_TAG may be needed, too.)
This ensures that u-boot will boot
the kernel with a command-line tag that incorporates the kernel options you
set in the "bootargs" environment variable.

If you have the CONFIG_CMDLINE_TAG option configured, the problem is almost
certainly with your kernel build. You have to instruct the kernel to pick up
the boot tags at a certain address
. This is done in the machine descriptor
macros, which are found in the processor start-up C code for your
architecture. For the Intel DBPXA250 "Lubbock" development board, the
machine descriptor macros are located at the bottom of the file
arch/arm/mach-pxa/lubbock.c, and they look like this:

MACHINE_START(LUBBOCK, "Intel DBPXA250 Development Platform")
MAINTAINER("MontaVista Software Inc.")
BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000))
FIXUP(fixup_lubbock)
MAPIO(lubbock_map_io)
INITIRQ(lubbock_init_irq)
MACHINE_END

The machine descriptor macros for your machine will be located in a similar
file in your kernel source tree. Having located your machine descriptor
macros, the next step is to find out where U-Boot puts the kernel boot tags
in memory for your architecture
. On the Lubbock, this address turns out to
be the start of physical RAM plus 0x100, or 0xa0000100. Add the
"BOOT_PARAMS" macro with this address to your machine descriptor macros; the
result should look something like this:

MACHINE_START(LUBBOCK, "Intel DBPXA250 Development Platform")
MAINTAINER("MontaVista Software Inc.")
BOOT_PARAMS(0xa0000100)
BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000))
FIXUP(fixup_lubbock)
MAPIO(lubbock_map_io)
INITIRQ(lubbock_init_irq)
MACHINE_END

If there is already a BOOT_PARAMS macro in your machine descriptor macros,
modify it so that it has the correct address. Then, rebuild your kernel and
re-install it on your target. Now the kernel should be able to pick up the
kernel options you have set in the "bootargs" environment variable.



uboot启动zImage(go)和uImage(bootm)分析
http://linux.chinaunix.net/techdoc/install/2009/03/15/1101440.shtml
可见go和bootm差异就是 go只是改写pc值,而bootm传递r0,r1,r2还有bootargs

Linux启动bootargs参数分析(转)
http://hi.baidu.com/sdvch/blog/item/26e20586ef9a8aa66d811978.html

Add customized ATAG in U-Boot and Linux
http://blog.xuite.net/bunny/blog/20594102

2008年6月25日 星期三

uImage + u-boot的啟動方式

我的kernel的TEXTADDR設在0x00008000,會蓋到uboot,所以不能用kernel的make uImage。

mkimage在u-boot的./tools下,build完u-boot也會把mkimage build出來,可以直接拿來用


make uImage: kernel的make uImgae是用方法的方式1產生的,所以如果要用的話也要用方法1的啟動方式

mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n 'Linux-2.6.16-star' -d arch/arm/boot/zImage arch/arm/boot/uImage

方法1: load address與entry address相同,則放到DRAM上的位置就不能一樣,而且要注意兩個image不要蓋到了,之間至少要留image size的空間,u-boot會把kernel image(不包括64byte header) copy到load address再啟動。
mkimage -A arm -O linux -T kernel -C none -a 0x01500000 -e 0x01500000 -n 'Linux-2.6.16-star' -d arch/arm/boot/zImage arch/arm/boot/uImage

setenv flashaddr 10040000;setenv kfile uImage; setenv ramaddr 1000000;
tftp $(ramaddr) $(kfile); bootm $(ramaddr);

方法2: 若是load address要與放在DRAM上的位置相同,因為u-boot不會自己跳過64byte的header,所以entry address要自己跳過64byte
mkimage -A arm -O linux -T kernel -C none -a 0x01500000 -e 0x01500040 -n 'Linux-2.6.16-star' -d arch/arm/boot/zImage arch/arm/boot/uImage

setenv flashaddr 10040000;setenv kfile uImage; setenv ramaddr 1500000;
tftp $(ramaddr) $(kfile); bootm $(ramaddr);


5.9.4. Execution Control Commands
http://www.denx.de/wiki/DULG/UBootCmdGroupExec

=> help bootm
bootm [addr [arg ...]]
- boot application image stored in memory
passing arguments 'arg ...'; when booting a Linux kernel,
'arg' can be the address of an initrd image
When booting a Linux kernel which requires a flat device-tree
a third argument is required which is the address of the
device-tree blob. To boot that kernel without an initrd image,
use a '-' for the second argument.
If you do not pass a third
a bd_info struct will be passed instead

The bootm command is used to start operating system images. From the image header it gets information about the type of the operating system, the file compression method used (if any), the load and entry point addresses, etc. The command will then load the image to the required memory address, uncompressing it on the fly if necessary. Depending on the OS it will pass the required boot arguments and start the OS at it's entry point.

The first argument to bootm is the memory address (in RAM, ROM or flash memory) where the image is stored, followed by optional arguments that depend on the OS.

Linux requires the flattened device tree blob to be passed at boot time, and bootm expects its third argument to be the address of the blob in memory. Second argument to bootm depens on whether an initrd initial ramdisk image is to be used. If the kernel should be booted without the initial ramdisk, the second argument should be given as "-", otherwise it is interpreted as the start address of initrd (in RAM, ROM or flash memory).

To boot a Linux kernel image without a initrd ramdisk image, the following command can be used:

=> bootm ${kernel_addr} - ${fdt_addr}

If a ramdisk image shall be used, you can type:

=> bootm ${kernel_addr} ${ramdisk_addr} ${fdt_addr}

Both examples of course imply that the variables used are set to correct addresses for a kernel, fdt blob and a initrd ramdisk image.

ALERT! When booting images that have been loaded to RAM (for instance using TFTP download) you have to be careful that the locations where the (compressed) images were stored do not overlap with the memory needed to load the uncompressed kernel. For instance, if you load a ramdisk image at a location in low memory, it may be overwritten when the Linux kernel gets loaded. This will cause undefined system crashes.

http://www.programmer-club.com/pc2020v5/forum/ShowSameTitleN.asp?URL=N&board_pc2020=embedded&index=74&id=2800&mode=&type_pc2020=sametitleLevel-2
應該先把 zImage 轉成 uImage 吧 .. (加 64bytes prefix)

U-BOOT下使用bootm引导内核方法
http://www.cnitblog.com/luofuchong/archive/2007/01/12/21834.html
S3C2410架构下的bootm只对sdram中的内核镜像文件进行操作(好像AT91架构提供了一段从flash复制内核镜像的代码,不过针对s3c2410架构就没有这段代码,虽然可以在u-boot下添加这段代码,不过好像这个用处不大),所以请确保你的内核镜像下载到sdram 中,或者在bootcmd下把flash中的内核镜像复制到sdram中。

如果我们没用mkimage对内核进行处理的话,那直接把内核下载到0x30008000再运行就行,内核会自解压运行(不过内核运行需要一个tag来传递参数,而这个tag建议是由bootloader提供的,在u-boot下默认是由bootm命令建立的)。

使用mkimage生成kernel image,会在内核的前面加上了64byte的信息,供建立tag之用。

bootm命令会首先判断bootm xxxx 这个指定的地址xxxx是否与-a指定的加载地址相同。
(1)如果不同的话会从这个地址开始提取出这个64byte的头部,对其进行分析,然后把去掉头部的内核复制到-a指定的load地址中去运行之
(2)如果相同的话那就让其原封不同的放在那,但-e指定的入口地址会推后64byte(這裡說的是『你』要手動改-e的值,後推64byte(0x40),u-boot不會自動幫你跳!!!因此會有兩種給參數的方式,相對的啟動方式也不同),以跳过这64byte的头部。


mkimage
-a参数后是内核的运行地址,-e参数后是入口地址。

-A ==> set architecture to 'arch'
-O ==> set operating system to 'os'
-T ==> set image type to 'type'
-C ==> set compression type 'comp'
-a ==> set load address to 'addr' (hex)
-e ==> set entry point to 'ep' (hex)
-n ==> set image name to 'name'
-d ==> use image data from 'datafile'
-x ==> set XIP (execute in place)
方法一、
mkimage -n 'linux-2.6.14' -A arm -O linux -T kernel -C none -a 0x30008000 -e 0x30008000 -d zImage zImage.img

sbc2410=>tftp 0x31000000 zImage.img
sbc2410=>bootm 0x31000000



方法二、
mkimage -n 'linux-2.6.14' -A arm -O linux -T kernel -C none -a 0x30008000 -e 0x30008040 -d zImage zImage.img

sbc2410=>tftp 0x30008000 zImage.img
sbc2410=>bootm 0x30008000


三、固化
sbc2410=>tftp 0x30008000 zImage.img
sbc2410=>nand erase 0x30000 0x1d0000
sbc2410=>nand write 0x30008000 0x30000 0x1d0000

设置u-boot启动命令:
1、针对方法一:
sbc2410=>setenv bootcmd nand read 0x31000000 0x30000 0x1d0000\;bootm 0x31000000
sbc2410=>saveenv
2、针对方法二:
sbc2410=>setenv bootcmd nand read 0x30008000 0x30000 0x1d0000\;bootm 0x30008000
sbc2410=>saveenv


U-BOOT(bootloader)程序的特点功能
http://www.dz863.com/Embedded-Systems-Design/Embedded-Design/U-BOOT-bootloader.htm
识别二进制、ELF32、uImage格式的Image,对Linux引导有特别的支持。U-BOOT对Linux 内核进一步封装为uImage。封装如下:
#{CROSS_COMPILE}-objcopy -O binary -R.note -R.comment -S vmlinux \ linux.bin
#gzip -9 linux.bin
#tools/mkimage -A arm -O linux -T kernel -C gzip -a 0xc0008000 -e\
0xc0008000 -n “Linux-2.4.20” -d linux.bin.gz /tftpboot/uImage
即在Linux内核镜像vmLinux前添加了一个特殊的头,这个头在include/image.h中定义,包括目标操作系统的种类(比如Linux, VxWorks等)、目标CPU的体系机构(比如ARM、PowerPC等)、映像文件压缩类型(比如gzip、bzip2等)、加载地址、入口地址、映像名称和映像的生成时间。当系统引导时,U-BOOT会对这个文件头进行CRC校验,如果正确,才会跳到内核执行。


http://blog.chinaunix.net/u1/43047/showart_1010014.html
The data movement of uImage bootup by u-boot

1. Kernel Load Address. This is the address, where the kernel was linked
to when you built the vmlinux and can be found in arch/arm/Makefile.
The default for it is:

ifeq ($(CONFIG_CPU_32),y)
PROCESSOR = armv
TEXTADDR = 0xC0008000
LDSCRIPT = arch/arm/vmlinux-armv.lds.in
endif

Provide this as "-a" parameter to mkimage.

2. Kernel Entry Point. This is the address, where ARMboot jumps to to
enter the Kernel. It usually is the same as the kernel load address.

Provide this as "-e" parameter to mkimage.

3. The Network Download Address. This is where you download the mkimage
File. This address MUST BE different to the Kernel Load Address, and
should be sufficiently far away to allow ARMboot to relocate the
image to the final Kernel Load Address. Loading to the 5th MB
within the RAM is usually a good idea, eg. if the RAM begins at
0xc0000000

2008年6月24日 星期二

上櫃/上市/興櫃/未上市

吼,有投資的前輩請再進

http://www.mobile01.com/topicdetail.php?f=37&t=90293&p=2



上市..上櫃...興櫃..未上市.四種的股票差別

http://www.wretch.cc/blog/end1314/7232767


上櫃股票
已公開發行但未上市僅於櫃檯賣買中心買賣的股票,公司設立需達三個會計年度。
(至少公司要成立三年以上)

上市股票
指已經公開發行並於集中市場以開掛牌買賣的股票,公司申請上市須設立達五個會計年
度,申請條件較上櫃股票嚴格。
(至少五年以上)

興櫃股票
就是指已經申報上市普 但還未上市的普通股股票
在還沒有上市前
依據櫃檯中心相關規定(核准上市限制)
先採用議價方式買賣<自行和證券商議價或是委託經紀商和證券商議價>
等到達到上市標準 即可上市 所以興櫃不一定會上櫃
要達到標準後才能上市
興櫃股票當然有股價 他跟上市櫃沒有太大的差異
因為他只是尚未達到上市標準
擁有的差異
只是興櫃在發行時 條件較寬鬆
比如說 時間較長 9點~15點 最小交易股數1股...等等


未上市股票
所謂的「未上市股票」,其實是和上市上櫃市場的一個相對性說法,也就是說,只要不
是在上市或上櫃的股票,都可以稱之為「未上市股票」。這樣的未上市公司,在台灣就
有數萬家之多,而其良窳相差不可謂不大。像知名的奇美實業、長春化工等,都是獲利
很高的未上市公司;而上市上櫃市場上很熱門的廣達、華碩、錸德等,其實也都在未上
市市場出現過。當然不可否認的是,有些未上市股票最後成為了壁紙──也就是說它根
本沒有獲利,甚至倒閉,投資人手中的股票當然就變成「壁紙股」了。但整體而言,未
上市股票的投資報酬率極高,因此,瞭解市場、慎選股票,才能在這個新興的投資市場
上獲得理想的報酬。

在未上市股票中又分為兩種,一種是「已公開發行」,另一種是「未公開發行」。這兩
者的區別是在於公司的資本額(股本)是否超過兩億元。依照國內的相關法令,凡公司資
本額超過新台幣兩億元以上者,均需強制公開發行。公開發行的用意是讓規模較大的公
司的股票,不會集中在少數人手中,因此資本額超過兩億以上的公司,是可以自由買賣
股票的。但未公開發行的公司,就不能公開買賣股票,只能私下交易了。

Virtual machine

A virtual appliance primer
http://www.linux.com/feature/138166


Xen, VirtualBox, and QEMU.

VMWare
Xen is a popular open source virtual machine monitor or hypervisor
VirtualBox, developed by Innotek and recently acquired by Sun
QEMU, the open source processor emulator.
Combined with its accelerator component, KQEMU, it's popular withpeople who prefer to use a 100% free and open source virtualizationsoftware




隨身的 Windows Live Messenger 和 Hotmail,不限時地掌握資訊盡在指間— Windows Live for Mobile

2008年6月17日 星期二

[轉錄] Making appointments

from http://www.theenglishweb.com/articles/making-appointments.php

Being able to make, change and cancel appointments is an important skill in business English. Here are some expressions you can use to do this concisely and clearly.

Asking for an appointment

(formal situations)
I would like to arrange an appointment to discuss….
Please would you indicate a suitable time and place to meet?

(neutral)
Would it be possible to meet (on a date) at your / our offices to discuss…?

(informal)
Can we meet (up) to talk about…?

Suggesting a time

(neutral)
Would Tuesday suit you?
Would you be available on Tuesday?

(informal)
What about…?
Let's say…

Agreeing to an appointment

(formal)
Thank you for your email. I would be available to discuss…. on (date) at (time and place)

(neutral / informal)
Tuesday sounds fine. Shall we say around (time) at (place)?

Saying a time is not convenient

(formal)
Unfortunately, I will be away on business during the week of May 6 – 11, so I will be unable to meet you then. However, if you were available in the following week, I would be glad to arrange a meeting with you.

I will be out of the office on Wednesday and Thursday, but I will be available on Friday afternoon.

Cancelling an appointment

(formal)
Unfortunately, due to some unforeseen business, I will be unable to keep our appointment for tomorrow afternoon.

Would it be possible to arrange another time later in the week?

(neutral)
I'm afraid that I have to cancel our meeting on Wednesday, as something unexpected has come up.

Would you be free to meet early next week?

Apologising

I apologise for any inconvenience. (formal)
I'm sorry about cancelling. (informal)

Asking for confirmation

Please confirm if this date and time is suitable / convenient for you. (neutral)
Can you let me know if this is OK for you? (informal)

Writing to someone you don't know

If you don't know the person, you'll need to give some background information about yourself or your company.

I am… and I would be interested to meet you to discuss…

I would be grateful if you could indicate a convenient time to meet during this week.

I look forward to hearing from you.

from http://tw.knowledge.yahoo.com/question/question?qid=1105071004425

"想辦法"
brainstorming, think about, trying to figure out something~


想出解決方案
figure out some solutions
come up with some ideas to solve the problem.

2008年6月10日 星期二

OpenMoko-AGPS

http://lists.openmoko.org/pipermail/community/2008-June/018528.html
AGPS
http://www.mail-archive.com/community@lists.openmoko.org/msg17058.html

http://openarchaeology.net
boilerplate code
binary protocol
FreeRunner's u-blox chip
binary protocol over NMEA

GPSD (TangoGPS)

DGPS
RXM-RAW

http://www.u-blox.com/products/Data_Sheets/ATR0630_35_SglChip_Data_Sheet(GPS.G4-X-06009).pdf

http://www.atmel.com/dyn/resources/prod_documents/doc4928.pdf



AFAIK-as far as i know

2008年6月6日 星期五

八年之病 求一夜之艾

八年之病 求一夜之艾/笨蛋被殺頭 壞蛋在偷笑

當贏家通吃時,想一想輸家


陳水扁正躲著偷笑!

[聽錯] 不要射進來....><

作者: mkl0301 (mkl) 看板: StupidClown
標題: [聽錯] 不要射進來....><
時間: Sat Jun 7 06:11:19 2008


話說 強者我同事 的英文名字叫做 Mac Lin
(不是Mac電腦的Mac,也不是M的大麥克的Mac...)

偏偏我們公司又是作網路SoC...
IC上有兩個MAC: MAC0(讀MAC零)和MAC1(讀MAC萬)和
所以不時就有些意想不到的 笑果

===========================================

當我們在抱怨我們的MAC功能不全時....我們會大喊 爛Mac 爛Mac
M大: ................

===========================================

同事J 與 同事D: Mac.....(blablablabla)
M大: (隱忍中)..............

同事J: 我的Mac Lin都不會動ㄟ...
同事D: 你只要有射進去...Mac Lin就應該會動了阿..
同事J: 喔..那我去射射看...

((突然站起來)) (因為公司座位有隔板)

M大: (火大) 最好是射什麼進去我是會動啦....

同事J 與 同事D: ................

--------

譯文:
(同事J: 我的MAC0都不會動ㄟ...)
(同事D: 你只要把 值 設定到 暫存器 裡 MAC0 就應該會動了阿)

===========================================

M大: 公司就不要有新人姓 萬,不然我一定強迫他要叫Mac....

((那你們兩個不就變公司門神了???))

--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.230.171.217

輸入法的意外...

來源: ptt
持續更新中....
不選字+眼殘+手殘.....


「真肛好」
「我肛肛才接到他電話」
「肛砲的」(剛泡)
「我想肛交到....第5章」(剛教)

「那你等等,我叫睪丸再傳給你」(校稿完)
「那你睪丸借我看」(搞完)

(我有同事問我 中出 是什麼....你...你...你這樣還算鄉民嗎???)
「中出大學」
「中出女中」
「國父 孫中出 先生」
「他上中出」(山 倉頡:山按了兩下)

「是唷~不然你問人家硬莖系在哪裡好了」(應經系) (陰莖細)
「你有參加自宮之夜嗎?」 (資工)
「喔~我要打大莖盃啊」(大經盃)

「你明天要幹嗎?」 (幹麻)
「你幹吧」(你看吧)((ㄍ的下面是ㄎ))

「我對成年熊貓沒性慾」(興趣)
「那你的性趣是什麼?」(興趣)


「我已精液整個禮拜沒看到他了.......」(已經一整個禮拜)
「你是說 華肛液肖喔?」 (華岡藝校)
「我射好再給妳」(設)
「醉進孕器很不好」
「鋼彈開的時候」(剛談開)
「我性無能不能請她打我手雞? 」(姓吳)(手機)
「洩了」(謝了)
「難用 皮夾 靈前」 (男用 皮夾 零錢)
...李白 將進酒 「古來聖賢皆寂寞,惟有淫者留其名」這般灑脫與豪情....(飲者)
「我很好騎」(好奇)
「要辦XX卡請找我 看電影買一送醫唷」(買一送一)
「什麼顏射?」(顏色)
「宦官」(換關)((打電動))
「我既然癢了就會自己抓!」(養了)
「短褲配上次拍畢照的那賤衣服很不搭后」(件)
「X-X凸」(圖)
「你很礙眼耶」(愛演)
「哪有阿!!!我下面也有發炎阿.....」(發言)
「今天終於是在晚上睡到妳了」(倉頡: 睡 = 月山竹十一, 見 = 月山竹山)
「電腦剛剛蕩了」(當)
周傳雄的"青花" "緊緊握著 青花信物 信守著承諾" 裡面的"青花信物"是什麼阿?「我那隻」(我哪知)
「我陪葬!!!」(我陪唱)((ㄔ旁邊就是ㄗ))
「懶皮薄」(臉皮薄)
「可米小子 的 求愛復刻版」 (求愛婦科板)
「他應該知道我是神吧」(誰)(ㄟ跟ㄣ)
「妳龜舉錯了!」(規矩)
「楚瑜怎樣怎樣的狀態」(處於)
「我的男妓死了」(難記)
「那嚇禮拜在入射也還來得及吧」(入社)
「濕了」(是了)
「就有化療啊」(有話聊)
「喔...我都叫她含啊...夠親蜜吧」(涵: 人名)
「我要尻槍噴在MBE裡面 做奈米磊精的研究」(我要用電子槍噴進MBE 做奈米磊晶的研究)
「你住過姦殺嘴嗎?」(尖沙嘴)
「小下流」(小夏留)((人名))
「在爽啥! 你喜歡那個女生你追悼了嗎」(追到)
「我討厭跳蛋!我快養死了!誰來救救我」(跳蚤)

「醫生說要吃氫彈」(清淡)
「我們沒有賣『華龍粥』喔」(划龍舟)
「不然妳是要我幫妳舔穴嗎!!」((義X蛋捲屑屑))
「不然你來我家我下面給妳吃」(下麵)

「就吸我精液啊」(就寫我敬業啊)

2008年6月5日 星期四

Programming

The X=X+1 Issue
http://www.linux-mag.com/id/6121

Imperative programming
http://en.wikipedia.org/wiki/Imperative_programming
procedural programming
"how" program do

Declarative programming
http://en.wikipedia.org/wiki/Declarative_programming
"what" program do

2008年6月4日 星期三

ESP rfc

IP Encapsulating Security Payload (ESP)

http://www.ietf.org/rfc/rfc1827.txt
http://www.ietf.org/rfc/rfc2406.txt
http://www.ietf.org/rfc/rfc4303.txt

Openswan release number

ㄧ年多前的信了
[Openswan dev] changes to release numbering

Nikon 鏡頭代碼說明

from http://www.gsg9.tw/showthread.php?t=572

ED 超低色散鏡片
用於糾正成像之色差,各類波長的光線通過光學鏡片時,不會聚焦或對焦於同一點而產生的影像與顏色上之扭曲;採用ED鏡片的Nikon鏡頭即使用最大光圈拍攝,仍具有極高的影像清晰度與對比;超級ED鏡片是一種新型鏡片,在鏡頭中與ED鏡片結合使用,,防止更大程度上之色差產生。

D 距離偵測機能
D型自動對焦Nikon鏡頭可將物體與相機之間的距離資訊提供給相機主體,以方便相機能記錄光圈資料,傳送到具有3D彩色矩陣測光和3D多重感應均衡補光閃光功能的尼康SLR相機上。

G鏡頭上無光圈控制環機能
沒有光圈控制環的鏡頭,只可於相機上設定該鏡頭的光圈;G鏡頭也可向相機提供距離資訊,以方便數位相機記錄光圈資料。

IF內對焦
無需旋轉鏡頭筒或改變鏡頭筒長度即可完成對焦之動作,當使用特殊濾鏡(如偏光鏡)時非常有用,對焦鏡對焦時,只移動內部鏡片組,無需伸縮鏡頭本身之長度,操控上更加穩定

AF自動對焦機能
通過相機中的對焦驅動馬達對鏡頭驅動後進行對焦,鏡頭本身中並無對焦馬達.鏡頭本身無動力來源。 GSG9

AF-S寧靜波動馬達自動對焦機能
通過鏡頭中的寧靜波動馬達進行對焦,而不是相機中的對焦驅動馬達。AF-S鏡頭對焦的速度比標準AF-Nikon鏡頭更快,而且幾乎完全無聲。有“II”標記的AF-S鏡頭重量更輕,而且體積上通常比同類的早期Nikon鏡頭更小。 GSG9

DC散焦控制機能
一種可讓攝影者通過旋轉鏡頭的DC控制環控制前景或背景中的球面像差程度的鏡頭。這可創造適合於人像攝影的圓形不聚焦模糊。通過將DC控制設定為零,DC-Nikon鏡頭可以相同焦長和最大光圈,與非DC-Molpm鏡頭一樣進行操作。 RF後部對焦機能
一種對焦系統,即只通過移動後部鏡頭組來進行對焦。此設計技術可使自動對焦操作更加順利和迅速。 GSG9

VR鏡頭防手震機能
一種可改善因相機主機之振動而導致的影像模糊的光學技術,並可在將快門速度降低三檔時進行快速拍攝,使長焦鏡頭在拍攝時能得到清晰的照片。在攝影者拍攝運動性物體時,系統甚至會自動進行檢測相機的移動。VR操作只能在個別Nikon相機上執行。 GSG9

DX數位單眼專用鏡頭
專為Nikon數位單眼相機(DSLR)所設計的鏡頭。這種鏡頭可以用更小的成像圈更有效地覆蓋成像感測器(CCD), 該成像圈比35mm底片片幅更小,所以一般不建議使用在全片幅的機種,如傳統相機。 GSG9

Micro微距近拍 機能
專為近距離或翻拍用途所設計的鏡頭。

2008年6月2日 星期一

批踢踢 文化

Wiki - 批踢踢
http://zh.wikipedia.org/wiki/Ptt


偽基 - 批踢踢
http://zh.uncyclopedia.info/wiki/%E6%89%B9%E8%B8%A2%E8%B8%A2


偽基 - 洨
http://zh.uncyclopedia.info/wiki/%E6%B4%A8

偽基 - 蘿莉
http://zh.uncyclopedia.info/wiki/%E8%98%BF%E8%8E%89

沒有是怎樣...滑鼠頭下腳上是能充電喔

話說上禮拜五離開公司前"好不容易"記得讓無線滑鼠去充電
(其實鑼紀的滑鼠不是很耗電,只是我也常常忘記讓他"歸位")
禮拜一進公司發現怎麼滑鼠在桌面上
想想應該是 強者我同事 D大 用我的電腦印東西
於是就小小酸了他一下
下班的時候順手把滑鼠拿去充電
=====================================

今天上班一開螢幕
ㄟ~怎麼是Google D大 的blog???

OS: 大概是 D大 用的(太明顯了...明明根本就是)
ㄟ...滑鼠歸位了...不錯不錯...
可是...怎麼怪怪的........

有圖有真相


原來滑鼠 頭下腳上 被翻過來 "充電"
靠~這是怎樣...這樣是能充電喔...

五樓你說說看...D大到底在想什麼

2008年6月1日 星期日

time in Ubuntu

我的Ubuntu 8.04上有兩個time

/usr/bin/time是屬於GNU的time package

test@test-laptop:~$ /usr/bin/time --version
GNU time 1.7test@test-laptop:~$ dpkg -S /usr/bin/time
time: /usr/bin/time
test@test-laptop:~$ dpkg -S /usr/bin/time
time: /usr/bin/time
這個則應該是bash builtin的time
test@test-laptop:~$ time --version
bash: --version: command not found

real 0m0.168s
user 0m0.132s
sys 0m0.036s
test@test-laptop:~$

Twitter + Bash == Bad Idea

what I am doing, RIGHT NOW
http://www.kroah.com/log/diary/2008_04_14.html


twitter
http://twitter.com/

Twitter is a service for friends, family, and co–workers to communicate and stay connected through the exchange of quick, frequent answers to one simple question: What are you doing?
Twitter + Bash == Bad Idea
http://blog.unixdaemon.net/cgi-bin/blosxom.pl/geekstuff/twitter_and_bash_bad_ideas.html

I'm not sure about the basic idea behind Twitter but after signing up, having a little look and noticing the Net::Twitter CPAN module I decided to implement a really bad idea...
#!/usr/bin/perl -w
use strict;
use warnings;
use Net::Twitter;

my $bot = Net::Twitter->new(
username => "username",
password => "password"
);

chomp(my $doing = <>);
$doing =~ s/^\s+\d+\s+//;

$bot->update($doing);
To make it 'useful' you'll need to run the following in your bash shell: PROMPT_COMMAND='history | tail -n 1 | /path/to/twitter_post.pl' and tada! People really will know what you're doing RIGHT NOW. Ahem, sorry.

Twitter / gregkh
http://twitter.com/gregkh

Linux/ Opensource related projects

Linux Driver Project (LDP)

linux kernel monkey log
http://www.kroah.com/log/

Free Linux Driver Development!
http://www.kroah.com/log/linux/free_drivers.html

Linux Driver Project Status Report as of April 2008
http://www.kroah.com/log/linux/linux_driver_project_status-2008-04.html

Wiki
http://www.linuxdriverproject.org/twiki/bin/view

Linux Kernel Development
https://www.linuxfoundation.org/publications/linuxkerneldevelopment.php

Google Summer of Code™
http://code.google.com/soc/2008/

Google Summer of Code™ 2008 Frequently Asked Questionshttp://code.google.com/opensource/gsoc/2008/faqs.html

Mentoring Organizations Participating in Google Summer of Code 2008

OpenMoko Inc.
http://code.google.com/soc/2008/openmoko/about.html
OpenMoko wiki
http://wiki.openmoko.org/wiki/Summer_of_Code_2008

OpenStreetMap
http://code.google.com/soc/2008/streetmap/about.html
OpenStreetMap
http://openstreetmap.org/
http://wiki.openstreetmap.org/index.php/Main_Page