2007-02-24

高鐵初體驗

Dr.Dan帶著小女朋友北上遊玩,為了讓他實踐多年來的請客承諾,初六只得結束春節假期北上,趁此機會,順便體驗台灣高鐵到底有多快。

初四跑去新左營站碰運氣,看看有沒有票可以買,從台鐵新左營站進去,兩個車站是共構的,不過看起來人氣就是有差,台鐵這邊採光比較不足,高鐵那邊就顯得明亮寬敞,當然人氣也是高鐵那邊比較汪,一堆老老少少應該是高鐵站一日遊的遊客吧。

高鐵的自動售票機工讀生竟然還在,燒錢一燒就是兩三個月,不是本錢太粗就是台灣人太笨,教了幾個月都教不會。

幸好初六還有車票可買,車票如左圖。高鐵的車位每排有五個座位,A-E,A和E是兩邊靠窗位子,CD之間是走道。

坐上車後感覺座位的前後間距較自強號來得大,要蹺腳或擺行李都蠻方便的,但上層的行李架就小了點,較大型行李可能無法擺上去。

高鐵最重要的就是速度啦,從高雄到台北,最快車速出現在台中往苗栗路段上,最高顯示車速達292KM/HR,其餘路段約250KM/HR,或許要坐一個半小時的那幾班才能感受300KM/HR的快感吧。

高鐵和自強號的差別還在於正妹較多,或許一次搭乘不能納入統計有效樣本內,但是本車箱內的正妹還真不少,更不要說服務人員,真的是有挑過的,可惜無相機在手,沒圖沒真相。

整體而言,高鐵的確是便利多了,車站離我家也比較近,如果每次都能有半價票可以用就好了:)
繼續閱讀.......

2007-02-15

小樹小小星

荒野中有一棵小樹,他時常仰望星空,無光害的荒野中,每顆星星都盡情地綻放自己的光芒,令人眼花瞭亂,遠遠地有顆小小星,閃爍著湛藍而微弱的星光,在群星中不起眼卻又令人無法忘懷。

直到那一天,小樹又如往常地抬頭仰望星空,突然間,那小小星的光芒顯得耀眼,他深深為那湛藍的光芒著迷,他立志要向上伸展以便能更接近那小小星。世事總無法那麼順利,小樹環顧四周,他身處於岩石堆中,四周的環境告訴他,你不能想要多高就有多高,但是為了小小星,他努力地克服種種限制,終於他發現小小星已不是小小星了,他看著她的光芒愈來愈耀眼,以為他和小小星的距離愈來愈近,那將是他的幸運星。

豈能盡如人意。不久前,空曠的荒野降下了暴風雪,小樹被暴風雪淹沒了,但小樹並不氣餒,他靜靜地等待雪融的日子,終於,積雪慢慢地融化了,小樹看到小小星依然高掛在天空閃耀著,小樹以為幸運星仍等待著他。

苦未盡。當小樹望著小小星的同時,一道來自小小星方向的閃光朝著小樹而來,小樹迎向它,竟是痛徹心屝的雷擊,小樹的身已焦黑不可辨,小樹固然想再接近小小星,橫亙著他與小小星之間的,除了焦黑的樹身外,還有小樹沒想過的N光年。

至此,小小星終於告訴小樹,依據萬有引力,質量大的物體才有吸引力,小樹也才恍然大悟自己的份量是多麼地微不足道。

當小樹理解N光年的距離遠遠大於樹身長,終其一生也無法到達之後,他知道不是砍掉樹身再成長就可以接近小小星,縱然到達了,小樹本身並不具份量,亦是徒然。小樹選擇不再望向小小星,但每當午夜夢迴時分,小樹仍會忍不住再朝小小星的方向看一眼,看著他年少時代的夢想。

小小星仍高掛著天空,她的光芒依然照向大地,仍然吸引著愛作夢的人向她接近,而她始終沒忘記她要的是有份量的人。
繼續閱讀.......

2007-02-14

How to multi-boot JUNOS on IBM T42[2]

INSTALLATION
INSTALL FreeBSD 4.X FIRST

Partition the disk as mentioned before and install minimum FreeBSD 4.X. Minimum installation
is enough because JunOS will format it later.

PKG_ADD JINSTALL

After boot,

1. cp /boot/boot{0,1,2} to /var/tmp first.

2. pkg_add jinstall-XXX-modified

3. cp /var/tmp/boot{0,1,2} to /boot

