From 755dff4dc817d84a7f8223885b18d069e6629c94 Mon Sep 17 00:00:00 2001 From: yudejp Date: Tue, 4 May 2021 10:46:27 +0900 Subject: [PATCH] Add utils --- .devcontainer/make_disk.sh | 11 +++++++++++ .devcontainer/run_qemu.sh | 5 +++++ 2 files changed, 16 insertions(+) create mode 100644 .devcontainer/make_disk.sh create mode 100644 .devcontainer/run_qemu.sh diff --git a/.devcontainer/make_disk.sh b/.devcontainer/make_disk.sh new file mode 100644 index 0000000..42611d7 --- /dev/null +++ b/.devcontainer/make_disk.sh @@ -0,0 +1,11 @@ +#!/bin/bash +if [ -e /home/vscode/disk.img ]; then + rm /home/vscode/disk.img +fi +qemu-img create -f raw disk.img 200M +mkfs.fat -n 'FIRMAMENT' -s 2 -f 2 -R 32 -F 32 disk.img +mkdir -p /home/vscode/mnt +sudo mount -o loop disk.img /home/vscode/mnt +sudo mkdir -p /home/vscode/mnt/EFI/BOOT +sudo cp /home/vscode/BOOTX64.EFI /home/vscode/mnt/EFI/BOOT/BOOTX64.EFI +sudo umount /home/vscode/mnt \ No newline at end of file diff --git a/.devcontainer/run_qemu.sh b/.devcontainer/run_qemu.sh new file mode 100644 index 0000000..c64e9a5 --- /dev/null +++ b/.devcontainer/run_qemu.sh @@ -0,0 +1,5 @@ +#!/bin/bash +qemu-system-x86_64 \ + -drive if=pflash,file=/home/vscode/osbook/devenv/OVMF_CODE.fd \ + -drive if=pflash,file=/home/vscode/osbook/devenv/OVMF_VARS.fd \ + -hda disk.img \ No newline at end of file