Command for phase 2.pdf - 1 Installing gcc compiler To...

This preview shows page 1 - 2 out of 2 pages.

1- Installing gcc compiler: To install gcc compiler to your ubuntu just run these two commands: a- sudo apt-get update b- sudo apt-get install build-essential ** to check if gcc has been correctly installed run this command: gcc -v 2- installing qemu: apt-get install qemu-kvm qemu virt-manager virt-viewer libvirt-bin 3- Compile and assemble command: nasm boot_sect.asm -f bin -o boot_sect.bin nasm kernel_entry.asm -f elf32 -o kernel_entry.o gcc -fno-pie -m32 -ffreestanding -c kernel.c -o kernel.o ld -m elf_i386 -o kernel.bin -Ttext 0x1000 kernel_entry.o kernel.o --oformat binary cat boot_sect.bin kernel.bin > os-image.bin 4- creating a disk image (this image file is needed by qemu): dd if=/dev/zero of=floppy.img bs=512 count=20 dd if=os-image.bin of=floppy.img conv=notrunc 5- Testing it in Qemu emulator: qemu-system-x86_64 -drive format=raw,file=floppy.img,index=0,if=floppy 6- Boot your OS from the USB: Now after testing your code on qemu it is time to transfer our OS to the USB flash

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture