-
Notifications
You must be signed in to change notification settings - Fork 105
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
Trap-and-emulate guestOS SDL-based applications #510
Labels
enhancement
New feature or request
Comments
Any chance to run mado? |
Hopefully, Mado is designed as an advanced yet lean window system for resource-constrained environments, making it suitable for system emulation validation. |
ChinYikMing
added a commit
to ChinYikMing/rv32emu
that referenced
this issue
Jan 3, 2025
To enable guest OS to run SDL applications using bidirectional queues, the VMM or system emulator must access the guest OS's virtual memory, as the queues are defined there. This requires MMU translation. Export rv->io.mem_trans() to perform gVA2gPA translation. Unifying MMU translation logic by using rv->io.mem_trans(), eliminating redundant flows: mmu_walk -> check_pg_fault -> check_signal -> get_ppn_and_offset. Also, this interface allowing src/syscall_sdl.c to handle virtual memory. TODO: dTLB can be introduced in rv->io.mem_trans() to cache the gVA2gPA translation. See: sysprog21#310, sysprog21#510
ChinYikMing
added a commit
to ChinYikMing/rv32emu
that referenced
this issue
Jan 3, 2025
To enable guest OS to run SDL applications using bidirectional queues, the VMM or system emulator must access the guest OS's virtual memory, as the queues are defined there. This requires MMU translation. Export rv->io.mem_trans() to perform gVA2gPA translation. Unifying MMU translation logic by using rv->io.mem_trans(), eliminating redundant flows: mmu_walk -> check_pg_fault -> check_signal -> get_ppn_and_offset. Also, this interface allowing src/syscall_sdl.c to handle virtual memory. TODO: dTLB can be introduced in rv->io.mem_trans() to cache the gVA2gPA translation. See: sysprog21#310, sysprog21#510
ChinYikMing
added a commit
to ChinYikMing/rv32emu
that referenced
this issue
Jan 4, 2025
To enable guest OS to run SDL applications using bidirectional queues, the VMM or system emulator must access the guest OS's virtual memory, as the queues are defined there. This requires MMU translation. In addition, the queues event data size likely larger than a word (maybe a page), thus the existing rv->io.mem_{read,write}_w do not sufficient for such memory manipulation. Export rv->io.mem_translate() to perform gVA2gPA translation. Unifying MMU translation logic by using rv->io.mem_translate(), eliminating redundant flows: mmu_walk -> check_pg_fault -> check_signal -> get_ppn_and_offset. Also, this interface allowing src/syscall_sdl.c to handle virtual memory by first translating the gVA2gPA, followed by memory_{read/write} the chunk of data at once. TODO: dTLB can be introduced in rv->io.mem_trans() to cache the gVA2gPA translation. See: sysprog21#310, sysprog21#510
A quick demo to run Doom in guest OS, showing the possibility and capability of the guest OS to handle display and audio : doom_run_in_guestOS.mp4BTW, some technical issues have to be resolved:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, the guest OS primarily uses its own syscall table. To enable it to run SDL-based applications, we may need to trap and emulate the SDL instruction, which would be handled by the rv32emu SDL backend.
Goal: at least able to run Doom, Quake and smolnes.
A simple demo is opening a white SDL screen.
The text was updated successfully, but these errors were encountered: