Skip to content
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

Switch video modes from inside kernel? #54

Open
xlar54 opened this issue Oct 3, 2017 · 4 comments
Open

Switch video modes from inside kernel? #54

xlar54 opened this issue Oct 3, 2017 · 4 comments

Comments

@xlar54
Copy link

xlar54 commented Oct 3, 2017

I see work being done on querying the video mode before the kernel boots up. Could it be done such that switching video modes is possible from within the kernel? The only example of such code Ive seen using VESA is using a virtual x86 mode thread and making the switch, but I dont know enough about VESA to be certain.

btw, thanks for your efforts. Im seriously considering switching my project to use your core, but I really need a VESA method to switch from 320x640x256, 640x480, and text 25x80. (Mine just uses a VGA driver)

https://github.com/xlar54/emudore64

(Edit: I also have the beginnings of a FAT32 filesystem that may be useful to this project, unless filesystems are outside the scope and intent)

@dthain
Copy link
Owner

dthain commented Oct 3, 2017

Looks like you are having fun with Emudore!
I have good memories of assembly hacking on the C64...

Unfortunately, I am not an expert on VESA mode switching. What I do know is that it is relatively easy to probe and switch VESA modes before entering protected mode by making BIOS calls. For Baserkernel, my intent was to just pick a mode at boot time and then treat it as a static framebuffer from then on.

It is possible to switch modes at runtime, but what you have to do is ask the BIOS for the protected mode entry point at boot time. Then, from the kernel, there is a clunky mode of invoking the entry point at runtime. We don't have any code for that, but it is described in the VESA document:

https://github.com/dthain/basekernel/blob/master/doc/vesa-bios.pdf

Another complication is that modern PCs don't necessarily implement fixed standard VESA modes. (Our code would be better if it enumerated the available modes before selecting one.)

A FAT filesystem would be interesting. We currently have an ISO9660 filesystem and are still sorting out some of the higher level abstractions. Send us a pull request and I can try to point you in the right direction..

@xlar54
Copy link
Author

xlar54 commented Oct 3, 2017

Yeah, im starting to think trying to switch bears no real benefit when i can just use a set VESA mode and scale up the 64's screen. Thank you though for the info.

Once I get your code plugged in, Ill try adding my FAT32 code and send you a pull request. Its not complete, but right now at least you can read files and directories. Writing is next. Expect ugly code though - you guys have been doing this longer than I have for certain. I take no offense to criticism if it helps your end project goal. :)

@kevinwern
Copy link
Collaborator

@xlar54, how is the FAT32 filesystem going with basekernel? Do you need any help from us? It'd be really cool to support!

@xlar54
Copy link
Author

xlar54 commented Oct 12, 2017

ive been away a few days but will be jumping back in soon. will keep you posted!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants