I want to set a resolution for my OS to 1024x600 without touching on VBE. I want this to make the user experience on the command-line, much more better.
- How can I do this?
- Any resource?
Nathan Paulino Campos
I'm not sure it's possible to switch to a high resolution without going through VBE. The other way to go would probably be to directly access the graphics card, but that would require documentation (which most of them don't publicly have). VBE and GFX drivers are about the only "easy" ways I know.Nathan wrote:Hello,
I want to set a resolution for my OS to 1024x600 without touching on VBE. I want this to make the user experience on the command-line, much more better.Best Regards,
- How can I do this?
- Any resource?
Nathan Paulino Campos
I don't think switching video modes isn't possible without using the BIOS/(U)EFI, unless you know how to deal with your graphics card. You could probably write a VGA driver, but I'm not even sure if you would ever be able to get a resolution like 1024x600. So you'll probably need VBE or a graphic card driver.Nathan wrote:Hello,
I want to set a resolution for my OS to 1024x600 without touching on VBE. I want this to make the user experience on the command-line, much more better.Best Regards,
- How can I do this?
- Any resource?
Nathan Paulino Campos
Combuster wrote:800x600x4xheadache@40
Are you in protected mode, long mode or real mode? For the first two you'll either need 8086-emulation or you'll have to drop back to real mode. 8086-emulation is available in protected mode, but only in protected mode, via Virtual Mode 8086, which you'll have to set up first. 8086-emulation is required in protected/long mode as the BIOS is not available directly, unlike in real mode. If you can make interrupt calls to the BIOS then you can simply use INT 0x10, like stated in the two articles you just read. Keep in mind that you cannot simply copy the code, even if you had VM86-support or if you were in real mode, as they're just samples. (Unless your VM86-setup looks and works exactly the same)Nathan wrote:Ok Combuster, I'm going to try VBE, but when I've tried How do I set a graphics mode and Getting VBE Mode Info, I just got a lot of errors.Combuster wrote:800x600x4xheadache@40
Unfortunately, in long mode you don't get v86 mode. So you have to convert the 16-bit instructions to 32-bit first, but there're far too many problems (there was a thread about it a while ago, which I can't find now)StephanVanSchaik wrote:Are you in protected mode, long mode or real mode? For the first two you'll either need 8086-emulation or you'll have to drop back to real mode.
I felt a strange feeling when I saw the name of that file, a feeling from the distant past...quanganht wrote: I have an old piece of code here, which is supposed to emulate real mode instructions and interrupts. But it is pure dark magic to me. So I appreciate any help in explaining that code.
I found it floating around quite a long time ago, so there might be a newer version avail.
May I make you aware that 8086-emulation doesn't refer to V86 mode only, or at least not in my context. Also, you can't really rely on the VBE protected mode interface as it is something that is usually not implemented, and if it is, it is most likely broken anyway.Selenic wrote:Unfortunately, in long mode you don't get v86 mode. So you have to convert the 16-bit instructions to 32-bit first, but there're far too many problems (there was a thread about it a while ago, which I can't find now)StephanVanSchaik wrote:Are you in protected mode, long mode or real mode? For the first two you'll either need 8086-emulation or you'll have to drop back to real mode.
Basically, if you got it working, you'd be a fair part of the way to writing a clone of Bochs or QEmu...
Speaking of Bochs and QEmu, they use a very simple video device (the BGA), which is easy to write a driver for; the best option would be writing that driver if you're using one of those two, or using the VBE pmode interface (which shouldn't be too much hassle to get working in long mode)
That's basically an emulator which will emulate 16-bit code as 32-bit (or 64-bit), although only some things are supported (most basic instructions). In Bochs when calling INT 0x10, AH=0x0E, you're most likely going to fail already for the second instruction as it is ADD r/8, imm8 (opcode: 0x80; at least that is the case for my version of Bochs). So if you plan to use that, you'll have to add some other instructions as well. If you want to get more insight of how it works, you should try and figure out how instructions are encoded on the x86(-64) architecture (See: http://wiki.osdev.org/X86_Instruction_Encoding or "Intel® 64 and IA-32 Architectures Software Developer's Manual Volume 2A: Instruction Set Reference, A-M").quanganht wrote:I have an old piece of code here, which is supposed to emulate real mode instructions and interrupts. But it is pure dark magic to me. So I appreciate any help in explaining that code.
I found it floating around quite a long time ago, so there might be a newer version avail.
Erm, I think I will cut this out as a new thread.
Ah, fair enough. I assumed you meant v86.StephanVanSchaik wrote:May I make you aware that 8086-emulation doesn't refer to V86 mode only, or at least not in my context.
Yeah, that's pretty unfortunate, but since when were standards ever followed properly? (I seem to remember reading that Bochs supports it properly, though)StephanVanSchaik wrote:Also, you can't really rely on the VBE protected mode interface as it is something that is usually not implemented, and if it is, it is most likely broken anyway.