-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a54b1ca
commit 03c9e47
Showing
6 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/disk.img |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
PROFILE=debug | ||
|
||
.PHONY: FORCE | ||
|
||
bootloader/target/x86_64-unknown-uefi/$(PROFILE)/bootloader.efi: FORCE | ||
cd bootloader && \ | ||
cargo build | ||
|
||
disk.img: bootloader/target/x86_64-unknown-uefi/$(PROFILE)/bootloader.efi | ||
# qemu-img create [-f format] [-o options] filename [size][preallocation] | ||
# mkfs.fat [-n VOLUME-NAME] [-s SECTORS-PER-CLUSTER] [-f NUMBER-OF-FATS] [-R NUMBER-OF-RESERVED-SECTORS] [-F FAT-SIZE] | ||
# ref.) `man mkfs.fat` | ||
# mount [-o options] device dir | ||
# loop -> mount as loop device | ||
qemu-img create -f raw disk.img 200M && \ | ||
mkfs.fat -n "lemola_osv2" -s 2 -f 2 -R 32 -F 32 disk.img && \ | ||
mkdir -p mnt && \ | ||
sudo mount -o loop disk.img mnt && \ | ||
sudo mkdir -p mnt/EFI/BOOT && \ | ||
sudo cp bootloader/target/x86_64-unknown-uefi/$(PROFILE)/bootloader.efi mnt/EFI/BOOT/BOOTX64.EFI && \ | ||
sudo umount mnt | ||
|
||
run: disk.img | ||
qemu-system-x86_64 \ | ||
-drive if=pflash,file=ovmf/OVMF_CODE.fd \ | ||
-drive if=pflash,file=ovmf/lemola_os_ovmf_vars.fd \ | ||
-hda disk.img |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
# only for ubuntu | ||
|
||
# NOTE* install rust before run this | ||
|
||
sudo apt-get install qemu-kvm -y | ||
sudo apt-get install ovmf -y | ||
|
||
# setup ovmf files by yourself | ||
|
||
# cp /usr/share/OVMF/OVMF_VARS.fd ./ovmf/lemola_os_ovmf_vars.fd | ||
# cp /usr/share/OVMF/OVMF_CODE.fd ./ovmf/OVMF_CODE.fd |