Reading a drive's serial number Nov 13, 2020 23:30:19 GMT 1 Quote Select PostDeselect PostLink to PostBack to Top Post by rmgillmore on Nov 13, 2020 23:30:19 GMT 1 When running in a 32-bit console, I am able (in 16-bit assembly language), to read a DOS drive serial number by executing this procedure: public absoluteDiskReaddiskReadFrame struc diskRead_OldFrame Dw ? diskRead_RtnAddr Dd ? driveNumber Db ? driveNumberIsByte Db ? controlPacketPtr Dd ? statusPtr Dd ?diskReadFrame endsabsoluteDiskRead proc far Push Bp Mov Bp, Sp ; ensure that DOS knows the disk media format by executing ; interrupt 21h, function 47h Mov Ah, 47h Mov Dl, [Bp].driveNumber Inc Dx Mov Si, sysCallAsmModule_Data Push Si Pop Ds Mov Si, offset diskBuffer Int 21h ; use interrupt 25h to read the requested sector(s) Mov Al, [Bp].driveNumber ; the drive number is only a byte, so Xor Ah, Ah ; ignore the upper byte in the word Lds Bx, [Bp].controlPacketPtr Mov Cx, -1 Int 25h ; absolute disk read Les Bx, [Bp].statusPtr ; prepare for save of error value Mov Word Ptr Es:[Bx], Ax Add Sp, 2 ; handle DOS disk read anomaly Pop Bp retabsoluteDiskRead endpThe serial number is located at the 29h offset into the buffer whose address is specified in the control packet.HOWEVER, when trying the same code in vDOS, I get an error 0103h (259) when attempting to read from sector zero.What I am trying to capture is reported by the vDos internal DIR command (reported as "Volume Serial Number").I am not afraid to write ASM, been doing it for almost 40 years now. But where is the serial number?