2006-12-25

libc6-dev

stdio.h is in libc-dev package.

GNU C Library: Development Libraries and Header Files

2006-12-18

youtube-dl

youtube-dl is a small command-line program to download videos from YouTube.com. It requires the Python interpreter, version 2.4 or later, and it's not platform specific. It should work in your Unix box, in Windows or in Mac OS X. The latest version is 2006.12.07. It's licensed under the MIT License, which means you can modify it, redistribute it or use it however you like complying with a few simple conditions.

http://www.arrakis.es/~rggi3/youtube-dl/

2006-12-08

agup daily

I've been execute "apup" to "sodu apt-get upgrade" daily, it's more than edgy distribution, so it's a experiment one. I am afraid of that there're many holes in my box, that if I haven't update one.

2006-11-24

Bootcfg

http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/bootcfg.mspx?mfr=true

Boot.ini Boot Parameter Reference

http://msdn2.microsoft.com/en-us/library/ms791480.aspx

Info: /cygdrive/c/EmbestIDE/Build/xgcc-arm-elf/bin/arm-elf-ld: cannot find -lc

FAQ

Please set the searching path of c library and gcc library correctly. Select the menu Project> Settings, open project configuration box, select the linked page and the option to add library searching path in drop-down box:
..\..\..\build\xgcc-arm-elf\arm-elf\lib\arm-inter
..\..\..\build\xgcc-arm-elf\lib\gcc-lib\arm-elf\3.0.2\arm-inter

The above path is the relative path of Embest IDE, users can also set absolute path.

2006-11-20

jmsort2.c


#include
//#include "algo.h"

void msort2(int lo, int hi, int S[]);
void mg2(int lo, int mid, int hi, int S[]);


void msort2(int lo, int hi, int S[])
{
int mid;
if ((lo < hi) && ((hi - lo) > 1))
{
mid = (lo + hi) / 2;
//printf(".S[%d]: %d, S[%d]: %d\n", lo, S[lo], mid, S[mid]);
msort2(lo, mid, S);
//printf("..S[%d]: %d, S[%d]: %d\n", mid + 1, S[mid + 1], hi, S[ hi]);
msort2(mid + 1, hi, S);
// Upper is OK
printf("\nlo: %d, mid: %d, hi: %d\n", lo, mid, hi);
mg2(lo, mid, hi, S);
}
}


void mg2(int lo, int mid, int hi, int S[])
{
int i = lo;
int j = mid + 1;
int k = lo;
int U[16];

while ((i <= mid) && (j <= hi))
{
if (S[i] < S[j]) U[k] = S[i++];
else U[k] = S[j++];
k++;
}

int a;
if (i < mid)
for (a = i; a <= mid; a++)
U[a+k] = S[i+a];
else
for (a = j; a <= hi; a++)
U[k+a] = S[j+a];

for (a = lo; a <= hi; a++)
{
S[a] = U[a];
printf("S[%d]: %d, ", a, S[a]);
}
printf("\n");
}


int main(void)
{
int S[] = { 27, 10, 12, 20, 25, 13, 15, 22 };
int sz = sizeof(S) / 4;
int lo = 0;
int hi = sz - 1;

msort2(lo, hi, S);


printf("\nFinally: ");
int a;
for (a = 0; a < 8; a++)
printf("%d, ", S[a]);
printf("\n");

return 0;
}

2006-11-19

HTML <> 的特殊用法

http://www.w3.org/TR/html4/charset.html


"&lt;" represents the < sign.
"&gt;" represents the > sign.
"&amp;" represents the & sign.
"&quot; represents the " mark.

見鬼了,指標無敵啦!

說什麼 in-place 可以節省記憶體空間。只要餵 pointer 過去就無敵了,可是怎麼偵測正確的 sizeof() 呢? o_O? 頭大!


Code:

    #include <stdio.h>

    int foo(int *pA);
    int foo2(int A[]);

    int main(void)
    {
    int A[] = { 5, 7 };
    int *pA = A;

    printf("%d\n", sizeof(A));
    printf("%d\n", sizeof(*pA)); // 其實我是第一個元素的大小
    printf("%d\n", sizeof(*(pA + 1))); // 我是第二個元素的大小
    printf("%d\n", foo(pA));
    printf("%d\n", foo2(A)); // 其實我也是傳第一個指標過去而已
    return 0;
    }

    int foo(int *pA)
    { return sizeof(*pA); }

    int foo2(int A[])
    { return *(A + 1); }


Output:

    8
    4
    4
    4
    7

2006-11-18

終於完成

17:45:29 :: images $ ls -lh
total 503k
-rw-r--r-- 1 a2n None 1.0k Nov 18 17:37 romfs.img
-rwxr-xr-x 1 a2n None 502k Nov 18 17:42 zImage
17:45:30 :: images $


明天的 TODO

    把 MicroWindow 或 MiniGUI 把玩一下。


話說 ARM9 tutorial 我跑不起來,心中有一股怨恨,也想列為 TODO,可是時間上不允許吧。 :-)

Err Log 2006-11-18

在全新的 XP 系統下編譯,在 make clean 出現以下的 err:

--

--
見鬼,重編譯後又沒事。

有個傢伙一直來撞牆



220.134.0.85

要把他 ban 掉!

$grep "220.134.0.85" auth.log |wc -l
346

從 Nov 18 11:00:09 開始撞,Nov 18 11:06:04 結束。

