seL4 UART input (on RISC-V)?
Hi all, I've been looking through the seL4 libraries and examples, and it seems to me that serial input should in some way be possible - the refos example appears to have a terminal, and I would imagine that debugging via GDB requires input in addition to output. However, the code to do this is unclear to me. Calling getchar() or similar leads to the unimplemented readv syscall, and calling __arch_getchar or similar causes a cap error even after running platsupport_serial_setup_simple(). Is there a step I'm missing? I'm specifically trying to get this working on RISC-V. Thanks, Baltazar ________________________________ Notice: This email and any attachments may contain proprietary (Draper non-public) and/or export-controlled information of Draper. If you are not the intended recipient of this email, please immediately notify the sender by replying to this email and immediately destroy all copies of this email. ________________________________
Hi Baltazar,
It depends on which RISC-V platform you're building for. Only The
HiFive platform has a serial driver [1] as of last month (haven't
tested it though), Spike doesn't [2] have a UART nor a serial driver,
so you can't getchar from userspace.
[1] https://github.com/seL4/util_libs/blob/aafc51ffb147adb10e2b0fa86cbbefe62926b...
[2] https://github.com/seL4/util_libs/blob/aafc51ffb147adb10e2b0fa86cbbefe62926b...
On Fri, 2 Aug 2019 at 17:14, Ortiz, Baltazar
Hi all,
I’ve been looking through the seL4 libraries and examples, and it seems to me that serial input should in some way be possible - the refos example appears to have a terminal, and I would imagine that debugging via GDB requires input in addition to output. However, the code to do this is unclear to me. Calling getchar() or similar leads to the unimplemented readv syscall, and calling __arch_getchar or similar causes a cap error even after running platsupport_serial_setup_simple().
Is there a step I’m missing? I’m specifically trying to get this working on RISC-V.
Thanks,
Baltazar
________________________________ Notice: This email and any attachments may contain proprietary (Draper non-public) and/or export-controlled information of Draper. If you are not the intended recipient of this email, please immediately notify the sender by replying to this email and immediately destroy all copies of this email. ________________________________ _______________________________________________ Devel mailing list Devel@sel4.systems https://sel4.systems/lists/listinfo/devel
-- Hesham
Thanks for pointing that out! I've been building for spike, but can definitely try HiFive. However, it's unclear to me how to actually build for it - I know how to specify it as the machine for simulation in QEMU, but I don't see support for specifying HiFive as the platform in CMake in 10.1.1 or master.
-----Original Message-----
From: Hesham Almatary
Hi all,
I’ve been looking through the seL4 libraries and examples, and it seems to me that serial input should in some way be possible - the refos example appears to have a terminal, and I would imagine that debugging via GDB requires input in addition to output. However, the code to do this is unclear to me. Calling getchar() or similar leads to the unimplemented readv syscall, and calling __arch_getchar or similar causes a cap error even after running platsupport_serial_setup_simple().
Is there a step I’m missing? I’m specifically trying to get this working on RISC-V.
Thanks,
Baltazar
________________________________ Notice: This email and any attachments may contain proprietary (Draper non-public) and/or export-controlled information of Draper. If you are not the intended recipient of this email, please immediately notify the sender by replying to this email and immediately destroy all copies of this email. ________________________________ _______________________________________________ Devel mailing list Devel@sel4.systems https://sel4.systems/lists/listinfo/devel
-- Hesham ________________________________ Notice: This email and any attachments may contain proprietary (Draper non-public) and/or export-controlled information of Draper. If you are not the intended recipient of this email, please immediately notify the sender by replying to this email and immediately destroy all copies of this email. ________________________________
On Fri, 9 Aug 2019 at 15:16, Ortiz, Baltazar
Thanks for pointing that out! I've been building for spike, but can definitely try HiFive. However, it's unclear to me how to actually build for it - I know how to specify it as the machine for simulation in QEMU, but I don't see support for specifying HiFive as the platform in CMake in 10.1.1 or master.
I was able to build sel4test for the HiFive target today with -DPLATFORM=hifive so it's definitely there. I believe Data61 has been targetting the HiFive hardware board rather than QEMU's sifive_u (they are slightly different). However, I did a few changes to get sel4test running on QEMU/sifive_u: 1) Replace kernel/tools/dts/hifive.dts with QEMU's DTS. 2) Build an Elf image instead of a binary one (need to change a cmake file). 3) Change KernelPlatformFirstHartID to 0 in the cmake file. 4) Change UART0_PADDR in sel4platsupport/hifive to QEMU's UART base address (also IRQ number). 5) Configure with ../init-build.sh -DSIMULATION=1 -DRISCV64=1 -DPLATFORM=hifive -DElfloaderImage=elf -DLibSel4PlatSupportUseDebugPutChar=OFF 6) qemu-system-riscv64 -machine sifive_u -nographic -serial mon:stdio -smp 1 -m 4095 -kernel images/sel4test-driver-image-riscv-hifive Hope that help. Cheers, Hesham
-----Original Message----- From: Hesham Almatary
Sent: Friday, August 9, 2019 10:06 AM To: Ortiz, Baltazar Cc: devel@sel4.systems Subject: Re: [seL4] seL4 UART input (on RISC-V)? Hi Baltazar,
It depends on which RISC-V platform you're building for. Only The HiFive platform has a serial driver [1] as of last month (haven't tested it though), Spike doesn't [2] have a UART nor a serial driver, so you can't getchar from userspace.
[1] https://github.com/seL4/util_libs/blob/aafc51ffb147adb10e2b0fa86cbbefe62926b... [2] https://github.com/seL4/util_libs/blob/aafc51ffb147adb10e2b0fa86cbbefe62926b...
On Fri, 2 Aug 2019 at 17:14, Ortiz, Baltazar
wrote: Hi all,
I’ve been looking through the seL4 libraries and examples, and it seems to me that serial input should in some way be possible - the refos example appears to have a terminal, and I would imagine that debugging via GDB requires input in addition to output. However, the code to do this is unclear to me. Calling getchar() or similar leads to the unimplemented readv syscall, and calling __arch_getchar or similar causes a cap error even after running platsupport_serial_setup_simple().
Is there a step I’m missing? I’m specifically trying to get this working on RISC-V.
Thanks,
Baltazar
________________________________ Notice: This email and any attachments may contain proprietary (Draper non-public) and/or export-controlled information of Draper. If you are not the intended recipient of this email, please immediately notify the sender by replying to this email and immediately destroy all copies of this email. ________________________________ _______________________________________________ Devel mailing list Devel@sel4.systems https://sel4.systems/lists/listinfo/devel
-- Hesham ________________________________ Notice: This email and any attachments may contain proprietary (Draper non-public) and/or export-controlled information of Draper. If you are not the intended recipient of this email, please immediately notify the sender by replying to this email and immediately destroy all copies of this email. ________________________________
-- Hesham
Thanks! This seems to work for 64 bit, but breaks before getting to the kernel for 32 bit. That seems to be a QEMU/bbl issue though, not something on seL4's end.
Baltazar
-----Original Message-----
From: Hesham Almatary
Thanks for pointing that out! I've been building for spike, but can definitely try HiFive. However, it's unclear to me how to actually build for it - I know how to specify it as the machine for simulation in QEMU, but I don't see support for specifying HiFive as the platform in CMake in 10.1.1 or master.
I was able to build sel4test for the HiFive target today with -DPLATFORM=hifive so it's definitely there. I believe Data61 has been targetting the HiFive hardware board rather than QEMU's sifive_u (they are slightly different). However, I did a few changes to get sel4test running on QEMU/sifive_u: 1) Replace kernel/tools/dts/hifive.dts with QEMU's DTS. 2) Build an Elf image instead of a binary one (need to change a cmake file). 3) Change KernelPlatformFirstHartID to 0 in the cmake file. 4) Change UART0_PADDR in sel4platsupport/hifive to QEMU's UART base address (also IRQ number). 5) Configure with ../init-build.sh -DSIMULATION=1 -DRISCV64=1 -DPLATFORM=hifive -DElfloaderImage=elf -DLibSel4PlatSupportUseDebugPutChar=OFF 6) qemu-system-riscv64 -machine sifive_u -nographic -serial mon:stdio -smp 1 -m 4095 -kernel images/sel4test-driver-image-riscv-hifive Hope that help. Cheers, Hesham
-----Original Message----- From: Hesham Almatary
Sent: Friday, August 9, 2019 10:06 AM To: Ortiz, Baltazar Cc: devel@sel4.systems Subject: Re: [seL4] seL4 UART input (on RISC-V)? Hi Baltazar,
It depends on which RISC-V platform you're building for. Only The HiFive platform has a serial driver [1] as of last month (haven't tested it though), Spike doesn't [2] have a UART nor a serial driver, so you can't getchar from userspace.
[1] https://github.com/seL4/util_libs/blob/aafc51ffb147adb10e2b0fa86cbbefe 62926b78f/libplatsupport/src/plat/hifive/uart.c#L51 [2] https://github.com/seL4/util_libs/blob/aafc51ffb147adb10e2b0fa86cbbefe 62926b78f/libplatsupport/src/plat/spike/chardev.c#L20
On Fri, 2 Aug 2019 at 17:14, Ortiz, Baltazar
wrote: Hi all,
I’ve been looking through the seL4 libraries and examples, and it seems to me that serial input should in some way be possible - the refos example appears to have a terminal, and I would imagine that debugging via GDB requires input in addition to output. However, the code to do this is unclear to me. Calling getchar() or similar leads to the unimplemented readv syscall, and calling __arch_getchar or similar causes a cap error even after running platsupport_serial_setup_simple().
Is there a step I’m missing? I’m specifically trying to get this working on RISC-V.
Thanks,
Baltazar
________________________________ Notice: This email and any attachments may contain proprietary (Draper non-public) and/or export-controlled information of Draper. If you are not the intended recipient of this email, please immediately notify the sender by replying to this email and immediately destroy all copies of this email. ________________________________ _______________________________________________ Devel mailing list Devel@sel4.systems https://sel4.systems/lists/listinfo/devel
-- Hesham ________________________________ Notice: This email and any attachments may contain proprietary (Draper non-public) and/or export-controlled information of Draper. If you are not the intended recipient of this email, please immediately notify the sender by replying to this email and immediately destroy all copies of this email. ________________________________
-- Hesham ________________________________ Notice: This email and any attachments may contain proprietary (Draper non-public) and/or export-controlled information of Draper. If you are not the intended recipient of this email, please immediately notify the sender by replying to this email and immediately destroy all copies of this email. ________________________________
participants (2)
-
Hesham Almatary
-
Ortiz, Baltazar