Currently, I need to create custom OS to test some ideas. My question is: How to set resolution of video card without interrupts? My system supports multiboot standard and kernel starts in protected mode, so I probably cannot use BIOS services.
I cannot find port number etc. to initialize video cart and set resoultion. I tries to write dword value in VGA graphic address space, but nothing displays.
Edit 1: I have found this snipped of code: http://bos.asmhackers.net/docs/vga_without_bios/snippet_5/vga.php
I don't know on what kind of license it was published, so I cannot use it. Also, I prefer to write custom code in C.
I will rewrite it in C and tell you it works, but somebody could tell me it is good (what's the contraindications). I ask, because you ask me if I can builtin a virtual machine into my kernel.
Edit2
__asm__ (
"cli\n \
mov %%cr0,%%eax\n\
mov $1,%%cl \n\
xor %%cl,%%cl \n\
and %%cl, %%al \n\
mov %%eax,%%cr0\n \
sti \n\
xor %%ax,%%ax\n \
mov $0x12,%%ah\n \
int $0x10\n \
cli\n \
mov %%cr0,%%eax\n \
or $1,%%al\n \
mov %%eax,%%cr0\n \
sti \
" : : : "eax", "ecx")
); I don't know putting there my source code and asking for help is appreciated. I wrote above code, which should switch into real mode, set video mode and return to protected mode. I don't know what I'm doing wrong. Is here description table register clean or something? I'm rather newbie in OS programming. My OS resets in this code segment. Tripple fallout? I have found first error - instead xor cl,cl should be neg/not cl. In both cases OS resets.