*為了不出現把自己鎖在牆外的窘境,先把作業寫好再說。

[有進步] Once I've used freopen, how can I get the original stdout (or stdin) back?

今天遇到的,有進步。

http://c-faq.com/stdio/undofreopen.html


FILE *fp;
freopen("foo.txt", "w", stdout);
fprintf(fp, "Hello, World\n");
fclose(fp);
printf("Hello, World2\n");


#Output
Hello, World2

And the "Hello, World" is write into *fp points to, "foo.txt".


Mistake example


    FILE *fp = freopen("foo.txt", "w", stdout);
    printf("Hello, World\n");
    fclose(fp);
    printf("Hello, World2\n");


    #Output
    (nothing)

    Because the "Hello, World" was be redirect to "foo.txt", althought it was already excused fclose(fp), but we got nothing from stdout. So the better way is to using fprintf().

2006-11-17

Err Log

pushd: not found
Makefile:40: WARNING: No kernel PCMCIA support found and PCMCIA_PATH is not defined
Makefile:47: WARNING: Linux wireless extensions, CONFIG_NET_RADIO, not enabled in the kernel
make[2]: *** [include/bits/getopt.h] Error 1
configure: error: `LDFLAGS' was not set in the previous run
configure: error: `CFLAGS' was not set in the previous run
configure: error: `CC' was not set in the previous run
configure: error: changes in the environment can compromise the build
configure: error: run `make distclean' and/or `rm config.cache' and start over
make[2]: *** [config.status] Error 1
make[2]: [_mopup] Error 1 (ignored)
make[2]: [_mopup] Error 1 (ignored)
make[3]: *** No rule to make target `clean'. Stop.
make[2]: [_tidy] Error 2 (ignored)
../../miniperl: not found
make[3]: *** No rule to make target `clean'. Stop.
../../miniperl: not found
make[3]: *** No rule to make target `clean'. Stop.
../../miniperl: not found
make[3]: *** No rule to make target `clean'. Stop.
../../miniperl: not found
make[3]: *** No rule to make target `clean'. Stop.
../../../miniperl: not found
make[3]: *** No rule to make target `clean'. Stop.
../../../miniperl: not found
make[3]: *** No rule to make target `clean'. Stop.
../../../miniperl: not found
make[3]: *** No rule to make target `clean'. Stop.
../../miniperl: not found
make[3]: *** No rule to make target `clean'. Stop.
../../../miniperl: not found
make[3]: *** No rule to make target `clean'. Stop.
../../miniperl: not found
make[3]: *** No rule to make target `clean'. Stop.
../../../miniperl: not found
make[3]: *** No rule to make target `clean'. Stop.
../../miniperl: not found
make[3]: *** No rule to make target `clean'. Stop.
../../miniperl: not found
make[3]: *** No rule to make target `clean'. Stop.
../../miniperl: not found
make[3]: *** No rule to make target `clean'. Stop.
../../miniperl: not found
make[3]: *** No rule to make target `clean'. Stop.
../../miniperl: not found
make[3]: *** No rule to make target `clean'. Stop.
../../../miniperl: not found
make[3]: *** No rule to make target `clean'. Stop.
../../../miniperl: not found
make[3]: *** No rule to make target `clean'. Stop.
../../miniperl: not found
make[3]: *** No rule to make target `clean'. Stop.
make[2]: [_tidy] Error 2 (ignored)
make[2]: *** No rule to make target `clean'. Stop.
awk: build-config.awk:16: fatal: cannot open file `Config.h' for reading (No such file or directory)
make[2]: *** [config.h] Error 2
configure: error: C compiler cannot create executables
See `config.log' for more details.
make[2]: *** [config.status] Error 77

BlueScreen Screen Saver v3.2

好物!

BlueScreen Screen Saver v3.2

Author 是 Mark Russinovich,害我以為是上次我去要 Logitech 的好人,哈哈。

2006-11-09

[Windows script] backup.bat



:: Author: Alan Lu
:: Date: 2006-11-09
:: Purpose: Backing up one directory by 7-zip compressor.
:: Ref: http://www.microsoft.com/technet/abouttn/flash/tips/tips_053106_2.mspx
:: Usage:
:: $> backup.bat
:: or
:: $> at 03:00 /every:Sunday backup.bat


@echo off
cls


::
:: %workspace% is a directory name where you want backup.
:: Don't forgot modify the %workspace%'s default value.
set workspace=foo

:: Setting environment variables with todoy's date values
for /f "tokens=1-4 delims=/" %%i IN ('date /t') DO (
set year=%%i
set month=%%j
set day=%%k
)

for /f "tokens=1-3 delims=:" %%i IN ('time /t') DO (
set hour=%%i
set minute=%%j
)

7z a -mx=9 "%year%-%month%-%day%-%hour%-%minute%.7z" %workspace%

2006-10-21

Cool!!!

make -j

-j jobs
Specifies the number of jobs (commands) to run simultaneously. If
there is more than one -j option, the last one is effective. If
the -j option is given without an argument, make will not limit
the number of jobs that can run simultaneously.


XDDD PID 爆量跟記憶體瞬間餵飽!超讚!我愛!

How to Remove Files with Reserved Names in Windows XP

http://support.microsoft.com/kb/315226/en-us
http://support.microsoft.com/?kbid=120716

2006-10-20

[Windows Batch] Getting MAC by ping

$ for /l %i IN (1, 1, 254) DO ping -f -n 1 -w 1 -s 1 -r 1 -i 1 -l 1 zz.xx.cc.%i


$for /l %j IN (1, 1, 220) DO
for /l %i IN (1, 1, 254) DO ping -f -n 1 -w 1 -s 1 -r 1 -i 1 -l 1 zz.xx.cc.%i

2006-10-13

[Windows Batch] for

因為幫辦公室妹妹轉 JPG into PDF,想到 ImageMagick convert。但是 cygwin 無法處理中文檔名,所以就翻 Windows Help 找 "for" 的用法,以下是一行解。


for /R %i IN (*.jpg) DO convert "%i" "%~dpni".pdf

2006-10-08

Memory Management

http://www.memorymanagement.org/bib/f.html
http://www.memorymanagement.org/
http://en.wikipedia.org/wiki/Memory_debugger

好站!繼續衝,今天看到 Ch.8 的 "Pointer & Dynamic memory",遇到 malloc() & free() 就軟掉了,因為我沒有 ANSI C 的手冊可以查,所以 code 看的很暈,其實自己也對 codes 有恐懼跟軟掉感,哈哈,加油啊!

想買 C++ Primer 的衝動,先借來看看吧。

Michael C. Daconta

2006-10-07

C的指標和動態記憶體管理



某個週末和佑安去探訪二手書坊,買了一本〝 C的指標和動態記憶體管理 (C pointers and dynamic memory management)〞,這本書讓我比較了解指標的用法,目前我看到 Ch5.  Array & Pointer。


我只花了 NT$ 70 買,應該是處超超超所值啦,後~~ ^_________^


以下是延伸的資源:

2006-10-06

NAND Flash

NAND memories



NAND flash memories cannot provide execute-in-place due to their different construction principles. These memories are accessed much like block devices such as hard disks or memory cards. The blocks are typically 512 or 2048 bytes in size. Associated with each block are a few bytes (typically 12–16 bytes) that should be used for storage of an error detection and correction block checksum.



NAND devices typically have software-based bad block management. This means that when a logical block is accessed it is mapped to a physical block, and the device has a number of blocks set aside for compensating bad blocks and for storing primary and secondary mapping tables.



The error-correcting and detecting checksum will typically correct an error where one bit in the block is incorrect. When this happens, the block is marked bad in a logical block allocation table, and its (still undamaged) contents are copied to a new block and the logical block allocation table is altered accordingly. If more than one bit in the memory is corrupted, the contents are partly lost, i.e. it is no longer possible to reconstruct the original contents. Some devices may even come with a pre-programmed bad block table from the manufacturer, since it is sometimes impossible to manufacture error-free NAND memories.



The first error-free physical block (block 0) is always guaranteed to be readable and free from errors. Hence, all vital pointers for partitioning and bad block management for the device must be located inside this block (typically a pointer to the bad block tables etc). If the device is used for booting a system, this block must contain the master boot record.



When executing software from NAND memories, virtual memory strategies are used: memory contents must first be paged or copied into memory-mapped RAM and executed there. A memory management unit (MMU) in the system is helpful, but this can also be accomplished with overlays.



For this reason, some systems will use a combination of NOR and NAND memories, where a smaller NOR memory is used as software ROM and a larger NAND memory is partitioned with a file system for use as a random access storage area.

 

NOR Flash

http://en.wikipedia.org/wiki/NOR_flash 


NOR memories

The read-only mode of NOR memories is similar to reading from a common memory, provided address and data bus is mapped correctly, so NOR flash memory is much like any address-mapped memory. NOR flash memories can be used as execute-in-place memory (XIP), meaning it behaves as a ROM memory mapped to a certain address. NOR flash memories have no intrinsic bad block management, so when a flash block is worn out, either the software using it has to handle this, or the device breaks.

When unlocking, erasing or writing NOR memories, special commands are written to the first page of the mapped memory. These commands are defined as the Common Flash memory Interface (defined by Intel) and the flash circuit will provide a list of all available commands to the physical driver.

Apart from being used as a ROM, the NOR memories can, of course, also be partitioned with a file system and used as any storage device.

2006-10-04

How do I uninstall all of Cygwin?


http://www.cygwin.com/faq/faq_2.html#SEC20


Setup has no automatic uninstall facility. The recommended method to
remove all of Cygwin is as follows:

Remove all Cygwin services. If a service is currently running, it must first be stopped with `cygrunsrv -E name', where `name' is the name of the service. Then use `cygrunsrv -R name' to uninstall the service from the registry. Repeat this for all services that you installed. Common services that might have been installed are sshd, cron, cygserver, inetd, apache, and so on.


Stop the X11 server if it is running, and terminate any Cygwin programs that might be running in the background. Remove all mount information by typing `umount -A' and then exit the command prompt and ensure that no Cygwin processes remain. Note: If you want to save your mount points for a later reinstall, first save the output of `mount -m' as described at http://cygwin.com/cygwin-ug-net/using-utils.html#mount.


