: : i use nasm assembler, but i must determine the type of file system. how can i do this program?
: :
:
:
: Check this site out. I would bookmark it since it has other good info on OS level stuff.
:
: http://www.nondot.org/sabre/os/articles/FileSystems/
:
:
:
:
There is an undocumented DOS interrupt function that can get that information. Took me some time to find it again.
I dont know if this matches the NASM syntax, but it's easy to convert..
Try this:
;Interrupt 0x21 subfunction 0x69(Get/Set Disk Serial Number)
MOV ah,0x69
;AL=0 - get serial number
;AL=1 - set serial number
MOV al,0
;Drive to check
;BL=0 - Default drive
;BL=1 - A drive
;BL=2 - B drive
;BL=3 - C drive
;BL=...
MOV bl,3
;DS:DX - Pointer to the buffer to contain extended BIOS parameter block
;Set DS if needed
MOV dx,offset ParamBlock
INT 0x21
;Structure of the parameter block:
ParamBlock:
infolevel db 0
serialnumber dd ?
volumelabel db 11 dup(?)
filesystem db 8 dup(?) ;This is what you need
;After calling int 0x21 the 8-byte string filesystem will hold
;the name of the file system. If it is FAT32 then the string will
;be "FAT32 ", if FAT16 then it will be "FAT16 " and so on.
Hope this helps!