Assembler and Pqmagic list the PRW.ASM implementation of the partition Logical disk character

Source: Internet
Author: User
Tags root directory

f$ of Imitation (DOS7.1). EXE (>512m mode run), P_quest's p$. Exe

This article is based on 486DX2, motherboard, can be with primary (boot)/secondary control IDE 2, Interrupt 14/15, each IDE, can bring master (boot, cable)/slave (cable) (jumper DS/empty) 2 channels, per channel, Can take 1 hard drive, each drive, can carry 1 blocks of Normal,lba,large mode IDE hard disk.

dos,98 to the hard disk, first press the IDE, then the M/s, sequentially numbered, do not make up idle channels. For example, there are 3 disks, blocks 1,2 on pri_m/s, Block 3 on Sec_cs, 3 blocks, and 80h~82h.

The IDE and channel of the boot disk are specified by the BIOS boot seq.

(1) The BIOS Interrupt 13h parameter of the y contiguous sector of DOS/98 's read-write F16/32 format x:
The 2/3 of AH indicates read/write, the low 6 bits of Al indicate that the Y,ES:BX points to the memory buf, CL's low 6 digits indicate X's sector sector, the smallest 1,ch, the left spell CL 6th, 7 bits, the cylinder number of the X, cylinder, the smallest 0,DH indicates the magnetic number head, the smallest 0, DL indicates the soft drive number.

The IDE's original Normal,bios limit cylinder number 1024, the head number 16, sector number 63, 512 bytes per fan, multiplied = capacity 528MB. Used as a cmos_chs (cylinder:head:sector) stereo-seeking fan.

LBA, the head number is only 255, capacity 8.4GB

LARGE, cylinder number >1024, head number 16, controller do cylinder number/2, head number *2 to fit 13h. Capacity 2048*16*63*512=1g

Peripheral settings: Block mode acceleration, PIO (parallel I/O interface) mode, impact rate

(2) Extended 13h linear 64-bit LBA search fan for LBA:

When CHS turn, lba=c*sectors_per_cylinder+h*sectors_per_track+ (s-1)
Wherein, the Sectors_per_cylinder is the number of each cylinder, Sectors_per_track is the number of fan per track, since s is numbered from 1, minus 1.

Chs2lba,lba2chs, see "(7) Wen".

Using EXTBLK blocks:

Extblk db 16: bytes of block (including this byte)
DB 0
Sec_tot DW 1 indicates y sector
Buf_off DW 0; Memory buf offset
Buf_seg DW 0; buf segment value
Lbal DW 0; LBA low double character low word
Lbah DW 0; LBA low double character high word
DD 0; LBA High double word

When reading/writing, ah=42h/43h, Ds:si points extblk

Extended I13 BIOS Support (column number <1024, first with CHS), and export hard disk number, head number, each number of fan, algorithm see "(7) text" H_geo

(3) hard disk partition:

Per hard disk, up to DOS primary partition, DOS extended partition, non-DOS partition 1 of 4, described in 16 byte/zone 64 byte partition table (DPT):

Booton db 0 80h/0, is active/inactive.
Db? Partition to start CHS number one
Dw? Low 6 bits: sector, low 6th, 7 bit and high byte, ' snap to ' cylinder number
Volume DB 0 Partition identity value
Db? End CHS
Dw?
Front DD 0 The number of sectors (called hidden) before this partition. Int_25h_dx=1, read the logical first fan after
In DD 0 The number of sectors that this partition contains

MBR (f$ 1-disk master boot record, floppy disk 0:0:1, first fan of hard DOS partition, that is int_25h_ fan number dx=1), turn CPU to the active primary partition boot record (format.com) of the OS in the OBR system.

The retention area of the primary partition (the boot sector PBS is inside, the floppy disk is only hidden in area 1), often 2 fat, and then the root directory.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.