git clone https://github.com/jhu-cs318/pintos.git
cd pintosVerify if your system already supports 32-bit x86 architecture:
objdump -i | grep elf32-i386If this command produces output, you can skip to Step 4 (Emulator). Otherwise, proceed to build the toolchain from source.
sudo apt-get install build-essential automake git
sudo apt-get install libncurses5-dev texinfoSWD=/path/to/setup # Replace with your desired path, e.g., /home/username/toolchain
mkdir -p $SWD
cd /path/to/pintos/src
misc/toolchain-build.sh $SWDAdd the following line to your ~/.bashrc file:
export PATH=$SWD/x86_64/bin:$PATHRestart your terminal or run:
source ~/.bashrcwhich i386-elf-gcc
i386-elf-gcc --version # Should show version 6.2.0Install QEMU for running Pintos:
sudo apt-get install qemu libvirt-binBuild and install the Pintos utilities:
cd pintos/src/utils && make
cp backtrace pintos Pintos.pm pintos-gdb pintos-set-cmdline \
pintos-mkdisk setitimer-helper squish-pty squish-unix \
/path/to/swd/x86_64/bin
mkdir /path/to/swd/x86_64/misc
cp ../misc/gdb-macros /path/to/swd/x86_64/misc- Perl 5.8.0 or later
- cgdb - Enhanced debugger interface (strongly recommended)
- ctags - Code navigation
- cscope - Code browsing
- NERDTree - File explorer for Vim
- YouCompleteMe - Code completion
- GUI editors (VS Code, CLion, etc.)
Test your installation:
cd pintos/src/threads
make
cd build
pintos --If successful, you should see:
PiLo hda1
Loading...........
Kernel command line:
Pintos booting with 3,968 kB RAM...
367 pages available in kernel pool.
367 pages available in user pool.
Calibrating timer... 838,041,600 loops/s.
Boot complete.
- Ensure you added the export PATH line to
~/.bashrc - Restart your terminal or run
source ~/.bashrc - Verify the path is correct with
echo $PATH
- Ensure all prerequisites are installed
- Check that you have sufficient disk space
- Verify you're using a compatible Ubuntu version
pintos/
├── src/
│ ├── threads/ # Thread implementation
│ ├── userprog/ # User program support
│ ├── vm/ # Virtual memory
│ ├── filesys/ # File system
│ ├── utils/ # Utility scripts
│ └── misc/ # Miscellaneous tools
This is an educational project. Follow your course guidelines for submitting modifications and assignments.
Refer to the original Pintos distribution for licensing information.
- Original Pintos Repository
- Course: CS2042 - Operating Systems