2010年11月30日 星期二

ARM VFP

ARM11MPCore/ARMv6/VFPv2
-mfloat-abi=softfp -mfpu=vfp

With buildroot-2010.05 config, there are some confussion regarding softfp. In toolchain/gcc/Makefile.in, parameter is defined by BR2_SOFT_FLOAT and BR2_SOFT_FLOAT_FP. But BR2_SOFT_FLOAT_FP is not found in .config/Config.in, while there is another BR2_VFP_FLOAT, which "depends on !BR2_SOFT_FLOAT"....

BR2_EXTRA_GCC_CONFIG_OPTIONS="--with-float=softfp --with-fpu=vfp"
Note that it is not "--with-float-abi=softfp"

BR2_TARGET_OPTIMIZATION="-O3 -pipe -mfloat-abi=softfp -mfpu=vfp"
1. check libm
2. check default setting (w/o giving -mfloat-abi and -mfpu)


ArmHardFloatPort
http://wiki.debian.org/ArmHardFloatPort
ArmHardFloatPort/VfpComparison
http://wiki.debian.org/ArmHardFloatPort/VfpComparison

3.17.2 ARM Options
http://gcc.gnu.org/onlinedocs/gcc-4.4.5/gcc/ARM-Options.html
-mfloat-abi=name
Specifies which floating-point ABI to use. Permissible values are: `soft', `softfp' and `hard'.

Specifying `soft' causes GCC to generate output containing library calls for floating-point operations. `softfp' allows the generation of code using hardware floating-point instructions, but still uses the soft-float calling conventions. `hard' allows generation of floating-point instructions and uses FPU-specific calling conventions.

Using -mfloat-abi=hard with VFP coprocessors is not supported. Use -mfloat-abi=softfp with the appropriate -mfpu option to allow the compiler to generate code that makes use of the hardware floating-point capabilities for these CPUs.

The default depends on the specific target configuration. Note that the hard-float and soft-float ABIs are not link-compatible; you must compile your entire program with the same ABI, and link with a compatible set of libraries.

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

-mfpu=name
-mfpe=number
-mfp=number
This specifies what floating point hardware (or hardware emulation) is available on the target. Permissible names are: `fpa', `fpe2', `fpe3', `maverick', `vfp', `vfpv3', `vfpv3-d16' and `neon'. -mfp and -mfpe are synonyms for -mfpu=`fpe'number, for compatibility with older versions of GCC.

If -msoft-float is specified this specifies the format of floating point values.



如何確認 uclibc 是有 VFP 最佳化的?
http://blog.richliu.com/2010/09/01/985/
arm-linux-gcc -mfloat-abi=soft -c -g -Wa,-a,-ad 1.c ; arm-linux-objdump -dS 1.o | less
__eabi_dmul

arm-linux-gcc -mfloat-abi=softfp -c -g -Wa,-a,-ad 1.c ; arm-linux-objdump -dS 1.o | less
fmuld (I see vmul.f64)


Vector Floating-Point (VFP)
http://scottshulinux.blogspot.com/2010/09/vector-floating-point-vfp.html


ARM VFP的一点体会
http://linux.chinaunix.net/bbs/viewthread.php?tid=1125926

VFP11 ™ VectorFloating-point Coprocessor Technical Reference Manual for ARM1136JF-S processorr1p5
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0274h/index.html

Documentation / arm / VFP / release-notes.txt
http://www.mjmwired.net/kernel/Documentation/arm/VFP/release-notes.txt

SoftFloat
http://www.jhauser.us/arithmetic/SoftFloat.html

TestFloat
http://www.jhauser.us/arithmetic/TestFloat.html

ARM11 VFP
http://blog.richliu.com/2010/03/22/890/


Floating point on ARM machines and Octave errors
http://people.bath.ac.uk/enpsgp/floating_point.html

paranoia
http://www.netlib.org/paranoia/

2010年11月29日 星期一

2010年11月16日 星期二

error: conflicting types for getline/parseline

mini_httpd

htpasswd.c:52: error: conflicting types for 'getline'
/buildroot-2010.05/arm-none-linux-gnueabi/libc/usr/include/stdio.h:651: note: previous declaration of 'getline' was here


Compiling Apache from source on Ubuntu 9.10 (Karmic Koala)
http://blog.tty.nl/2009/11/11/compiling-apache-from-source-on-ubuntu-9-10-karmic-koala/

The Perfect Server - Fedora 11 x86_64 [ISPConfig 2] - Page 5: 16 ISPConfig
http://www.howtoforge.com/perfect-server-fedora-11-x86_64-ispconfig-2-p5

Build of Apache 1.3.41 fails on Fedora 12
http://fedoraforum.org/forum/showthread.php?t=238170

Fixed:
1. vi /buildroot-2010.05/arm-none-linux-gnueabi/libc/usr/include/stdio.h
2. goto line 651
3. replace getline to parseline
4. after rebuild, remember change it back, or others may fail
xlib_libX11 1.3.2

imLcPrs.c:413: error: conflicting types for 'parseline'
/buildroot-2010.05/arm-none-linux-gnueabi/libc/usr/include/stdio.h:651: note: previous declaration of 'parseline' was here

basename prototype mis-match between libiberty.h and string.h

