You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently writing my own kernel.
I use the GOP to get a framebuffer.
I look through all, and grab the one, that has the best properties.
The annoying part is, that I CAN iterate over all Modes and grab their respective ModeInfo.
It is just, that there is no good way to know which mode I have the info of.
That means it is impossible for me to modeset, because I don't know which index ModeInfo is from.
My current approach is the following. It doesn't feel very clean, but I don't think, that I can come up with a better approach.
let st = unsafe{uefi_services::system_table().as_mut()};//todo: have a better way, to draw stuffletmut gop = st.boot_services().locate_protocol::<uefi::proto::console::gop::GraphicsOutput>()?;//SAFETY:// FIXME: Cannot satisfy.// This Application could have been started by another Application.// If that Application also got the GOP, this is a violation.let gop = unsafe{&mut*gop.get()};let i = gop.modes();
the start, and gets set toSome(i.next())).let i = i.enumerate().map(|(mn,m)|(mn,*m.info())).filter(|(_,m)|m.pixel_format()!=PixelFormat::BltOnly);
I feel like this could be written safer, if uefi allowed getting the Index of Mode.
The text was updated successfully, but these errors were encountered:
Oops. I completely forgot to look at set_mode.
The abstraction makes sense then. What doesn't make sense is that gop.query_mode is public.
We don't know anything about indexes, and we cannot query anything from the current api.
Either make a index getter, or query_mode private in my eyes.
Any reason why Mode is non-Copy, non-Clone and most of all non-debug?
It is not like we can change something inside of Mode accidentally.
I am currently writing my own kernel.
I use the GOP to get a framebuffer.
I look through all, and grab the one, that has the best properties.
The annoying part is, that I CAN iterate over all Modes and grab their respective ModeInfo.
It is just, that there is no good way to know which mode I have the info of.
That means it is impossible for me to modeset, because I don't know which index ModeInfo is from.
My current approach is the following. It doesn't feel very clean, but I don't think, that I can come up with a better approach.
I feel like this could be written safer, if uefi allowed getting the Index of Mode.
The text was updated successfully, but these errors were encountered: