Skip to content

Commit

Permalink
[DOCS] Add step to init submodules in all READMEs
Browse files Browse the repository at this point in the history
The DTC compiler is now submodule of Xvisor so in freshly cloned
Xvisor we need to init submodules once. This patch updates all
READMEs accordingly.

Signed-off-by: Anup Patel <anup@brainfault.org>
  • Loading branch information
avpatel committed Jan 25, 2017
1 parent 06afe9f commit f5172a8
Show file tree
Hide file tree
Showing 37 changed files with 1,005 additions and 799 deletions.
117 changes: 63 additions & 54 deletions docs/arm/bcm2835-raspi.txt
Expand Up @@ -28,45 +28,50 @@ Following are steps to create these images and boot Xvisor on Raspberry Pi:
[2. GoTo Xvisor source directory]
# cd <xvisor_source_directory>

[3. Configure Xvisor with Generic v6 default settings]
[3. Initialize Xvisor submodules]
# git submodule init
# git submodule update
(Note: This is required to be done only once in freshly cloned xvisor source)

[4. Configure Xvisor with Generic v6 default settings]
# make ARCH=arm generic-v6-defconfig

[4. Build Xvisor & DTBs]
[5. Build Xvisor & DTBs]
# make; make dtbs

[5. Make U-Boot compatible uvmm.bin for use with bootm command]
[6. Make U-Boot compatible uvmm.bin for use with bootm command]
# mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Xvisor -d build/vmm.bin build/uvmm.bin

[6. Build Basic Firmware]
[7. Build Basic Firmware]
# make -C tests/arm32/realview-eb-mpcore/basic

[7. Copy defconfig to Linux build directory]
[8. Copy defconfig to Linux build directory]
# cp tests/arm32/realview-eb-mpcore/linux/linux-<linux_version>_defconfig <linux_build_directory>/.config

[8. GoTo Linux source directory]
[9. GoTo Linux source directory]
# cd <linux_source_directory>

[9. Configure Linux in build directory]
[10. Configure Linux in build directory]
# sed -i 's/0xff800000UL/0xff000000UL/' arch/arm/include/asm/pgtable.h
# make O=<linux_build_directory> ARCH=arm oldconfig

[10. Build Linux in build directory]
[11. Build Linux in build directory]
# make O=<linux_build_directory> ARCH=arm Image dtbs

[11. Patch Linux kernel to replace sensitive non-priviledged instructions]
[12. Patch Linux kernel to replace sensitive non-priviledged instructions]
# <xvisor_source_directory>/arch/arm/cpu/arm32/elf2cpatch.py -f <linux_build_directory>/vmlinux | <xvisor_source_directory>/build/tools/cpatch/cpatch32 <linux_build_directory>/vmlinux 0

[12. Extract patched Linux kernel image]
[13. Extract patched Linux kernel image]
# ${CROSS_COMPILE}objcopy -O binary <linux_build_directory>/vmlinux <linux_build_directory>/arch/arm/boot/Image

[13. Create BusyBox RAMDISK to be used as RootFS for Linux kernel]
[14. Create BusyBox RAMDISK to be used as RootFS for Linux kernel]
(Note: For subsequent steps, we will assume that your RAMDISK is located at <busybox_rootfs_directory>/rootfs.img)
(Note: Please refer tests/common/busybox/README.md for creating rootfs.img using BusyBox)

[14. GoTo Xvisor source directory]
[15. GoTo Xvisor source directory]
# cd <xvisor_source_directory>

[15. Create disk image for Xvisor with Guest Linux and Guest Basic Firmware]
[16. Create disk image for Xvisor with Guest Linux and Guest Basic Firmware]
# mkdir -p ./build/disk/tmp
# mkdir -p ./build/disk/system
# cp -f ./docs/banner/roman.txt ./build/disk/system/banner.txt
Expand All @@ -81,7 +86,7 @@ Following are steps to create these images and boot Xvisor on Raspberry Pi:
# cp -f <busybox_rootfs_directory>/rootfs.img ./build/disk/images/arm32/rootfs.img
# genext2fs -B 1024 -b 16384 -d ./build/disk ./build/disk.img
OR
[15. Create disk image for Xvisor with only Guest Basic Firmware]
[16. Create disk image for Xvisor with only Guest Basic Firmware]
# mkdir -p ./build/disk/tmp
# mkdir -p ./build/disk/system
# cp -f ./docs/banner/roman.txt ./build/disk/system/banner.txt
Expand All @@ -92,63 +97,63 @@ Following are steps to create these images and boot Xvisor on Raspberry Pi:
# cp -f ./tests/arm32/realview-eb-mpcore/basic/nor_flash.list ./build/disk/images/arm32/realview-eb-mpcore/nor_flash.list
# genext2fs -B 1024 -b 16384 -d ./build/disk ./build/disk.img

