Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

32-bit MSDOS (Announce)

posted by mceric, Germany, 28.09.2021, 01:04

> I assume that CHS and LBA are mutually exclusive?

Not at all. You simply use the LBA detection int 13 call and if that is positive, you are allowed to use LBA style disk access. You can always stick to CHS, but of course CHS has the added complexity that the same LBA sector can have different CHS locations depending on how your current geometry is arranged, for example based on your BIOS CMOS settings. But of course there also is an int 13 call to query the current CHS geometry :-)

> Or can you write code, including a boot sector, that
> gracefully detects whether you are on an LBA-capable
> system and switch to LBA?

Of course, yes. The detection is simple, just write your own public domain code to use it. From RBIL:

INT 13 - IBM/MS INT 13 Extensions - INSTALLATION CHECK
AH = 41h
BX = 55AAh
DL = drive (80h-FFh)
Return: CF set on error (extensions not supported)
AH = 01h (invalid function)
CF clear if successful
BX = AA55h if installed
AH = major version of extensions
01h = 1.x
20h = 2.0 / EDD-1.0
21h = 2.1 / EDD-1.1
30h = EDD-3.0
AL = internal use
CX = API subset support bitmap (see #00271)
DH = extension version

Bitfields for IBM/MS INT 13 Extensions API support bitmap:
Bit(s) Description (Table 00271)
0 extended disk access functions (AH=42h-44h,47h,48h) supported
1 removable drive controller functions (AH=45h,46h,48h,49h,INT 15/AH=52h)
supported
2 enhanced disk drive (EDD) functions (AH=48h,AH=4Eh) supported
extended drive parameter table is valid (see #00273,#00278)
3-15 reserved (0)

One of the reserved bits later got used to indicate support for linear pointers to RAM, I think even supporting 64-bit pointers for buffers beyond your first 4 GB of RAM, for int 13 LBA calls. Read the updated EDD specs for details if you want to use that feature.

See int 13 functions 08 and 48 for details about checking the current CHS geometry. To access sector contents, use functions 2 and 3 for CHS or 42 and 43 for LBA style.

---
FreeDOS / DOSEMU2 / ...

 

Complete thread:

Back to the forum
Board view  Mix view
22632 Postings in 2109 Threads, 402 registered users, 391 users online (1 registered, 390 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum