2010年6月20日 星期日

Linux source code 目錄樹結構


Linux用來支持各種體系結構的源代碼包含大約4500個C語言程序,存放在270個左右的子目錄下,總共大約包含200萬行代碼,大概佔用58MB磁 盤空間。

源代碼所有在目錄:/usr/src/linux (大部分linux發行版本中)

init 內核初始化代碼
kernel 內核核心部分:進程、定時、程序執行、信號、模塊。 。 。
mm 內存處理
arch 平台相關代碼
    i386 IBM的PC體系結構
       kernel 內核核心部分
       mm 內存管理
       math-emu 浮點單元軟件仿真
       lib 硬件相關工具函數
       boot 引導程序
          compressed 壓縮內核處理
          tools 生成壓縮內核映像的程序
    alpha 康柏的Alpha體系結構
    s390 IBM的System/390體系結構
    sparc Sun的SPARC體系結構
   sparc64 Sun的Ultra-SPARC體系結構
    mips SGI的MIPS體系結構
    ppc Motorola-IBM的基於PowerPC的體系結構
    m68k Motorola的基於MC680x0的體系結構
    arm 基於ARM處理器的體系結構
fs 文件系統
    proc /proc虛擬文件系統
    devpts /dev/pts虛擬文件系統
    ext2 Linux本地的Ext2文件系統
    isofs ISO9660文件系統(CD-ROM)
    nfs 網絡文件系統(NFS)
    nfsd 集成的網絡文件系統服務器
    fat 基於FAT的文件系統的通用代碼
    msdos 微軟的MS-DOS文件系統
    vfat 微軟的Windows文件系統(VFAT)
    nls 本地語言支持
    ntfs 微軟的Windows NT文件系統
    smbfs 微軟的Windows服務器消息塊(SMB)文件系統
    umsdos UMSDOS文件系統
    minix MINIX文件系統
    hpfs IBM的OS/2文件系統
    sysv SystemV、SCO、Xenix、Coherent和Version7文件系統
    ncpfs Novell的Netware核心協議(NCP0
    ufs UnixBSD、SunOs、FreeBSD、NetBSD、OpenBSD和NeXTStep文件系統
    affs Amiga的快速文件系統(FFS)
    coda Coda網絡文件系統
    hfs 蘋果的Macintosh文件系統
    adfs Acorn磁盤填充文件系統
    efs SGI IRIX的EFS文件系統
    qnx4 QNX4 OS使用不的文件系統
    romfs 只讀小文件系統
    autofs 目錄自動裝載程序的支持
    lockd 遠程文件鎖定的支持
Net 網絡代碼
Ipc System V的進程間通信
Drivers 設備驅動程序
    block 塊設備驅動程序
       paride 從並口訪問IDE設備的支持
    scsi SCSI設備驅動程序
    char 字符設備驅動程序
       joystick 遊戲桿
       ftape 磁帶流設備
       hfmodem 無線電設備
       ip2 IntelliPort的多端口串行控制器
    net 網卡設備
    sound 音頻卡設備
    video 視頻卡設備
    cdrom 專用CD-ROM設備(除ATAPI和SCSI之外)
    isd0n ISDN設備
    apl000 富士的AP1000設備
    macintosh 蘋果的Macintosh設備
    sgi SGI的設備
    fc4 光纖設備
    acorn Acorn的設備
    misc 雜項設備
    pnp 即插即用的支持
    usb 通用串行總線(USB)的支持
    pci PCI總線的支持
    sbus Sun的SPARC SBus的支持
    nubus 蘋果的Macintosh Nubus的支持
    zorro Amiga的Zorro總線的支持
    dio 惠普的HP300 DIO總線的支持
    tc Sun的TurboChannel支持(尚未完成)
Lib 通用內核函數
Include 頭文件(.h)
    linux 內核核心部分
       lockd 遠程文件加鎖
       nfsd 集成的網絡文件服務器
       sunrpc Sun的遠程過程調用
       byteorder 字節交換函數
       modules 模塊支持
    asm-generic 平台無關低級頭文件
    asm-i386 IBM的PC體系結構
    asm-alpha 康柏的Alpha體系結構
    asm-mips SGI的MIPS體系結構
    asm-m68k Motorola-IBM的基於PowerPC的體系結構
    asm-ppc Motorola-IBM的PowerPC體系結構
    asm-s390 IBM的System/390體系結構
    asm-sparc Sun的SPARC體系結構
    asm-sparc64 Sun的Ultra-SPARC體系結構
    asm-arm 基於ARM處理器的體系結構
    net 網絡
    scsi SCSI支持
    video 視頻卡支持
    config 定義內核配置的宏所在的頭文件
scripts 生成內核映像的外部程序
Documentation有關內核各個部分的通用解釋和註釋的文本文件

參考資料:《UNDERSTANDING THE LINUX KERNEL》 DANIEL P.BOVET & MARCO CESATI 著  (by huihoo.com Allen)

2010年6月18日 星期五

IPv6 Tunnel Broker


Tunnel Broker(以下簡稱TB)是通道代理人的意思,IPv4/IPv6 雙堆疊Client主機可藉由它的協助,透過 IPv4 網路與 IPv6 網路中的節點進行網路通訊。其主要原理是在TB及Client之間,利用IPv4網路建立起一條虛擬的隧道(Tunnel),將IPv6的封包封裝在IPv4封包裡面傳送,類似目前常見的IP Sec VPN應用。由於TB是利用IPv4網路來建立tunnel,因此使用本服務時,必須先確認可正常連上IPv4網路。
HiNet將採用的TB設備為Hexago Gateway6,必須搭配其專屬的Hexago Client軟體(Gateway6 Client Utility)才能運作,目前僅提供支援WinXP及Vista作業系統的Client軟體。本軟體將會使用到TCP/UDP port number 3653及IP protocol number 41,若有安裝防火牆,請更新安全管控原則才能使用。操作使用過程示意如下:








軟體下載及安裝說明

2010年6月7日 星期一

To slove that make menuconfig doesn't work in Fedora 12

執行時出現下列錯誤

HOSTCC  scripts/kconfig/lxdialog/checklist.o
在包含自 scripts/kconfig/lxdialog/checklist.c:24 的檔案中:
scripts/kconfig/lxdialog/dialog.h:32:20: 錯誤:curses.h:沒有此一檔案或目錄


解決方法:

Doing "yum install ncurses-devel" to fix this problem

2010年6月4日 星期五

screenrc 的風格




第一種

caption always "%{= wk} %{= KY} [%n]%t @ %H %{-} %= %{= KR} %l %{-} | %{= KG} %Y-%m-%d %{-} "
hardstatus alwayslastline " %-Lw%{= Bw}%n%f %t%{-}%+Lw %=| %0c:%s "

 

第二種

caption always "%{=u .G} %-w%<%{=ub .y}%n %t%{=u .G}%+w "
hardstatus alwaysignore
hardstatus alwayslastline "%{= .K} [%l]%<%=%{= .W}@%H %=%{= .y} %Y/%m/%d%{= .m} %0c:%s "


第三種

caption always "%{=u .G} %-w%<%{=ub .y}%n %t%{=u .G}%+w "
hardstatus alwaysignore
hardstatus alwayslastline "%{= .K} [%l]%<%=%{= .W}@%H %=%{= .y} %Y/%m/%d%{= .m} %C %A"


第四種

caption always "%{=u .G} %-w%<%{=ub .y}%n %t%{=u .G}%+w "
#hardstatus alwayslastline "%{= wk} %{by} %H %{wk} | %-Lw%{kw}◣%{= g}%n%f* %t%{wk}◤%{wk}%+Lw%< %= %{kw}◣%{= R} [%m/%d %c] %{-}"





2010年6月2日 星期三

How to delimit TR069,OAM and OMCI


What is TR069?
TR069 is a protocol number define by DSL forum (www.broadband-forum.com). The protocol name is CPE WAN Management Protocol. The CPE WAN Management Protocol defines a mechanism that encompasses secure auto-configuration of a CPE, and also incorporates other CPE management functions into a common framework.
The CPE WAN Management Protocol is intended to support a variety of functionalities to manage a collection of CPE, including the following primary capabilities:
a)Auto-configuration and dynamic service provisioning
b)Software/firmware image management
c)Status and performance monitoring
d)Diagnostics
There are a lot of protocols related to TR069. For example:
Number
Describe
Date
TR-069 Amendment 2
CPE WAN Management Protocol v1.1
December 2007
TR-098 Amendment 1
Internet Gateway Device Data Model for TR-069
December 2006
TR-104
DSLHomeTM Provisioning Parameters for VoIP CPE
September 2005
TR-111
DSLHomeTMApplying TR-069 to Remote Management of Home Networking Devices
December 2005
TR-142
Framework for TR-069 enabled PON devices
March 2008
What is OAM?
OAM is Operations, Administration, and Maintenance.
Chapter 57 of 802.3ah defines the Operations, Administration, and Maintenance (OAM) sublayer, which provides mechanisms useful for monitoring link operation such as remote fault indication and remote loopback control. In general, OAM provides network operators the ability to monitor the health of the network and quickly determine the location of failing links or fault conditions. The OAM described in this clause provides data link layer mechanisms that complement applications that may reside in higher layers.
This subclause provides details and functional requirements for the OAM objectives:
a) Remote Failure Indication
1) A mechanism is provided to indicate to a peer that the receive path of the local DTE is nonoperational.
2) Physical layer devices using Clause 66 may support unidirectional operation that allows OAM
remote failure indication during fault conditions.
3) Subscriber access physical layer devices using Clause 65 support unidirectional operation in
the direction from OLT to ONU that allows OAM remote failure indication from OLT during fault conditions.
4) Physical layer devices other than those listed above do not support unidirectional operation allowing OAM remote failure indication during fault conditions. Some physical layer devices have specific remote failure signaling mechanisms in the physical layer.
b) Remote Loopback
A mechanism is provided to support a data link layer frame-level loopback mode.
c) Link Monitoring
1) A mechanism is provided to support event notification that permits the inclusion of diagnostic information.
2) A mechanism is provided to support polling of any variable in the Clause 30 MIB.
d) Miscellaneous
1) Implementation and activation of OAM is optional.
2) A mechanism is provided that performs OAM capability discovery.
3) An extension mechanism is provided and made available for higher layer management applications.
Note:The 802.3ah standard only describes some OAM capabilities on the link layer, and no provisioning capabilities to configure other CPE features.
What is OMCI?
OMCI is ONT Management and Control Interface.
The OMCI is used by the OLT to control an ONT. This protocol allows the OLT to:
a) establish and release connections across the ONT;
b) manage the UNIs at the ONT;
c) request configuration information and performance statistics;
d) autonomously inform the system operator of events such as link failures.
The OMCI protocol runs across either an ATM or GEM connection between the OLT controller and the ONT controller that is established at ONT initialization. The OMCI protocol is asymmetric: the controller in the OLT is the master and the one in the ONT is the slave. A single OLT controller using multiple instances of the protocol over separate control channels may control multiple ONTs.
The ONT management and control interface requirements given in this Recommendation are needed to manage the ONT in the following areas:
a) configuration management;
b) fault management;
c) performance management;
d) security management.
Note: G.984.4 OMCI does specify quite extensive provisioning capabilities.
TR142 -------TR069, OAM and OMCI
First we explain what are TR069, OAM and OMCI. They have lot of capabilities and someone maybe overlap another one. How to delimit them? TR142 define some clauses for delimit TR069, OAM and OMCI.
In broad terms, layer 3 auto-configuration is the same for a PON ONT as for a DSL BNT. A PON ONT can be assigned an IP address via DHCP, IPCP, or static IP addressing. The main difference between the PON ONT and the DSL B-NT configuration and management is in the link layer.
There is quite a big difference between OMCI capabilities and 802.3ah. Briefly, the 802.3ah standard only describes some OAM capabilities on the link layer, and no provisioning capabilities to configure other CPE features. In contrast OMCI does specify quite extensive provisioning capabilities, including management of services such as voice services, circuit emulation services, etc.
OAM
OMCI
For the configuration and management of the PON ONT, PLOAM messages, OMCI and 802.3ah still play the role for which they were designed. The TR-069 protocol (CPE WAN Management Protocol) can complement OMCI (and related protocols) for the configuration and management of subscriber services, meaning services for layer3 and above. TR-069 can also overlap OMCI (and related protocols) in the configuration and management of the PON ONT itself. TR-069 is moreover used for the configuration and management of other customer premises devices (STB, VoIP, network storage elements…) as explained in TR-106. Note that it is not in the goal of this Technical Report to define a clear delimitation on the roles of OMCI and TR-069, as this is implementation-specific.
reference documentation
TR-142:Framework for TR-069 enabled PON devices
TR-069:CPE WAN Management Protocol
G.984.4
802.3ah

How to repair and clone disk with ddrescue

  ddrescue  is a tool that can be used to repair and clone disks on a  Linux system . This includes hard drives, partitions, DVD discs, flas...