Add device driver (uio_ivshmem.ko) on guest
来源:互联网 发布:structure软件说明 编辑:程序博客网 时间:2024/05/22 17:06
1 start guest
sudo /etc/init.d/networking restartsudo qemu-system-x86_64 -m 1204 -hda /home/xzl/virtual_machine/ubuntu-12.04-amd64-test.img -localtime -net nic,vlan=0,macaddr=52-54-00-12-34-2,model=virtio -net tap,vlan=0,ifname=tap2,script=no -boot c -smp 2 -chardev socket,path=/tmp/ivshmem_socket,id=foo -device ivshmem,chardev=foo,size=256
2 make and make install driver kernel modules on VM
cd Nahanni/kernel_module/uio/make make install
Makefile for driver kernel modules
# obj-m is a list of what kernel modules to build. The .o and other# objects will be automatically built from the corresponding .c file -# no need to list the source files explicitly.obj-m := uio_ivshmem.o # KDIR is the location of the kernel source. The current standard is# to link to the associated source tree from the directory containing# the compiled modules.KDIR := /lib/modules/$(shell uname -r)/build# PWD is the current working directory and the location of our module# source files.PWD := $(shell pwd)# default is the default make target. The rule here says to run make# with a working directory of the directory containing the kernel# source and compile only the modules in the PWD (local) directory.default: $(MAKE) -C $(KDIR) M=$(PWD) modulesinstall: cp uio_ivshmem.ko /lib/modules/$(shell uname -r)/kernel/drivers/uio/clean: rm -f *.ko *.o uio_ivshmem.mod.c Module.symvers
make install == "cp uio_ivhshmem.ko /lib/modules/$(shell uname -r)/kernel/driver/uio/"
3 install driver kernel modules
cd /lib/modules/3.5.0-23-generic/kernel/drivers/uio/sudo insmod uio.kosudo insmod uio_ivshmem.ko
4 verification
ls /dev/uio*
you will see
/dev/uio0
or
ls /sys/bus/pci/drivers
agpgart-intel ahci ata_generic ehci_hcd ioapic ohci_hcd pata_acpi pcieport serial uhci_hcd virtio-pci xhci_hcdagpgart-via asiliantfb ata_piix imsttfb langwell_gpio parport_pc pata_sis piix4_smbus tsi721 uio_ivshmem xen-platform-pcii
you can find uio_ivshmem in /sys/pci/drivers
or
ls /sys/bus/pci/devices/0000\:00\:04.0/driver/module/drivers/
you also can find uio_ivshmem
pci:uio_ivshmem
0000:00:04.0 is the busID of ivshmem device
you can fetch the busID through "lspci"
5 problems
It is failed to load the uio_ivshmem driver modules at boot time when I edit the /etc/modules adding lines uio and uio_ivshmem
I can't figure out the reason.
- Add device driver (uio_ivshmem.ko) on guest
- linux device driver .ko module Makefile 模板
- Device Driver
- host application or driver claiming the device on macosx
- RHEL(CENTOS)6.3/6.4/6.5 guest on VMware prints "UNSUPPORTED HARDWARE DEVICE: CPU"
- add new LAN8710 and LAN8720 device ids to smsc phy driver
- Linux Device Driver: char device
- linux device driver
- Delete usb Device Driver
- BASIC DEVICE DRIVER
- BASIC TDI DEVICE DRIVER
- BASIC TDI DEVICE DRIVER
- BASIC DEVICE DRIVER
- Solaris device driver
- Audio Device Driver
- Linux device driver
- platform device driver
- Linux device driver
- Android Conversion to Dalvik format failed: Unable to execute dex: Target out of range: +0000fffa
- void及void指针含义的深刻解析
- 联想笔记本&台式机专用系统 GHOSTXPSP3 v2013.06 海量驱动DVD版
- 关于政府网站群安全性的几点见解
- iOS7初体验(1)——第一个应用程序HelloWorld
- Add device driver (uio_ivshmem.ko) on guest
- 【装机首选】惠普笔记本&台式机专用系统 GHOSTXPSP3 v2013.06 海驱版
- 环境变量立即生效
- 手机开发之四:后记和参考文档
- 一些 SQL 语句
- 下拉菜单--一体显示下拉菜单
- Aandroid NDK开发之串口控制
- 使用Nginx的X-Accel-Redirect实现大文件下载
- 4、创建产品分类的业务类并重写删除方法