This pull request aims to provide the support of the virtio-blk device for the project. The modification mainly includes:
A code implementation of virtio-blk device
Device tree source adjustment
Linux kernel configuration adjustment
Interrupt assignment / handling of the virtio-blk device
To test the new feature, you need to:
Create a test disk image using dd, cfdisk, losetup, and mkfs.ext4, where I followed the guide of the presentation "Embedded linux from scratch in 45 minutes" at page 35.
Launch the emulator using:
./semu <linux-image> [<dtb>] [<disk-img>]
The virtio-blk device should be enumerated at /dev/vda during the boot-up process. The following experiment can help to verify the device works properly:
Observe the partition table of the disk:
fdisk -l
Mount the disk to a directory:
mkdir mnt/
mount /dev/vda1 mnt/
Try writing some thing to the mount directory:
echo "Hello World!" > mnt/test.txt
Unmount the disk:
umount mnt/
After re-launching the semu, the written file should remain existing.
This pull request aims to provide the support of the virtio-blk device for the project. The modification mainly includes:
To test the new feature, you need to:
dd
,cfdisk
,losetup
, andmkfs.ext4
, where I followed the guide of the presentation "Embedded linux from scratch in 45 minutes" at page 35.The virtio-blk device should be enumerated at
/dev/vda
during the boot-up process. The following experiment can help to verify the device works properly:semu
, the written file should remain existing.