Hi, This does the following by way of example: a) scan the BIOS for valid physical (hard ) disks b) read the partition table of each hard disk and report on whether the disk has been at least partitioned, and if so tells about the DOS partitions c) scan all valid DOS hard drive numbers to see which disks are mounted. Note: The physical-to-logical mapping is somewhat complex if you have extended DOS partitions on your disk; this program will not be able to locate which physical drive goes with which logical drive in any case. But the bootable partition on the first physical drive will be the C: drive. I'm not sure about what happens if an extended partition somehow precedes a bootable partition and then you boot from floppy though :). Also, this does not know about CD-ROMs either, it will probably assume they are hard disks if the CBIOS can mount them or the device driver is installed. You can get the info you need as follows: a) if the AA55 tag isn't located on the master boot sector the disk is totally raw and nothing can be done until you run FDISK b) if it is, there must be a DOS partition or you have to run FDISK c) it must be a non-extended partition if you want it to be bootable. (usually a primary partition these days) d) DOS must like the file system on the thing or you have to run FORMAT. I'm assuming that function 36h will return the error value if the disk hasn't been formatted (-1) but I can't verify that right off hand. Unfortunately I don't know how to go mapping logical drives to physical drives in the general case, but excpet in very extreme circumstances (e.g. you use a non-standard partitioning program) I suspect DOS will ALWAYS mount the first non-extended partition as the C: drive if it can be mounted at all. Otherwise I guess it would mount the first logical drive in the extended partition as the C: drive if there is one. Unfortunately this leads to a little ambiguity, as, I don't know how to verify that the C: drive is actually on the first physical disk rather than on the second physical disk or somewhere else (like on a CD). Although there IS an easy way to check for RAM disks... but I didn't do it. David .model tiny .code org 100h .386 start: jmp go lastdrv db 0 numdrvs db 0 drvmask dd 0 numphys db 0 buf db 512 DUP (0) ; ; utility to print a message out of the code stream ; Msg PROC pop si push dx msgl: lodsb or al,al jz msgx mov dl,al mov ah,2 int 21h jmp Msgl msgx: pop dx push si ret Msg ENDP ; ; utility to print a number ; Number PROC sub ecx,ecx mov ebx,10 nl1: sub edx,edx div ebx push dx inc cx or eax,eax jnz nl1 nl2: pop dx mov ah,2 add dl,'0' int 21h loop nl2 ret Number ENDP ; ; check for physical drives that the BIOS knows about ; checkphys PROC call Msg db "Physical drives:",10,13,0 mov dx,80h cpl: mov bx,offset buf mov cx,1 mov ax,201h int 13h jc cpx ; ; now print partition status ; call Msg db " ",0 push dx add dl,'0'-80h mov ah,2 int 21h call Msg db ": ",0 int 3 cmp word ptr [buf + 510],0aa55h jz partitioned call Msg db "Unformatted",10,13,0 jmp phsjn partitioned: call Msg db "Partitioned",10,13,0 mov di,01beh+offset buf mov cx,4 mov dx,0 cpl2: cmp byte ptr [di + 4],6 jnz cpn6 call Msg db " Primary DOS partition, 16 bit FAT",0 jmp cplb cpn6: cmp byte ptr [di + 4],1 jnz cpn1 call Msg db " (old style) DOS partition, 12 bit FAT",0 jmp cplb cpn1: cmp byte ptr [di + 4],4 jnz cpn4 call Msg db " (old style) DOS partition, 16 bit FAT",0 cplb: test byte ptr [di] , 80h jz pcnonboot Call Msg db ", Marked for boot",0 pcnonboot: Call Msg db 10,13,0 jmp cplpx cpn4: cmp byte ptr [di + 4],5 jnz cplpx call Msg db " Extended Dos Partition, 16 bit FAT",10,13,0 cplpx: add di,16 loop cplx jmp phsjn cplx: jmp cpl2 phsjn: pop dx inc dl jmp cpl cpx: and dl,7fh mov [numphys],dl call Msg db " Total: ",0 movzx eax,[numphys] call Number call Msg db 10,13,0 ret checkphys ENDP ; ; set the value of the lastdrv and the numdrvs values ; getdosdrives PROC ; ; first, get avilable DOS drive devices ; mov ah,19h ; get def driue int 21h mov dl,al mov ah,0eh ; get number of active drives int 21h mov [lastdrv],al call Msg db "Reported last logical (DOS) drive: ",0 mov dl,[lastdrv] add dl,'@' mov ah,2 int 21h call Msg db ":",10,13," Logical (Dos) drives: ",0 ; ; Now some of them may be unused, so, go check the status of each drive ; with a size check ; mov edx,3 drvlp: mov ah,36h push dx int 21h pop dx cmp ax,-1 jz nodrive add dl,'@' mov ah,2 int 21h sub dl,'@' call Msg db ": ",0 bts [drvmask],edx ; set the mask bit inc [numdrvs] ; and inc the count nodrive: inc dx cmp dl,[lastdrv] jc drvlp gddone: call Msg db " Total: ",0 movzx eax,[numdrvs] call Number call Msg db 10,13,0 ret getdosdrives ENDP go PROC call Msg db "CHD V1.0",10,13,10,13,0 call checkphys call getdosdrives int 20h go endp end start