oprofile-0.9.4

In file included from ../libutil/op_libiberty.h:27,
from op_spu_bfd.cpp:24:
/buildroot-2010.05/output/toolchain/binutils-2.20.1/include/libiberty.h:106: error: new declaration 'char* basename(const char*)'
/buildroot-2010.05/arm-none-linux-gnueabi/libc/usr/include/string.h:601: error: ambiguates old declaration 'const char* basename(const char*)'
make[4]: *** [op_spu_bfd.o] Error 1
make[4]: Leaving directory `/buildroot-2010.05/output/build/oprofile-0.9.4/libutil++'


basename prototype mis-match between libiberty.h and string.h
https://bugzilla.redhat.com/show_bug.cgi?id=487995

Fixed by:
diff --git a/configure.in b/configure.in
index 7ffd735..09384f9 100644
--- a/configure.in
+++ b/configure.in
@@ -100,6 +100,8 @@ AC_CHECK_LIB(popt, poptGetContext,, AC_MSG_ERROR([popt library not found]))

AX_BINUTILS

+AC_CHECK_DECLS([basename], [], [], [[#include <libgen.h>]])
+
# C++ tests

AC_LANG_CPLUSPLUS
--
1.7.0.4

2010年11月14日 星期日

洗鼻器

有用善鼻洗鼻機媽咪.看一下注意一下.....
http://www.babyhome.com.tw/mboard.php?op=d&sID=1445864&bid=37&r=


認識洗鼻器
http://www.entdoctor.com.tw/nose/nasalirrigator/101.html

脈動式洗鼻器

塑膠瓶重力式洗鼻器

手擠壓式洗鼻器

噴霧式洗鼻器



洗鼻機、洗鼻器 心得
http://blog.yam.com/kiss486/article/23405046

洗鼻器
http://blog.roodo.com/foreverfish/archives/2764629.html

洗鼻器好處知多少
http://hk.epochtimes.com/9/5/6/99497.htm

脈動式洗鼻器--使用心得
http://mypaper.pchome.com.tw/chiapinghsu/post/1306315202

Using gmail to send your patches

Using gmail to send your patches
https://git.wiki.kernel.org/index.php/GitTips#Using_gmail_to_send_your_patches

git send-email
http://elinux.org/Git_usage#send-email

git format-patch -s -n -o XXXX YYY..ZZZ
git send-email --to mkl0301@gmail.com XXXX/


git send-mail shows:
Can't locate Net/SMTP/SSL.pm in @INC (@INC contains: /usr/share/perl/5.8.8 /etc/perl /usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at /usr/libexec/git-core/git-send-email line 1037, <FIN> line 1.
git-send-email misses dependency to libnet-smtp-ssl-perl
https://bugs.launchpad.net/ubuntu/+source/git-core/+bug/272939
libnet-smtp-ssl-perl

http://lists.zerezo.com/git/msg711675.html
msmtp
My Ubuntu 8.04 have msmtp only.


Unable to initialize SMTP properly. Check config and use --smtp-debug. VALUES: server=msmtp encryption=tls hello=localhost.localdomainport=587 at /usr/libexec/git-core/git-send-email line 1069.

In ~/.gitconfig, use:
smtpserver = /usr/bin/msmtp
instead of
smtpserver = msmtp


msmtp: /home/XXX/.msmtprc: must be owned by you
msmtp: /home/XXX/.msmtprc: must have no more than user read/write permissions

chmod ag-rw ~/.msmtprc
chown XXX .msmtprc
(When I was in "sudo -s", owner must be root, but in user XXX directory.)

2010年11月11日 星期四

Linux defconfig reduction

make savedefconfig; mv defconfig arch/arm/configs/lala_defconfig

2010年11月10日 星期三

mount XFS 64KB block size cause "Function not implemented"

mount xfs with 64kb blocksize...
http://www.groupsrv.com/linux/about161614.html

Re: mount: Function not implemented?
http://oss.sgi.com/archives/xfs/2004-07/msg00524.html

Not on linux, it can only do filesystem blocksize upto pagesize.
So on ia32 it maxes out at 4K.

XFS: A high-performance journaling filesystem
http://oss.sgi.com/projects/xfs/

Filesystem Block Size

The minimum filesystem block size is 512 bytes. The maximum filesystem block size is the page size of the kernel, which is 4K on x86 architecture and is set as a kernel compile option on the IA64 architecture (up to 64 kilobyte pages). So, XFS supports filesystem block sizes up to 64 kilobytes (from 512 bytes, in powers of 2), when the kernel page size allows it.

Sending patch to community

  1. use Linus tree (most prefer)
  2. sparse check
    make C=1 (check compiled files)
    make C=2 (check all files)
  3. git format-patch -s -n --subject-prefix="PATCH v3" -o XXX commitA..commitB
  4. scripts/checkpatch.pl XXX/*
  5. write a brief [PATCH v3 0/X] XX (copy a patch content, and modified it as 0/XX), add result of following command to the end of the file. Add the based linux tree (e.g. linux-2.6.37-rc2)
    git shortlog commitA..commitB
    git diff --stat --summary commitA..commitB
  6. select lists/maintainers to send to.
  7. Send to yourself first. If no problem, send to all then.
    git send-email --to A --to B XXX


arm-linux: Mailing Lists - FAQ
http://www.arm.linux.org.uk/mailinglists/faq.php

Patch State
http://www.arm.linux.org.uk/developer/patches/

Guide to ARMLinux: Making your own patches
http://www.aleph1.co.uk/oldsite/armlinux/book/x1699.html

TI Davinci: Patch upstream sending
http://processors.wiki.ti.com/index.php/Patch_upstream_sending

Re: [GIT PULL] generic arm for MSM
http://www.spinics.net/lists/arm-kernel/msg85062.html
Never base your tree on linux-next. You really should use a stable tree, such as Linus' tree. The linux-next tree is constantly thrown away and rebuilt, and your own tree will keep a reference on that obsoleted linux-next version otherwise.

http://www.spinics.net/lists/arm-kernel/msg85110.html
As people have said you should *never* send any pull requests based on-next, it's a constantly rebasing merge of various development trees ofvarying quality and so will never be merged into mainline. If you aresending stuff based on -next for some reason send it as a patches.


Documentation/sparse.txt
http://www.mjmwired.net/kernel/Documentation/sparse.txt

2010年11月9日 星期二

Error: too many positional arguments

enable DEBUG in head.S cause:

arch/arm/boot/compressed/head.S: Assembler messages:
arch/arm/boot/compressed/head.S:1019: Error: too many positional arguments
arch/arm/boot/compressed/head.S:1036: Error: too many positional arguments

Fixed by:
diff --git a/arch/arm/mach-cns3xxx/include/mach/debug-macro.S b/arch/arm/mach-cns3xxx/include/mach/debug-macro.S
index d16ce7e..263cf6f 100644
--- a/arch/arm/mach-cns3xxx/include/mach/debug-macro.S
+++ b/arch/arm/mach-cns3xxx/include/mach/debug-macro.S
@@ -10,7 +10,7 @@
* published by the Free Software Foundation.
*/

- .macro addruart,rx
+ .macro addruart,rx, rtmp
mrc p15, 0, \rx, c1, c0
tst \rx, #1 @ MMU enabled?
moveq \rx, #0x10000000


ARM: SAMSUNG: Fixup commit 4e6d488af37980d224cbf298224db6173673f362
http://kerneltrap.org/mailarchive/git-commits-head/2010/3/19/30452

2010年11月8日 星期一

screen

screen -ls
screen -r <pid>


screen
http://tavi.debian.org.tw/index.php?page=screen

Linux Screen指令 @ 複雜的人生,複雜的自己。 :: 痞客邦 PIXNET ::
http://lagunawang.pixnet.net/blog/post/2836825-linux-screen%E6%8C%87%E4%BB%A4

C-a c 或 C-a C-c 開啟新的視窗,並同時切換到這個新的視窗
C-a n 或 C-a C-n 或 C-a (space) 切換到下一個視窗(0->1 1->2 ...)


Booting CNS3420 EVB

linux-2.6.36(use ARM's instead of vanilla kernel, or you see SD card issue described bellow)
cns3420vb_defconfig
use CodeSourcery's Sourcery G++ Lite 2009q1-203 for ARM GNU/Linux
http://www.codesourcery.com/sgpp/lite/arm/portal/release858

Re: Booting CNS3420 EVB v 1.3 failed with 2.6.36 (and 2.6.35)
http://permalink.gmane.org/gmane.linux.ports.arm.kernel/94998

So, you need to build the kernel with the following command:
make LOADADDR=0x200000 uImage
And boot with these commands:
setenv machid ad8
setenv bootargs console=ttyS0,38400 ip=on
tftp 100000 uImage
bootm 100000


Only uImage can boot, bootpImage won't.Both uImage and bootpImage can boot. It works too with "ubootpImage" (uImage form of bootpImage).
(2011.03.20: bootpImage do boot in 2.6.38!!. I did nothing, not even the CONFIG_CMDLINE, which have root=/dev/mmcblk0p1, while no SD inserted.)

u-boot "go" command doesn't pass machid on r1, so "go" won't work.

Default config uses /dev/mmcblk0p1 as rootfs.


With Cavium SDK's kernel, only bootpImage can boot, while uImage cannot, no matter with machid or not.(ok after v1.1)

parameter given by bootargs in u-boot doesn't take effect in kernel.
  1. kernel config CONFIG_CMDLINE_FORCE is not set,
  2. u-boot config CONFIG_CMDLINE_TAG, CONFIG_SETUP_MEMORY_TAGS, CONFIG_MISC_INIT_R is enabled
  3. in kernel mach code, MACHINE_START section do contain BOOT_PARAMS, and correct.

從 u-boot傳bootargs給kernel
http://mkl-note.blogspot.com/2008/06/u-bootbootargskernel.html

It seems the CNS3XXX MMC driver(CONFIG_MMC_SDHCI_CNS3XXX) is not enabled by default. Even if it is enabled, using MMC as rootfs would cause crash:
mice: PS/2 mouse device common for all mice
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
mmc0: SDHCI controller on platform [platform] using PIO
Waiting for root device /dev/mmcblk0p2...
mmc0: Minimum clock frequency too high for identification mode
mmc0: new high speed SDHC card at address d629
mmcblk0: mmc0:d629 SD08G 7.40 GiB
mmcblk0: p1 p2
VFS: Mounted root (ext2 filesystem) readonly on device 179:2.
Freeing init memory: 96K
Kernel panic - not syncing: Attempted to kill init!
Backtrace:
[<c0024860>] (dump_backtrace+0x0/0x114) from [<c016cc70>] (dump_stack+0x18/0x1c)
r7:c7815bc0 r6:c7815bc0 r5:c7819ee0 r4:c01f6510
[<c016cc58>] (dump_stack+0x0/0x1c) from [<c016ccd4>] (panic+0x60/0x17c)
[<c016cc74>] (panic+0x0/0x17c) from [<c0032ba4>] (do_exit+0x7c/0x5b4)
r3:c01ec260 r2:c7819e40 r1:c7815cbc r0:c01bd3af
[<c0032b28>] (do_exit+0x0/0x5b4) from [<c0033160>] (do_group_exit+0x84/0xb8)
[<c00330dc>] (do_group_exit+0x0/0xb8) from [<c003dcdc>] (get_signal_to_deliver+0x2b8/0x2e8)
r5:c7819ee0 r4:0000000b
[<c003da24>] (get_signal_to_deliver+0x0/0x2e8) from [<c0023804>] (do_notify_resume+0x64/0x628)
[<c00237a0>] (do_notify_resume+0x0/0x628) from [<c0020e98>] (work_pending+0x24/0x28)
I disabled L1 cache, and everything works fine. It seems there is cache cocherency issue on SD driver for 2.6.36 vanilla kernel.

This is fixed by Catalin's cache maintenance changes:
Catalin Marinas (5):
ARM: Allow lazy cache flushing via PG_arch_1 for highmem pages
ARM: Assume new page cache pages have dirty D-cache
ARM: Introduce __sync_icache_dcache() for VIPT caches
ARM: Use lazy cache flushing on ARMv7 SMP systems
ARM: Remove superfluous flush_kernel_dcache_page()
in ARM's tree git://linux-arm.org/linux-2.6.git

2010年11月6日 星期六

u-boot/Linux booting machid

(u-boot)/include/asm-arm/mach-types.h

#define MACH_TYPE_IMX27IPCAM 1871
#define MACH_TYPE_NEMOC 1872
#define MACH_TYPE_GENEVA 1873
#define MACH_TYPE_VEGA 2776


(u-boot)/lib_arm/bootm.c: do_bootm_linux

linux内核启动过程——基于S3C2410(1)zImage自解压
http://os.it168.com/a2009/0610/993/000000993984.shtml

[原创] linux启动流程分析(1)---bootloader启动内核过程
http://www.eetop.cn/blog/html/45/11145-560.html

[原创] linux启动流程分析(2)---内核启动地址的确定
http://www.eetop.cn/blog/html/45/11145-562.html

ARM Linux Kernel Boot Requirements
http://www.arm.linux.org.uk/developer/booting.php

(linux)/arch/arm/tools/mach-types
ttc_vision2 MACH_TTC_VISION2 TTC_VISION2 2775
cns3420vb MACH_CNS3420VB CNS3420VB 2776
lpc2 MACH_LPC2 LPC2 2777


(linux)/arch/arm/kernel/head-common.S: lookup_machine_type

linux内核启动之lookup_machine_type
http://blog.chinaunix.net/u2/73067/showart_2229056.html
例子分享:
我现在移植的一个板子,是不带mmu的,刚开始怎么都启动不起来,打印出“done, booting the kernel",然后就无声无息了。后来在Kernel startup entry point开始处的ENTRY(stext)下添加了句代码:”ldr r1, =machine_arch_type“就很顺利得起来了.后来分析知道,添加这句代码后就不会进行平台的匹配了!但是启动以后也是正常的!不知道此处平台匹配的真正意义是什么,还需要与有经验的朋友共同探讨。


linux板级设备的初始化过程
http://hi.baidu.com/rwen2012/blog/item/4163bb033273b88bd43f7cbc.html

第9章 内核调试技术
http://mcuol.com/download/upfile/armLinuxEMB09.pdf

2010年11月4日 星期四

Debugging Linux before start_kernel

Kernel Debugging Tips
http://elinux.org/Kernel_Debugging_Tips
Kernel Debugging Tips: Accessing the printk buffer after a silent hang on boot
http://elinux.org/Kernel_Debugging_Tips#Accessing_the_printk_buffer_after_a_silent_hang_on_boot
Kernel Debugging Tips: Compilation tricks for the kernel
http://elinux.org/Kernel_Debugging_Tips#Compilation_tricks_for_the_kernel

Linux startup process
http://en.wikipedia.org/wiki/Linux_startup_process#Kernel_phase

1.3 linux/arch/arm/boot/compressed/head.S
http://amitshah.bizhat.com/arm/arm_linux_boot-1.html#ss1.3

Booting the Kernel
http://www.linux.it/~rubini/docs/boot/boot.html

The Linux BootPrompt-HowTo
http://tldp.org/HOWTO/BootPrompt-HOWTO.html#toc3


FreeBSD Developers' Handbook: Chapter 10 Kernel Debugging
http://www.freebsd.org/doc/en/books/developers-handbook/kerneldebug.html

[ETRADE] Stress Test Event Descriptions

Stress Test Event Descriptions
https://etrade.wb.riskmetrics.com/apollo/Command/EventDescriptions?event=sep11

Stress Test Event Descriptions

September 11th
September 11, 2001 Two hijacked passenger jets crash into the twin towers of the World Trade Center in New York. The impact of the crashes triggers the collapse of both towers. A third hijacked plane crashes into the Pentagon in Washington, and a fourth possibly heading for the White House, is diverted by passengers and crashes 20 miles south of Pittsburgh.
September 11, 2001 The world watches the horrific sequence of events. Within hours, President George Bush places all United States armed forces on worldwide alert after a shell-shocked nation sustained its worst attack since Pearl Harbor.
September 11, 2001 Financial markets plunge in Europe and Latin America before trading is halted. American markets do not open and will remain closed until Sept 17th; it will be first time the New York Stock Exchange remained closed for two full days since the Great Depression. Stocks fall 4.6 percent in Spain and 8.5 percent in Germany; price of Brent crude oil for November delivery jumps to $28.87 per barrel, up $1.50; price of gold at afternoon fixing in London rises $15.50, to $287 per ounce; US dollar is weak against major currency, falling to 119.20 yen from 121.04; euro rises to 91.5 cents from 89.8 cents, and strengthens against Latin American currencies.
September 12, 2001 Economists fear the economic paralysis caused by the terrorist attacks on New York and Washington could tip the vulnerable US economy into recession over the next six months and drag the rest of the world down with it. Stock markets in Europe and Latin America continue to fall sharply after attacks; dollar falls against yen and euro; oil and gold prices continue to surge. Tokyo's Benchmark Stock Average plunged 6.63% to 9610.10, which was the lowest since December 1983, and the eighth largest percentage decline ever. In Taiwan stocks, the Benchmark Weighted Index opened down 274 pts (-6.56%) after a one-day suspension.
September 17, 2001 In one of the most anticipated trading days in stock market history the US markets reopen. The US Federal Reserve and the European Central Bank both cut interest rates by 0.5% to head off recession. Large financial institutions become sellers and the Dow plunges 7.1% (684 pts) to 8920.70. The S&P 500 had its worst finish since October 1998, down 53.81 pts (4.9%). The New York Stock Exchange records its busiest day ever with over 2.3 billion shares traded.
September 17, 2001 Asian markets closed with heavy losses amid fears of military conflict as the US readies for an attack on Afghanistan and worries of global recession. Japan's Nikkei fell 5.04% to its lowest level since December 1983. Korea's KOSPI index dropped 2.8%. Airline and insurance stocks led the retreat. Even Chinese investors, who normally ignore outside events were gripped by uncertainty after the attacks on the US. The Shanghai B share index tumbled over 6%.
September 18, 2001 The Bank of England and Japan's central bank cut rates as part of a coordinated campaign to boost confidence, following similar moves by the US Federal Reserve and the European Central Bank. But with fears of a global recession growing, investors remain despondent. European markets all head lower, with the FTSE falling almost 100 points to 4,800. Paris was down 2.09%, while Frankfurt was off 1.48%.
September 18, 2001 After an initial bounce, US markets quickly lose ground falling 43 points. This slip, combined with the previous day's 600-point plunge and the Dow officially enters a bear market, defined as a 20% fall from market highs.

Tech-Wreck
March 2000 The NASDAQ Composite reaches an all-time intra-day high of 5,132. The Composite is up a whopping 78% from November 1999, all in the midst of a higher interest rate environment.
March 21 The NASDAQ 100 tracking stock, QQQ, is the third most heavily traded stock in the US with 33 million shares changing hands. This marks the first time in history that a stock linked to the performance of an index trades this actively, a prime indication of the prevalent steroid enhanced demand for technology stocks. The Fed tightens by another 25bps, which represents the fifth move in less than a year.
April 3 Judge Thomas Jackson delivers his much-anticipated ruling in the Microsoft anti-trust case. Although no one is certain what the implications or ramifications the ruling might bring, everyone knows that it's very important. The NASDAQ falls.
April 4 Both the Dow and the NASDAQ drop roughly 500 points in intra-day trading but rebound to finish the day with only modest losses. However, this will mark the beginning of a very volatile 2-month period, with the suffering the brunt of selling. The NASDAQ will be down 39% from its peak at one point.
April 2000 Headline CPI for March registers at 0.8% following February's 0.6%. This is higher than anticipated and fuels inflationary concerns. The high use of margin is cited as a factor for the swift and steep decline in equity prices.
May - June 2000 Equity markets begin to claw back as economic reports show signs of slowing and inflation indicators come back in line with consensus. The markets begin to increasingly sense that the Fed may be through raising rates.

Russian Crisis & Long-Term Capital
June 1998 IMF Director, Mchel Camdessus assures the world's financial markets that there is no reason to panic about Russia. 'Contrary to what markets and commentators are imagining,' Camdessus insists, ' this not a crisis.'
June 1998 Russian credit spreads widen further, yielding more than comparable Nigerian bonds. Russians express concern that reserves may fall below $12 billion, less than half a year ago, if a meaningful credit facility is not extended.
Mid-July 1998 the IMF announces a $17 billion bailout fund, to be distributed over 18 months. Officials hope that the package will buy the Russians time.
August 17 Russia announces a wider trading band on the rouble and a moratorium on GKOs (Russian treasury bills), effectively devaluing and defaulting simultaneously. Russia indicates that it plans to devalue by 30%.
August 26 Stanley Druckenmiller of Soros' Quantum Fund admits to losses of about $2 billion as a result of the Russian devaluation. Credit Suisse First Boston states that profits have shrunk by $250 million in 2 months.
August 27 The rouble trades at R13/$ in the offshore market, representing a 50% devaluation. The government fixes the official rate at R7.86/$. Reserves have reportedly dipped below $13 billion.
September 1998 International capital markets are in a state of panic. Equities plunge, at one point, the S&P 500 is down by 21% and the NASDAQ by 25% from its peak in July. US Treasuries rally. The 30-year bond yield falls to almost 4.5%. Credit spreads, including swap spreads, blow out causing widespread losses in the financial markets. Fearing global repercussions of a Long-term Capital Management (a large hedge fund speculating in highly leveraged transactions) collapse, a consortium of banks infuse the troubled hedge fund with a $3.5 billion rescue package. Other firms are reportedly in similar trouble.
September 1998 The Fed cuts rates 3 times in the fall to inject liquidity into the financial markets. Equity markets remarkably bounce back by year's end.

Asian Currency Crisis
January 1997 Hanbo Steel, a Korean conglomerate, collapses under $6 billion in debt the first sign of increasing economic difficulties that will engulf the region in the months ahead.
March 10 Thai authorities commit to purchasing $3.9 billion in bad property loans from financial institutions but fail to follow through with promises. IMF Director Michel Camdessus suggests that this crisis has no reason to develop further.
May 26 Local conditions deteriorate in Thailand and equity prices continue to slide as the central bank fails to cut interest rates as planned. The baht is hit by massive speculation. Speculation spills over to the Philippines, forcing the central bank to raise overnight rates to 13%.
June 1997 Thai PM Chavalit Yongchaiyudh states, "We will never devalue the baht", even as stocks slide to an 8-year low. The central bank announces its intent to tighten currency controls, restricting the flow of funds. Finance minister Amnuay Viravan resigns.
July 2 Thai authorities announce a managed float of the baht, equities surge in local market terms. The baht weakens by 20%, beginning a contagion effect. The Philippine central bank steps in the markets to defend the peso.
July 11 The baht touches record lows against the US dollar. The Philippine peso is freed to float in a wider band.
July 1997 The Malaysian ringgit begins to collapse, prompting the government to raise interest rates further. Ultimately, authorities abandon its defense of the ringgit, and the currency sinks to a 38-month low.
August 14 Indonesia also gives up its defense of the rupiah. The currency sinks 20%.
August 15-21 Hong Kong rates soar to above 9% causing property share prices to crash.
August 1997 The Malaysian government, in an attempt to discourage short selling, restricts trading in all 100 stocks that comprise the Kuala Lumpur Composite. PM Mohammed blames the crisis on George Soros, calling him a moron.
August 1997 The IMF approves another $3.9 billion credit facility for Thailand, bringing total commitments to $16.7 billion.
September 1997 Korean automaker, the KIA Group, halts debt payments putting in jeopardy $10 billion worth of loans. KIA requests the courts to mediate in order to seek protection from creditors. Meanwhile, in Indonesia, authorities decide to halt projects totaling R39 trillion in order to stem the budget shortfall.
October 1997 Hong Kong Chief Executive Tung Chee-hwa promises to keep the Hong Kong dollar pegged to the US dollar. Moody's cuts Thailand's sovereign credit rating for the third time in 1997. Malaysian PM Mohammed imposes a total ban on F/X trading. The ringgit falls 4%.
October 31 The IMF extends Indonesia a $23 billion support package.
November 1997 The Korean won comes under increasing pressure as the Japanese yen weakens vis-à-vis the US dollar. Korean equities slide and international reserves dwindle.
November 17 Korea halts intervention in the currency market, sending the won through the psychological threshold of W1,000/US$.
December 1997 As regional currencies are pushed to recent lows against the US dollar, a record IMF-led bailout package of $57 billion for Korea is announced. This stems the tide temporarily but currencies soon resume a downward spiral. Usable reserves in Korea have reportedly dwindled to $6 billion. Three Asian countries see their sovereign debt rating fall to junk status. Liquidity in the markets remains thin.
December 26 The Korean won rallies from W1,836 to W1,400 as the first installment of a $60 billion multilateral credit facility is distributed. The worst is considered to be over.

The Tequila Crisis
November 1994 Mexico makes final preparations for presidential elections. International reserves presumably stand at $17 billion but the growing current account deficit looms.
December 1 Ernesto Zedillo Ponce de Leon is sworn in as Mexico's new president. Reserves are reported at $14 billion.
December 9 Mexican Finance Minister Jaime Serra Puche publicly announces that the Mexican currency will not be devalued amid growing concern of the current account deficit.
December 19 Finance Minister Serra informs President Zedillo that jittery Mexicans are moving money out of the country at an increasingly alarming rate. Capital flight is characterized by "hot money". In fact, Mexico sees more than $1 billion leave the country in a single day. International reserves are significantly below earlier estimates, now at only $6.5 billion. The bolsa plummets.
December 20 Mexican authorities unexpectedly widen the peso trading band to 15%. The peso drops immediately. Renewed uprisings in Chiapas are blamed.
December 21 All limits on the peso are removed, effectively "free floating" the currency. The peso loses over 40% from pre-devaluation levels.
December 24 The markets begin to focus on $58 billion in interest payments coming due in 1995, of which $20 billion will come due in the first 3 months.
December 29 Finance Minister Jaime Serra Puche submits his resignation. Guillermo Ortiz will replace Serra. The bolsa and peso recover on confirmation that the US will package together a rescue fund.
January 3 President Zedillo announces on national television his acceptance of the $18 billion international rescue package, funded largely by the US. The markets are unconvinced that this will be enough. The peso continues to stumble despite higher short-term rates.
January 30 President Clinton confirms a global financial support package totaling $48 billion despite the lack of consensus in Congress. The final package will be closer to $53 billion. The markets react favorably.
March 1995 After a month of respite, new worries mount throughout Latin America. The Mexican peso resumes its fall. Concerns over the banking sector as well the currency peg in Argentina grow. Argentine Finance Minister Domingo Cavallo insists that Argentina's peso will not be devalued.
March 1995 Confidence in the region is slowly restored as banking reforms are announced and global market conditions improve.

Euro Crisis
October 3, 1990 Germany is reunified. Although the German Government resists raising interest rates, the resulting debt burden is so large that an upward movement in interest rates becomes highly likely.
September 1990 The UK joins the Exchange Rate Mechanism (ERM). The driving motivation for the UK's participation is the attractiveness of low interest rates. The low cost of financing is an integral component to stimulate Britain's sluggish economic growth.
February 1992 The Maastricht Treaty is signed, but remains to be ratified. This document sets forth the timetable and conditions for the 12 member nations to converge to a single currency. Unfortunately, Europe's economic activity is far from converging. The UK and several other European states are faced with a deep economic slowdown. Germany, on the other hand, trying to stem inflationary pressures due to a relaxed monetary policy to facilitate reunification, has inched up rates recently. Friction begins to mount.
June 2 The Danes reject the Treaty and tension rises. The French also decide to hold a referendum, scheduled for late September.
July 1992 The Bundesbank raises the discount rate to 8.75%. The French clamor of a possible "no" vote.
August 1992 Sweden decides to enter the European Community. To do so, lending rates are hiked 300bps to 16%.
September 1992 With reserves almost depleted after trying to defend its currency, Finland opts to let the markka float. The currency depreciates 12%. Sweden, a rival exporter, is next targeted. Swedish authorities raise short-term, to 75% on one day, to defend the krona. The Italian lira and British pound are next in line.
September 13 After failing to support the lira, the lira drops by 7% and the Bundesbank announces it will cut the Lombard rate. However, rates are eased less than expected.
September 16 Even after raising interest rates to overnight rate to 12% from 10%, the pound succumbs to selling pressure. The UK and Italy are forced from the ERM.
September 19-20 Group of Seven discussions end with no meaningful resolution on German interest rates. The British make it clear that they will not re-enter the ERM unless the Germans moderate their stance. Meanwhile, the French narrowly agree to the Maastricht Treaty. A single European currency is announced until 1999.

Gulf War Crisis
May 1990 Saddam Hussein labels overproduction of oil by Kuwait and the United Arab Emirates as economic warfare against Iraq.
July 15-17 Iraq accuses Kuwait of stealing oil from the Rumaylah oil field on the Kuwaiti-Iraqi border and warns of military reciprocity.
August 2 Iraqi troops invade Kuwait and seize Kuwaiti oil fields.
August 9 US authorities react quickly, sending troops to Saudi Arabia. The UN declares the Iraqi annexation of Kuwait null and void.
August 12 International forces instigate a naval blockade of Iraq. All shipments of Iraqi oil are halted.
September 1 Airfares predicted to rise as much as 30% due to higher fuel prices as a result of the Gulf War.
The UN sets January 15, 1991 as the deadline for an Iraqi withdrawal from Kuwait. Hussein adamantly rejects all UN resolutions.
January 9 Negotiations between US Secretary of State James Baker and Iraqi Foreign Minister Aziz end in stalemate.
January 12 Congress grants President Bush authority to wage war upon Iraq.
January 17 Operation Desert Storm begins.
January 24 Allied ground campaign begins.
January 25 Iraq begins an environmental war, pumping millions of gallons of crude oil into the Gulf.
February 26 A month's worth of bombings batter Hussein's resolve. Hussein announces Iraq's withdrawal from Kuwait. The Iraqi exodus from Kuwait City results in the Highway of Death.
February 27 Coalition forces enter Kuwait City. President Bush declares Kuwait liberated.

Black Monday
February 1987 The Securities and Exchange Commission (SEC) announces that it is significantly expanding its initial investigation of Ivan Boesky and Drexel Burnham Lambert.
February 13 Prominent investment banker Martin Siegel pleads guilty to a number of tax and securities charges. Siegel pays $9 million in fines and faces up to 10 years in prison.
April 27 The SEC investigation into the practices of Drexel Burnham Lambert now focuses on the West Coast operations of Michael Milken.
April 29 Both the US dollar and Treasuries plummet after the House of Representatives passes an amendment that will attempt to reduce the trade surpluses of many Asian nations. The markets fear that this move will prompt Asian investors to reduce their exposure to US investments.
October 16 Iranian missiles hit a US-flagged tanker off the coast of Kuwait. The yield on the 30-year bond increases to 10.12%, a return on par with average historical returns in the stock market. Treasury Secretary James Baker expresses his concern about the recent dramatic increase in volatility of the stock market.
October 17-18 Nervous investors fret all weekend over deteriorating economic conditions and increasing tensions in the Middle East. With long-term bond yields almost on par with long-term returns in the stock market, stocks look increasingly unattractive.
October 19 At first light, two US warships shell an Iranian oil platform in the Persian Gulf. This is the last straw. The Dow Jones Industrial Average plunges an unprecedented 508 points, wiping 22.6% off the value of the stock market - the worst one-day decline since the start of World War I. On the trading floor, chaos reigns as many traders are flooded with sell orders. Many simply give up trying to sell. Program selling exacerbates depressed conditions. The volume of shares traded hits 604 million, almost twice the prior record of 339 million.
October 19 The Fed injects $2.2 billion of liquidity through open market operations by November 4. Fed Chairman Alan Greenspan reassures the public that the Fed will continue to be a source of liquidity. Fed fund rates are driven down 179bps by month's end.

貨幣ETF, 匯率風險

ETF的貨幣應用(Currency ETFs and FOREX-related ETFs)
http://greenhornfinancefootnote.blogspot.com/2010/03/etfcurrency-etfs-and-forex-related-etfs.html

ETF的貨幣應用續(Currency ETFs and FOREX-related ETFs)
http://greenhornfinancefootnote.blogspot.com/2010/03/etfcurrency-etfs-and-forex-related-etfs_18.html

什麼是利差交易(What is Carry Trade?)
http://greenhornfinancefootnote.blogspot.com/2009/12/what-is-carry-trade.html

資產配置初步—配置中的匯率風險(Asset Allocation in Essence—Exchange Rate Risk of International Asset Allocation)
http://greenhornfinancefootnote.blogspot.com/2008/08/asset-allocation-in-essenceexchange.html

基金的計價幣別
http://greenhornfinancefootnote.blogspot.com/2007/05/blog-post_4090.html

新發的貨幣型ETF (Ticker: DBV), A Currency ETF for the Long/Short Trade: The PowerShares DB G10 Curren
http://www.moneyq.org/forum/index.php?showtopic=11106

外匯投資不再麻煩 貨幣ETF可分散風險 投資簡單
http://bar.cnyes.com/html/100102-1/8CC065E83103AEE.shtml

美元愈來愈弱,怎麼辦?
http://greenhornfinancefootnote.blogspot.com/2007/05/blog-post_9880.html

弱勢美元,誰受損,誰受益? (Winners and Losers with a Weaker US Dollar)
http://greenhornfinancefootnote.blogspot.com/2007/10/winners-and-losers-with-weaker-us.html

外匯避險
http://greenhornfinancefootnote.blogspot.com/2007/05/blog-post_264.html

2010年11月2日 星期二

投資全球的策略

投資全球的策略(一)已開發國家
http://buffettism.blogspot.com/2009/06/blog-post_2008.html

投資全球的策略(二)開發中國家
http://buffettism.blogspot.com/2009/06/blog-post_16.html

投資全球的策略(三)VT or VTI+VGK+VPL+VWO?
http://buffettism.blogspot.com/2009/06/vt-or-vtivgkvplvwo.html

投資全球的策略(四)美、歐、亞、新興在多空市場的走勢
http://buffettism.blogspot.com/2009/07/blog-post_02.html

投資全球的策略(五)怎麼決定投資比例?
http://buffettism.blogspot.com/2009/08/blog-post_621.html

投資全球的策略(六)資產配置的驗證
http://buffettism.blogspot.com/2009/08/blog-post_05.html

投資全球的策略(七)資產配置的驗證-續
http://buffettism.blogspot.com/2009/08/blog-post_12.html

效率前緣使用的注意事項
http://buffettism.blogspot.com/2009/08/blog-post_03.html

債券

債券相關ETF總整理
http://buffettism.blogspot.com/2009/09/etf.html

債券存續期間的重要性
http://buffettism.blogspot.com/2010/04/blog-post_06.html

注意!買美政府債也會慘賠
http://buffettism.blogspot.com/2010/09/blog-post_15.html

投資人是否應該因為預期升息而從債券市場撤退?
http://buffettism.blogspot.com/2010/08/blog-post_24.html

運用ETFs來建構自己的債券投資組合
http://buffettism.blogspot.com/2010/08/etfs.html

貨幣讓資產配置更多元化
http://buffettism.blogspot.com/2010/10/blog-post_3986.html

債券泡沫:小投資者在冒大險?
http://buffettism.blogspot.com/2010/10/blog-post_17.html