/cs630-qemu-lab

用于学习80386汇编及其体系架构。

Primary LanguageAssembly

CS630 on Qemu(a virtual machine) in Ubuntu

Prepare

If want to do the following exercises, PLEASE install Qemu and some other related tools in Ubuntu/Linux system.

$ sudo apt-get install qemu

If want to do the exercises of CS630 on Qemu in Ubuntu, need to execute the following command to mirror the resources in the course site to res/:

$ make update

Usage

Our project allows to:

  • Specify an assembly file for compiling with ./configure /path/to/file.s
  • Compile and run the assembly in real mode with make boot
  • Compile and run the assembly in protected mode with make pmboot

For example, to compile the src/helloworld.s, we can configure it with:

$ ./configure src/helloworld.s

To compile the assembly files from res/, use rtcdemo.s as an example, just type:

$ ./configure res/rtcdemo.s

Real mode exercise

  • helloworld

      $ ./configure src/helloworld.s
      $ make boot
    
  • rtc

      $ ./configure src/rtc.s
      $ make boot
    

Protected mode exercise

  • helloworld

      $ ./configure src/pmhello.s
      $ make pmboot
    
  • rtc

      $ ./configure src/pmrtc.s
      $ make pmboot
    

NOTE

In fact, some exercises not about "protected mode" also need to use the 2nd method to compile, for they begin execution with CS:IP = 1000:0002, and need a "bootloader" to load them, or their size are more than 512 bytes, can not be put in the first 512bytes of the disk (MBR).

See more notes from NOTE.md.