Q: Vesa and long mode ?...
Q: Vesa and long mode ?...
Hello folks,
I have a question to somebody who knowns about vesa and long mode (amd64).
The main thing in vesa - it's a vesa bios calls, but while you are in long mode you not able to call this functions.
So, I have a microkernel OS, microkernel can allow userspace task to become driver - I mean I can handle an hardware interrups, allocate IO pages, allocate IO ports.
The questions is - can I implement vesa driver without VESA bios calls (using io ports and io pages) ?
Thank you.
I have a question to somebody who knowns about vesa and long mode (amd64).
The main thing in vesa - it's a vesa bios calls, but while you are in long mode you not able to call this functions.
So, I have a microkernel OS, microkernel can allow userspace task to become driver - I mean I can handle an hardware interrups, allocate IO pages, allocate IO ports.
The questions is - can I implement vesa driver without VESA bios calls (using io ports and io pages) ?
Thank you.
Re: Q: Vesa and long mode ?...
Hi,
The most common way of doing this seems to be switching modes at boot time only. If you create a mode with a LFB, you dont need to switch planes.
Another alternative which would need a quite fully fledged OS would be to use emulation or virtualisation to run the necessary BIOS code. This would require some serious thought about security, though (which ports do emulate access to? do you allow any RM code to run outside of the BIOS area?).
My advice to start with is use a LFB!
Cheers,
Adam
The most common way of doing this seems to be switching modes at boot time only. If you create a mode with a LFB, you dont need to switch planes.
Another alternative which would need a quite fully fledged OS would be to use emulation or virtualisation to run the necessary BIOS code. This would require some serious thought about security, though (which ports do emulate access to? do you allow any RM code to run outside of the BIOS area?).
My advice to start with is use a LFB!
Cheers,
Adam
- Owen
- Member

- Posts: 1700
- Joined: Fri Jun 13, 2008 3:21 pm
- Location: Cambridge, United Kingdom
- Contact:
Re: Q: Vesa and long mode ?...
If your system has support for VESA in protected mode, then you could always create GDT entries for 32-bit processes and use 32-bit code to access VESA. How you implement this will be heavily kernel dependent.
- Love4Boobies
- Member

- Posts: 2111
- Joined: Fri Mar 07, 2008 5:36 pm
- Location: Bucharest, Romania
Re: Q: Vesa and long mode ?...
He mentioned he's using long mode. AFAIK there's no support for VBE in long mode. You DO have compatibility mode, but I'm not sure about changing the video mode. That could proove tricky (but not impossible).
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
[ Project UDI ]
Re: Q: Vesa and long mode ?...
Boot time switching is a not good idea , microkernel shouldn't know anything about hardware as it possible. You can look out my project - http://jarios.org where you can find general concept.AJ wrote:Hi,
The most common way of doing this seems to be switching modes at boot time only. If you create a mode with a LFB, you dont need to switch planes.
Another alternative which would need a quite fully fledged OS would be to use emulation or virtualisation to run the necessary BIOS code. This would require some serious thought about security, though (which ports do emulate access to? do you allow any RM code to run outside of the BIOS area?).
My advice to start with is use a LFB!
Cheers,
Adam
Virtualization is another thing that makes true microkernel architecture worse (I mean tricks like compatibility mode or smth else).
LFB == Linux Framebuffer ? if yes, I cannot use it anyway.
I've heard that it's possible to use VGA (sVGA) ports to switch mode ...
Maybe some solution can be found in xorg vesa driver, anyway vesa bios calls it's a really worse solution in general case.
Re: Q: Vesa and long mode ?...
LFB == Linear Frame Buffer, so you can use itmadtirra wrote: LFB == Linux Framebuffer ? if yes, I cannot use it anyway.
I've heard that it's possible to use VGA (sVGA) ports to switch mode ...
I know of ways to switch VGA mode without using the BIOS (like here), but not SVGA modes. There are also some other links on the wiki and I'm certain there will be some old forum posts that could provide you with some answers.
Combuster tends to be pretty good at this VGA stuff, so maybe he has some ideas...
Cheers,
Adam
Re: Q: Vesa and long mode ?...
Oh, sorry ... LFB == Linear frame buffer - so, I can assume how to works with video memory within long mode - it's a trivial.
The main problem it's a mode switching ...
The main problem it's a mode switching ...
- Combuster
- Member

- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Q: Vesa and long mode ?...
VGA isn't quite the same as VESA. VGA isn't good for getting above 640x480x4, let alone higher bit depths.Combuster tends to be pretty good at this VGA stuff, so maybe he has some ideas...
If you really want to use VESA you'll have to run the BIOS code in some way or another, like running it before entering pmode, or emulating it one way or another. (v8086, hypervisor, interpreter)
Re: Q: Vesa and long mode ?...
I'm afraid about other video cards drivers. I have a look to xorg video drivers - and I'm not so happy with it - xf86int10 mostly used.Combuster wrote:VGA isn't quite the same as VESA. VGA isn't good for getting above 640x480x4, let alone higher bit depths.Combuster tends to be pretty good at this VGA stuff, so maybe he has some ideas...
If you really want to use VESA you'll have to run the BIOS code in some way or another, like running it before entering pmode, or emulating it one way or another. (v8086, hypervisor, interpreter)
So, I think that microkernel will be extended with faked vm86, anyway most of things can be done via uspace libs.
Hardware design makes software design ugly ;(
Re: Q: Vesa and long mode ?...
I sometimes get a bit annoyed with that too. The way you can mitigate this is by making your external interfaces neat and clearly defined so that you can take pride in clearing up the mess that is the PC architecturemadtirra wrote:Hardware design makes software design ugly ;(
I know a bit more about your design now (have seen your web site), but are you really dead set against passing some video mode information from the boot loader to your kernel? If you pre-set a video mode at boot time and pass the info to the kernel? If you did, you could start the HW server with a "command-line parameter" containing mode info. If the HW server detects a dedicated driver for the video card, it can use that. If not, it can use the fall back VESA driver in the known boot-time resolution.
Cheers,
Adam
Re: Q: Vesa and long mode ?...
Yes, I know, but anyway it's a not so good solution.AJ wrote:I sometimes get a bit annoyed with that too. The way you can mitigate this is by making your external interfaces neat and clearly defined so that you can take pride in clearing up the mess that is the PC architecturemadtirra wrote:Hardware design makes software design ugly ;(![]()
I know a bit more about your design now (have seen your web site), but are you really dead set against passing some video mode information from the boot loader to your kernel? If you pre-set a video mode at boot time and pass the info to the kernel? If you did, you could start the HW server with a "command-line parameter" containing mode info. If the HW server detects a dedicated driver for the video card, it can use that. If not, it can use the fall back VESA driver in the known boot-time resolution.
Cheers,
Adam
The better way is an implementation of vm86 in user space like a library - there are some existing solution (on L4 microkernel) - http://svn.tudos.org/repos/tudos/trunk/l4/pkg/x86emu/
Idea - port it to Jari OS , looks like a very good idea
thanks anyway
PS you can look out this - http://jarios.org/doku.php?id=showcase to make a sense of Jari OS progress.