Delete the Cygwin root folder and all subfolders. If you get an error that an object is in use, then ensure that you've stopped all services and closed all Cygwin programs. If you get a 'Permission Denied' error then you will need to modify the permissions and/or ownership of the files or folders that are causing the error. For example, sometimes files used by system services end up owned by the SYSTEM account and not writable by regular users. The quickest way to delete the entire tree if you run into this problem is to change the ownership of all files and folders to your account. To do this in Windows Explorer, right click on the root Cygwin folder, choose Properties, then the Security tab. Select Advanced, then go to the Owner tab and make sure your account is listed as the owner. Select the 'Replace owner on subcontainers and objects' checkbox and press Ok. After Explorer applies the changes you should be able to delete the entire tree in one operation. Note that you can also achieve this in Cygwin by typing `chown -R user /' or by using other tools such as CACLS.EXE.


Delete the Cygwin shortcuts on the Desktop and Start Menu, and anything left by setup.exe in the download directory. However, if you plan to reinstall Cygwin it's a good idea to keep your setup.exe download directory since you can reinstall the packages left in its cache without redownloading them.


If you added Cygwin to your system path, you should remove it unless you plan to reinstall Cygwin to the same location. Similarly, if you set your CYGWIN environment variable system-wide and don't plan to reinstall, you should remove it.


