When we study Linux, in addition to learning how to use it to build a server, the kernel is also full of curiosity, often meditate on when I can also write small and beautiful operating system. And when we write a minios, and how to test it and debug it, the hardware environment emulator Bochs can solve this problem well. Let me take the bochs2.4 and Linux0.11 root.img, boot.img as the basis, to establish a Linux0.11 kernel running debugging environment.
A tool and mirror
1.bochs2.4;
2.bochs2.4 config file;
3.minix FS (root-0.11.img)
4.kernel (Boot-0.11.imag)
Because Minix FS is used in the Linux0.11 kernel, our root file image is selected Minix file system, and the tools and images are available at the following links:
Links: http://pan.baidu.com/s/1Ew5T8
Password: e2z7;
Two install bochs2.4 and create configuration file
1. After the download is complete, Bochs can be placed in any folder, bochs2.4 configuration file bochsrc_fd.bxrc, root file system image and boot image are placed in the X-disk Linux0.11 directory.
If it is a different system, change the hardware configuration in BOCHSRC_FD.BXRC to support system operation as needed.
2.bochs2.4 always click OK to install.
Three boot bochs2.4 and load kernel image
1. Double-click the profile BOCHSRC_FD.BXRC to eject the two forms as shown:
2. Last hint, kernel to load the root filesystem and press ENTER, let's take a look at the contents of BOCHSRC_FD.BXRC.
By configuration file: 1. Kernel mirroring in the FDA, 2. The root file system image in Fdb 3.boot loads the image in the FDA. So when the kernel boot is complete and the kernel image needs to load the image of the root file system, we need to reset the emulator a disk and select the root image.
3. Click OK to load the Linux0.11 image successfully if the following conditions occur:
After that, we can see the results of the operation by typing the LS cat/a.out commands.
Similarly, we can load our own written system and perform simulations and debugs on the Bochs.
Bochs use of Open source simulator