Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2353405
  • 博文数量: 141
  • 博客积分: 3552
  • 博客等级: 中校
  • 技术积分: 4148
  • 用 户 组: 普通用户
  • 注册时间: 2009-07-15 14:39
个人简介

熟悉Linux下程序设计及各种应用程序 熟悉C Language 熟悉Glusterfs、FFmpeg、CDN 系统设计,计算机图形系统设计、分布式程序设计 目前主要研究方向:流媒体

文章分类

全部博文(141)

分类: LINUX

2009-09-20 18:32:15

858 gdb ./vmlinux
  859 target remote localhost:1234
  860 gdbserver 1234
  861 yum install gdbserver
  862 gdb vmlinux
  863 gdb vmlinux
  864 gdb vmlinux
  865 vi .config
  866 vi .config
  867 make menuconfig
  868 vi .config
  869 make
  870 gdb vmlinux
  871 make menuconfig
  872 vi .config
  873 vi .config
  874 make
  875 vi .config
  876 make
  877 gdb vmlinux
  878 poweroff;exit
  879 cd /opt/linux-2.6/
  880 ls
  881 git pull
  882 cd /opt/
  883 ls
  884 cd /qemu/
  885 ls
  886 history |grep qemu
  887 qemu --help
  888 qemu --kernel linux-0.2.img
  889 qemu --kernel linux-0.2.img
  890 qemu -hda linux-0.2.img
  891 qemu -hda linux-0.2.img
  892 qemu -hda linux-0.2.img
  893 qemu --kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda linux-0.2.img
  894 qemu --kernel /opt/linux-2.6/arch/x86/boot/bzImage --initrd initrd.img.gz -hda linux-0.2.img
  895 qemu --kernel /opt/linux-2.6/arch/x86/boot/bzImage --initrd initrd.img.gz
  896 qemu --kernel linux-0.2.img
  897 qemu -hda linux-0.2.img
  898 qemu -hda linux-0.2.img
  899 qemu -hda linux-0.2.img
  900 qemu -hda linux-0.2.img -net nic
  901 qemu -hda linux-0.2.img -net user
  902 qemu -hda linux-0.2.img -net nice,bridge
  903 qemu -hda linux-0.2.img -net nice,mode=bridge
  904 qemu -hda linux-0.2.img -net nic,mode=bridge
  905 qemu -hda linux-0.2.img -user-net
  906 qemu -hda linux-0.2.img -net user
  907 qemu -hda linux-0.2.img -net nic -net tap,ifname=tap0,script=/etc/qemu-ifup
  908 ifconfig
  909 qemu -hda linux-0.2.img -net nic -net tun,ifname=tap0,script=/etc/qemu-ifup
  910 qemu -hda linux-0.2.img -net nic -net /dev/net/tun,ifname=tap0,script=/etc/qemu-ifup
  911 vi /dev/net/tun
  912 ll /dev/net/tun
  913 vi /etc/qemu-ifup
  914 qemu -hda linux-0.2.img -net nic -net tap,ifname=tap0,script=/etc/qemu-ifup
  915 qemu -hda linux-0.2.img -net nic -net tap,ifname=tap0,script=/etc/qemu-ifup
  916 modprobe tun
  917 qemu -hda linux-0.2.img -net nic -net tap,ifname=tap0,script=/etc/qemu-ifup
  918 ifconfig
  919 qemu -hda linux-0.2.img -net nic,macaddr=00:00:00:00:00:04 -net user
  920 qemu --kernel /opt/linux-2.6/arch/x86/boot/bzImage --initrd initrd.img.gz
  921 qemu -hda linux-0.2.img -net nic -net tap,ifname=tap0,script=/etc/qemu-ifup
  922 qemu -hda linux-0.2.img -net nic -net tap,ifname=tap0,script=/etc/qemu-ifup qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda linux-0.2.img -append "root/dev/hda"
  923 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda linux-0.2.img -append "root/dev/hda"
  924 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -sda linux-0.2.img -append "root/dev/hda"
  925 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda linux-0.2.img -append "root/dev/hda"
  926 cd
  927 ls
  928 cp /home/liuqi/busybox-initramfs-dist.tar.bz2 .
  929 tarjxvf busybox-initramfs-dist.tar.bz2
  930 tar jxvf busybox-initramfs-dist.tar.bz2
  931 ls
  932 ls busybox-initramfs
  933 ls
  934 yum install bridge-utils uml-utilities vtun
  935 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero
  936 yum install bridge-utils uml-utilities vtun
  937 modprobe tun
  938 /etc/init.d/vtun start
  939 chmod a+rw /dev/net/tun
  940 brctl addbr br0
  941 ifconfig br0 192.168.99.1 netmask 255.255.255.0 up
  942 for ((i=0; i < NUM_OF_DEVICES ; i++)); do echo -n "Setting up "; tunctl -b -u $USERID -t qtap$i; brctl addif br0 qtap$i; ifconfig qtap$i up 0.0.0.0 promisc; done
  943 /etc/init.d/vtund start
  944 /etc/init.d/kvm-network stop
  945 ifconfig
  946 ifconfig br0 192.168.1.198 netmask 255.255.255.0 up
  947 qemu -kernel arch/i386/boot/bzImage -hda /dev/zero -net nic -net tap,ifname=qtap0,script=no
  948 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tap,ifname=qtap0,script=no
  949 ifconfig br0 192.168.99.1 netmask 255.255.255.0 u
  950 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tap,ifname=qtap0,script=no
  951 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tap,ifname=qtap0,script=no
  952 lsmod |grep tun
  953 ls -l /dev/net/tun
  954 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tap
  955 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tun
  956 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tap,ifname=qtap0,script=no
  957 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tap,ifname=qtap0,script=/etc/qemu-ifup
  958 vi /etc/qemu-ifup:
  959 vi /etc/qemu-ifup
  960 vi /etc/qemu-ifup
  961 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tap,ifname=qtap0,script=/etc/qemu-ifup
  962 vi /etc/qemu-ifup
  963 chmod 777 /etc/qemu-ifup
  964 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tap,ifname=qtap0,script=/etc/qemu-ifup
  965 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tap,ifname=qtap0,script=no
  966 /etc/init.d/kvm-network stop
  967 chmod 777 /etc/init.d/kvm-network
  968 /etc/init.d/kvm-network stop
  969 ls /lib/modules/`uname -r`/kernel/drivers/net/tun.ko
  970 /etc/init.d/kvm-network start
  971 yum install tunctl
  972 /etc/init.d/kvm-network start
  973 yum install vtun
  974 vtund
  975 vi /etc/init.d/kvm-network
  976 /etc/init.d/kvm-network start
  977 ifconfig
  978 /etc/init.d/kvm-network stop
  979 vi /etc/init.d/kvm-network
  980 /etc/init.d/kvm-network stop
  981 /etc/init.d/kvm-network start
  982 ifconfig
  983 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tap,ifname=qtap0,script=no
  984 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tap,ifname=qtap0,script=no -serial "stdio" -serial "pty" -append '$console kgdbwait kgdboc=ttyS1'
  985 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tap,ifname=qtap0,script=no -S
  986 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tap,ifname=qtap0,script=no -S
  987 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tap,ifname=qtap0,script=no -serial "stdio" -serial "pty" -append
  988 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tap,ifname=qtap0,script=no -serial "stdio" -serial "pty"
  989 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tap,ifname=qtap0,script=no -S
  990 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tap,ifname=qtap0,script=no -S
  991 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tap,ifname=qtap0,script=no -S
  992 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tap,ifname=qtap0,script=no -S
  993 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tap,ifname=qtap0,script=no -S
  994 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tap,ifname=qtap0,script=no -S
  995 qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -net nic -net tap,ifname=qtap0,script=no -S
  996 service network restart
  997 ls
  998 history
