Below are the steps to get an ARM64 version of Ubuntu running in the QEMU emulator on Windows 10.
Install for Windows from choco package manager
choco install qemu --version=2021.5.5 -confirm
PS D:\arm64-ubuntu2004\qemu> qemu-system-aarch64 --help
| /* | |
| ============================================================================ | |
| Name : branch_mispred.c | |
| Author : John Demme | |
| Version : Mar 21, 2011 | |
| Description : A template for perf_event. Requires Linux 2.6.32 or higher | |
| ============================================================================ | |
| */ | |
| #define _GNU_SOURCE |
| all: kernel_modules | |
| obj-m := kernel_zerocopy_mmap.o | |
| KDIR := /lib/modules/$(shell uname -r)/build | |
| PWD := $(shell pwd) | |
| %.ko: %.o | |
| $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) $@ |
| # Makefile for gtest examples | |
| GOOGLE_TEST_LIB = gtest | |
| GOOGLE_TEST_INCLUDE = /usr/local/include | |
| G++ = g++ | |
| G++_FLAGS = -c -Wall -I $(GOOGLE_TEST_INCLUDE) | |
| LD_FLAGS = -L /usr/local/lib -l $(GOOGLE_TEST_LIB) -l pthread | |
| OBJECTS = main.o string-compare.o |
| codename=$(lsb_release -cs) | |
| sudo tee /etc/apt/sources.list.d/ddebs.list << EOF | |
| deb http://ddebs.ubuntu.com/ ${codename} main restricted universe multiverse | |
| # deb http://ddebs.ubuntu.com/ ${codename}-security main restricted universe multiverse | |
| deb http://ddebs.ubuntu.com/ ${codename}-updates main restricted universe multiverse | |
| deb http://ddebs.ubuntu.com/ ${codename}-proposed main restricted universe multiverse | |
| EOF | |
| sudo apt-get update |
| use std::collections::HashMap; | |
| use std::fs::File; | |
| use std::future::Future; | |
| use std::io::Error; | |
| use std::io::IoSliceMut; | |
| use std::io::Result; | |
| use std::marker::PhantomData; | |
| use std::os::unix::io::AsRawFd; | |
| use std::os::unix::io::RawFd; | |
| use std::pin::Pin; |
| const std = @import("std"); | |
| pub fn main() !void { | |
| const epollfd = blk: { | |
| const rc = std.os.linux.epoll_create1(std.os.linux.EPOLL_CLOEXEC); | |
| const err = std.os.linux.getErrno(rc); | |
| if (err != 0) return error.EpollCreateFailed; | |
| break :blk @intCast(i32, rc); | |
| }; | |
| defer std.os.close(epollfd); |
| // Test case for OP_SPLICE short read issue. Most systems may require the open | |
| // file limit to be raised (4096, which is probably still within the hard limit, | |
| // should be enough). | |
| // | |
| // This tries to read from a file called '20k', which I generated with the | |
| // following: | |
| // `dd if=/dev/random of=20k bs=1k count=20` | |
| #define _GNU_SOURCE | |
| #include <errno.h> |
| /**/ | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <unistd.h> | |
| #include <fcntl.h> | |
| #include <string.h> | |
| #include <strings.h> | |
| #include <errno.h> | |
| #include <sys/time.h> | |
| #include <sys/resource.h> |
| #!/usr/env python | |
| import urllib2 | |
| from HTMLParser import HTMLParser | |
| import os | |
| def downloadFile(url, filename): | |
| u = urllib2.urlopen(url+'?format=txt') | |
| localFile = open(filename, 'w') |