Compile with Bochs running under Windows Linux-0.11 (rpm)

https://blog.csdn.net/u014688145/article/details/50575588

Brief description: Bochs is primarily a free and open-source x86-based PC-emulator. Learning linux0.11 kernel, it recommended on the simulator.
Environment to build steps:
1, download Linux0.11 system package, download links are included in this package Bochs software.

Click Open link http://oldlinux.org/Linux.old/bochs/linux-0.11-devel-040329.zip
2, decompression linux-0.11-devel-040329.zip, the directory structure as shown below:

 

Really used to document here: Bochs-2.1.1.exe, bochsrc-hd.bxrc, bootimage-0.11, bootimage-hd-0.11, HDC-0.11.img
3, click Bochs-2.1.1.exe installation.

4, after the installation is complete, all the files in the linux-0.11-devel-040329, the file to the root directory bochs just installed. The original directory as follows:


After the copy of the directory:

 

5, after the copy is complete, run bochsrc-hd.bxrc, if the installation is successful, i.e., open to see the following interface:

 

This is already the x86PC simulator, set up a complete Linux operating system. Linux command to establish operating platform, will be able to operate Linux. Since learning the operating system needs, we need at Linux, the operating system and complete a simple compilation of source code modification, so as to achieve the ability to understand the Linux kernel. Next, the main demonstration of the Linux kernel source code modifications, as well as the kernel compilation process. Since the Linux version of the reason, we also need to make adjustments to the code can be successfully compiled.

Kernel compilation process:
1, into the / usr / src under / linux directory, type the command cd ../src/linux, as shown below:

 

2, compile, type the command clean and make make.

 

If an error occurs as follows: gcc-cc1: Invalid option "string-insns". This is the need to -mstring-insns parameters Makefile file in the Linux directory removed. In addition, each subdirectory fs, lib, kernel drivers and three subdirectories kernel directory (math, blk_drv, chr_drv) Makefike among the parameters -mstring-insns removed. Here only demonstrates the Makefile in the root directory modification.

3, Yotsugi personal reformation: / linux / Makefile, / linux / fs / Makefile, / linux / lib / Makefile,

/ Linux / kernel / Makefile, / linux / kernel / math / Makefile, / linux / kernel / blk_drv / Makefile, / linux / kernel / chr_drv / Makefile file. Under linux directory, type: vi Makefile. As shown below:

 

Find -mstring-insns parameter file and delete the save.

4, to / usr / local / bin files found ar, ar and the renamed gar, type the command: mv ar gar. As shown below:

 

5, back to the linux directory, re-type make clean and make, compile the kernel link.

 

 

Prompt appears on the map, that is, the surface of the program compiled successfully. After completing the compilation, you can start modifying the kernel source, so as to achieve the purpose of expansion of operating system functions and learning how to operate the system. Here, our simple modification, linux operating system boot entry bootsect.s source, so that the output string personalized boot.

6, enter / usr / src / linux / boot directory, modify the source code bootsect.s, save and exit.

! The Print some INANE Message
MOV AH, # 0x03! Read Cursor POS
XOR BH, BH
int 0x10
MOV CX, # 47
MOV BX, # 0x0007! Page 0, attribute. 7 (Normal)
MOV BP, # MSG1
MOV AX, # 0x1301! String Write, Move Cursor
int 0x10
MSG1:
.byte 13,10
.ascii "Create Loading System IS ... by the this Demon"
.byte 13,10,13,10
.org 508
7, after editing, the directory linux and re-type the make command to complete the compilation.

8, after make a successful build boot image file Image. Image output of this file if desired, may first bootimage-0.11-hd backup file and then use the following commands will replace bootimage-0.11-hd to the new boot file, type the command: dd bs = 8192 if = Image of = / dev / fd0. As shown below:

 

9 Click reset to restart the Linux operating system. As shown below:


----------------
Disclaimer: This article is CSDN blogger "Demon in black and white 'original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
Original link: https: //blog.csdn.net/u014688145/article/details/50575588

Guess you like

Origin www.cnblogs.com/yasepix/p/12295607.html