[16. Make U-boot compatible initrd for use with bootm command]
[17. Make U-boot compatible initrd for use with bootm command]
# mkimage -A arm -O linux -T ramdisk -a 0x01000000 -n "Xvisor ramdisk" -d build/disk.img build/udisk.img

[17. Unplug bootable SD card from Raspberry Pi and plug it on your development machine]
[18. Unplug bootable SD card from Raspberry Pi and plug it on your development machine]

[18. Mount boot partition (or partition 0) of SD card on your development machine]
[19. Mount boot partition (or partition 0) of SD card on your development machine]

[19. Copy uvmm.bin, DTB, and disk.im to boot partition of SD card]
[20. Copy uvmm.bin, DTB, and disk.im to boot partition of SD card]
# cp -f build/uvmm.bin <path_to_mounted_boot_partition_of_sd_card>
# cp -f build/arch/arm/board/generic/dts/bcm2835/one_guest_ebmp.dtb <path_to_mounted_boot_partition_of_sd_card>
# cp -f build/udisk.img <path_to_mounted_boot_partition_of_sd_card>

[20. Unmount boot partition (or partition 0) of SD card from your development machine]
[21. Unmount boot partition (or partition 0) of SD card from your development machine]

[21. Unplug SD card from your development machine and plug it back on Raspberry Pi]
[22. Unplug SD card from your development machine and plug it back on Raspberry Pi]

[22. Connect to serial port of Raspberry Pi using Putty or Minicom]
[23. Connect to serial port of Raspberry Pi using Putty or Minicom]

[23. Power-up or Reset Raspberry Pi and press any key when U-Boot shows auto-boot count down]
[24. Power-up or Reset Raspberry Pi and press any key when U-Boot shows auto-boot count down]

[24. Enable MMC interface from U-Boot command line]
[25. Enable MMC interface from U-Boot command line]
U-Boot> mmc dev 0:0

[25. Copy Xvisor from SD card to SDRAM]
[26. Copy Xvisor from SD card to SDRAM]
U-Boot> fatload mmc 0 0x00200000 uvmm.bin

[26. Copy Xvisor DTB from SD card to SDRAM]
[27. Copy Xvisor DTB from SD card to SDRAM]
U-Boot> fatload mmc 0 0x00800000 one_guest_ebmp.dtb

[27. Copy disk image from SD card to SDRAM]
[28. Copy disk image from SD card to SDRAM]
U-Boot> fatload mmc 0 0x02000000 udisk.img

[28. Jump into Xvisor after disabling MMU, interrupts, etc]
[29. Jump into Xvisor after disabling MMU, interrupts, etc]
U-Boot> bootm 0x00200000 0x02000000 0x00800000

[29. Kick Guest0 for starting Basic Firmware]
[30. Kick Guest0 for starting Basic Firmware]
XVisor# guest kick guest0

[30. Bind to virtual UART]
[31. Bind to virtual UART]
XVisor# vserial bind guest0/uart0

[31. Try few commands of Basic firmware or goto next step]
[32. Try few commands of Basic firmware or goto next step]
[guest0/uart0] basic# hi
[guest0/uart0] basic# hello
[guest0/uart0] basic# help

[32. Copy linux from NOR flash to RAM and start linux booting from RAM]
[33. Copy linux from NOR flash to RAM and start linux booting from RAM]
[guest0/uart0] basic# autoexec
(Note: "autoexec" is a short-cut command)
(Note: The <xvisor_source_directory>/tests/arm32/realview-eb-mpcore/linux/cmdlist
file which we have added to guest NOR flash contains set of commands for booting
linux from NOR flash)

[33. Wait for Linux prompt to come-up and then try out some commands]
[34. Wait for Linux prompt to come-up and then try out some commands]
[guest0/uart0] / # ls

