2007年12月31日 星期一

how to update gentoo

1. emerge --sync
2. emerge -uND world
3. emerge --depclean
To clean no use package.
4. revdep -rebuild
To re-compile packages which dynamic linking should be updated.
Loop this step until there are no warnings.

2007年12月20日 星期四

tun


猜測tun應該是這樣讓userspace 的程式可以跟kernel溝通,qemu的程式碼很漂亮...........

2007年11月28日 星期三

ebooks

It's amazing to discover this web which offers many ebooks:
http://www.gutenberg.org/wiki/Main_Page

2007年9月28日 星期五

2007年9月22日 星期六

lab重新佈網路線

因為大章魚先生想把實驗室網路全換成內部可跑1G的,就開始了昨天勞累的一天的工作><"

使用資源:
Amp的cat 5e 線(精準度很高,是很棒的線)
Amp的頭 probest的線 (用料實在,但太粗很難壓)
壓條們
鋼釘
標籤套
鋸子

總共拉24條線,最難的是固定壓條,敲敲打打的,真是累了學弟跟大章魚. 為了節省成本,每條線的編碼是以A,B,0,1編碼, 分別為AA000,AA001,AA011,AA100,AA110,AA111以此類推,使得0跟1的用量一樣. AMP 頭,一個要5元以上

最可怕的釘壓條,還好弄完還滿專業的


AMP線





D-Link DGS-1224T

2007年9月2日 星期日

qemu+minix+bridge+pppoe

在家裡的電腦要透過pppoe上網,無奈minix沒有pppoe,所以當在qemu裏面的minix要透過bridge上網時就要外部有個已撥好pppoe且有架DHCP的server才行.

是不是真的需要另一台server呢?其實不用,用host os就可以了,host os 撥上pppoe後再開啟DHCP,
就會分給tap1 ip了. 為什麼會這樣呢?因為dhcp server 會在br0那邊聽,當tap1送出dhcp request, dhcp server 就會聽到拉!!

2007年8月12日 星期日

note1-interrupt

interrupt是由IC i8259提供, 當irq進來時, 需要irq_handler接序動作, minix3把這個寫在gate_table裏面, 原本應當是如此就可以結束. 但因minix3把所有在gate_table的irq_handler寫成同一個function, 再由傳入的參數(即irq的值)決定call到哪個irq_handler, 因此就在i8259.c內多了一個註冊irq_handler的程式: put_irq_handler, 此function主要有個 array指向所有irq的function, 如果同一個irq有數個handlers, 則以link list連接.
在clock, system裏面用的stack是在程式內定義好的一段區域 k_stktop, 把k_stktop load 到sp, 就可以把_restart填到stack裏面當return address, 所以每次interrupt結束都會跑restart那段程式, run next_ptr.

2007年7月25日 星期三

Thanks to My BIG Octopus

Today I have a "burst device".
What it can do? You can't figure out!!
Actually, it just a reset button on my desk for convenient. It is easy to reset my computer now.
When u must reset ur computer more than ten times a day. It will be necessary to have reset button on ur hand.

2007年7月21日 星期六

using serial port to debug on minix3

Surfing on minix news group, and I find it claim it has serial port output in kernel, but actually it is not complete.
UART, controller for controlling serial port ,game port and ...I didn;t got fimiliar with it.

Implemetation:
I write init_serialport(in kernel/kprintf.c) , it will be called in kernel main function if SERIAL_DEBUG is defined.
Then what kputc()(in kernel/kprintf.c) do is to write one char to register.

Thanks to
http://www.beyondlogic.org/serial/serial.htm#1

2007年7月20日 星期五

如何灌gentoo

1.設定網路
2.用fdisk分割好所要磁區(密切注意 要換type跟開機磁區)
3.用mkreiserfs和mkswap格式化磁區
4.mount到/mnt/gentoo
mount -t proc none /mnt/proc
swapon /dev/hda3
5.用link2 http://cdpa.linux.nsysu.edu.tw下載portage跟stage3
6.解stage3到/mnt/gentoo而 portage到/mnt/gentoo/usr下
7.編輯/mnt/gentoo/etc下面的文件(先不要chroot,因為chroot後沒有vim)
8.chroot 用emerge裝grub跟gentoo-sources(kernel)
9.編kernel(要選cpu跟硬碟,可用dmesg,還有支援的fs)
10.打grub....root(hd0,3)這是grub所在位置.....setup(hd0)裝再此硬碟第一個block
11.修改grub設定檔,要注意檔案在/boot下面 root (hd0,3)表示boot檔案的位置,以此為相對位置

