jasonbu opened a new pull request, #18343:
URL: https://github.com/apache/nuttx/pull/18343
## Summary
This PR adds VirtIO 9P filesystem (v9fs) support for BUILD_KERNEL
configuration and enables it on the qemu-armv7a knsh board.
## Changes
1. v9fs: add va_to_pa for kernel build compatible
Add up_addrenv_va_to_pa() conversion for buffer addresses in v9fs client
read/write operations
This is required because in kernel build mode, virtual addresses need to be
converted to physical addresses for VirtIO device DMA operations
2. fs/v9fs: add support for KERNEL build, only transfer 4K once
Limit read/write transfer size to page boundary (CONFIG_MM_PGSIZE) in kernel
build
This handles non-contiguous physical memory pages - each transfer stays
within a single physical page
Use bufptr instead of directly modifying buffer pointer for proper iteration
3. board/armv7a/knsh: enable fdt/virtiommio/virtiov9fs support
Enable CONFIG_DEVICE_TREE=y
Enable CONFIG_DRIVERS_VIRTIO=y and CONFIG_DRIVERS_VIRTIO_MMIO=y
Enable CONFIG_FS_V9FS=y and CONFIG_V9FS_VIRTIO_9P=y
Adjust RAM settings: start from 0x40100000 with size 15728640 to accommodate
FDT
4. Documents/boards/qemu-armv7a: add knsh v9fs launch method
Add documentation for launching KNSH with VirtIO 9P filesystem
Include QEMU command with -fsdev and -device virtio-9p-device options
Document mount command: mount -t v9fs -o trans=virtio,tag=share /share
## Testing
CI-test, qemu-v7a v9fs mount and ls check if working for review hostfiles.
```bash
# Build knsh
$ ./tools/configure.sh qemu-armv7a:knsh
$ make V=1 -j`nproc`
$ make export V=1
$ cd ../apps
$ ./tools/mkimport.sh -z -x ../nuttx/nuttx-export-*.tar.gz
$ make import -j`nproc`
$ cd ../nuttx
# Run with v9fs
$ qemu-system-arm -semihosting -M virt -m 1024 -nographic \
-fsdev local,security_model=none,id=localshared,path=. \
-device virtio-9p-device,id=fs0,fsdev=localshared,mount_tag=share \
-kernel ./nuttx
# Inside nsh
nsh> mount -t v9fs -o trans=virtio,tag=share /share
nsh> ls /share
```
test result:
```bash
ostest_main: Exiting with status 0
nsh> ls -l /share/nuttx
-rwxrwxr-x 3367716 /share/nuttx
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]