diff options
author | Arturs Artamonovs <dos21h@gmail.com> | 2023-12-22 10:10:53 +0000 |
---|---|---|
committer | Arturs Artamonovs <dos21h@gmail.com> | 2023-12-22 10:10:53 +0000 |
commit | b5987117a40aad82d56e2b07b512fe92a11bbbd9 (patch) | |
tree | 2ba80485b4a03a94f01914ae806c2d39ec376a73 /md/writeup/qemu_arm64.md | |
parent | abd86a19625c94610cfca5be6b9c5e74d4e60e58 (diff) | |
download | md-content-origin/new/qemu_arm64.tar.gz md-content-origin/new/qemu_arm64.zip |
Update Qemu ARM64 notesorigin/new/qemu_arm64
Diffstat (limited to 'md/writeup/qemu_arm64.md')
-rw-r--r-- | md/writeup/qemu_arm64.md | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/md/writeup/qemu_arm64.md b/md/writeup/qemu_arm64.md index 244319c..79f8819 100644 --- a/md/writeup/qemu_arm64.md +++ b/md/writeup/qemu_arm64.md @@ -67,11 +67,44 @@ qemu-system-aarch64 -M virt -m 1024 -cpu cortex-a53 \ ## Run virt -Qemu contains configuration to run non existent machine called virt that suppose to be run with virtual machines. +Qemu contains configuration to run physicaly non existant ARM64 board called virt that suppose to be run with virtual machines and contains generic configuration. + +Basic examples how to boot into the busy box shell is. Build busy boxwith mount,ash,exec and echo. +Create init script that will set the pathes and create some dev,proc and sys mount points and switch +to busybox shell. + +```bash +#!/sh +/busybox echo "Boom" > /dev/kmsg +export PATH=/sbin:/usr/sbin:/bin:/usr/bin:/ +/busybox mount -t proc none /proc +/busybox mount -t sysfs none /sys +/buysbox mount -t devtmpfs -o nosuid,mode=0755 udev /dev +/busybox mount /dev/pts +/busybox mount -t devpts -o noexec,nosuid,gid=5,mode=0620 devpts /dev/pts || true +exec /busybox sh +``` + +Create initrd files with init file and busybox utilities + +```bash +find . | cpio -o -c -R root:root | gzip -9 > ../initrd-arm64.img +``` + +Boot into the just created initrd ```bash +qemu-system-aarch64 \ + -machine virt -m 1024M -cpu cortex-a53 \ + -kernel bootfs-arm64/Image.gz \ + -initrd initrd-out.gz \ + -append "root=/dev/ram0 console=ttyAMA0 debug " \ + -nographic ``` + + + ## Under ArchLinux Install all qemu packages with @@ -99,4 +132,5 @@ pacman -S qemu-full 12. [https://wiki.archlinux.org/title/mkinitcpio](https://wiki.archlinux.org/title/mkinitcpio) 13. https://www.ibm.com/docs/en/zos/2.4.0?topic=codes-exit-status-usrsbininit 14. https://access.redhat.com/solutions/24029 -15. [http://phwl.org/2022/qemu-aarch64-debian/](http://phwl.org/2022/qemu-aarch64-debian/)
\ No newline at end of file +15. [http://phwl.org/2022/qemu-aarch64-debian/](http://phwl.org/2022/qemu-aarch64-debian/) +16. [http://git.main.lv/cgit.cgi/os201.git/tree/create_installroot](http://git.main.lv/cgit.cgi/os201.git/tree/create_installroot)
\ No newline at end of file |