Operating System Experiment 2-install and configure pintos in ubuntu

Source: Internet
Author: User

It took two times to complete the OSS experiment ..

Summarize the first error.

When debugging pintos using gdb, the following error is reported:

Bochsrc.txt: 8: Bochs is not compiled with gdbstub support

Baidu has not found a solution for a long time. Later, the problem was solved by setting ubuntu 64-bit compatibility with 32-bit.

The specific solution is as follows: (execute the following three commands in sequence)

(Execute these three commands before installing and configuring pintos)


$ sudo apt-get install libc6:i386 libgcc1:i386 gcc-4.6-base:i386 libstdc++5:i386 libstdc++6:i386$ sudo apt-get install libncurses5:i386$ sudo apt-get install g++-multilib

Then install pintos.

Installation Process

 

1. Install bochs

General steps:

Install bochs• $ tar zxvf bochs-2.4.5.tar.gz• $ cd bochs-2.4.5• $./configure --enable-gdb-stub • $ make• $ sudo make install


Details:

Download Bochs and pintos to home/qing In ubuntu (change to your user name)

Open the terminal (Application --- attachment --- terminal) and enter the command: sudo passwd root. The system prompts you to enter the new password of the root user. after entering the password twice, the root user is successfully activated, later, you can log on with the root user.

 

Enter the bochs location through the terminal: cd/home/qing (Add/at the beginning to indicate the absolute path)

Decompress bochs: tar zxvf bochs-2.4.5.tar.gz

After decompression, you can see from the location -- computer ---- file system --- home ---- qing that the file has been decompressed into a folder.

Follow these steps:

Go to the decompressed bochs Folder: cd bochs-2.4.5

Configure bochs:./configure-enable-gdb-stub (note the first point)

Common Errors:

1. configure: error: C ++ preprocessor "/lib/cpp" fails sanity check

Solution: Enter sudo aptitude install build-essential

2. X windows gui was selected, but Xwindows libraries were not found .",

Solution: Enter the sudo apt-get install libx11-dev on the terminal in the networking state

Sudo apt-get install xserver-xorg-dev

Sudo apt-get install xorg-dev)

Compile: make (check whether there is any error information after compilation. If there are some packages installed as prompted, re-compile them)

Install: sudo makeinstall

Bochs has been installed.

 

Ii. Next we will install and run pintos

General steps:

• Install and run Pintos• $ tar zxvf pintos2011.tar.gz• $ cd pintos/src/threads• $ make• $cd build• $ ../../utils/pintos -- run alarm-multiple


Details:

First, as with bochs, enter the location and decompress

Decompress the package and enter pintos/src/threads. Compile

After compilation, go to the build directory and run the test case alarm-multiple


3. debug pintos with gdb

General steps:

• $ cd /pintos/src/threads/build• $ ../../utils/pintos --gdb -s -- run alarm-multiple 

• Bochs stops and waits gdb connection


Details:

Enter the following command :.. /.. /utils/pintos -- gdb-s -- run alarm-multiple (note that there is a space between run and the Front horizontal bar) (you can directly use the pintos command After configuring the environment variable)

Wait for connection.

At this time, we open another terminal, enter the build directory of pintos, and enter the command: gdb kernel. o (note that it is the English letter o, not the number 0)

In this way, we enter the gdb

Enter the command: targetremote localhost: 1234 to connect to the program you just opened (note that there is a space after the colon)

Enter: continue

You will see that the waiting program continues to run.

However, there are still many gdb commands, which are left for you to explore their usage. Example: l, B, c, r, p, n, s, bt


Final result:


 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.