-
/me gets out book.
int 13h is the BIOS disk reading, writing, and controlling interrupt. Here are some functions:
00h: Reset Disk System
01h: Read Disk System Status
02h: Read Sector
03h: Write Sector
04h: Verify Sector
05h: Format Track
06h: Format Bad Track
07h: Format Drive, Starting at Given Track
08h: Get Drive Parameters
09h: Initialize Fixed Disk Tables
0Ah: Read Sector Long
0Bh: Write Sector Long
0Ch: Seek Cylinder
0Dh: Reset Fixed Disk System
10h: Test Drive Status
11h: Recalibrate Drive
19h: Park Heads
Now, I know this book is a bit old, but, that's what it has to say about everything. If you'd like, I could post the entries for each function. That's all I really know about the topic though, as I haven't tried to do much else. I have a tutorial somewhere on my other machine about boot-sector structure and doing coding for it.
Other than this, I would guess that an OS would have support for such a thing, and there should be documentation around about doing something like that.
[edit]
Forgot to mention that this book doesn't talk about protected-mode programming.
[/edit]
-
Found a little something
http://www.codeguru.com/Cpp/W-P/syst...cle.php/c5765/
I would think you may have problems with your app getting
permission, under a modern OS, to write to absolute (physical)
sectors. It probably would have been easy in DOS, but normally
the OS manages the low level physical interface to disk
and user apps have to ask the OS to create, open or write to
files.
-
thanks rcgreen, that's been the most helpful thus far. but what about doing this without windows intervention? as in, a bootable floppy disk that runs an EXE with a menu giving the choice of different format types and such.
-
Bear in mind that BIOS interrupts are only effective when running under a DOS or pre-boot environment, and certainly won't be avaible while running (for example) Windows.
In a Windows DOS BOX, you will be able to execute the safer BIOS functions, but it's extremely unlikely that dos boxes allow and app to do direct hard disc IO.
Also, discs that the BIOS doesn't know about can never be accessed this way, for example, non-bootable SCSI, non-bootable USB etc.
If you really really want to do this in win32 (which seems highly unlikely but I'll humour you), You need to use CreateFile() with a raw device name (Works with NT NOT win9x (but who cares, win9x should be just a bad memory these days)). This needs administrator rights, may need some other rights that you have to turn on (on a per-process basis), and is very likely to wreck your machine if you don't know what you're doing.
Slarty