Finally, if you want to be thorough you can delete the registry tree `Software\Cygnus Solutions' under HKEY_LOCAL_MACHINE and/or HKEY_CURRENT_USER. However, if you followed the directions above you will have already removed all the mount information which is typically
the only thing stored in the registry.

--
Alan Lu, a man, enjoy programming & UNIX.
My website: http://alan0098.googlepages.com/

搞笑漫畫日和1 No.4

 

落下女-追辣妹的方法

 

2006-10-02

骯髒

因為 ARM9 Linux 做不好,所以就覺得大陸寫的教材很骯髒,其實是自己沒有能力去 hacking 那些東西,幹幹幹,幹麻做在 cygwin 呢? :'(


要怎麼拆解?或是怎麼做才會順利呢?煩心 ~~~~~~ :( 

[Bash] .

Generating a script named "start.sh" file like below,

#!/bin/sh
export PATH=/foo/foo:$PATH

Then, we need excute ". start.sh".

$ man 1 bash

BASH_ARGC
An array variable whose values are the number of parameters in each
frame of the current bash execution call stack. The number of
parameters to the current subroutine (shell function or script
executed with . or source) is at the top of the stack. When a
subroutine is executed, the number of parameters passed is pushed onto
BASH_ARGC. The shell sets BASH_ARGC only when in extended debugging
mode (see the description of the extdebug option to the shopt builtin
below)


--
Alan Lu, a man, enjoy programming & UNIX.
My website: http://alan0098.googlepages.com/

2006-09-29

ANSI C, lvalue

Value (computer science) 


In C: L-value and r-value

Some languages use the idea of l-value and r-value. L-values are values that have addresses, meaning they are variables or dereferenced references to a certain place. R-value is either l-value or non-l-value — a term only used to distinguish from l-value. In C, the term l-value originally meant something that could be assigned (coming from left-value, indicating it was on the left side of the = operator), but since 'const' was added to the language, this now is termed a 'modifiable l-value'.

An l-value is an expression that designates (refers to) an object. A non-modifiable l-value is addressable, but not assignable. A modifiable l-value allows the designated object to be changed as well as examined. An r-value is any expression that is not an l-value, it refers to a data value that is stored at some address in memory.

2006-09-28

NTFS sucks!

In cygwin with NTFS of WindowsXP sp2 environment, I''d input:

mv uClinux-dist /usr/local/src


take me about 30minutes, it's really sucks!!


In Linux box, the inode will help it shorter. But why?  Let me study in the Ch.11 FileSystem.

patch -p0

-pnum or --strip=num

Strip the smallest prefix containing num leading slashes from each file name found in the patch file. A sequence of one or more adjacent slashes is counted as a single slash. This controls how file names found in the patch file are treated, in case you keep your files in a different directory than the person who sent out the patch. For example, supposing the file name in the patch file was


    /u/howard/src/blurfl/blurfl.c



setting -p0 gives the entire file name unmodified, -p1 gives

    u/howard/src/blurfl/blurfl.c



without the leading slash, -p4 gives

    blurfl/blurfl.c



and not specifying -p at all just gives you blurfl.c. Whatever you end up with is looked for either in the current directory, or the directory specified by the -d option.

2006-09-14

Google Reader -> Bloglines



Ya, I did it in today, 'cuz the AJAX operation is such slowly in Opera 9.00, and some error often occured in operation.  So that, I exported all of feed to bloglines.

My buddy, Howl suggests me some useful RSS reader, I've never tried it yet, 'cuz now I prefer the on-line service (a.k.a API application).  Maybe next time, I'll try these good tool. :-)

2006-08-26

for

To untar all tarballs
$ for i in `ls -1 --color=never`;do tar -xjf "$i";done


Zipping all directory to echo directory which with prefix as $i

$ for i in `ls -1d --color=never */`;do 7z a -mx=9 "$i".7z "$i";done

Zipping all directory to current direcotry with directory name as its prefix

$ for i in $(ls -1d --color=never *`;do 7z a -mx=9 $i.7z $i;done

2006-08-22

www.STUT.edu.tw

從原本的 RedHat Enterprise 4 換成 Windows 系列了。這個比較表滿有意思的。來找找其他的比較表格。

2006-08-20

Acer Veriton 3200 使用手冊

S58M MB99135-1
48.38H01.011M.1.T

Acer Veriton 3200 使用手冊

Acer─使用手冊及文件下載 -> 桌上型電腦 -> 搜尋

Realtek 8139



One day, we've a network curriculum in FEC, Ralph told us that the Realtek 8139 ethernet chip is good than others, 'cuz it can be program and control as we hope.


