Page 1 of 1 [ 5 posts ] 

kmalloc
Hummingbird
Hummingbird

User avatar

Joined: 10 Dec 2013
Age: 34
Gender: Male
Posts: 21

29 Mar 2014, 2:54 am

Is int 0x13h used any longer on the intel and amd64 platforms today? If not than what method is used to read storage media in assembly source.



one-A-N
Veteran
Veteran

User avatar

Joined: 2 Mar 2010
Age: 70
Gender: Male
Posts: 883
Location: Sydney

29 Mar 2014, 5:22 am

Those BIOS interrupts are still available for real mode operating systems (and assembly programmers).

In protected mode, the operating system (Linux, MacOSX, Windows, etc) provides its own functions to read storage.

When the computer boots, the BIOS would use int 13 to read the master boot sector of the hard disk, or the boot sector of a floppy disk.

More reading: http://wiki.osdev.org/ATA_in_x86_RealMode_%28BIOS%29



kmalloc
Hummingbird
Hummingbird

User avatar

Joined: 10 Dec 2013
Age: 34
Gender: Male
Posts: 21

30 Mar 2014, 1:33 am

Well, I thought that int 0x13h was a old BIOS interrupt routine to read the drive. LBA is pretty much used. Also, is the master boot record really a disk partition or is the disk partitions is inside of the master boot record? I would like to know.



one-A-N
Veteran
Veteran

User avatar

Joined: 2 Mar 2010
Age: 70
Gender: Male
Posts: 883
Location: Sydney

30 Mar 2014, 5:51 am

kmalloc wrote:
Well, I thought that int 0x13h was a old BIOS interrupt routine to read the drive. LBA is pretty much used. Also, is the master boot record really a disk partition or is the disk partitions is inside of the master boot record? I would like to know.


Int 13h has a number of functions, including a couple of newer ones that support LBA (0x42=read and 0x43=write): http://wiki.osdev.org/ATA_in_x86_RealMode_%28BIOS%29#LBA_in_Extended_Mode

The master boot record (MBR, the first sector on the hard disk) contains the partition table: a list of the four possible primary partitions on the hard disk, along with various details about them. The partition table only takes up part of the master boot sector. The actual partitions themselves start further into the hard disk, depending on the values that are stored in the MBR's partition table. Different operating systems begin the first partition in different places, some leaving a noticeable gap before the first partition so that special software can be stored in the unpartitioned space and loaded before booting the active partition (Example: LVM2 under Linux). The remaining sectors in the first track of the hard disk, just after the MBR, can also be used for storing the details of extra partitions (partitions #5-64), if I remember correctly.

The MBR is never part of a partition, although it would be possible to make it a part of one, I guess. Not sure why you would want to do that, as you DON'T want your MBR overwritten by other processes.



Cornflake
Administrator
Administrator

User avatar

Joined: 30 Oct 2010
Gender: Male
Posts: 68,708
Location: Over there

30 Mar 2014, 5:54 am

The MBR:
http://en.wikipedia.org/wiki/Master_boot_record (plus links off it)


_________________
Giraffe: a ruminant with a view.