flat assembler
Message board for the users of flat assembler.

Index > OS Construction > VM86 problems

Author
Thread Post new topic Reply to topic
Artlav



Joined: 23 Dec 2004
Posts: 188
Location: Moscow, Russia
Artlav 24 Nov 2005, 20:54
Iam writing a BIOS module for my PM OS using VM86.
But somewhy neither interrupts nor i/o works in vmode.
On int 10h unidentified exeption is generated.

First question: What is wrong?
Second question: Is there better ways to access BIOS from PM?

Thank you in advance.

Setup:
Code:
CR4: 0x2D3

VM TSS GDT record:
00h: 0x091c00af 0xf000e920 0x00000000 0x00000000
10h: 0x00000000 0x00000000 0x00000000 0x00000000

VM TSS selector: 0xE0

VM TSS:
00h: 0x00000000 0x00000000 0x00000000 0x00000000
10h: 0x00000000 0x00000000 0x00000000 0x0042f000
20h: 0x00000000 0x000a3202 0x00000000 0x00000000
30h: 0x00000000 0x00000000 0x00000000 0x00000000
40h: 0x00000000 0x00000000 0x00001000 0x00001000
50h: 0x00001000 0x00001000 0x00000000 0x00000000
60h: 0x00000000 0x00900000 0x000001b0 0x00000000
70h: 0x00000000 0x00000000 0x00000000 0x00000000
80h: 0x00000000 0x00000000 0x00000000 0x00000000
90h: 0x00000000 0x00000000 0x00000000 0x00000000
A0h: 0x00000000 0x00000000 0x00000000 0x00000000
B0h: 0x00000000 0x00000000 0x00000000 0x00000000

VM pages:
0x00000-0x9FFFF mapped to the randomly allocated app memory.
Preserved original IVT image is copyed to 0x0.
0xA0000-0xFFFFF mapped to the same physical area.

vm code (0x1000:0x0):
use16

start:
jmp     begin

begin:
mov     sp,stacks
add     sp,199

mov     ax,0013h
int     10h

jmp     $

stacks  rb 200
    
Post 24 Nov 2005, 20:54
View user's profile Send private message Visit poster's website Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u 24 Nov 2005, 23:08
I go back to realmode from pmode and back to pmode for my OS, for vesa mode switching etc, it works fine.
I have made a demo for doing this, let me know if you want to try it.
It needs vesa2 for the demo.

PS: You can also try these games for Dex4u (my OS) that user the switching function,
heres a self extraring image for floppy http://www.dex4u.com/Dex4uPong.zip
The image includes a old ver of Dex4u OS, along with some games.
Post 24 Nov 2005, 23:08
View user's profile Send private message Reply with quote
Artlav



Joined: 23 Dec 2004
Posts: 188
Location: Moscow, Russia
Artlav 28 Nov 2005, 17:59
Solved the problem recently (gdt and tss is not paged in the vm86), and found, that there is no real need in the BIOS driver...
Strange thing - two years ago i didn't knew how to continue the OS without it, and when it's finally done there is already no use for it.

Dex4u: Good ones.
What about all the pmode structures - how they will be preserved in the switch? i mean paging, segments?
Or should i create a plain memory area within the first mb with the rm code?
Post 28 Nov 2005, 17:59
View user's profile Send private message Visit poster's website Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u 28 Nov 2005, 18:44
Here is a simple demo of switch to & from pmode for ints, come with fasm source code http://www.dex4u.com/DemoVesa.zip
Note: the code needs vesa2 and was done when i was called ASHLEY4 Wink .

PS: If you have any ? about the inner workings of Dex4u OS, you can ask ? here: http://dex.7.forumer.com/
Post 28 Nov 2005, 18:44
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.