17 Star 56 Fork 16

泰晓科技 / Linux X86 Assembly Lab

Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
Clone or download
Notice: Creating folder will generate an empty file .keep, because not support in Git

Subscribe Wechat

CS630 on Qemu in Ubuntu

CS630 Qemu Lab Usage



Please install docker at first:


In order to run docker without password, please make sure your user is added in the docker group:

$ sudo usermod -aG docker $USER

In order to speedup docker images downloading, please configure a local docker mirror in /etc/default/docker, for example:

$ grep registry-mirror /etc/default/docker
DOCKER_OPTS="$DOCKER_OPTS --registry-mirror=https://docker.mirrors.ustc.edu.cn"
$ service docker restart

In order to avoid network ip address conflict, please try following changes and restart docker:

$ grep bip /etc/default/docker
$ service docker restart

If the above changes not work, try something as following:

$ grep dockerd /lib/systemd/system/docker.service
ExecStart=/usr/bin/dockerd -H fd:// --bip= --registry-mirror=https://docker.mirrors.ustc.edu.cn
$ service docker restart

Choose a working directory

If installed via Docker Toolbox, please enter into the /mnt/sda1 directory of the default system on Virtualbox, otherwise, after poweroff, the data will be lost for the default /root directory is only mounted in DRAM.

$ cd /mnt/sda1

For Linux or Mac OSX, please simply choose one directory in ~/Downloads or ~/Documents.

$ cd ~/Documents


Using Ubuntu as example:

$ git clone https://gitee.com/tinylab/cloud-lab.git

$ cd cloud-lab/ && tools/docker/choose cs630-qemu-lab

$ tools/docker/run

Login the noVNC website with the printed password and launch the lab via the desktop shortcut.


A backup of the cs630 exercises has been downloaded in res/, update it with:

$ make update


Bascially, please type:

$ make help

Compile and Boot

Some examples can be compiled for Real mode, some others need to be compiled for Protected mode.

To boot with curses based graphic (console friendly), please pass 'G=0' to make, exit with 'ESC' + '2' to Qemu monitor console and the 'quit' command, or use 'ALT' + '2' and 'quit'.

$ make boot G=0

By default, src/rtc.s is compiled and boot, Or use SRC to specify one:

$ make boot SRC=src/rtc.s
$ make boot SRC=res/rtcdemo.s

To boot with latest qemu and better performance (may not work with some floppy examples):

$ export QEMU_PREBUILT=0
$ make boot

To get better performance, you'd better enable cpu virtualization in bios to enable kvm:

CTRL+ALT+Delete (Reboot your host) --> Delete --> Bios features --> Intel Virtualization Technology

To debug with it:

$ make debug

$ make debug SRC=src/helloworld.s DST=boot.elf
$ make debug SRC=src/rtc.s DST=boot.elf

Modify .gdbinit to customize your own auto-load gdb scripts.


  • Due to linking issue, debug not work with protected mode assembly currently, need to be fixed up later.

  • To debug the real mode example, please replace the 'ljmp $addr $label' instruntion with 'jmp label'

res/memsize.s: ljmp $0x07C0, $main --> jmp main, see git show 86555

Real mode exercise

  • helloworld

      $ make boot SRC=src/helloworld.s
  • rtc

      $ make boot SRC=src/rtc.s

Protected mode exercise

  • helloworld

      $ make boot SRC=src/pmhello.s
  • rtc

      $ make boot SRC=src/pmrtc.s


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:

$ make note

Contact and Sponsor

** Contact us and Sponsor via wechat **


Comments ( 1 )

Sign in for post a comment


Linux X86 AT&T 汇编语言实验室 —— 基于 Docker/Qemu 的 Linux X86 AT&T 汇编语言学习和开发环境;社区正在试做免安装的 Linux Lab Disk,抢先体验地址:https://shop155917374.taobao.com spread retract


No release

Linux X86 Assembly Lab




load more
can not load any more
Linux X86 Assembly Lab


101046 36f486cf 1899542 101055 4cb66026 1899542