Adding a hardware device in Bao #82
Replies: 2 comments
-
I'm wondering what version/commit you are on since, currently, there are no such entries on that struct. In the past,
Here, the answer is no. Since Bao is not supposed to manage that many devices directly, having an automatic way of mapping them does not seem that useful. The way to go about it is, as you've done, using the mem allocation and mapping APIs to map that device in its initialization function explicitly. Glad you were able to figure it out with virtually no docs (which were are working on). BTW, we will likely add in the near-future platform-specific hooks (e.g. |
Beta Was this translation helpful? Give feedback.
-
Thank you for the detailed and prompt response. Indeed I realize now that I have been working on an earlier commit. It does make sense that hypervisor is not supposed to manage any device directly. The reason I wanted to assign a device was because I was trying to add a performance monitoring unit device to Bao and setting it up for memory bandwidth regulation of Guest VMs. I guess I can list down the steps I followed here so anyone else looking to do same might benefit:
|
Beta Was this translation helpful? Give feedback.
-
Hi.
I am trying to add a custom device to Bao Hypervisor which I have to read and write to. What is the best way to doing so?
Having a look at src/platform/xyz/xyz_desc.c file, it seems that the struct used is called platform. Looking into the definition of the struct platform, it seems that it does have a element for specifying devices. Specifically platform.dev_num and platform.devs elements. I do not yet have an understanding of how mapping is done for Bao's VAS itself. Would simply specifying device in this struct work.
P.S: I have been able to add a device and get it working by using mem_map_dev function and I am able to read and write to the device registers. But I am wondering if the authors implemented the functionality of adding device through config file?
Beta Was this translation helpful? Give feedback.
All reactions