Skip to content

finallyjustice/JOS-vmx

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dongli's Update

By default, the JOS-vmx cannot be compiled on my Ubuntu 12.04 64-bit with gcc-4.6. We should manually install gcc-4.4. sudo apt-get install gcc-4.4 sudo apt-get install gcc-4.4-multilib

CC should also be changed to gcc-4.4 in GNUmakefile.

To play with bochs, a bochsrc is also provided. Just run:

bochs

A deb of bochs is available at : http://www3.cs.stonybrook.edu/~porter/courses/cse591/s14/bochs_2.6.2-2_amd64.deb It is also available on my github at : https://github.com/finallyjustice/backup

The "master" branch is for the lab. The "study" branch is the solution.

JOS

JOS is a teaching OS using by MIT/Stanford/UCLA OS course. There are several hands-on exercises in it.

The code in this git repo comes from UCLA OS course website: http://www.cs.ucla.edu/~kohler/class/06f-aos/index.html

JOS-vmx

JOS-vmx(JOS Virtual Machine eXtensions) is another hands-on exercise, which aims at turning JOS into a hypervisor by utilizing hardware assisted virtualization(ex. Intel-vt).

Prerequisite

  • Have read the Chapter 19 INTRODUCTION TO VIRTUAL-MACHINE EXTENSIONS of Intel Software Developer's Manual Volume 3B System Programming Guide, Part 2(3B in brief).
  • Have finished JOS Lab2.
  • Have known what is the Matrix.
  • Have EPT and Unrestricted guest features present in the CPU. This is not necessary if you use bochs emulator instead.

Exercise

There are five exercises: Ex1 - Ex5

As Ex3(EPT) is more complicated than others, here is a guide on it.

Command

  • Step1: > make
  • Step2: > make install-grub
  • Step3: Add a JOS entry in your system grub list(eg. /boot/grub/menu.lst)

Something like this:

title JOS-vmx
        root (hd0,0)
        kernel /jos
  • Step4: Reboot your computer
  • Step5: Enter JOS in grub

When Ex1 - Ex5 are completed

  • Step6: Type matrix in JOS command line:

K>matrix

You will create a VM which contains JOS itself, so don't be panic when the system seems to be rebooting. It is not rebooting, it is just booting the VM.

  • Step7: Enter JOS in grub in the matrix
  • Step8: Type cpuid in JOS command line

K>cpuid

You will get 'deadbeef'. If you get that, it means that you are in the Matrix.

Congratulations!

alternative(not recommended, using this way only if you have no suitable machine)

Install Bochs(A PC emulator)

  • Download bochs-2.4.5
  • cd bochs-2.4.5

  • ./configure --enable-debugger --enable-vmx=2 --enable-x86-64 --prefix=/usr

  • make & make install

  • The following process is just the same as what we did in JOS lab.

Further Readings

CSE 591, Spring 2014: Special Topics in Computer Science: Virtualization

Sayings

"When you have learned to snatch the error code from the trap frame, it will be time for you to leave." --- 《The Tao Of Programming》

"When you have learned to create the MATRIX, it will be time for you to leave." --- Jules Wang

About

Virtual Machine eXtension for JOS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 72.4%
  • C++ 15.9%
  • Assembly 7.3%
  • Makefile 3.4%
  • Perl 1.0%