Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Set up a 32-bit Debian Linux system on a Oracle Virtual Box virtual machine. You should not install GUI on the Linux system. 2. Run
Set up a 32-bit Debian Linux system on a Oracle Virtual Box virtual machine. You should not install GUI on the Linux system.
2. Run the provided boot sector programs.
To submit,
1. Upload a screen shot of the running Linux system;
2. Upload a screen shot for each boot sector program you run.
===================================================
Experimenting Boot Sector Code We can write our own boot sector code. Although you can write the code to the disk's boot sector, we run it in the emulated x86 system using QEMU. The following examples are from Nick Bundell. Compiling and Running Boot Sector Code For the programs given here, the procedure to compile and run the code are as follows, provided that the program to run is in file example.asm: 1. Compile example.asm. Open a terminal window, run nasm example.asm -f bin -o example.bin 2. Run example.asm on the x86 system emulated by the QEMU emulator. In the terminal window, run qemu-system-i386 -drive format=raw, file=example. bin -curses -monitor telnet:127.0.0.1:54321, server, nowait 3. Open the QEMU monitor. Open another terminal window run telnet 127.0.0.1 54321 To quit the QEMU emulator, issue quit command as in (qemu) quit Example 0 Infinite Loop Following the steps in the above, we do the following: 1. Create boot(.asm. On the Linux system, create the boot0.asm file using either nano, vi, or other editors if you have installed. ; booto. as ; a do-nothing infinite loop loop: jnp loop times 510-($-$$) db 0 dw Oxaa55 2. Compile booto.asm. Open a terminal window, run nasm booto. asm -f bin -o booto.bin 3. Run booto.asm on the x86 system emulated by the QEMU emulator. In the terminal window, run qemu-system-i386 -drive format=raw, file=booto.bin -curses -monitor telnet:127.0.0.1:54321, server, novait 4. Open the QEMU monitor. Open another terminal window run telnet 127.0.0.1 54321 To quit the QEMU emulator, issue quit command as in (qemu) quit Example 2 Printing a Message Similarly, you can run and observe the following code. ; booti asm print Hello on console nov ah, Ox0e nov al, 'H' int 0x10 mov al, 'e' int 0x10 mov al, 'l' int 0x10 mov al, 'l' int Ox10 nov al, o int Ox10 jmp $ times 510-($-$$) db 0 dw Oxaa55 Example 3 Printing a Message in a Loop Now print "Hello" a few times. i boot2. as ; print Hello 3 times mov bx, 3 mov ah, Ox0e print_hello: mov al, 'H' int Ox10 nov al, 'e' int 0x10 nov al, 'l' int Ox10 mov al, 'l' int Ox10 mov al, 'o int Ox10 mov al, ? int Ox10 dec bx cmp bx, 0 jne print_hello jmp $ times 510-($-$$) db 0 dw Oxaa55 Experimenting Boot Sector Code We can write our own boot sector code. Although you can write the code to the disk's boot sector, we run it in the emulated x86 system using QEMU. The following examples are from Nick Bundell. Compiling and Running Boot Sector Code For the programs given here, the procedure to compile and run the code are as follows, provided that the program to run is in file example.asm: 1. Compile example.asm. Open a terminal window, run nasm example.asm -f bin -o example.bin 2. Run example.asm on the x86 system emulated by the QEMU emulator. In the terminal window, run qemu-system-i386 -drive format=raw, file=example. bin -curses -monitor telnet:127.0.0.1:54321, server, nowait 3. Open the QEMU monitor. Open another terminal window run telnet 127.0.0.1 54321 To quit the QEMU emulator, issue quit command as in (qemu) quit Example 0 Infinite Loop Following the steps in the above, we do the following: 1. Create boot(.asm. On the Linux system, create the boot0.asm file using either nano, vi, or other editors if you have installed. ; booto. as ; a do-nothing infinite loop loop: jnp loop times 510-($-$$) db 0 dw Oxaa55 2. Compile booto.asm. Open a terminal window, run nasm booto. asm -f bin -o booto.bin 3. Run booto.asm on the x86 system emulated by the QEMU emulator. In the terminal window, run qemu-system-i386 -drive format=raw, file=booto.bin -curses -monitor telnet:127.0.0.1:54321, server, novait 4. Open the QEMU monitor. Open another terminal window run telnet 127.0.0.1 54321 To quit the QEMU emulator, issue quit command as in (qemu) quit Example 2 Printing a Message Similarly, you can run and observe the following code. ; booti asm print Hello on console nov ah, Ox0e nov al, 'H' int 0x10 mov al, 'e' int 0x10 mov al, 'l' int 0x10 mov al, 'l' int Ox10 nov al, o int Ox10 jmp $ times 510-($-$$) db 0 dw Oxaa55 Example 3 Printing a Message in a Loop Now print "Hello" a few times. i boot2. as ; print Hello 3 times mov bx, 3 mov ah, Ox0e print_hello: mov al, 'H' int Ox10 nov al, 'e' int 0x10 nov al, 'l' int Ox10 mov al, 'l' int Ox10 mov al, 'o int Ox10 mov al, ? int Ox10 dec bx cmp bx, 0 jne print_hello jmp $ times 510-($-$$) db 0 dw Oxaa55Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started