Disk I/O in Pmode / VBE

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.
Mullins

Disk I/O in Pmode / VBE

Post by Mullins »

I have entered pmode and are running C-code, how do i do disk I/O now? I can't use INT 13h now right?
Does anyone know where i can find docs on disk I/O?

Docs for VBE would be nice too.. ;)
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:Disk I/O in Pmode / VBE

Post by Candy »

Mullins wrote: I have entered pmode and are running C-code, how do i do disk I/O now? I can't use INT 13h now right?
Does anyone know where i can find docs on disk I/O?

Docs for VBE would be nice too.. ;)
You don't have any functions for disk IO at your disposal. You cannot use the VBE functions if you didn't get a PM entry point, and there are lots that don't HAVE a pm entry point.

Write your own drivers for them. (yes, that means, get the standards & write every sector writing operation yourself)
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 I/O in Pmode / VBE

Post by Pype.Clicker »

iirc, the docs for VBE are available on VBE.org ...

You can find an essay on writing disk drivers in pmode on my website

There are also basic documentations about HDD programming on OSRC (see .:QuickLinkz:.)

However, in a first time, it could be more interresting for you to load as much as you need while you're still in (un)real mode and have your pmode code working on a ramdisk rather than on real hardware ...

Same goes for the VBE stuff ... stick with text mode as long as graphics aren't really necessary and if you want to enable graphic mode before you have the required things in your OS (pmode entry point lookup or Vm86 support), just set up the required mode in your realmode bootloader ...
Mullins

Re:Disk I/O in Pmode / VBE

Post by Mullins »

Thanks, that should be enough to get me started ;)

Btw, VBE is just for fun.
ASHLEY4

Re:Disk I/O in Pmode / VBE

Post by ASHLEY4 »

Try this link:

http://debs.future.easyspace.com/Progra ... loppy.html

As for vesa you have to initialize it in real mode,or use v86.
ASHLEY4.
User avatar
bubach
Member
Member
Posts: 1223
Joined: Sat Oct 23, 2004 11:00 pm
Location: Sweden
Contact:

Re:Disk I/O in Pmode / VBE

Post by bubach »

As for vesa you have to initialize it in real mode,or use v86.
Why? If you know how, you should be able to set it in pmode, or?

/ Christoffer
"Simplicity is the ultimate sophistication."
http://bos.asmhackers.net/ - GitHub
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:Disk I/O in Pmode / VBE

Post by Candy »

bubach wrote:
As for vesa you have to initialize it in real mode,or use v86.
Why? If you know how, you should be able to set it in pmode, or?

/ Christoffer
if you know how you don't use vesa. VESA is the name for the 16-bit BIOS extensions (and nowadays the 32-bit extensions, that are barely present in practice). If you can use some method that works, you're not using vesa but you've written a normal driver.

As for that, if I make a v86 monitor, that logs every bit & byte the realmode prog out() & in()s do I get the info for a driver? If so, that'd rock.
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 I/O in Pmode / VBE

Post by Pype.Clicker »

well, you'll not exactly have a driver ... what you'll have is a communication for *one* instanciation. As there are usually timings and status polling in such a communication, i'm unsure it will be replayable, and i doubt it will be usable on another graphic card that yours...

btw, most PCI configuration goes through memory-mapped registers, so in/outs will no longer be of any help :(
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:Disk I/O in Pmode / VBE

Post by Candy »

Pype.Clicker wrote: well, you'll not exactly have a driver ... what you'll have is a communication for *one* instanciation. As there are usually timings and status polling in such a communication, i'm unsure it will be replayable, and i doubt it will be usable on another graphic card that yours...
it's in the v86 monitor, doubt there's a lot of timing issues.

Memory mapped IO could still be done, just manually progress the cursor, or disassemble the video bios (yes I'm a sick dude).
User avatar
bubach
Member
Member
Posts: 1223
Joined: Sat Oct 23, 2004 11:00 pm
Location: Sweden
Contact:

Re:Disk I/O in Pmode / VBE

Post by bubach »

forget my stupid comment above. i know that! *blames it on that i have been so tired latly* ;-)

Why not disassemble a bios and check it out? Where lies the vesa info? becasue i think i have a disassembled BIOS on my hd at home.. :-P
Then we could (together?) make a great video driver..

/ Christoffer
"Simplicity is the ultimate sophistication."
http://bos.asmhackers.net/ - GitHub
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:Disk I/O in Pmode / VBE

Post by Candy »

bubach wrote: forget my stupid comment above. i know that! *blames it on that i have been so tired latly* ;-)

Why not disassemble a bios and check it out? Where lies the vesa info? becasue i think i have a disassembled BIOS on my hd at home.. :-P
Then we could (together?) make a great video driver..

/ Christoffer
vesa is the interface between your prog and the driver for the video card. If you disassemble the bios you get a driver for only that video card, possibly only that series. Other ways might be better
User avatar
bubach
Member
Member
Posts: 1223
Joined: Sat Oct 23, 2004 11:00 pm
Location: Sweden
Contact:

Re:Disk I/O in Pmode / VBE

Post by bubach »

but if i am i real mode in my os and i set some svga mode with vesa. where is the driver? not in my os anyway.. so the drivers should be somewhere in the bios (for all cards), right?

/ Christoffer
"Simplicity is the ultimate sophistication."
http://bos.asmhackers.net/ - GitHub
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 I/O in Pmode / VBE

Post by Pype.Clicker »

btw, informations about how to set up video modes are usually available for most cards (Xfree86 is the best example of it ;) ... VESA is simply a "least resistance" way that ensures you that you'll be able to turn on *any* card and not just "the card you have at home" ...
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:Disk I/O in Pmode / VBE

Post by Candy »

bubach wrote: but if i am i real mode in my os and i set some svga mode with vesa. where is the driver? not in my os anyway.. so the drivers should be somewhere in the bios (for all cards), right?

/ Christoffer
No. The driver is in the video bios that is on your video card. There's no reason why it should have all video card drivers there, so they aren't there.
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 I/O in Pmode / VBE

Post by Pype.Clicker »

Candy wrote:

No. The driver is in the video bios that is on your video card. There's no reason why it should have all video card drivers there, so they aren't there.
Indeed. Everything under 0xC000:xxxx is the memory-mapped video ROM directly from your video card. It exists from the old ages of PC XT iirc. That's a pitty network card have no such things ...
Post Reply