- source ../CoWare.csh -pa
- scide
星期四, 12月 11, 2008
星期三, 12月 10, 2008
星期二, 12月 09, 2008
SystemCall addition
Kernel Space:
REF:
- 在 kernel/sys.c 新增函式,並EXPORT
- include/asm-xxx/unistd.h 新增中斷號碼。
NR_syscalls 記得+1. - arch/i386/kernel/entry.S ( < 2.6.12 ) or syscall_table.S(>2.6.12)
+.long sys_xxx
- include/asm/unistd_32.h 新增與Kernel相同的號碼的define.
- include/bits/syscall.h
#define SYS_xxx __NR_xxx
static inline _syscall2(long, NEW, int, arg1, int, arg2);
/*linux中一共定義了7種不同的_syscall*,在 unistd.h 裡面
可以看到,若定義 system call 有要傳參數的話必需使用別
的 _syscall
*/_syscall1(int,addtotal,int, num)- test
#include
_syscall2(long, hello, int, arg1, int, arg2);
int main(){
printf(" %d \n", hello(1, 2) );
return 0;
}
- 新版kernel已改為 syscall ,不再使用舊的那七種方式
- #include
#include
#include
//static inline _syscall2(long, NEW, int, arg1, int, arg2);
int main(){
time_t tt;
// time(&tt );
syscall( 13, &tt );
printf("tt=%d\n", tt );
}
- #include
REF:
- http://www.csie.ncu.edu.tw/~hsufh/COURSES/FALL2007/syscall.html
標籤:
【Programming】
星期五, 12月 05, 2008
MIPS Instruction set format
R-Type Instructions (Opcode 000000)
| opcode (6) | rs (5) | rt (5) | rd (5) | sa (5) | function (6) |
I-Type Instructions (All opcodes except 000000, 00001x, and 0100xx)
| opcode (6) | rs (5) | rt (5) | immediate (16) |
J-Type Instructions (Opcode 00001x)
| opcode (6) | target (26) |
Coprocessor Instructions (Opcode 0100xx)
| opcode (6) | format (5) | ft (5) | fs (5) | fd (5) | function (6) |
Reference:
- Page URL: http://www.d.umn.edu/~gshute/spimsal/talref.html
- http://www.mrc.uidaho.edu/mrc/people/jff/digital/MIPSir.html
- http://www.mrc.uidaho.edu/mrc/people/jff/digital/MIPS_slides/
標籤:
【學校、課業、論文】
星期一, 11月 10, 2008
粗級英文-比較、不定詞
30分鐘
形容詞的比較
形容詞的比較
- 比較急....then.....
- the 比較急......of the...
- 修飾:
- much, a lot, far
- even
- a little
- junior/senior/major/minor 用 比較急.....to....
- 其他用法
- 比較急 and 比較及 ( 越來越 ...)
The more, the better.
The more we get, the happier we'll be.
- 比較急 and 比較及 ( 越來越 ...)
- as 原級 as ->像..... 一樣.
Your hair is as long as mine. - 疑問句: 三者以上用最高級.
Which do you like best, mary, eva or jessica.
- to +Vo
- It's +形容詞(事物) + for + 人 + to + Vo
- It's +形容詞(人) + of + 人 + to +Vo.
To be patient with your wife is best for you.
It's best for you to be patient with others.
- 當受詞時:decide/hope/want/expect/volunteer ,必用不定詞.
- 當主詞補語: be+ to + VO , 補充說明.
To see is to believe. - 當受詞補語: O+V+受詞 + 受詞捕語.
He told me to give up smoking. - want/ask/teach/tell/get/show 等,用不定詞當受詞補語.
- 否定不定詞 -> not + to + Vo.
- 不定詞的形容詞用法(修飾名詞):
- 名詞/something ...._+to+Vo.
- 不定詞的副詞用法(修飾動詞)
- 表目的: in order to + V0
She went to London in order to study English.
go/come 通常用and 連接
Come and see me. - 表原因、情感:
- 表目的: in order to + V0
- too + adj/adv + to +Vo.
You are too young to understand the whole thing. - adj/adv + enough + to +Vo.
標籤:
【English】
粗級英文-II 時態
20 分鐘
現代簡單式:
現代簡單式:
- 事實、真理.
- 習慣
- 現在
- 遇到下面的時間副詞:
- yesterday
- last+ 時間
- 時間 + ago
- Vo + ing
- Ve -> 去e +ing
- V(子音 +短母音+子音 ) ->重複字尾+ing. ex: putting/cutting/swimming.
- 表示重複動作, always/all the time/again and again 等副辭片語出現.
He is always complaining.
The car is breaking down all the time - 表示最近的未來即將發生的, come/go/start/leave/arrive
I'm leaving for taipei tomorrow
My boyfriend is coming to see me tomorrow. - 感官、情感不可用進行式
see/hear/smell/love/like
- 過去時間反覆性的動作, 習慣.
- 特定時機正在進行.
- be going to + Vo -> 實現性非常高的、預先計畫好的行為。
- will + Vo -> 不需事先計畫的.
I will be fifty years old next year.
- 一般: V0 直接用.
- 否定: Don't( Never) + V0
- Let's +V0
- What + a(an) + adj + n + O!
WTF.
What a day. - How + adj + (O+V)!
How smart he is! <--- 這不是疑問句喔!!
標籤:
【English】
粗級英文-I 詞類
20分鐘
複數名詞的變化:
規則的:
所有格:
複數名詞的變化:
規則的:
- 普通:N + s
- s, sh, ch, x, o + es
- (子音 + o ) + es, ex: tomatoes , 不過有例外: photos, pianos..
- (子音 + y ) 去y + ies ex: babies, stories, cities, ladies.
- f, fe, 去fe + ves ex: wives, knives.例外: chiefs, rootfs
- 字尾加 en, ren: oxen, children
- 變母音 men, womem, teeth, mice.
- fish, deer, sheep, Chinese, Japanese
所有格:
- 人: A's B
- 無生物: A of B.
- be 動詞的疑問句可用 yes/no 回答,而答句中的主詞要用代名詞.
- 第三人稱加s / es 的方法同名詞.have/has 例外
- 一般否定句:
- 不可直接加NOT , 要用 do(I/you) or does(第三人稱) 助動詞.也就是說除了一般句,一般動詞都要配 do/does.
- 所以do /does 之後必定出現原形動詞.
- 過去式:
- Vo + ed ex: helped/spelled/wanted.
- Ve + d ex: danced
- 子音 + 短母音 + 子音 -> 重複字尾+ed , ex:stopped/planned.
- 字尾為子音+y -> 去y + ied ex:studied/cried.
- 不規則: ate/read/rode/came/went/had/saw/taught/gave/took
- 否定句疑問句同一般式: + did
- both、all: 出現於否定句,代表 "部分否定"
I dont know both of her parents.
他的父母親我並非都認識. - either/neither: 任一唯一/兩者都不
- some/any: 一般用法 some 用於肯定, any用於其他.
標籤:
【English】
星期四, 11月 06, 2008
Initrd
Initrd 筆記:
2.6 kernel 下有新式的 Initrd 作法,目前看到Fedora 下Initrd 都是用這種
2.6 kernel 下有新式的 Initrd 作法,目前看到Fedora 下Initrd 都是用這種
- 製作
bash# find . | cpio -c -o > ../initrd.img
bash# gzip ../initrd.img - 解開
cd /tmp/imagefile
gzip -cd /boot/imagefile.img | cpio -imd --quiet
- 製作
bash# dd if=/dev/zero of=../initrd.img bs=512k count=5
bash# mkfs.ext2 -F -m0 ../initrd.img
bash# mount -t ext2 -o loop ../initrd.img /mnt
bash# cp -r * /mnt
bash# umount /mnt
bash# gzip -9 ../initrd.img - 解開
mount -t ext2 -o loop ../initrd.img /mnt
- Fedora 裡面的initrd.img 解開後看到的init 裡面用的sh 是 /bin/nash,如果系統是自己包的這個要注意。
- /init 跟/linuxrc 的問題:
cpio 的做法會去找 /init. 沒有這個檔就會出一堆怪問題,root fs type 錯,找不到root 之類的.要確定 init 的權限、內容。 舊式的會先跑 /linuxrc 不過這要看kernel內有沒改過,追kernel才比較清楚. - 至於 kernel parameter 可以不用傳 root=/dev/ram0 可以省略了.
- busybox build 完記得 ldd busybox,缺的Library 要放入/lib,不然就是用uClibc build成static。
標籤:
【Programming】
星期四, 10月 23, 2008
SystemC注意事項
限定用法
- Interface:
- sc_fifo_in_if, sc_fifo_out_if
- Channel:
- sc_fifo
- Port:
- sc_port
標籤:
【學校、課業、論文】
Kdesvn ssh+svn 不用一直輸入密碼的方法
首先先確認 Server(注意是Server) 上的幾件事
- /home/user mode 不能是 777 , 最少要755
- /home/user/.ssh 設 700
- /home/user/.ssh/authorized_keys 設600 (這個檔沒有沒關係, 等等會產生, 要注意).
- ssh-keygen -> Enter -> Enter .... 不用管一直按就對了.
- ssh-keygen -t dsa -> Enter -> Enter .... 不用管一直按就對了.
- 把產生id_dsa.pub id_rsa id_dsa copy 到你要連的 Server /home/user/.ssh/.
- 到Server上 cat id_dsa.pub >> authorized_keys (/home/user/.ssh/目錄下).
- 確認Server端檔案權限.
標籤:
【Linux 應用】
訂閱:
文章 (Atom)