Merge "website: Fix code formatting and links for learning gem5 part 2"
diff --git a/_data/documentation.yml b/_data/documentation.yml
index 4171b41..c2f0f6d 100644
--- a/_data/documentation.yml
+++ b/_data/documentation.yml
@@ -19,6 +19,14 @@
         - page: Building EXTRAS
           url: /documentation/general_docs/building/EXTRAS
 
+    - title: Doxygen
+      id: doxygen-docs
+      subitems:
+        - page: Develop Branch
+          url: http://doxygen.gem5.org/develop/index.html
+        - page: v19.0.0.0
+          url: http://doxygen.gem5.org/release/v19-0-0-0/index.html
+
     - title: Full System
       id: fullsystem
       subitems:
@@ -28,6 +36,10 @@
           url: /documentation/general_docs/fullsystem/devices
         - page: m5term
           url: /documentation/general_docs/fullsystem/m5term
+        - page: Building Linux ARM Kernel
+          url: /documentation/general_docs/fullsystem/building_arm_kernel
+        - page: Building Android Marshmallow
+          url: /documentation/general_docs/fullsystem/building_android_m
 
     - title: Memory System
       id: memory_system
@@ -221,7 +233,7 @@
     items:
        - title: gem5 Doxygen
          id: doxygen
-         url: https://gem5.github.io/gem5-doxygen
+         url: http://doxygen.gem5.org/release/current/index.html
 
   - title: Reporting Problems
     items:
diff --git a/_pages/about.md b/_pages/about.md
index f20598c..5b8acaa 100755
--- a/_pages/about.md
+++ b/_pages/about.md
@@ -22,7 +22,7 @@
 These CPU models use a common high-level ISA description. In addition, gem5
 features a KVM-based CPU that uses virtualisation to accelerate simulation.
 
-### [Event-driven memory system.](Media:2015_ws_02_hansson_gem5_workshop_2015.pdf "wikilink")
+### [Event-driven memory system.](/documentation/general_docs/memory_system)
 gem5 features a detailed, event-driven memory system including caches,
 crossbars, snoop filters, and a fast and accurate DRAM controller model, for
 capturing the impact of current and emerging memories, e.g. LPDDR3/4/5, DDR3/4,
@@ -30,7 +30,7 @@
 e.g., to model complex multi-level non-uniform cache hierarchies with
 heterogeneous memories.
 
-### [Multiple ISA support](Supported Architectures "wikilink")
+### [Multiple ISA support](/documentation/general_docs/architecture_support)
 gem5 decouples ISA semantics from its CPU models, enabling effective support
 of multiple ISAs. Currently gem5 supports the Alpha, ARM, SPARC, MIPS, POWER,
 RISC-V and x86 ISAs. However, all guest platforms aren't
@@ -44,9 +44,9 @@
 
 ### Full-system capability
   - **ARM**: gem5 can model up to 64 (heterogeneous) cores of a
-        Realview ARM platform, and boot [unmodified
-        Linux](ARM_Linux_Kernel "wikilink") and
-        [Android](Android_Marshmallow "wikilink") with a combination of
+        Realview ARM platform, and boot 
+	[unmodified Linux](/documentation/general_docs/fullsystem/building_arm_kernel) and
+        [Android](/documentation/general_docs/fullsystem/building_android_m) with a combination of
         in-order and out-of-order CPUs. The ARM implementation supports
         32 or 64-bit kernels and applications.
   - **x86**: The gem5 simulator supports a standard PC platform and boots unmodified Linux
@@ -75,18 +75,17 @@
 range of experiments in power- and energy-efficiency. With out-of-the-box
 support for OS-controller Dynamic Voltage and Frequency (DVFS) scaling, gem5
 provides a complete platform for research in future energy-efficient systems.