2007年7月13日 星期五

以後不會買IBM的小no了

不知道其他地方售後服務怎樣,不過高雄實在不怎麼好,態度很好,技術很差.....
我把小黑送修,因為發現它過熱,風扇不怎麼轉,買不到兩年,不過是一年保的機種,維修要錢了。檢測完說要換整個散熱模組,他們也不想想,這整個模組除了風扇跟sensor會壞外,還有什麼東西會壞,竟然要整個換掉,要價NT$2310,我可以體諒他們的東西都是封在一起的,不能單獨換,但是既然拆了,為什麼不順便清一清了,連我全部都是新的螺絲回來全都變成舊的,誰會在那裡檢查螺絲><"
選擇不維修,回家後拆下來清,風扇就好了。
C小D最生氣的是,有個customer說升級完的BIOS有問題,問能不能替他回復到舊的BIOS,工程師竟然跟他說他們沒有做這樣的服務,因為弄不好主機板會壞掉.......><" 他是小學生吼......軟體去燒firmware遇中斷會有問題,但至少技術人員應該要有可以直接寫ROM的機器阿!!!!!最好是會壞拉!!!

他們的技術真的很差,聽說是外包,應該不會再買IBM了,除非發現其他地方維修不錯。

2007年6月30日 星期六

關於新source重編過後舊source重編還是爛的問題

問題:
只有重編servers的部份 ,沒有動到開機的image, 因為有改 Number of boot servers, 所以一定會爛,但重新編old source竟蓋不回來。

原因:
是由於在rs資料夾內的service這個command,當這個command爛掉後,偵測硬體時間的程式起不來,系統時間頓時變成1970年7月1日,使得make 對下的指令不如預期的去蓋掉會爛的的程式。

解決方式:
1.把爛掉的程式先移除,就可順利install->不好。
2.比較好的方式是把編完的程式touch成現在的時間,如此才不會造成檔案時間是錯的那個。

2007年6月19日 星期二

setup virtualbox for minix

Network is down in minix 3.1.2a when it is be installed in virtualbox. But it should work because the NIC of virtualbox is also AMD pcnet.

The template solution is:
1. set qemu_pci=1 in boot monitor, but what I do is to insert hard code to /usr/src/driver/pci/pci.c
2. comment line 631 in /usr/src/driver/lance.c ; it call assert(0), but I don;t know why assert(0) fails, but I think it;s not important. I don;t know why ec->linmem must be zero now, but what I need is network can work, and it does. So I don;t wanna to trace next codes.

what I learn in progress of solving this problem.
1. Linux has a good API in driver programming.
2.Minix's IPC make program more complicate, but u just trust on it, and focus on errors in lance driver.
3.Minix has command "service".
4.U must copy the execution file of driver to /usr/sbin, the Makefile in /usr/src/tools won;t do it for u.
5.virtualbox's chip id of NIC is 79C973, it's not easy to pronounce in Chinese. :)

2007年6月5日 星期二

getsysinfo(SI_MEM_ALLOC) to PM must transfer to VM

現在先將送到pm的訊息轉到vm,之後要改成直接送向vm

2007年5月10日 星期四

memory allocation of minix

設計:
用不同的slot裝不同段的memory

實作:
1.有一個free slot的array ,有不用的memory就要一個slot來放,形成一個hole list, 以
hole_head指向開頭
2.hole list用base address的大小排列,造成每次釋放memory的時間較要求memory久
3.memory分配是以first fit方式進行

2007年4月23日 星期一

simple svn server setup

1.configure file of svn server is in /etc/conf.d
a. SVNSERVE_OPTS="--root=repository_path" set ur repository path here
b. SVNSERVE_USER SVNSERVE_GROUP set server's user and group, special user and group is good for safety
2."svnadmin create repository_dir" can create repository
3.there are other configure files in repository_dir/conf
a. u can just use a passwd-db and not to specify an authz-db for no path-base access
b. edit username and password in passwd-db file
4.remember to change owner of repository_dir and start svnserve in /etc/init.d
5.u can initiate ur repository with "svn import"
6.then use "svn checkout" and "svn commit" to sent ur modified file