summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArturs Artamonovs <dos21h@gmail.com>2023-12-22 10:14:18 +0000
committerArturs Artamonovs <dos21h@gmail.com>2023-12-22 10:14:18 +0000
commit16232936770eac53e636681d197551bb98fb6091 (patch)
tree8229e1b02c2d25d3d262d61e65588a6df49f1378
parentb4faa70d6f59d3c6d426ae052f2a53ef12648ce9 (diff)
parentb5987117a40aad82d56e2b07b512fe92a11bbbd9 (diff)
downloadmd-content-16232936770eac53e636681d197551bb98fb6091.tar.gz
md-content-16232936770eac53e636681d197551bb98fb6091.zip
Got latest from master
-rw-r--r--md/writeup/qemu_arm64.md38
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