Disk Access Under Pmode

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
peter c

Disk Access Under Pmode

Post by peter c »

As BIOS calls are disabled after switching into pmode,how do I access disks?
And is there any way to copy the code stored in BIOS so I could use it in Pmode?
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:Disk Access Under Pmode

Post by Pype.Clicker »

unfortunately no... the code in the BIOS accesses all its variables with a segment/offset approach ...

but, in fact, you make me doubt about it ... one could evaluate the code "on the fly" from the interrupt entry point, and translate the segment values in something that is more "pmode-friendly" (for instance, when you see segment #C000, you create a new segment which base is 0x000C0000 and put its selector overthere).

You might even not need to parse the code, but just let the CPU run and react on #GPF events (cpu: hum, hum .. i really dislike that 0xb800 selector ... biosmonitor: don't worry, dude, here's a nice 0x002c selector you can use instead cpu : gr8t! i'll use it with care

* cpu got access to VRAM *
)
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:Disk Access Under Pmode

Post by Pype.Clicker »

anyway, i think using virtual mode is safer than this auwful hack ...
Peter C

Re:Disk Access Under Pmode

Post by Peter C »

Thanks for the message,but I just can't belive that all pmode OS(for example,windows 95) switch back to V386 mode or Real mode to call any BIOS function.If they do so on every VESA 1.2 bank switching and every disk access,it will surely be VERY SLOW!
I just wonder I can call bios functions WITHOUT always switch between different modes.
Warmaster199

Re:Disk Access Under Pmode

Post by Warmaster199 »

Actually, you can grab a pointer to a function in the VESA BIOS to switch banks. The VESA BIOS Switch Bank function is 32-bit protected mode code, so it's alot faster to get that pointer, rather than use the Bios calls
Tim

Re:Disk Access Under Pmode

Post by Tim »

Don't use the BIOS at all, except for VESA for cards that don't support VBE3. Definitely write your own disk drivers.
Post Reply