☰
×
◈ Introductions
◈ Linux Kernel Compilation
◈ Linux Kernel Debugging
◈ Linux Kernel APIs - I
◈ Linux Kernel APIS - II
◈ Linux Kernel APIS - III
◈ KGDB Setup
◈ QEMU Setup
◈ Linux System Calls Table
◈ Useful Linux Commands
Home
About
Consulting
Training
Tutorials
Interview Questions
Contact
Tutorials
QEMU Setup
Home
Qemu Setup in Linux
◈ Introductions
◈ Linux Kernel Compilation
◈ Linux Kernel Debugging
◈ Linux Kernel APIs - I
◈ Linux Kernel APIS - II
◈ Linux Kernel APIS - III
◈ KGDB Setup
◈ QEMU Setup
◈ Linux System Calls Table
◈ Useful Linux Commands
Tutorials - QEMU Setup
Qemu Setup in Linux
« Prev
Next »
QEMU Setup in Linux
Compile kernel: cd /usr/src/linux-3.12.1 $ ls arch/x86/config $ make i386_defconfig $ make menuconfig satkg@satkg:~$make write program : init.c #include
#include
int main(void) { while(1) { printf(“Hello World \n”); usleep(1000000); } return 0; } $ gcc -static -o init init.c $ dd if=/dev/zero of = ramdisk.img bs=1M count =4 $ mkfs.ext2 ramdisk.img $ sudo mount -o loop ramdisk.img rootfs $ sudo cp init rootfs $ sudo mkdir rootfs/dev $ sudo mknod rootfs/dev/console c 5 1 $ sudo mknod rootfs/dev/ram b 1 0 $ sudo umount rootfs qemu -kernel /usr/src/linux-3.12.1/arch/x86/boot/bzImage -initrd ./ramdisk.img -append “root=/dev/ram init=/init” Creation of new virtual machine: $ qemu-img create ubuntu.img 10G $ ls -l ubuntu.img Install Ubuntu: $ qemu -hda ubuntu.img -boot d -cdrom /ubuntu-13.10.iso -m 512 Booting: $ quemu -m 512 -hda ubuntu.img
« Prev
Next »
Helpful Links
Interview Questions
Corporate Training
Recommended Books
Linux Consulting
Apply for Job Assistance
If you have any queries please email us at
info@motionzen.com