-See [how to run your own DVFS experiments](Running_gem5#Experimenting_with_DVFS
-"wikilink").
+However, the existing DVFS documentation is out of date. You can find this page 
+at the [old wiki](http://old.gem5.org/Running_gem5.html#Experimenting_with_DVFS).
 
-
-### [A trace-based CPU](TraceCPU "wikilink")
+### [A trace-based CPU](/documentation/general_docs/cpu_models/TraceCPU)
 CPU model that plays back elastic traces, which are dependency and timing
 annotated traces generated by a probe attached to the out-of-order CPU model.
 The focus of the Trace CPU model is to achieve memory-system (cache-hierarchy,
 interconnects and main memory) performance exploration in a fast and reasonably
 accurate way instead of using the detailed CPU model.
 
-### [Co-simulation with SystemC.](Media:2015_ws_09_2015-06-14_Gem5_ISCA.pptx "wikilink")
+### [Co-simulation with SystemC.](http://old.gem5.org/wiki/images/4/4c/2015_ws_09_2015-06-14_Gem5_ISCA.pptx)
 gem5 can be included in a SystemC simulation, effectively running as a
 thread inside the SystemC event kernel, and keeping the events and timelines
 synchronized between the two worlds. This functionality enables the gem5
@@ -94,7 +93,7 @@
 models, such as interconnects, devices and accelerators. A wrapper for SystemC
 Transaction Level Modelling (TLM) is provided.
 
-### [A NoMali GPU model.](Media:2015_ws_04_ISCA_2015_NoMali.pdf "wikilink")
+### [A NoMali GPU model.](http://old.gem5.org/wiki/images/5/53/2015_ws_04_ISCA_2015_NoMali.pdf)
 gem5 comes with an integrated NoMali GPU model that is compatible with the
 Linux and Android GPU driver stack, and thus removes the need for software
 rendering. The NoMali GPU does not produce any output, but ensures that
diff --git a/_pages/documentation/general_docs/fullsystem/building_android_m.md b/_pages/documentation/general_docs/fullsystem/building_android_m.md
new file mode 100644
index 0000000..3b2b620
--- /dev/null
+++ b/_pages/documentation/general_docs/fullsystem/building_android_m.md
@@ -0,0 +1,414 @@
+---
+layout: documentation
+title: "Building Android Marshmallow"
+doc: gem5 documentation
+parent: fullsystem
+permalink: /documentation/general_docs/fullsystem/building_android_m
+---
+
+# Building Android Marshmallow
+
+This guide gives detailed step-by-step instructions on building an Android Marshmallow image along with a working kernel and .dtb file that work with gem5.
+
+## Overview
+To successfully run Android in gem5, an image, a compatible kernel and a device tree blob.dtb file configured for the simulator are necessary. This guide shows how to build Android Marshmallow 32bit version using a 3.14 kernel with Mali support. An extra section will be added in the future on how to build the 4.4 kernel with Mali.
+
+## Pre-requisites
+This guide assumes a 64-bit system running 14.04 LTS Ubuntu. Before starting it is important first to set up our system correctly. To do this the following packages need to be installed through shell.
+
+**Tip: Always check for the up-to-date prerequisites at the Android build page.**
+
+Update and install all the dependencies. This can be done with the following commands:
+
+```
+sudo apt-get update
+
+sudo apt-get install openjdk-7-jdk git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip
+```
+
+Also, make sure to have repo correctly installed [(instructions here)](https://source.android.com/source/downloading.html#installing-repo).
+
+Ensure that the default JDK is OpenJDK 1.7:
+
+```
+javac -version
+```
+
+To cross-compile the kernel (32bit) and for the device tree we will need the following packages to be installed:
+
+```
+sudo apt-get install gcc-arm-linux-gnueabihf device-tree-compiler
+```
+
+Before getting started, as a final step make sure to have the gem5 binaries and busybox for 32-bit ARM.
+
+For the gem5 binaries just do the following starting from your gem5 directory:
+```
+cd util/m5
+make -f Makefile.arm
+cd ../term
+make
+cd ../../system/arm/simple_bootloader/
+make
+```
+
+For busybox you can find the guide [here](http://wiki.beyondlogic.org/index.php?title=Cross_Compiling_BusyBox_for_ARM).
+
+## Building Android
+We build Android Marshmallow using an AOSP running build based on the release for the Pixel C. The AOSP provides [other builds](https://source.android.com/source/build-numbers.html#source-code-tags-and-builds), which are untested with this guide.
+
+**Tip: Synching with repo will take a long time. Use the -jN flag to speed up the make process, where N is the number of parallel jobs to run.**
+
+Make a directory and pull the Android repository:
+
+```
+mkdir android
+cd android
+repo init --depth=1 -u https://android.googlesource.com/platform/manifest -b android-6.0.1_r63
+repo sync -c -jN
+```
+
+Before you start the AOSP build, you will need to make one change to the build system to enable building libion.so, which is used by the Mali driver. Edit the file `aosp/system/core/libion/Android.mk` to change `LOCAL_MODULE_TAGS` for libion from 'optional' to 'debug'. Here is the output of `repo diff`: 
+
+```
+  --- a/system/core/libion/Android.mk
+  +++ b/system/core/libion/Android.mk
+  @@ -3,7 +3,7 @@ LOCAL_PATH := $(call my-dir)
+  include $(CLEAR_VARS)
+  LOCAL_SRC_FILES := ion.c
+  LOCAL_MODULE := libion
+  -LOCAL_MODULE_TAGS := optional
+  +LOCAL_MODULE_TAGS := debug
+  LOCAL_SHARED_LIBRARIES := liblog
+  LOCAL_C_INCLUDES := $(LOCAL_PATH)/include $(LOCAL_PATH)/kernel-headers
+  LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
+  $(LOCAL_PATH)/kernel-headers
+```
+
+Source the environment setup and build Android:
+
+**Tip: For root access and "debuggability" [sic] we choose userdebug. Build can be done in different modes as seen** [here](https://source.android.com/source/building.html#choose-a-target).
+**Tip: Making Android will take a long time. Use the -jN flag to speed up the make process, where N is the number of parallel jobs to run.**
+
+***Make sure to do this in a bash shell.***
+
+```
+source build/envsetup.sh
+lunch aosp_arm-userdebug
+make -jN
+```
+
+## Creating an Android image
+
+After a successful build, we create an image of Android and add the init files and binaries that configure the system for gem5. The following example creates a 3GB image.
+
+**Tip: If you want to add applications or data, make the image large enough to fit the build and anything else that is meant to be written into it.**
+
+Create an empty image to flash the Android build and attach the image to a loopback device:
+
+```
+dd if=/dev/zero of=myimage.img bs=1M count=2560
+sudo losetup /dev/loop0 myimage.img
+```
+
+We now need to create three partitions: AndroidRoot (1.5GB), AndroidData (1GB), and AndroidCache (512MB).
+
+First, partition the device:
+
+```
+sudo fdisk /dev/loop0
+```
+
+Update the partition table:
+
+```
+sudo partprobe /dev/loop0
+```
+
+Name the partitions / Define filesystem as ext4:
+
+```
+sudo mkfs.ext4 -L AndroidRoot /dev/loop0p1
+sudo mkfs.ext4 -L AndroidData /dev/loop0p
+sudo mkfs.ext4 -L AndroidCache /dev/loop0p3
+```
+
+Mount the Root partition to a directory:
+
+```
+sudo mkdir -p /mnt/androidRoot
+sudo mount /dev/loop0p1 /mnt/androidRoot
+```
+
+Load the build to the partition:
+
+```
+cd /mnt/androidRoot
+sudo zcat <path/to/build/android>/out/target/product/generic/ramdisk.img | sudo cpio -i
+sudo mkdir cache
+sudo mkdir /mnt/tmp
+sudo mount -oro,loop <path/to/build/android>/out/target/product/generic/system.img /mnt/tmp
+sudo cp -a /mnt/tmp/* system/
+sudo umount /mnt/tmp
+```
+
+Download and unpack the [overlays](http://dist.gem5.org/dist/current/arm/kitkat-overlay.tar.bz2) that are necessary from the [gem5 Android KitKat page](http://old.gem5.org/Android_KitKat.html "wikilink") and make the following changes to the `init.gem5.rc` file. Here is the output of `repo diff`: 
+
+```
+  --- /kitkat_overlay/init.gem5.rc
+  +++ /m_overlay/init.gem5.rc
+  @@ -1,21 +1,13 @@
+  +
+   on early-init
+       mount debugfs debugfs /sys/kernel/debug
+  
+   on init
+  -    export LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/vendor/lib/egl
+  -
+  -    # See storage config details at http://source.android.com/tech/storage/
+  -    mkdir /mnt/media_rw/sdcard 0700 media_rw media_rw
+  -    mkdir /storage/sdcard 0700 root root
+  +    # Support legacy paths
+  +    symlink /sdcard /mnt/sdcard
+       chmod 0666 /dev/mali0
+       chmod 0666 /dev/ion
+  -
+  -    export EXTERNAL_STORAGE /storage/sdcard
+  -
+  -    # Support legacy paths
+  -    symlink /storage/sdcard /sdcard
+  -    symlink /storage/sdcard /mnt/sdcard
+  
+   on fs
+       mount_all /fstab.gem5
+  @@ -60,7 +52,6 @@
+       group root
+       oneshot
+  
+  -# fusewrapped external sdcard daemon running as media_rw (1023)
+  -service fuse_sdcard /system/bin/sdcard -u 1023 -g 1023 -d
+  /mnt/media_rw/sdcard /storage/sdcard
+  +service fingerprintd /system/bin/fingerprintd
+       class late_start
+  -    disabled
+  +    user system
+```
+
+Add the Android overlays and configure their permissions:
+
+```
+sudo cp -r <path/to/android/overlays>/* /mnt/androidRoot/
+sudo chmod ug+x /mnt/androidRoot/init.gem5.rc
+/mnt/androidRoot/gem5/postboot.sh
+```
+
+Add the m5 and busybox binaries under the sbin directory and make them executable:
+
+```
+sudo cp <path/to/gem5>/util/m5/m5 /mnt/androidRoot/sbin
+sudo cp <path/to/busybox>/busybox /mnt/androidRoot/sbin
+sudo chmod a+x /mnt/androidRoot/sbin/busybox /mnt/androidRoot/sbin/m5
+```
+
+Make the directories readable and searchable:
+
+```
+sudo chmod a+rx /mnt/androidRoot/sbin/ /mnt/androidRoot/gem5/
+```
+
+Remove the boot animation:
+
+```
+sudo rm /mnt/androidRoot/system/bin/bootanimation
+```
+
+Download and unpack the Mali drivers, for gem5 Android 4.4, from [here](http://malideveloper.arm.com/resources/drivers/arm-mali-midgard-gpu-user-space-drivers/). Then, make the directories for the drivers and copy them:
+
+```
+sudo mkdir -p /mnt/androidRoot/system/vendor/lib/egl
+sudo mkdir -p /mnt/androidRoot/system/vendor/lib/hw
+sudo cp <path/to/userspace/Mali/drivers>/lib/egl/libGLES_mali.so /mnt/androidRoot/system/vendor/lib/egl
+sudo cp <path/to/userspace/Mali/drivers>/lib/hw/gralloc.default.so /mnt/androidRoot/system/vendor/lib/hw
+```
+
+Change the permissions
+
+```
+sudo chmod 0755 /mnt/androidRoot/system/vendor/lib/hw
+sudo chmod 0755 /mnt/androidRoot/system/vendor/lib/egl
+sudo chmod 0644 /mnt/androidRoot/system/vendor/lib/egl/libGLES_mali.so
+sudo chmod 0644 /mnt/androidRoot/system/vendor/lib/hw/gralloc.default.so
+```
+
+Unmount and remove loopback device:
+
+```
+cd /..
+sudo umount /mnt/androidRoot
+sudo losetup -d /dev/loop0
+```
+
+## Building the Kernel (3.14)
+
+After successfully setting up the image, a compatible kernel needs to be built and a .dtb file generated.
+
+Clone the repository containing the gem5 specific kernel:
+
+```
+git clone -b ll_20140416.0-gem5 https://github.com/gem5/linux-arm-gem5.git
+```
+
+Make the following changes to the kernel gem5 config file at `<path/to/kernel/repo>/arch/arm/configs/vexpress_gem5_defconfig`. Here is the output of `repo diff`:
+
+```
+  --- a/arch/arm/configs/vexpress_gem5_defconfig
+  +++ b/arch/arm/configs/vexpress_gem5_defconfig
+  @@ -200,4 +200,15 @@ CONFIG_EARLY_PRINTK=y
+  CONFIG_DEBUG_PREEMPT=n
+  # CONFIG_CRYPTO_ANSI_CPRNG is not set
+  # CONFIG_CRYPTO_HW is not set
+  +CONFIG_MALI_MIDGARD=y
+  +CONFIG_MALI_MIDGARD_DEBUG_SYS=y
+  +CONFIG_ION=y
+  +CONFIG_ION_DUMMY=y
+  CONFIG_BINARY_PRINTF=y
+  +CONFIG_NET_9P=y
+  +CONFIG_NET_9P_VIRTIO=y
+  +CONFIG_9P_FS=y
+  +CONFIG_9P_FS_POSIX_ACL=y
+  +CONFIG_9P_FS_SECURITY=y
+  +CONFIG_VIRTIO_BLK=y
+  +CONFIG_VMSPLIT_3G=y
+  +CONFIG_DNOTIFY=y
+  +CONFIG_FUSE_FS=y
+```
+
+For the device tree, add the Mali GPU device and increase the memory to 1.8GB. Do this with the following changes at `<path/to/kernel/repo>/arch/arm/boot/dts/vexpress-v2p-ca15-tc1-gem5.dts.` Here is the output of `repo diff`:
+
+```
+  --- a/arch/arm/boot/dts/vexpress-v2p-ca15-tc1-gem5.dts
+  +++ b/arch/arm/boot/dts/vexpress-v2p-ca15-tc1-gem5.dts
+  @@ -45,7 +45,7 @@
+  
+           memory@80000000 {
+                   device_type = "memory";
+  -                reg = <0 0x80000000 0 0x40000000>;
+  +                reg = <0 0x80000000 0 0x74000000>;
+           };
+  
+          hdlcd@2b000000 {
+  @@ -59,6 +59,14 @@
+  //                mode = "3840x2160MR-16@60"; // UHD4K mode string
+                    framebuffer = <0 0x8f000000 0 0x01000000>;
+            };
+  +
+  +    gpu@0x2d000000 {
+  +        compatible = "arm,mali-midgard";
+  +        reg = <0 0x2b400000 0 0x4000>;
+  +        interrupts = <0 86 4>, <0 87 4>, <0 88 4>;
+  +        interrupt-names = "JOB", "MMU", "GPU";
+  +    };
+  +
+  /*
+          memory-controller@2b0a0000 {
+                    compatible = "arm,pl341", "arm,primecell";
+```
+
+Download and unpack the userspace matching Mali kernel drivers for gem5 from [http://malideveloper.arm.com/resources/drivers/open-source-mali-midgard-gpu-kernel-drivers/ here]. Copy them to the gpu driver directory:
+
+```
+cp -r <path/to/kernelspace/Mali/drivers>/driver/product/kernel/drivers/gpu/arm/ drivers/gpu
+```
+
+Change the following in `<path/to/kernelspace/Mali/drivers>/drivers/video/Kconfig` and `<path/to/kernelspace/Mali/drivers>/drivers/gpu/Makefile` based on the following diffs:
+
+Here is the output of the Kconfig `repo diff`:
+
+```
+  --- a/drivers/video/Kconfig
+  +++ b/drivers/video/Kconfig
+  @@ -23,6 +23,8 @@ source "drivers/gpu/host1x/Kconfig"
+  
+  source "drivers/gpu/drm/Kconfig"
+  
+  +source "drivers/gpu/arm/Kconfig"
+  +
+   config VGASTATE
+          tristate
+          default n
+```
+
+Here is the output of the drivers/gpu/Makefile `repo diff`:
+
+```
+  --- a/drivers/gpu/Makefile
+  +++ b/drivers/gpu/Makefile
+  @@ -1,2 +1,2 @@
+  -obj-y                += drm/ vga/
+  +obj-y                += drm/ vga/ arm/
+```
+
+Finally, build the kernel and the .dtb file.
+
+**Tip: Use the -jN flag to speed up the make process, where N is the number of parallel jobs to run.**
+
+Build the kernel:
+```
+make CROSS_COMPILE=arm-linux-gnueabihf- ARCH=arm vexpress_gem5_defconfig
+make CROSS_COMPILE=arm-linux-gnueabihf- ARCH=arm vmlinux -jN
+```
+
+Create the .dtb file:
+
+```
+dtc -I dts -O dtb arch/arm/boot/dts/vexpress-v2p-ca15-tc1-gem5.dts > vexpress-v2p-ca15-tc1-gem5.dtb
+```
+
+## Testing the build
+
+Make the following changes to example/fs.py. Here is the output ``repo diff``:
+
+```
+  --- a/configs/example/fs.py Thu Jun 02 20:34:39 2016 +0100
+  +++ b/configs/example/fs.py Fri Jun 10 15:37:29 2016 -0700
+  @@ -144,6 +144,13 @@
+       if is_kvm_cpu(TestCPUClass) or is_kvm_cpu(FutureClass):
+           test_sys.vm = KvmVM()
+  
+  +    test_sys.gpu = NoMaliGpu(
+  +        gpu_type="T760",
+  +        ver_maj=0, ver_min=0, ver_status=1,
+  +        int_job=118, int_mmu=119, int_gpu=120,
+  +        pio_addr=0x2b400000,
+  +        pio=test_sys.membus.master)
+  +
+      if options.ruby:
+          # Check for timing mode because ruby does not support atomic accesses
+          if not (options.cpu_type == "detailed" or options.cpu_type == "timing"):
+```
+
+And the changes to FS config to either enable or disable software rendering.
+
+```
+  --- a/configs/common/FSConfig.py Thu Jun 02 20:34:39 2016 +0100
+  +++ b/configs/common/FSConfig.py Thu Jun 16 10:23:44 2016 -0700
+  @@ -345,7 +345,7 @@
+  
+             # release-specific tweaks
+             if 'kitkat' in mdesc.os_type():
+  -                cmdline += " androidboot.hardware=gem5 qemu=1 qemu.gles=0 " + \
+  +                cmdline += " androidboot.hardware=gem5 qemu=1 qemu.gles=1 " + \
+                            "android.bootanim=0"
+  
+         self.boot_osflags = fillInCmdline(mdesc, cmdline
+```
+
+Set the following M5\_PATH:
+
+```
+M5_PATH=. build/ARM/gem5.opt configs/example/fs.py --cpu-type=atomic --mem-type=SimpleMemory --os-type=android-kitkat --disk-image=myimage.img --machine-type=VExpress_EMM --dtb-filename=vexpress-v2p-ca15-tc1-gem5.dtb -n 1 --mem-size=1800MB
+```
+
+## Building older versions of Android
+
+gem5 has support for running even older versions of Android like KitKat. The documentation to do so, as well as the necessary drivers and files required, can be found on the old wiki [here](http://old.gem5.org/Android_KitKat.html). 
diff --git a/_pages/documentation/general_docs/fullsystem/building_arm_kernel.md b/_pages/documentation/general_docs/fullsystem/building_arm_kernel.md
new file mode 100644
index 0000000..503dcee
--- /dev/null
+++ b/_pages/documentation/general_docs/fullsystem/building_arm_kernel.md
@@ -0,0 +1,144 @@
+---
+layout: documentation
+title: "Building ARM Kernel"
+doc: gem5 documentation
+parent: fullsystem
+permalink: /documentation/general_docs/fullsystem/building_arm_kernel
+---
+
+# Building ARM Kernel
+
+This page contains instructions for building up-to-date kernels for gem5 running on ARM. 
+
+## Prerequisites
+These instructions are for running headless systems. That is a more "server" style system where there is no frame-buffer. The description has been created using the latest known-working tag in the repositories linked below, however the tables in each section list previous tags that are known to work. To built the kernels on an x86 host you'll need ARM cross compilers and the device tree compiler. If you're running a reasonably new version of Ubuntu or Debian you can get required software through apt:
+
+```
+apt-get install  gcc-arm-linux-gnueabihf gcc-aarch64-linux-gnu device-tree-compiler
+```
+
+If you can't use these pre-made compilers the next easiest way to obtain the required compilers from [Linaro](http://releases.linaro.org/latest/components/toolchain/binaries/). 
+
+Depending on the exact source of your cross compilers, the compiler names used below will required small changes.
+
+To actually run the kernel, you'll need to download or compile gem5's bootloader. See the (bootloaders)(#bootloaders) section in this documents for details.
+
+## Linux 4.x
+Newer gem5 kernels for ARM (v4.x and later) are based on the vanilla Linux kernel and typically have a small number of patches to make them work better with gem5. The patches are optional and you should be able to use a vanilla kernel as well. However, this requires you to configure the kernel yourself. Newer kernels all use the VExpress\_GEM5\_V1 gem5 platform for both AArch32 and AArch64. The required DTB files to describe the hardware to the OS ship with gem5. To build them, execute this command:
+
+```
+make -C system/arm/dt
+```
+
+## Kernel Checkout
+To checkout the kernel, execute the following command:
+
+```
+git clone https://gem5.googlesource.com/arm/linux
+```
+
+The repository contains a tag per gem5 kernel releases and working branches for major Linux revisions. Check the [project page](https://gem5-review.googlesource.com/#/admin/projects/arm/linux project page) for a list of tags and branches. The clone command will, by default, check out the latest release branch. To checkout the v4.4 branch, execute the following in the repository:
+```
+git checkout -b gem5/v4.4
+```
+
+## AArch32
+To compile the kernel, execute the following commands in the repository:
+
+```
+make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- gem5_defconfig
+make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j `nproc`
+```
+
+Testing the just built kernel:
+
+```
+./build/ARM/gem5.opt configs/example/fs.py --kernel=/tmp/linux-arm-gem5/vmlinux --machine-type=VExpress_GEM5_V1 \
+    --dtb-file=$PWD/system/arm/dt/armv7_gem5_v1_1cpu.dtb
+```
+
+## AArch64
+To compile the kernel, execute the following commands in the repository:
+
+```
+make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- gem5_defconfig
+make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j `nproc`
+```
+
+Testing the just built kernel:
+
+```
+./build/ARM/gem5.opt configs/example/fs.py --kernel=/tmp/linux-arm-gem5/vmlinux --machine-type=VExpress_GEM5_V1 \
+    --dtb-file=$PWD/system/arm/dt/armv8_gem5_v1_1cpu.dtb --disk-image=linaro-minimal-aarch64.img
+```
+
+# Legacy kernels (pre v4.x)
+Older gem5 kernels for ARM (pre v4.x) are based on Linaro's Linux kernel for ARM. These kernels use either the VExpress\_EMM (AArch32) or VExpress\_EMM64 (AArch64)  gem5 platform. Unlike the newer kernels, there is a separate AArch32 and AArch64 kernel repository and the device tree files are shipped with the kernel.
+
+## 32 bit kernel (AArch32)
+These are instructions to generate a 32-bit ARM Linux binary.
+
+To checkout the aarch32 kernel, execute the following command:
+
+```
+git clone https://gem5.googlesource.com/arm/linux-arm-legacy
+```
+
+The repository contains a tag per gem5 kernel release. Check the [project page](https://gem5-review.googlesource.com/#/admin/projects/arm/linux-arm-legacy project page) for a list of branches and release tags. To checkout a tag, execute the following in the repository:
+
+```
+git checkout -b TAGNAME
+```
+
+To compile the kernel, execute the following commands in the repository:
+
+```
+make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- vexpress_gem5_server_defconfig
+make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j `nproc`
+```
+
+Testing the just built kernel:
+
+```
+./build/ARM/gem5.opt configs/example/fs.py  --kernel=/tmp/linux-arm-gem5/vmlinux \
+   --machine-type=VExpress_EMM --dtb-file=/tmp/linux-arm-gem5/arch/arm/boot/dts/vexpress-v2p-ca15-tc1-gem5.dtb 
+```
+
+## 64 bit kernel (AArch64)
+These are instructions to generate a 64-bit ARM Linux binary. 
+
+To checkout the aarch64 kernel, execute the following command:
+
+```
+git clone https://gem5.googlesource.com/arm/linux-arm64-legacy
+```
+
+The repository contains a tag per gem5 kernel release. Check the [project page](https://gem5-review.googlesource.com/#/admin/projects/arm/linux-arm64-legacy project page) for a list of branches and release tags. To checkout a tag, execute the following in the repository:
+
+```
+git checkout -b TAGNAME
+```
+
+To compile the kernel, execute the following commands in the repository:
+
+```
+make ARCH=arm64 CROSS_COMPILE=aarch64-none-elf- gem5_defconfig
+make ARCH=arm64 CROSS_COMPILE=aarch64-none-elf- -j4
+```
+
+Testing the just built kernel:
+
+```
+./build/ARM/gem5.opt configs/example/fs.py --kernel=/tmp/linux-arm64-gem5/vmlinux --machine-type=VExpress_EMM64 \
+    --dtb-file=/tmp/linux-arm64-gem5/arch/arm64/boot/dts/aarch64_gem5_server.dtb --disk-image=linaro-minimal-aarch64.img
+```
+
+# Bootloaders
+There are two different bootloaders for gem5. One of 32-bit kernels and one for 64-bit kernels. They can be compiled using the following command:
+
+```
+make -C system/arm/simple_bootloader
+make -C system/arm/aarch64_bootloader
+```
+
+Once you have compiled the binaries, put them in the binaries directory in your M5\_PATH.
diff --git a/_pages/documentation/general_docs/fullsystem/disks.md b/_pages/documentation/general_docs/fullsystem/disks.md
index 1d1db0c..253ad0f 100644
--- a/_pages/documentation/general_docs/fullsystem/disks.md
+++ b/_pages/documentation/general_docs/fullsystem/disks.md
@@ -525,7 +525,7 @@
 
 ## 4) Using Packer to create a disk image
 
-This section discusses an automated way of creating gem5-compatible disk images with Ubuntu server installed. We make use of packer to do this which makes use of .json template files to build and configure a disk image. These template files can be configured to build a disk image with specific benchmarks installed.
+This section discusses an automated way of creating gem5-compatible disk images with Ubuntu server installed. We make use of packer to do this which makes use of a .json template file to build and configure a disk image. The template file could be configured to build a disk image with specific benchmarks installed. The mentioned template file can be found [here](/assets/files/packer_template.json).
 
 
 ### Building a Simple Disk Image with Packer
diff --git a/_pages/events/asplos-2018.md b/_pages/events/asplos-2018.md
new file mode 100644
index 0000000..43b99f4
--- /dev/null
+++ b/_pages/events/asplos-2018.md
@@ -0,0 +1,97 @@
+---
+title: "ASPLOS 2018"
+date: 2020-02-04T14:54:41-07:00
+draft: false
+permalink: events/asplos-2018
+---
+
+# Learning gem5 Tutorial at ASPLOS 2018
+
+Thanks to all of those who attended the tutorial! Links to the slides and videos are below.
+
+ - Part 1: [Slides](/_pages/static/events/learning gem5 - part 1.pdf) and [Video](https://www.youtube.com/watch?v=wo4b9FPEiHk)
+ - Part 2: [Slides](/_pages/static/events/learning gem5 - part 2.pdf) and [Video 1](https://www.youtube.com/watch?v=SEiOsMmG5qo) [Video 2](https://www.youtube.com/watch?v=eiliJz_YsG4)
+ - Part 3: [Slides](/_pages/static/events/learning gem5 - part 3.pdf) and [Video](https://www.youtube.com/watch?v=XTIrVBb86aM)
+ - Part 4: [Slides](/_pages/static/events/learning gem5 - part 4.pdf) and [Video](https://www.youtube.com/watch?v=JFC0km8zPbw)
+ - Part N: [Slides](/_pages/static/events/learning gem5 - other.pdf)
+
+We will be hosting a Learning gem5 tutorial at [ASPLOS 2018](http://asplos2018.org/) in Williamsburg, VA on March 24th.
+
+gem5 is used by an incredible number of architecture researchers. The gem5 paper has been cited over 2000 times according to Google Scholar. However, gem5 is a unique software infrastructure; as a user, you also have to be a developer. Currently, there are few resources for young computer architects to learn how to productively use gem5.
+
+This tutorial builds off of the [Learning gem5 book](/documentation/learning_gem5/introduction) and will introduce junior architecture students to the inner workings of gem5 so they can be more productive in their future research. The goal of the "tutorial" section of this tutorial is not to introduce attendees to every feature of gem5, but to give them a framework to succeed when using gem5 in their future research.
+
+After spending the morning learning about the basics of how gem5 works, the afternoon will be a series of invited talks from users who have experience using gem5 on "gem5 best practices". This will cover a variety of topics including the basics of computer architecture research, software development practices, and how to contribute to the gem5 open source project.
+
+This tutorial is perfect for beginning graduate students or other computer architecture researchers to get started using one of the architecture communities most popular too.
+
+This page is under development. It will be updated often leading up to the day of the tutorial. Hope to see you there!
+### Preparing for the tutorial
+
+To get the most out of this tutorial, you are encouraged to bring a laptop to work along. This will be an interactive tutorial, with many coding examples. Additionally, by bringing a laptop, you will be able to easily participate in the afternoon coding sprint.
+
+While this tutorial is appropriate for you even if you've never used gem5 before, you'll get more out of it if you familiarize yourself with gem5 before coming. Specifically, by downloading gem5 and making sure it builds on your system you will save yourself a lot of time. Reading and completing the [first chapter from the the Learning gem5 book](http://www.gem5.org/documentation/learning_gem5/part1/building/) before coming to the tutorial is strongly encouraged.
+### Audience
+
+The primary audience is junior computer architecture researchers (e.g., first or second year graduate students) who are planning on using gem5 for future architecture research. We also invite others who want a high-level idea of how gem5 works and its applicability to architecture research.
+# Schedule
+
+## Morning Schedule: Learning gem5 8:30 – 10:00
+
+ - Breakfast 7:00 – 8:30
+ - What is gem5 and history
+ - Getting started with gem5
+    - Overall (software) architecture of gem5
+    - Compiling gem5
+    - Simple introduction script
+    - First time running gem5
+    - Interpreting gem5's output
+    - Simple assembly example to show debug trace of everything
+ - Extending gem5
+    - Structure of C++ code
+    - Writing a simple SimObject
+ - BREAK 10:00 – 10:30
+    - Discrete event simulation programming
+    - SimObject parameters
+    - gem5 memory system
+    - Overview of simple cache implementation
+
+## Lunch (Provided) 12:00 – 1:30
+## Advanced Learning gem5 topics 1:30 – 3:30
+
+ - Building a CPU model in gem5
+    - ISAs and CPU model ISA relation
+    - Overview of different CPU models
+    - Building a simple CPU model
+ - Coherence protocols with Ruby
+    - Intro to Ruby
+    - Simple MSI protocol
+    - Configuring Ruby
+    - Debugging Ruby protocols
+ - Quick overview of other gem5 topics
+    - Overview of full system simulation
+    - Briefly gem5's other features
+    - gem5 limitations
+ - BREAK 3:30 – 4:00
+
+## gem5 Best Practices 4:00 – 5:00
+
+ - Developing and contributing to gem5
+
+   This will cover an quick introduction to [git](https://git-scm.com/), best practices for contributing, how to test gem5, and how to use [gem5's code review site](https://gem5-review.googlesource.com/).
+ - Ryota Shioya: Visualizing the out-of-order CPU model
+
+   Konata is a new CPU pipeline viewer and has many useful features not in the previous text-based viewer. This talk will explain how to use the new viewer and best practices in gem5. [https://github.com/shioyadan/Konata/releases]
+
+   [Link to presentation](http://learning.gem5.org/tutorial/presentations/vis-o3-gem5.pdf)
+ - Éder F. Zulian: Using gem5 for Memory Research
+
+   This talk provides an overview of our experiences with the gem5 simulator at the Microelectronic System Design Research Group of the TU Kaiserslautern. It begins with our motivation and use cases for applying gem5. Then we jump ahead to a brief description of innovations introduced by our research group and partners.
+
+   The span of topics covers the DRAM power model used by gem5 (DRAMPower), which is being currently extended and maintained by our group. Furthermore, we show how a simple HMC memory model can be built from native objects provided by gem5, the configuration parameters are generated by our DRAMSpec tool.
+
+   Moreover, we present how gem5 can be coupled to SystemC/TLM2.0 based modules, an interesting approach for industry to reuse in-house and third-party SystemC modules together with gem5. Finally, we close the session showing a bunch of useful scripts, called gem5 Tips and Tricks, for setting up and breaking the ice with gem5.
+
+   [Link to presentation](http://learning.gem5.org/tutorial/presentations/gem5_mem_research.pdf)
+
+Open forum for questions and feedback 5:00 – 5:30
diff --git a/_pages/events/hcpa-2017.md b/_pages/events/hcpa-2017.md
new file mode 100644
index 0000000..e7f4381
--- /dev/null
+++ b/_pages/events/hcpa-2017.md
@@ -0,0 +1,68 @@
+---
+title: "HPCA 2017"
+date: 2020-02-06T16:05:30-07:00
+draft: false
+permalink: events/hpca-2017
+---
+
+# Learning gem5 Tutorial and Coding Sprint at HPCA 2017
+
+We will be hosting a Learning gem5 tutorial at [HPCA 17](http://hpca2017.org/) in Austin, TX. This tutorial will consist of two parts. In the morning, we will cover an introduction to gem5. Namely, I will be giving a series of lectures following the [Learning gem5 book](/documentation/learning_gem5/introduction).
+
+In the afternoon, we will have a gem5 coding sprint. You can find more information about coding sprints on Wikipedia. We are planning on pairing junior developers, including those who attend the morning Learning gem5 tutorial, with more senior developers and squashing some gem5 bugs or adding small new features. We will have a list of small gem5 projects that can be knocked out in an afternoon. Hopefully, through this sprint, we will be able to expand the developers of gem5.
+
+This page is under development. It will be updated often leading up to the day of the tutorial. Hope to see you there!
+
+### Preparing for the tutorial
+
+To get the most out of this tutorial, you are encouraged to bring a laptop to work along. This will be an interactive tutorial, with many coding examples. Additionally, by bringing a laptop, you will be able to easily participate in the afternoon coding sprint.
+
+While this tutorial is appropriate for you even if you've never used gem5 before, you'll get more out of it if you familiarize yourself with gem5 before coming. Specifically, by downloading gem5 and making sure it builds on your system you will save yourself a lot of time. Reading and completing the [first chapter from the the Learning gem5 book](/documentation/learning_gem5/part1/building/) before coming to the tutorial is **strongly encouraged**.
+
+### About this tutorial
+
+gem5 is used by an incredible number of architecture researchers. The gem5 paper was cited by more than 800 papers last year (2015) alone according to Google Scholar. However, gem5 is a unique software infrastructure; as a user, you also have to be a developer. Currently, there are few resources for young computer architects to learn how to productively use gem5. Building off of a book, [Learning gem5](/documentation/learning_gem5/introduction), this tutorial will introduce junior architecture students to the inner workings of gem5 so they can be more productive in their future research. The goal of the "tutorial" section of this tutorial is not to introduce attendees to every feature of gem5, but to give them a framework to succeed when using gem5 in their future research.
+
+After spending the morning learning about how gem5 works, the afternoon will be a hands-on ["code sprint"](https://en.wikipedia.org/wiki/Sprint_(software_development)). Members of the gem5 development community will introduce new gem5 contributors to the code submission and review process. We will spend the afternoon in small groups squashing simple bugs in gem5. This exercise will both help junior architects be more productive in their future work and improve gem5 at the same time.
+
+### Audience
+
+The primary audience is junior computer architecture researchers (e.g., first or second year graduate students) who are planning on using gem5 for future architecture research. We also invite others who want a high-level idea of how gem5 works and its applicability to architecture research.
+
+For the afternoon coding sprint, we invite all gem5 developers to participate. The more participation we have from experienced developers, the more we can get done!
+
+# Schedule
+
+More details to come soon.
+### Morning Schedule: Learning gem5
+
+  - 8:30 — What is gem5 and history
+  - 8:40 — Getting started with gem5
+    - Overall (software) architecture of gem5
+    - Compiling gem5
+    - Simple introduction script
+    - First time running gem5
+    - Interpreting gem5's output
+    - Simple assembly example to show debug trace of everything
+  - 9:15 — Extending gem5
+    - Structure of C++ code
+    - Writing a simple SimObject
+  - BREAK 10:00 — 10:30
+    - 10:30 — Discrete event simulation programming
+    - SimObject parameters
+    - 10:50 — gem5 memory system
+  - 11:40 — Quick overview of other gem5 topics
+    - Overview of full system simulation
+    - Overview of Ruby
+    - Briefly gem5's other features
+    - gem5 limitations
+
+### 12:00 — 1:30 Lunch (Will be provided!)
+### Afternoon Schedule: gem5 Coding Sprint
+  - Developing and contributing to gem5 — Andreas Sandberg [~30 minutes]
+
+    Andreas will describe the process of writing code and contributing changes to mainline gem5. He will go over the code submission and code review process. **This will cover gem5's new submission and code review process using Gerrit!**
+
+  - Split into small groups to work on code!
+  - Closing statements, recap, and feedback.
+
diff --git a/_pages/events/index.md b/_pages/events/index.md
index 682a38c..12765c4 100644
--- a/_pages/events/index.md
+++ b/_pages/events/index.md
@@ -27,6 +27,12 @@
 use gem5 to explore system architecture designs of microarchitectures
 implementing SVE.
 
+## ASPLOS 2018: Learning gem5
+
+[Full-day gem5 tutorial at ASPLOS 2018](asplos-2018)
+
+This tutorial covers the basics of building gem5, running it, extending and contributing to gem5, and other advanced gem5 topics.
+
 ## Arm Research Starter Kit on System Modeling using gem5
 
 <https://github.com/arm-university/arm-gem5-rsk>
@@ -48,6 +54,10 @@
 Workshop](arm-summit-2017) covers many
 advanced topics in gem5 such as Ruby, Garnet, and SystemC.
 
+## gem5 Tutorial and Coding Sprint at HPCA 2017
+
+[This tutorial](hpca-2017) introduces gem5 topics covered in the Learning gem5 book and paired junior software developers with seniors developers in a coding sprint to add features and bug fixes to the gem5 codebase using Gerrit.
+
 ## dist-gem5 at ISCA-44 (Toronto, 2017)
 
 dist-gem5 is a gem5-based simulation infrastructure which enables
diff --git a/_pages/static/events/learning gem5 - other.pdf b/_pages/static/events/learning gem5 - other.pdf
new file mode 100644
index 0000000..51edc8d
--- /dev/null
+++ b/_pages/static/events/learning gem5 - other.pdf
Binary files differ
diff --git a/_pages/static/events/learning gem5 - part 1.pdf b/_pages/static/events/learning gem5 - part 1.pdf
new file mode 100644
index 0000000..db3b629
--- /dev/null
+++ b/_pages/static/events/learning gem5 - part 1.pdf
Binary files differ
diff --git a/_pages/static/events/learning gem5 - part 2.pdf b/_pages/static/events/learning gem5 - part 2.pdf
new file mode 100644
index 0000000..c903d67
--- /dev/null
+++ b/_pages/static/events/learning gem5 - part 2.pdf
Binary files differ
diff --git a/_pages/static/events/learning gem5 - part 3.pdf b/_pages/static/events/learning gem5 - part 3.pdf
new file mode 100644
index 0000000..b5fdca0
--- /dev/null
+++ b/_pages/static/events/learning gem5 - part 3.pdf
Binary files differ
diff --git a/_pages/static/events/learning gem5 - part 4.pdf b/_pages/static/events/learning gem5 - part 4.pdf
new file mode 100644
index 0000000..b81762a
--- /dev/null
+++ b/_pages/static/events/learning gem5 - part 4.pdf
Binary files differ
diff --git a/assets/files/packer_template.json b/assets/files/packer_template.json
new file mode 100644
index 0000000..68f89eb
--- /dev/null
+++ b/assets/files/packer_template.json
@@ -0,0 +1,98 @@
+{
+    "builders":
+    [
+        {
+            "type": "qemu",
+            "format": "raw",
+            "accelerator": "kvm",
+            "boot_command":
+            [
+                "{{ user `boot_command_prefix` }}",
+                "debian-installer={{ user `locale` }} auto locale={{ user `locale` }} kbd-chooser/method=us ",
+                "file=/floppy/{{ user `preseed` }} ",
+                "fb=false debconf/frontend=noninteractive ",
+                "hostname={{ user `hostname` }} ",
+                "/install/vmlinuz noapic ",
+                "initrd=/install/initrd.gz ",
+                "keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA ",
+                "keyboard-configuration/variant=USA console-setup/ask_detect=false ",
+                "passwd/user-fullname={{ user `ssh_fullname` }} ",
+                "passwd/user-password={{ user `ssh_password` }} ",
+                "passwd/user-password-again={{ user `ssh_password` }} ",
+                "passwd/username={{ user `ssh_username` }} ",
+                "-- <enter>"
+            ],
+            "cpus": "{{ user `vm_cpus`}}",
+            "disk_size": "{{ user `image_size` }}",
+            "floppy_files":
+            [
+                "http/{{ user `preseed` }}"
+            ],
+            "headless": "{{ user `headless` }}",
+            "http_directory": "http",
+            "iso_checksum": "{{ user `iso_checksum` }}",
+            "iso_checksum_type": "{{ user `iso_checksum_type` }}",
+            "iso_urls": [ "{{ user `iso_url` }}" ],
+            "memory": "{{ user `vm_memory`}}",
+            "output_directory": "{{ user `image_name` }}-image",
+            "qemuargs":
+            [
+                [ "-cpu", "host" ],
+                [ "-display", "none" ]
+            ],
+            "qemu_binary":"/usr/bin/qemu-system-x86_64",
+            "shutdown_command": "echo '{{ user `ssh_password` }}'|sudo -S shutdown -P now",
+            "ssh_password": "{{ user `ssh_password` }}",
+            "ssh_username": "{{ user `ssh_username` }}",
+            "ssh_wait_timeout": "60m",
+            "vm_name": "{{ user `image_name` }}"
+        }
+    ],
+    "provisioners":
+    [
+        {
+            "type": "file",
+            "source": "../gem5/util/m5/m5",
+            "destination": "/home/gem5/"
+        },
+        {
+            "type": "file",
+            "source": "scripts/serial-getty@.service",
+            "destination": "/home/gem5/"
+        },
+        {
+            "type": "file",
+            "source": "scripts/runscript.sh",
+            "destination": "/home/gem5/"
+        },
+        {
+            "type": "shell",
+            "execute_command": "echo '{{ user `ssh_password` }}' | {{.Vars}} sudo -E -S bash '{{.Path}}'",
+            "scripts":
+            [
+                "scripts/post-installation.sh"
+            ]
+        }
+    ],
+    "variables":
+    {
+        "boot_command_prefix": "<enter><wait><f6><esc><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
+        "desktop": "false",
+        "image_size": "8192",
+        "headless": "true",
+        "iso_checksum": "34416ff83179728d54583bf3f18d42d2",
+        "iso_checksum_type": "md5",
+        "iso_name": "ubuntu-18.04.2-server-amd64.iso",
+        "iso_url": "http://old-releases.ubuntu.com/releases/18.04.2/ubuntu-18.04.2-server-amd64.iso",
+        "locale": "en_US",
+        "preseed" : "preseed.cfg",
+        "hostname": "gem5",
+        "ssh_fullname": "gem5",
+        "ssh_password": "12345",
+        "ssh_username": "gem5",
+        "vm_cpus": "16",
+        "vm_memory": "8192",
+        "image_name": "ubuntu"
+  }
+
+}