4. reboot

This is because jinstall-XXX replaces /boot/boot{0,1,2} with its own version and during next boot,
JunOS on T42 hangs at boot1. This could be hardware support problem on these boot code of JunOS. Luckily, using the original bootX solves the problem. You should be able to see the boot messages on the screen.

JunOS will install all its packages and reboot again automatically.
After boot, congradulatoin, you have a JunOS laptop.

Annoying messages will keep pumping out until you save your first configuration.


FINAL STEP

Each boot, JunOS restores /etc/ttys to default, i.e. we cannot login from terminal. To solve this problem, cut the following code to /etc/rc.custom, which JunOS will execute in /etc/rc.local.
--------- CUT HERE BELOW: /etc/rc.custom -------------------------------------

#!/bin/sh

echo 'ttyv0 "/usr/libexec/getty Pc" cons25 on secure' >> /etc/ttys

echo "Restart INIT....."

kill -HUP 1

--------- END OF CUT --- -----------------------------------------------------


Now everything is done. Enjoy it.


繼續閱讀.......

How to multi-boot JUNOS on IBM T42[1]

DISCLAIMER
This is a memo of my experiment. I don't have any source nor packages here. And nothing is warranted. Do it at your own risk !!

GOAL
To multi-boot JUNOS on IBM T42 notebook.

SOME FACTS
o JUNOS supports em driver
o T42 has an em nic but no com port
o By default, you can only login from com port after JUNOS boots up.

ISSUES
MULTI-BOOT

JUNOS installation will check current partition of the hard disk. It will partition and format entire disk if this is a new installation. This gives me a hint that we can skip the format process and preseve
some space for other OSs.

After digging some codes, the key function is the preserve_partdrive() in /sbin/init. JUNOS has pre-defined partition structure, from partition a to partition f, mounted as /, swap, the disk, /config and /var. preserve_partdrive() checks these four partitions' size. If the partition table complies to some pre-defined criteria, init will keep the partition table in tact.

I set the size of these four partitions as 133120 sectors, 2*mem size, 20480 sectors and 1G, respectively. 133120 sectors and 20480 sectors are defined in /sbin/init as min_rootsize and min_configsize. The rest of the disk space can be used for other OSs.

Also notice that JUNOS always uses the first slice. You should better install JUNOS first.

VIDEO CONSOLE
By default, boot messages will output to com console, which T42 doesn't have.

VIRTUAL TERMINAL
By default, JUNOS has serial and pseudo terminals but virtual terminals. To be able to use virtual terminal is the key point of JUNOS laptop. I'll provide the solution later.

CREATE A SPECIAL VERSION OF JINSTALL
Typical install process is as below:
pkg_add jinstall-XXX.tgz -> reboot -> bootstrap install -> pkg_add packages -> reboot -> boot with JUNOS

Files modified:
jinstall-XXX-domestic-signed.tgz ->
jinstall-XXX-domestic.tgz ->
bootstrap-install-XXX.tar:/boot/loader.conf
jbundle-XXX-domestic.tgz:+INSTALL

BOOTSTRAP INSTALL
In the bootstrap install, the interim kernel, /boot/install, mounts root on a memory disk of a cd9660 iso image, mdimg.gz. In the mdimg.gz is the minimum required collection for JUNOS installation.

Some modifications are needed at this stage,
1. set console to 'vidconsole' in /boot/loader.conf to see the booting process on the screen.

CHANGES BEFORE SECOND REBOOT
After JUNOS installs all its packages, it will reboot the system. The default /etc/ttys doesn't enable virtual terminals. To solve this problem, add the following code to the end of the last if-block in +INSTALL of jbundle-XXX.tgz.
--------- CUT HERE BELOW ------------------------------------------------
echo 'ttyv0 "/usr/libexec/getty Pc" cons25 on secure' >> /etc/ttys
--------- END OF CUT ----------------------------------------------------

PACKAGE VERIFICATION
JUNOS use verify_hash() in each +INSTALL to check the integrity of package, including md5, sha1 and in-house certification. Since we have modified the content of jinstall-XXX, each hash digest should be updated accordingly. However, I don't know how to generate the .sig file, so I choose to skip it, i.e. comment out all sig-related check in each +INSTALL.

RE-PACKAGE
After applying all modification, you should re-package it. Notice that each +CONTENTS should be updated accordingly, especially the @srcdir variable.

繼續閱讀.......