Util today, I's visited the Realtek 8139 spec webpage, the last one is 75 pages, well~ well~ well~ it's more better than the D-Link 530Tx+ for me.


Extend:
*RTL8139C(L)+
*RTL8139C(L)
*Network Interface Controllers (list all)

2006-08-16

2006-08-04

New House LAN

Getway: 192.168.0.1

**$telnet 192.168.0.1 80
HTTP/1.0 400 Bad Request
Content-type: text/html
Pragma: no-cache
Date: Fri, 04 Aug 2006 14:06:10 GMT
Last-modified: Fri, 04 Aug 2006 14:06:10 GMT
Accept-Ranges: bytes
Connection: close


**$nmap -O 192.168.0.1
Starting Nmap 4.11 ( http://www.insecure.org/nmap ) at 2006-08-04 22:02 台北標準時間
Interesting ports on 192.168.0.1:
Not shown: 1678 closed ports
PORT STATE SERVICE
80/tcp open http
8080/tcp open http-proxy
MAC Address: 00:0E:A0:00:08:84 (NetKlass Technology)
Device type: general purpose
Running: Linux 2.4.X|2.5.X
OS details: Linux 2.4.0 - 2.5.20
Uptime 0.492 days (since Fri Aug 04 10:14:05 2006)

Nmap finished: 1 IP address (1 host up) scanned in 8.734 seconds


**$tracert www.ntu.edu.tw
Tracing route to w3.cc.ntu.edu.tw [140.112.8.130]
over a maximum of 30 hops:

1 2 ms 2 ms 2 ms 192.168.0.1
2 35 ms 45 ms 34 ms 218-175-144-254.dynamic.hinet.net [218.175.144.2
54]
3 44 ms 42 ms 32 ms tn-st-c6r1.router.hinet.net [168.95.54.18]
4 33 ms 43 ms 42 ms tn-st-c12r12.router.hinet.net [220.128.27.118]
5 38 ms 44 ms 32 ms kh-c12r12.router.hinet.net [220.128.25.30]
6 39 ms 50 ms 39 ms tp-s2-c12r12.router.hinet.net [220.128.2.14]
7 55 ms 40 ms 51 ms tp-s2-c12r2.router.hinet.net [220.128.2.113]
8 45 ms 50 ms 38 ms tp-s2-c76r2.router.hinet.net [211.22.35.213]
9 40 ms 52 ms 64 ms 211.22.35.177
10 52 ms 41 ms 54 ms 211.20.43.121
11 52 ms 40 ms 54 ms w3.cc.ntu.edu.tw [140.112.8.130]

Trace complete.

2006-07-13

Burning Tools

cdburn

Because I re-partition my disc and re-install my Windows box, so I was stay in Win32 environment for setting.


Some neat utilities I prefer, like the burning CD tools. Today, I found the CDBurn.exe by Google, it's made in M$, project named "Windows Server 2003 Resource Kit Tools", and found this information in "How can I write ISO files to CD?".


So that now, I using it to burn out the Ubuntu Linux 6.06 CD for installing my Linux box later. ;)


An other tool as I found, "CreateCD"

2006-07-12

ISO Tools

Today, I bough a joy stick to play game, include "Silent Hill" and "MapleStory" or Hafe Life".

The Silent Hill 3 that I download ISO file, thus I need to mount it then install and play it. First, I try to install the "Alcohol 50%", it's a simple version with "Alcohol 120%", without the burn CD/DVD function, and it has non-registry. Both 50% and 120% are can generate ISO file.

Second, I installed the "WinISO", but it seems older than "IsoBuster", and WinISO cannot edit files which more than 2GB, but IsoBuster can satisfied.

Finally, I tried the "DAEMON tools", it seems as the same principle like Alcohol, 'cuz durning the install procedure, it prompts a warning dialog, said something like, "If u install this program, maybe ur debugger, like ICE... cannot run well.". Ya... u know, in Unix-Like OSes, we can mount ISO file as a file node, for genernal at /mnt. Maybe these tools also did like Unix-Like.

"Daemon tools" doesn't need to registry and has no prompt dialog, haha, it's good for me, 'cuz the dialog is really really bother me... even everyone except the Darmon tool TEAM. :P


Thus... I pick and choose the "Daemon Tools" for mount ISO files. Maybe after this moment, I need to programs which support burn out a ISO files and NO REGISTRY DIALOG.

:D :D

2006-07-11

Meeting Log

Mine

.equ WTCON, 0x01d30000
.equ WTCON, 0x01d30000
.equ PCONE, 0x01d20028
.equ LOCKTIME, 0x1d8000c
.equ PLLCON, 0x01d80000
.equ CLKCON, 0x01d80004


.globl start
start:
b reset
add pc, pc, #0x0c000000
add pc, pc, #0x0c000000
add pc, pc, #0x0c000000
add pc, pc, #0x0c000000
add pc, pc, #0x0c000000
add pc, pc, #0x0c000000
add pc, pc, #0x0c000000



The seven times of add action, it brings PC out to INTERRUPT AREA, avoid to excute the interrupt vector.

Our next step is getting to Linux-based tutorial. It's so happy to meet these nonOS tutorial, and we consider that these advance sections should be study later, except advisor indicated LED section.


NOTE: The UNet ICE can use in Embest 2005 Pro.

2006-07-05

__divsi3

