Wednesday, June 3, 2015

GSoC: Update kernel on qemu virtual machine with bochs and Set up the Github repo

1.Update kernel on qemu virtual machine with bochs

The origin kernel version is 3.2.0, and I am working on airlied's repo:
  git://anongit.freedesktop.org/drm-intel

I don't change kernel very often, usually when a new Linux distribution(e.g. Ubuntu 15.04) is out, I will download that and set up a new Virtual Machine, not smart and nothing to do with kernel update. After days of google and trying, finally I set up the new kernel, which is 4.0.0-rc4+.

Following is what I do setting up the new kernel:
  I compile the linux source code on the host machine(even though it is a VMware VM, compile on it is far more quicker than compile on the qemu VM, which is running on the host VMware VM).
  Working dir is ~/work
  • use the kernel config of host VM(same as the qemu VM)
   #cp /boot/config-3.2.0-4-amd64 ~/work/linux/.config
  • select 'M' for Bochs and Cirrus driver
   #make menuconfig
  • compile and install (This takes the longest time)
   #make bzImage
   #make modules
   #make modules_install
   #make install

  After these operations, we got the following files(or directory) install in the host VM:
   /lib/modules/4.0.0-rc4+/
   /boot/initrd.img-4.0.0-rc4+
   /boot/System.map-4.0.0-rc4+
   /boot/vmlinuz-4.0.0-rc4+
  These are what we need to set up the new kernel for the qemu VM, we compress them in a single file and scp it from the host to qemu VM, decompress it and put them in the right places(same as the host).
  We still need some other operations:
   #cd /lib/modules/4.0.0-rc4+/
   #depmod -a -v 4.0.0-rc4+
  and update the grup menuentry:
   #update-grub 

Ok, now reboot, choose the newly installed kernel entry, it works! 

And check the kernel version:
   #uname -r
  I got 4.0.0-rc4+
check the modules running on the qemu virtual machine:
   #lsmod
  got the following modules related to bochs:
   bochs_drm
   ttm
   drm_kms_helper
   drm
   i2c_core
   syscopyarea
   sysfillrect
   sysimgblt
   
And then I checked if there was any error in dmesg, got the following warning:

[  302.072360] ------------[ cut here ]------------
[  302.076145] WARNING: CPU: 0 PID: 2907 at drivers/gpu/drm/ttm/ttm_bo_vm.c:265 ttm_bo_vm_open+0x34/0x3b [ttm]()
[  302.076465] Modules linked in: rfcomm bnep bluetooth rfkill uinput nfsd auth_rpcgss oid_registry nfs_acl nfs lockd grace fscache sunrpc loop bochs_drm ttm drm_kms_helper drm kvm_amd kvm psmouse i2c_core evdev syscopyarea sysfillrect pcspkr serio_raw sysimgblt ext4 crc16 jbd2 mbcache sg sr_mod cdrom sd_mod ata_generic ata_piix e1000 libata scsi_mod
[  302.077427] CPU: 0 PID: 2907 Comm: Xorg Not tainted 4.0.0-rc4+ #1
[  302.077458] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2007
[  302.077647]  0000000000000000 0000000000000009 ffffffff813b526d 0000000000000000
[  302.077698]  ffffffff8103e8c3 00000000810f6832 ffffffffa021df5a ffff880027100400
[  302.077724]  ffff88001ae5c800 ffff880027100400 ffff88002f87c3b0 ffff88002f8b50c0
[  302.077778] Call Trace:
[  302.078839]  [<ffffffff813b526d>] ? dump_stack+0x40/0x50
[  302.078946]  [<ffffffff8103e8c3>] ? warn_slowpath_common+0x98/0xb0
[  302.079076]  [<ffffffffa021df5a>] ? ttm_bo_vm_open+0x34/0x3b [ttm]
[  302.079117]  [<ffffffffa021df5a>] ? ttm_bo_vm_open+0x34/0x3b [ttm]
[  302.079146]  [<ffffffff8103d242>] ? copy_process.part.32+0xbe0/0x1689
[  302.079175]  [<ffffffff8111caae>] ? get_empty_filp+0xef/0x174
[  302.079201]  [<ffffffff8103de35>] ? do_fork+0xb4/0x25e
[  302.079230]  [<ffffffff813b960d>] ? stub_clone+0x6d/0x90
[  302.079255]  [<ffffffff813b9332>] ? system_call_fastpath+0x12/0x17
[  302.079435] ---[ end trace d4b7cc30b85ed796 ]---

I am not sure if this warining is fatal, post it here just for later compare with the bochs driver after converting to atomic mode-setting.

2.Set up the Github repo

Firstly create a new empty repository on github, then you got the repo's url:
  https://github.com/zhjwpku/gsoc.git

Since currently my origin is airlied's, I changed it by:
  #git remote rename origin airlied
Then I add some remotes:
  #git remote add origin https://github.com/zhjwpku/gsoc.git
  #git push
  #git remote add drm-intel git://anongit.freedesktop.org/drm-intel

Finish setting up the github repo.

No comments:

Post a Comment