PDA

View Full Version : anyone know about interrupt 13h extensions?



merlyn2000
06-13-2002, 08:49 PM
is there a library, for djgpp, that can handle interrupt 13h extensions?

or a function built in?

fcook1SPAMBLOCK@carolina.rr.com

sean
06-13-2002, 08:53 PM
If you want to include assembly code into your programs, just do the following:

ASM
{
...
}

You could put the { right after ASM but that's all a matter of style- makes no difference. I'm not sure I completely understood the question, so if this doesn't help, please tell me.

merlyn2000
06-13-2002, 09:05 PM
13h extensions is the method of accessing a harddrive larger than
8gb ...

well, what i need to do is determine if 13hextensions is available, and if so use them.

function biosdisk works fine on small drives u see, but leaves blank spots on larger drives because there are essentially more sectors. int 13h is the old access point, so to speak. there are now extensions to that, basically adding more commands i think.

again what i need is:

more information, detailed.
a library which will essentially replace function biosdisk.
-or-
another function, possibly already existing, which i am
unaware of.

thanx for trying to help tho ... u peeps here is 2 kewl. i feel uneducated, versus unwanted; as i have felt in the past
posting to newsgroups.

sean
06-13-2002, 10:19 PM
I have no idea how to answer your question without some serious improvisation - try setting up some error control, and then run int 13h with it's extensions inside the ASM {...}. Then you'd know whether or not it works, but f it doesn't, it'll just continue.

merlyn2000
06-14-2002, 06:44 AM
'tis a tough item i'll admit. seems like it may be a good way to get 'brushed up' on my C again.

If anyone ahs an idea where i may find a library, or some info ...
plz buzz in



:D

merlyn2000
06-14-2002, 07:17 AM
is there ANY way to reuse code from another program?

okok suppose that i have source for a program such as fdisk. well FreeFdisk ... i do have it. it's written in c++ me thinks, well at least its written in spaghetti, and i don't understand it. the int13h extensions are accessed as they should be and work properly. else large disk support wouldn't be there. can i simply write code calling his functions and then compile with his sources?????


that would be cool ... and ez'r than writing my own.

sean
06-14-2002, 12:40 PM
Well, that is a general goal of OOP, and thus C++. If it's already compiled, I can think of one way, but it's probably illegal. Here's DEBUG, I was actually about to upload it for some other post. I forgot which one though.... I'll have to go find it. Anyway - use the following instructions:
n [full path of the program]
l
u
keep pushing u to view it's unassembled assembly code. As long as you can follow it well, you should be okay. The only way you're going to be able to do this easily, is if you hade partially compiled code, like *obj files or libraries.

sean
06-14-2002, 12:41 PM
I forgot to mention - press ? and enter for full instructions, and press q and enter at any prompt to quit. If it freezes or something, use CTRL+PAUSE/BREAK. This won't work on anything newer than Win 2000

sean
06-14-2002, 12:45 PM
Sorry about the numerous posts - I keep forgetting stuff. Heres the file. Because the site doesn't allow *.exe, I just changed the extension to cpp. Use DOS or something change it back to a file type you can exectue. It's still in the right format.

Shiro
06-14-2002, 02:16 PM
Seems you can use int 13h with function 41h, if the carry flag is not set, then the machine has the extensions.

http://home.teleport.com/~brainy/diskaccess.htm
http://www.pcguide.com/ref/hdd/bios/overExtensions-c.html

But do you need a library for that? If the machine has the extionsions, you can use the machine's extensions.

VirtualAce
06-15-2002, 04:01 AM
You can use any of the MS extensions to int 13h. Be forewarned though that Windows locks all volumes so every invocation of this interrupt returns an error ERR_LOCKED_VOLUME or something like that.

Actually you need to lock the volume (rather than unlock, as with most MS stuff). I have tried several of the RBIL entries that should do it, but to no avail. I have not been able to use direct disk access at all(except in my own bootstrap code) and eventually gave up on it under Windows.

The problem is that when Windows boots, it hooks the int 13 vector and puts its own handler there. Who knows if it even saves the previous handler or just breaks the chain. The ideal method would be to bypass the Windows handler and get to the actual BIOS handler, but if Windows did not save the handler address this is next to impossible. Even if Windows did save the address it's prob not going to tell you what it was and for good reason.

You should also query first to make sure the computer has the LBA extensions - most do - but its just a precaution.

If you find out how to lock the darn volumes so Windows will shut up and let me do my thing with int 13h, let me know will ya.
:D

sean
06-15-2002, 12:17 PM
Aren't there functions equivalent to all the Service Table INterrupts?

VirtualAce
06-15-2002, 10:54 PM
There are other extensions that have been added such as VBE and another to control BIOS FLASH ROM. There is another set of extensions specifically dedicated to shutting down the computer (powering off), but I don't know what they are and have not found any information regarding these extensions. But since I reckon this would be the only way to shut down the system - via interrupt to the mobo and then the mobo takes care of the rest - I know they exist.

sean
06-16-2002, 10:06 AM
And also to add to my previous question: are thre C/C++ equivalents of these new interupts?

merlyn2000
06-16-2002, 11:25 AM
biosdisk (bios.h) was the OLD 'equivelant, i too wanna know if the new extensions are interfaced with a C/C++ library function

sean
06-16-2002, 07:25 PM
lol - biosdisk.h - that sounds like ti would have something to do with assembler. Unless it gets into some really in depth C stuff, it should still compile under C++ syntax shouldn't it? I mean I know it would be object-oriented, but it would still work, wouldn't it?

merlyn2000
06-16-2002, 10:18 PM
biosdisk.h would work ... just go into 'C' mode for that ...

i think. ima dos coder, know nuthin of windows coding in c.

vb i know and it dont get close to biosdisk.h

hehehahahaheh

sean
06-17-2002, 11:00 AM
Speaking of programming for Windows in C, does anyone know any tutorials on windows.h (comes with C++ compilers, but it's written in C), because OWL - I just don't like its style, and I'm looking at switching to plain C - it's closer to the system, and I don't use OOP a whole lot.