When we hacking C code, found that c code in the disassembly window, the for() loop was be translated to __divsi3. Thus, we hacking the "__divsi3" in the cygwin.

After I hacked the gcc-core source code, at gcc-4.1.1/gcc/config/ia64/lib1funcs.asm, as below:


---

#ifdef L__divsi3
// Compute a 32-bit integer quotient.
//
// From the Intel IA-64 Optimization Guide, choose the minimum latency
// alternative.
//
// in0 holds the dividend. in1 holds the divisor.

.text
.align 16
.global __divsi3
.proc __divsi3
__divsi3:
.regstk 2,0,0,0
// Check divide by zero.
cmp.ne.unc p0,p7=0,in1
sxt4 in0 = in0
sxt4 in1 = in1
;;
setf.sig f8 = in0
setf.sig f9 = in1
(p7) break 1
;;
mov r2 = 0x0ffdd
fcvt.xf f8 = f8
fcvt.xf f9 = f9
;;
setf.exp f11 = r2
frcpa.s1 f10, p6 = f8, f9
;;
(p6) fmpy.s1 f8 = f8, f10
(p6) fnma.s1 f9 = f9, f10, f1
;;
(p6) fma.s1 f8 = f9, f8, f8
(p6) fma.s1 f9 = f9, f9, f11
;;
(p6) fma.s1 f10 = f9, f8, f8
;;
fcvt.fx.trunc.s1 f10 = f10
;;
getf.sig ret0 = f10
br.ret.sptk rp
;;
.endp __divsi3
#endif

---

Inside of the "config" sub-directory, there has more plaform implement the __divsi3 function. Thus, many platform need the function, but used different their assembly instruction.

--
a2n@ubuntu-en:config$ grep -r "__divsi3" *
alpha/alpha.c: /* Prevent gcc from generating calls to __divsi3. */
arc/lib1funcs.asm: .global ___divsi3
arc/lib1funcs.asm:___divsi3:
arm/lib1funcs.asm: bl SYM(__divsi3)
arm/lib1funcs.asm: bl SYM(__divsi3)
bfin/lib1funcs.asm:.global ___divsi3;
bfin/lib1funcs.asm:.type ___divsi3, STT_FUNC;
bfin/lib1funcs.asm:___divsi3:
bfin/lib1funcs.asm: CALL ___divsi3;
divmod.c:__divsi3 (long a, long b)
h8300/lib1funcs.asm: .global ___divsi3
h8300/lib1funcs.asm:___divsi3:
h8300/h8300.c: "__divsi3",
ia64/lib1funcs.asm:#ifdef L__divsi3
ia64/lib1funcs.asm: .global __divsi3
ia64/lib1funcs.asm: .proc __divsi3
ia64/lib1funcs.asm:__divsi3:
ia64/lib1funcs.asm: .endp __divsi3
ia64/ia64.c: set_optab_libfunc (sdiv_optab, SImode, "__divsi3");
ia64/t-ia64: __divsi3 __modsi3 __udivsi3 __umodsi3 __save_stack_nonlocal m32c/m32c-lib2.c:SItype __divsi3 (SItype a, SItype b);
m32c/m32c-lib2.c:__divsi3 (SItype a, SItype b)
m68k/lb1sf68.asm: .globl SYM (__divsi3)
m68k/lb1sf68.asm:SYM (__divsi3):
m68k/lb1sf68.asm: PICCALL SYM (__divsi3)
mt/lib2extra-funcs.c:__divsi3 (SItype a, SItype b)
stormy16/stormy16-lib2.c:extern SItype __divsi3 (SItype, SItype);
stormy16/stormy16-lib2.c:__divsi3 (SItype a, SItype b)
v850/lib1funcs.asm: .globl ___divsi3
v850/lib1funcs.asm: .type ___divsi3,@function
v850/lib1funcs.asm:___divsi3:
v850/lib1funcs.asm: .size ___divsi3,.-___divsi3
v850/lib1funcs.asm: jarl ___divsi3,r31
xtensa/lib1funcs.asm: .global __divsi3
xtensa/lib1funcs.asm: .type __divsi3,@function
xtensa/lib1funcs.asm:__divsi3:
xtensa/lib1funcs.asm: .size __divsi3,.-__divsi3
--

2006-07-03

Meeting Log

My slide
howls'


TODO for Wed.:

*Reinforcing the script section, add Memory Layout from the lecture of china.
*Replacing "CS :: Example" by more complete example, better for demo and present.


Meeting note:
*Thumb mode
--

.arm
adr r0, Tstart +1
bx r0

.thumb
Tstart:
[...]

--
16-bit data line mode {00, 01}, {10, 11}, the MSB bit is exange by "0" and "1". 32-bit is {00, 01, 10, 11}, {100, 101, 110, 111}. The default mode is .arm, thus load the instruction to memory by 3-bits.

For parting 16-bit and 32-bit mode; it's 16-bit if LSB is 1, so "Tstart +1", is plus LSB bit to 1 to tail of machine code.

Return 32-bit mode from 16-bit, we can use "mov pc, lr".

*One label of Literal can be present more different types.

2006-06-29

Log

Today, we have already study in C program, before C, we're confused in Thumb section example. But after we've asked teacher then we figure out.

This afternoon, we plan the meeting note on next _Mon._, as below:

1. Instruction Set; CC, Instruct Monenic

2. Solve problem procedure;
*bl, stmfc, adr +8, thumb +1, stack_top
*little-endian, Pre-index, Post-index


