-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
qemu_x86 's SeaBIOS clears the screen every time it runs #11717
Comments
not a zephyr bug, did not find any way to change this behavior in qemu. |
|
I found this great workaround, recommended: export QEMU_EXTRA_FLAGS="-bios $HOME/OVMF_CODE-32.fd" I looked into making this the default but hit two issues: 1.a Different Linux distributions package OVMF differently (or not at all?). Zephyr could probably re-package it though, maybe in the SDK next to Qemu 2 QEMU_EXTRA_FLAGS is not per-arch and I couldn't get any combination to work with qemu_x86_64. Funny enough all other archs are unaffected, I think all other qemus just silently drop the Considering qemu Mentioning this much longer alternative to QEMU_EXTRA_FLAGS="-drive file=${HOME}/OVMF_CODE-32.fd,if=pflash,format=raw" |
Forgot to mention this: OVMF makes |
Messes up my Linux terminal as well.
Worth trying. Definitely don't need a BIOS, we handle matters from the reset vector onwards. [edit:] Not strictly true. Something in QEMU transfers the PC to the ENTRY point in the ELF binary. Don't believe the BIOS has any involvement though, |
@marc-hb I tried with OVMF_CODE.fd, but it does not work or boot into qemu. This is the one I copied from the ovmf package:
Any hints? |
Yes. It recently stopped working for me too and I bisected it at the qemu flash size commit above. I asked there but no answer. |
That patch just reorganizes the memory map of the emulated hardware and allows Zephyr to use more of it (and potentially modifies where things get placed, though I'd have to check link results to be sure). One possibility is that OVMF is actually using some of that memory, and that it's doing something important when qemu comes alone and scribbles over memory with the imaged passed in the -kernel argument. Qemu's -kernel is sort of weird: it doesn't coordinate with normal firmware boot at all AFAIK, it just writes an image into place and arranges to force the PC to point to the entry point. But it has to do that "after" the firmware has tried to do something sane (because you have to allow the BIOS to get the machine ready), and it's possible that this detection gets fouled up somehow by the change in memory map. It's an idea anyway. Alas we don't really have a serious qemu expert in zephyr to answer questions like this, and we really need one. |
Hi @marc-hb , not sure how I can help with this issue? I'm not much of a QEMU expert. But if you have something you'd like me to test, I'm happy to! |
I saw some of your GRUB-related work so I thought you could maybe find some documentation about booting Zephyr "for real", without any qemu -kernel shortcut / hack. |
Googling a bit more I found that Clear Linux has already solved this
UPDATED: based on that old discussion https://lists.gnu.org/archive/html/qemu-devel/2016-03/threads.html#04844 I first thought Clear Linux used Interesting bit from https://download.clearlinux.org/image/ start_qemu.sh
|
Here's my newest and... greatest workaround. Totally unrelated to OVMF. find sanity-out -name handler.log | while read -r HLOG; do
sed -i -e '1,5 s/.*SeaBIOS/SeaBIOS/' \
-e 's/Booting from ROM.*Booting Zephyr/Booting from ROM...\r\n***** Booting Zephyr/' \
"$HLOG"
done This removes the control characters from log files (and makes them deterministic). Hope it helps. |
??? |
Weird I didn't see this year-old issue, I'm suffering from it all this time. To remind a short history with qemu_x86 options: we used to have different set of options, which didn't use SeaBIOS and thus didn't clear screen. But that config had its own weird issues and corner cases, e.g. we had issues with #9112, which worked for the original author, but not for folks who tried to test it. So, there were a series of refactors and fixes to QEMU options (e.g. #11710) to clean it up, side effect of which was this screen clearing issues with SeaBIOS. I played with it for some time then to see if something can be done to both get right PCI config and no SeaBIOS, but couldn't get it at that time. Anyway, I have high hopes for zephyrproject-rtos/sdk-ng#124 |
Steps to reproduce:
Build and run any test case for qemu_x86.
Observe that the screen is cleared before the emulator prints any output.
Expected behavior:
Screen is not cleared
Impact:
This is VERY annoying when using 'sanitycheck -i' as we can't see a proper log of all the output of all the failing test cases.
Only QEMU on x86 seems to be affected.
The text was updated successfully, but these errors were encountered: