Disk Sector loading

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
truenoteno

Disk Sector loading

Post by truenoteno »

when you ask to load a sector of a disk into memory, will it load the entire file also or just the 1 sector ?
Chris Giese

RE:Disk Sector loading

Post by Chris Giese »

>On 2001-09-24 20:01:12, truenoteno wrote:
>when you ask to load a sector of a disk into memory, will it load the entire file also or just the 1 sector ?

It depends. What function do you use to load the
disk sectors? Do you use BIOS INT 13h?
Do you use the read() or fread() functions in C?
What OS are you using?
Iwabee

RE:Disk Sector loading

Post by Iwabee »

>On 2001-09-24 22:17:52, Chris Giese wrote:
>>On 2001-09-24 20:01:12, truenoteno wrote:
>>when you ask to load a sector of a disk into memory, will it load the entire file also or just the 1 sector ?
>
>It depends. What function do you use to load the
>disk sectors? Do you use BIOS INT 13h?
>Do you use the read() or fread() functions in C?
>What OS are you using?

How to load sectors from HD in protected mode?
Chris Giese

RE:Disk Sector loading

Post by Chris Giese »

>On 2001-09-25 01:12:26, Iwabee wrote:
>>On 2001-09-24 22:17:52, Chris Giese wrote:
>>>On 2001-09-24 20:01:12, truenoteno wrote:
>>>when you ask to load a sector of a disk into memory, will it load the entire file also or just the 1 sector ?
>>
>>It depends. What function do you use to load the
>>disk sectors? Do you use BIOS INT 13h?
>>Do you use the read() or fread() functions in C?
>>What OS are you using?
>
>How to load sectors from HD in protected mode?

INT 13h and drivers for both the floppy and
IDE hard disks deal in sectors. For these
devices, one sector = 512 bytes.

You can load more than one sector at a time
so long as they are contiguous (next to each
other on the disk). In general, a file is
fragmented: the disk sectors it uses are NOT
contiguous. You need another layer of software
(the filesystem) to find the disk sectors
actually used by a file.

Hope this helps.
Iwabee

RE:Disk Sector loading

Post by Iwabee »

>>>>when you ask to load a sector of a disk into memory, will it load the entire file also or just the 1 sector ?
>>>
>>>It depends. What function do you use to load the
>>>disk sectors? Do you use BIOS INT 13h?
>>>Do you use the read() or fread() functions in C?
>>>What OS are you using?
>>
>>How to load sectors from HD in protected mode?
>
>INT 13h and drivers for both the floppy and
>IDE hard disks deal in sectors. For these
>devices, one sector = 512 bytes.
>
>You can load more than one sector at a time
>so long as they are contiguous (next to each
>other on the disk). In general, a file is
>fragmented: the disk sectors it uses are NOT
>contiguous. You need another layer of software
>(the filesystem) to find the disk sectors
>actually used by a file.

Ok. I know that, but in _PROTECTED_ _MODE_ BIOS ints
are disabled so I have to find another way. For
example thru I/O ports. What I ask is HOW to do this?
j.weeks

RE:Disk Sector loading

Post by j.weeks »

>Ok. I know that, but in _PROTECTED_ _MODE_ BIOS ints
>are disabled so I have to find another way. For
>example thru I/O ports. What I ask is HOW to do this?

Uhm... all that info wont fit in one message :) Besides,
it depends on what kind of hd. IDE or SCSI?

If you're lookin' for IDE info (which you probably are)
just search for the ATA Standard (or for IDE HD
programming). I believe HelpPC had a section
on HD's as well.

j.weeks
Post Reply