The operating system class teacher referred to the practice of Yuanyuan and asked us to do a simple operating system experiment. The instructor's tutorial was completed in the winXP environment, however, since I have already used ubuntu as the main system, I hope to complete this experiment of creating a Myos Virtual Machine under ubuntu.
Previously, I had already installed the Virtual Machine VirtualBox, so this experiment was completed in the VirtualBox environment.
First, compile the boot file. You can also use nasm to compile the. asm file in linux. The installation command is as follows:
Sudo apt-get install nasm
The compilation command is the same as that in windows:
Nasm boot. asm-o boot. bin
The second is to create a virtual floppy disk. Because VirtualBox cannot create a virtual floppy disk like creating a virtual blank hard disk, it can only select an existing virtual floppy disk (. img), so we need to first create a boot based on our previous compilation. bin virtual floppy disk. According to Yu Yuan's book, I found this command:
Dd if = boot. bin of = floppy. img bs = 512 count = 1
This command can create a 512B file named floppy in the main folder. img, written to boot. bin's virtual floppy disk image (due to boot. bin limit, floppy. img size can only be B ). Among them, boot. bin is the read location, loppy. img is the write location, bs = 512 is 512 bytes read each time, and count = 1 refers to read once.
Now you can create a MyOS Virtual Machine in VirtualBox. After clicking the create button, you need to change the default values during the installation process: select other for the operating system and version, select 4 mb for the memory size, and remove the Star-up Disk check box.
Do not start after the build. There is another step. Select the created MyOS, set-Storage-add floppy controller-select a floppy controller-Add a virtual floppy disk-select floppy. img in the master folder-OK.
At this time, the virtual machine MyOS is finished. The screen is as follows:
After completing the above experiment, consider floppy. img can only be limited by 512 bytes. If the image is not perfect, Baidu finds the following command to create a blank virtual floppy disk (1 MB ):
Dd if =/dev/zero of = floppy. img bs = 1048576 count = 1
Then I use wineto open floppywriter.exe and write the boot. bin file. Later, the process is the same as above, and the above picture can be obtained successfully.
Author: Chen Yu