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?
Disk Access Under Pmode
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Disk Access Under Pmode
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 *
)
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 *
)
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Disk Access Under Pmode
anyway, i think using virtual mode is safer than this auwful hack ...
Re:Disk Access Under Pmode
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.
I just wonder I can call bios functions WITHOUT always switch between different modes.
Re:Disk Access Under Pmode
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
Re:Disk Access Under Pmode
Don't use the BIOS at all, except for VESA for cards that don't support VBE3. Definitely write your own disk drivers.