[root@localhost liuqi]# cat /etc/init.d/vtund
#!/bin/sh
#
# vtund     Startup script for the virtual tunnel daemon
#
# chkconfig: - 55 45
# description: Virtual Tunnel Daemon provides the facility to create \
# virtual tunnels over TCP/IP networks and allows for \
# shaping, compression, and encryption of tunneled traffic.

### BEGIN INIT INFO
# Provides:
# Required-Start:
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start:
# Default-Stop:
# Short-Description:
# Description:
### END INIT INFO

# Source function library.
. /etc/rc.d/init.d/functions

exec="/usr/sbin/vtund"
prog="vtund"
config="/etc/vtund.conf"

[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog

lockfile=/var/lock/subsys/$prog

start() {
    [ -x $exec ] || exit 5
    [ -f $config ] || exit 6
    echo -n $"Starting $prog: "
    daemon $exec -s
    retval=$?
    echo
    [ $retval -eq 0 ] && touch $lockfile
    return $retval
}

stop() {
    echo -n $"Stopping $prog: "
    killproc $prog
    retval=$?
    echo
    [ $retval -eq 0 ] && rm -f $lockfile
    return $retval
}

restart() {
    stop
    start
}

reload() {
    echo -n $"Reloading config for $prog: "
    killproc $prog -HUP
    retval=$?
    echo
    return $retval
}

force_reload() {
    restart
}

rh_status() {
    # run checks to determine if the service is running or use generic status
    status $prog
}

rh_status_q() {
    rh_status >/dev/null 2>&1
}


case "$1" in
    start)
        rh_status_q && exit 0
        $1
        ;;
    stop)
        rh_status_q || exit 0
        $1
        ;;
    restart)
        $1
        ;;
    reload)
        rh_status_q || exit 7
        $1
        ;;
    force-reload)
        force_reload
        ;;
    status)
        rh_status
        ;;
    condrestart|try-restart)
        rh_status_q || exit 0
        restart
        ;;
    *)
        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
        exit 2