[34. Enter character seqence 'ESCAPE+x+q" return to Xvisor prompt]
[35. Enter character seqence 'ESCAPE+x+q" return to Xvisor prompt]
[guest0/uart0] / #

(Note: replace all <> brackets based on your workspace)
Expand Down Expand Up @@ -177,42 +182,47 @@ Realview-EB-MPCore guest with Xvisor running on QEMU Raspberry-Pi Host:
[2. GoTo Xvisor source directory]
# cd <xvisor_source_directory>

[3. Configure Xvisor with Generic v6 default settings]
[3. Initialize Xvisor submodules]
# git submodule init
# git submodule update
(Note: This is required to be done only once in freshly cloned xvisor source)

[4. Configure Xvisor with Generic v6 default settings]
# make ARCH=arm generic-v6-defconfig

[4. Build Xvisor & DTBs]
[5. Build Xvisor & DTBs]
# make; make dtbs

[5. Build Basic Firmware]
[6. Build Basic Firmware]
# make -C tests/arm32/realview-eb-mpcore/basic

[6. Copy defconfig to Linux build directory]
[7. Copy defconfig to Linux build directory]
# cp tests/arm32/realview-eb-mpcore/linux/linux-<linux_version>_defconfig <linux_build_directory>/.config

[7. GoTo Linux source directory]
[8. GoTo Linux source directory]
# cd <linux_source_directory>

[8. Configure Linux in build directory]
[9. Configure Linux in build directory]
# sed -i 's/0xff800000UL/0xff000000UL/' arch/arm/include/asm/pgtable.h
# make O=<linux_build_directory> ARCH=arm oldconfig

[9. Build Linux in build directory]
[10. Build Linux in build directory]
# make O=<linux_build_directory> ARCH=arm Image dtbs

[10. Patch Linux kernel to replace sensitive non-priviledged instructions]
[11. Patch Linux kernel to replace sensitive non-priviledged instructions]
# <xvisor_source_directory>/arch/arm/cpu/arm32/elf2cpatch.py -f <linux_build_directory>/vmlinux | <xvisor_source_directory>/build/tools/cpatch/cpatch32 <linux_build_directory>/vmlinux 0

[11. Extract patched Linux kernel image]
[12. Extract patched Linux kernel image]
# ${CROSS_COMPILE}objcopy -O binary <linux_build_directory>/vmlinux <linux_build_directory>/arch/arm/boot/Image

[12. Create BusyBox RAMDISK to be used as RootFS for Linux kernel]
[13. Create BusyBox RAMDISK to be used as RootFS for Linux kernel]
(Note: For subsequent steps, we will assume that your RAMDISK is located at <busybox_rootfs_directory>/rootfs.img)
(Note: Please refer tests/common/busybox/README.md for creating rootfs.img using BusyBox)

[13. GoTo Xvisor source directory]
[14. GoTo Xvisor source directory]
# cd <xvisor_source_directory>

[14. Create disk image for Xvisor with Guest Linux and Guest Basic Firmware]
[15. Create disk image for Xvisor with Guest Linux and Guest Basic Firmware]
# mkdir -p ./build/disk/tmp
# mkdir -p ./build/disk/system
# cp -f ./docs/banner/roman.txt ./build/disk/system/banner.txt
Expand All @@ -227,7 +237,7 @@ Realview-EB-MPCore guest with Xvisor running on QEMU Raspberry-Pi Host:
# cp -f <busybox_rootfs_directory>/rootfs.img ./build/disk/images/arm32/rootfs.img
# genext2fs -B 1024 -b 16384 -d ./build/disk ./build/disk.img
OR
[14. Create disk image for Xvisor with only Guest Basic Firmware]
[15. Create disk image for Xvisor with only Guest Basic Firmware]
# mkdir -p ./build/disk/tmp
# mkdir -p ./build/disk/system
# cp -f ./docs/banner/roman.txt ./build/disk/system/banner.txt
Expand All @@ -238,31 +248,31 @@ Realview-EB-MPCore guest with Xvisor running on QEMU Raspberry-Pi Host:
# cp -f ./tests/arm32/realview-eb-mpcore/basic/nor_flash.list ./build/disk/images/arm32/realview-eb-mpcore/nor_flash.list
# genext2fs -B 1024 -b 16384 -d ./build/disk ./build/disk.img

[15. Launch QEMU]
[16. Launch QEMU]
# qemu-system-arm -M raspi -m 512M -display none -serial stdio -kernel build/vmm.bin -dtb build/arch/arm/board/generic/dts/bcm2835/one_guest_ebmp.dtb -initrd build/disk.img

[16. Kick Guest0 for starting Basic Firmware]
[17. Kick Guest0 for starting Basic Firmware]
XVisor# guest kick guest0

[17. Bind to virtual UART]
[18. Bind to virtual UART]
XVisor# vserial bind guest0/uart0

[18. Try few commands of Basic firmware or goto next step]
[19. Try few commands of Basic firmware or goto next step]
[guest0/uart0] basic# hi
[guest0/uart0] basic# hello
[guest0/uart0] basic# help

[19. Copy linux from NOR flash to RAM and start linux booting from RAM]
[20. Copy linux from NOR flash to RAM and start linux booting from RAM]
[guest0/uart0] basic# autoexec
(Note: "autoexec" is a short-cut command)
(Note: The <xvisor_source_directory>/tests/arm32/realview-eb-mpcore/linux/cmdlist
file which we have added to guest NOR flash contains set of commands for booting
linux from NOR flash)

[20. Wait for Linux prompt to come-up and then try out some commands]
[21. Wait for Linux prompt to come-up and then try out some commands]
[guest0/uart0] / # ls

[21. Enter character seqence 'ESCAPE+x+q" return to Xvisor prompt]
[22. Enter character seqence 'ESCAPE+x+q" return to Xvisor prompt]
[guest0/uart0] / #

(Note: replace all <> brackets based on your workspace)
Expand All @@ -271,4 +281,3 @@ Realview-EB-MPCore guest with Xvisor running on QEMU Raspberry-Pi Host:
(Note: for more info on your desired ARM host refer docs/arm/)
(Note: you are free to change the ordering of above steps based
on your workspace)

0 comments on commit f5172a8

Please sign in to comment.