3. Command Script
*Can any script to finish the set procedure?

4. R13. SP, R14. LR, R15. PC
*Memory Layout status

5. Flags
*msr, mrs, cpsr, spsr


And next _Wed._:
1. Gamil, Calendar
2. adreus

2006-06-27

What are linker script files?

From:What are linker script files?

Date 7/5/2005 10:42:22 AM
Question What are linker script files?
Answer


Linker script:
In the Embed system development, it needs to use linker position file. This file describes the relevant information of code linker position, including code section, data section, address section, and the linker shall use the code of this file to the whole system as correct position. This file is called as linker scripts file.
The following is an example of Linker script:

SECTIONS
{
. = 0x02000000;
.text : { *(.text) }
Image_RO_Limit = .;
Image_RW_Base = .;
.data : { *(.data) }
.rodata : { *(.rodata) }
Image_ZI_Base = .;
.bss : { *(.bss) }
Image_ZI_Limit = .;
__bss_start__ = .;
__bss_end__ = .;
end = .;
.debug_info 0 : { *(.debug_info) }
.debug_line 0 : { *(.debug_line) }
.debug_abbrev 0 : { *(.debug_abbrev)}
.debug_frame 0 : { *(.debug_frame) }
}

What's is command script (*.cs) ?

From: What is a command script file *.cs? How can I make a command script file?

Haha~~ it is one of FAQs. :P I am lamer. 囧rz


Date 7/5/2005 10:47:09 AM
Question What is a command script file *.cs? How can I make a command script file?
Answer

While debugging software or after the target board resetted, sometimes users may need IDE automatically finish some special functions such as resetting target board, clearing off watchdog, shutting off interrupts, memory map, etc., these special functions can be completed through executing a group of commands. This group of commands saved as a text file and is called command script file.
You can execute the command script (*.cs) file to initialize your target board before debugging. But such a file is not necessary if some programs (such as bios,bootloader) execute well after power on. The cs file for Embest Debugger is just very useful to debug a target board without any code in boot rom.
For Embest IDE, when remotely connected to the target device, we can execute the command script (*.cs) file to initialize the system before debugging. We can do as following:
Project ->Settings ->DEBUG ->Action After connected, select the command script that you want to execute.
The following are the examples of command scripts :

; stop target CPU
stop
; configurations of the special register
memwrite 0xffe00000 0x01002535
memwrite 0xffe00004 0x02002121
memwrite 0xffe00024 0x06
; configuration for Mapping Address
memwrite 0xffe00020 0x01
refresh
download -v D:\Demo\armdemo\debug\led.elf 0x2000000
;end

2006-06-26

PS2 Linux

PlayStation®2 Developer Network
Opening Up the PlayStation 2 with Linux


*Scientific Computing on the Sony PlayStation 2

Log

Today, we have the experiment on Sec.3.1-1 and Sec.3.1-2, we know the Flash address range and RAM address range.

The Embest IDE is not stable on the PC, we don't know what's going on, PCs' or Embests' problem. Clicking the "Rest(Ctrl+R)", the entry point will be offset, advisor said that, 'cuz the entry point be taked to 0x00000000, and the "Connect" will excute the initial file (*.cs), then initial some memory addressing configuration. Thus, after Reset, entry point will be offset, and different with program specified.


Be mentioned is this section, "lsr" and "lsl", a little different. :-)

2006-06-23

ARM[7,9] Survey log

ARM9 Family
* ARM9 has two cores, ARM920T(Dual 8K cache) & ARM922T(Dual 16K cache)
* Supports much feature(SoC, extension application).

ARM7 Family
* ARM720T has the MMU.
* ARM7 all has the AHB(Advanced High-performance Bus)
* ARM7 has four cores, ARM7TDMI, ARM7TDMI-S, ARM7EJ-S, ARM720T
* Supports Java, Jazelle, JTEK

2006-06-22

SIC/XE assembler

In this semester, one of corriculum, System Software. We need to write a SIC/XE assembler, my stuff is not be done in now, it is such buggy.

Some drawback below,
1. Generating the right objcode output.
2. The SYMTAB can be replaced by HashTab
3. Snipping some variables which doesn't used.


TODO,
1. To survey the performance with algorithm(timer) with my sutff.
2. ...


Finally, thx for somebody who has been help me for code it, especially kornelius. :)

Download my sutff

2006-05-20

M$ gift, Logitech QuickCam Pro 5000

Hi 各位,

很幸運地,我收到微軟從美國寄給我的免費 Camera。我整理出這個 eMail 討論的過程,希望幫助大家也可以如此幸運。

某天專題 meeting 完後,我回家上 Google 找 USB webcam driver,然後找到一個微軟員工的網誌 (Blog) — Mikehall's Embedded WEblog。
http://blogs.msdn.com/mikehall/archive/2006/03/01/541495.aspx,去 GotDotNet 找檔案,結果有錯誤,載點消失,所以又回報給另一個人 (Julie Sanders)。

