vm86 and int 0x10 mode 0x13 - graphics, what else?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
distantvoices
Member
Member
Posts: 1600
Joined: Wed Oct 18, 2006 11:59 am
Location: Vienna/Austria
Contact:

vm86 and int 0x10 mode 0x13 - graphics, what else?

Post by distantvoices »

Ha!

and No,this is no joke. I've implemented vm86 stuff. I build a vm86 process, which has bios, vga bios and bios data area mapped into it's adress space. It behaves weird and queer never the less.

On real pc (Athlon xp 1700 +/nvidia 3d tnt 32 mb) it simply blanks the screen and displays a blinking cursor. When I switch back to text mode, the resolution remains the same, but text input is ok. In bochs, it is the same. screen is erased, but nothing else happens. For mode 13 i use this formula to get the offset for a pixel: y*xres+x or y<<8+y<<6+x. No pixel no lines.

the tutorials don't really reveal the problem to me. Maybe I am just thinking way too complicated.

Does somebody have experience with this stuff? More than mapping bios relevant memory into the vm86-memory space can't be done for making it accessible to vm86 task. Are there more caveats?
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
drizzt

Re:vm86 and int 0x10 mode 0x13 - graphics, what else?

Post by drizzt »

beyond infinity wrote: For mode 13 i use this formula to get the offset for a pixel: y*xres+x or y<<8+y<<6+x. No pixel no lines.
I think you should use this forumula: y<<6+y<<4+x.

...and for more helps, post your code... maybe there are problems into your v86 monitor...
distantvoices
Member
Member
Posts: 1600
Joined: Wed Oct 18, 2006 11:59 am
Location: Vienna/Austria
Contact:

Re:vm86 and int 0x10 mode 0x13 - graphics, what else?

Post by distantvoices »

Thanks for reply, Dark Elf.

Nay,i won't put source code here. I do the debugging myself coz it is my error. Would be too much for you to translate germen variable names to something understandable.

The vm86 monitor is working fine. I can trap in and out of vm86 mode with smooth elegance. It also goes through the bios routines and here the vm86-monitor dsoes the stuff it is expected to do.

What does not go the right way is: the switch to any graphics mode using bios int 10h. I wonder if there are any data areas left. Maybe I have overwritten something? Pointing me to some bios memory layout would be great. Possible tehat I've overseen something?

stay safe
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
beyond infinity lazy

Re:vm86 and int 0x10 mode 0x13 - graphics, what else?

Post by beyond infinity lazy »

woi ... really really weird error ... Didn't push nor handle exception error codes in my exception handler ... so no wonder it crapped out and didn't even consider to work in proper manner.

yeah, as someone has stated somewhere: the smallest bugs are the idiots cradle. But never the less, it's been worth the studying and searching. This way one learns about to search at the right places. It's really been as if you search a key everywhere but at the door knob where you've put it the day before.*lol*

now the vm86 subsystem of my kernel does wonderful work. It's something that works with message passing. Ah ... brain resting feels good...
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:vm86 and int 0x10 mode 0x13 - graphics, what else?

Post by Pype.Clicker »

well done. I still have to implement these, so if you're working on an open-source project, let me know where i can get a glance at it ...
beyond infinity lazy

Re:vm86 and int 0x10 mode 0x13 - graphics, what else?

Post by beyond infinity lazy »

Probably at www.distantvoices.org this weekend, you'll find sources and a grub-floppy-image for download.

I always test it on at least two computers(for hardware compatibility) and on bochs (for intermediate bug tracking). The video subsystem should by then be able to toggle between text mode and vga-modes and draw some boxes in vga.

to come: mouse interaction with console/vga screen -> changes according the video modes. Maybe it is of use maybe its pure crap.
Post Reply