esac
exit $?
[root@localhost liuqi]# cat /etc/init.d/kvm-network
#!/bin/bash
# id of the user running qemu (kvm). Make sure you change it appropriately.
USERID=1000

# number of TUN/TAP devices to setup
NUM_OF_DEVICES=1

case $1 in
start)
        modprobe tun
        /etc/init.d/vtund start
        chmod a+rw /dev/net/tun
        echo -n "Setting up bridge device br0"
        brctl addbr br0
        ifconfig br0 192.168.99.1 netmask 255.255.255.0 up
        for ((i=0; i < NUM_OF_DEVICES ; i++)); do
                echo -n "Setting up "
                tunctl -b -u $USERID -t qtap$i
                brctl addif br0 qtap$i
                ifconfig qtap$i up 0.0.0.0 promisc
        done
        ;;
stop)
        for ((i=0; i < NUM_OF_DEVICES ; i++)); do
                ifconfig qtap$i down
                brctl delif br0 qtap$i
                tunctl -d qtap$i
        done
        ifconfig br0 down
        brctl delbr br0
        /etc/init.d/vtund stop
        ;;
*)
        echo "Usage: $(basename $0) (start|stop)"
        ;;
esac

[root@localhost liuqi]#

阅读(4901) | 评论(4) | 转发(1) |
0

上一篇:objcopy用法

下一篇:内核线程创建

给主人留下些什么吧!~~

2012-03-21 15:24:11

请教一个问题,我的QEMU是自己下载源码,然后编译完成后。使用如下命令:
./qemu-system-arm -kernel arm-test/zImage.integrator -initrd arm-test/arm_root.img  
发现kernel是可以正常启动的,但是这个arm-test里面的东西都是从官网上下载的。如果要跑我自己编译的kernel 源代码,这个initrd和kernel image该如何制作,请教了。

T-Bagwell2011-12-03 11:09:26

unbutun: 楼主有在xp下用过吗?最近装了个manager版的,装fc10 ubuntu11.04啥的都有问题,不知你是否遇到过?.....
木有遇到过呀,一般是在Linux下玩

unbutun2011-11-18 20:26:19

楼主有在xp下用过吗?最近装了个manager版的,装fc10 ubuntu11.04啥的都有问题,不知你是否遇到过?

T-bagwell2009-11-03 18:07:45

qemu -kernel /opt/linux-2.6/arch/x86/boot/bzImage -hda /dev/zero -S