然後,我發現 Who wants a Free WebCam ? (http://blogs.msdn.com/mikehall/archive/2006/04/17/577924.aspx),當我現在再次回首時,才知道真的是限量名額 25 位,能得到免費的 WebCam,哈哈,真是太幸運了,當下立刻 eMail 給 Nic Sagez,我真的不曉得他要送 WebCam 給我,看來我那晚有點神智不清,呵呵。

我是 4/18 8pm (臺灣時間) 那天開始發信給他。信件標題為 "Need webcam usb driver"。

【第一封 - 4/18 8:32pm】
Hi Nic,

I am a student from Taiwan, we are develop a project base the Windows
CE platform, now we are looking for the USB webcam driver, and I got
something from Mikehall's Embedded WEblog, we need your support,
please, thanks.


Alan Lu, a man, enjoy programming & UNIX.
My website: http://webmail.stut.edu.tw/194G0010/

哈哈,我發現我的簽名檔還滿白爛的。因為我寫我喜歡程式設計,還有 UNIX,哈哈,巴結點是否要寫喜歡 Windows series 呢?
後面會把反應 GotDotNet 寄給 Julie 信件貼出,也是滿白爛的,哈哈。
總而言之,原本自己就很白爛了。:P

【第一封回覆 - 4/18 10:47pm】
Hi Alan,

I'd be happy to provide you with a camera. I just need the following
information:

- Name
- Address
- Phone Number
- Project to extend the driver

Thanks a lot!

Nic

Nic Sagez | Product Manager | Windows Embedded | (425) 707-8716 |
nsagez@microsoft.com
Access Windows CE Shared Source code TODAY!

原來,Nic 是該公司的嵌入式系統部門產品經理。

【第二封 - 4/18 11:37pm】
Hi Nic,

Thank you very much.

Name: Alan Lu
Address: No.1,Nantai St,Yung-Kang City,Tainan Taiwan 710 Roc
Phone Number: +886923601223
Device model: Logitech QuickCam Pro 5000

當晚,我正在苦著什麼是 "Device model" 呢?是要寫發展平台呢?亦或是 WebCam 呢?我還有問佑安,佑安還問他的香港朋友呢。
哈哈,免費送的網頁就有寫到,"Nic Sagez has about 25 Logitech QuickCam Pro 5000 devices sat in his office.",哈哈,再寫一次 Logitech QuickCam Pro 5000 還滿怪的。

【第二封回覆 - 4/25 1:01am】
Hi Alan,

Your camera is in the mail and should get to you this week.
I'm looking forward to seeing your contribution to the project!

哈哈,我有職業病啦,原本我真的只是向他要 USB Camera driver 而已,然後看見 mail 這個字,以為是 eMail,現在才曉得是包裹 (DHL 的呢~)。
最後一句話讓我很感動,他這麼關心我的專題,呵呵,比小貞貞還關心啦 ~~ ^_________^

【第三封 - 5/2 9:50pm】
Hi Nic,

I'm waiting for your mail, but it's no response, could you email me
the webcam driver ?

誤會開始了,真丟臉啦,哈哈。 >"<

【第三封回覆 - 5/2 10:34pm】
Hi Alan,

It looks like the webcam has been delivered to you on the 27th of April
and it was signed by "Costamp" (I'm not sure who that is).

You can download the driver from the gotdotnet workspace
(http://www.gotdotnet.com/workspaces/workspace.aspx?id=0eb87e35-13e4-4fa
3-9fde-71e9136f47de) in the "release" section.

Let me know if you have any questions,

Thanks!

哈哈,人家很好心,結果我還是沒搞懂第一段 (算是略過),因為他真的表明說 4/27 那天就從美國寄出包裹了。
第二次感動,也是最後一段,時時關切我的進度。

【第四封 - 5/2 11:07pm】
Oh ~~ thx, Nic.

I just forgot to visit GotDotNet website, I got it now.

BTW, you're very kind for dealing my question, thank you very much.

哈哈,兩次的感動就免不了要謝謝對方囉。真的很友善地處理我的問題呢 ~~

最後,我公佈與 Julie 的白爛對話過程。標題是 "Error page feedback"。

【第一封 - 4/18 8:13pm】
URL, http://www.gotdotnet.com/workspaces/workspace.aspx?id=0eb87e35-13e4-4fa3-9fde-71e9136f47de

Workspace name, Shared Source USB Webcam Driver,
http://msdn.microsoft.com/embedded/usewinemb/ce/sharedsrccode/USBDriver/default.aspx

UserName: null
OS, Windows XP SP2
Browser, Opera 9.00 build 8212
Passport login, NO
Contacting me for more info, YES

Plz fix it, thx.


Alan Lu, a man, enjoy programming & UNIX.
My website: http://webmail.stut.edu.tw/194G0010/

雙重白爛,第一:沒有用微軟牌上網器 (IE),因為沒 Linux 版 IE。第二:又是 UNIX,哈哈。 XD
某日,我去看我的個人網站 meter,有發現他們還瀏覽我的網站,真罕見。

【第一封回覆 - 4/19 12:44am】
Hello,

GotDotNet is currently offline. We are aware of the problem and will
have things up and running again as soon as possible.

Thank you for your patience. We will notify you when the site becomes
available.

Julie Sanders
Microsoft GotDotNet \ MSDN & TechNet Blogs

看的出來滿積極地修復錯誤。

【第一封回覆2 - 4/19 7:21am】
Hello,

GotDotNet is back up! Thanks for your patience.

他們大公司,機器可能滿多的吧,竟然要 7 hrs 才恢復。哈哈 ~~

最後,我原本都討厭 M$ 這種世界霸主,所以索性玩起 non-M$ 系統。來南台,接觸不少 Win32 prog,漸漸接受這種模式了。這次又這麼幸運地收到禮物,哈哈,開始喜歡微軟了啦。:D