Simple FAT12 Problem
Posted: Sat Dec 18, 2004 6:10 am
Hi,
I need to know where the BIOS Parameter Block is on a floppy.
I've added a BPB to the bootsector before the boot-code, like this:
I then use partcopy to copy it to the first sector (boot sector).
The BPB in the code shows that the volume label is "BOOT DISK", but when I go to explorer (Windows ME) is shows no volume label >:(
I've also tried formating the a floopy in Win ME and placing my code (with BPB) in the floppy. Then I go to a Hex editor and find that the BPB in my code is at 0x0000 and the BPB that Win ME on the floppy is at 0x2600 ???
Can someone pls tell me how to format a floppy with FAT12 in Windows ME or what format Win ME uses when it formats a floppy (because all it says is "FAT").
I also need to know how to access the BPB.
Thanks in advance.
I need to know where the BIOS Parameter Block is on a floppy.
I've added a BPB to the bootsector before the boot-code, like this:
Code: Select all
[bits 16]
[org 0x7c00]
jmp main
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; B I O S P A R A M E T E R B L O C K
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
OEM_ID db "12345678" ; The OEM ID (Who formatted the disk?)
BytesPerSector dw 0x0200 ; 512 bytes per sectors
SectorsPerCluster db 0x01 ; 1 sector per cluster
ReservedSectors dw 0x0001 ; 1 reserved sector (boot sector)
TotalFATs db 0x02 ; 2 copies of the FAT
MaxRootEntries dw 0x00E0 ; Up to 224 entries in the root dir
TotalSectorsSmall dw 0x0B40 ; 18 * 80 * 2 = 2880 sectors
MediaDescriptor db 0xF0 ; 0xF0 = 3.5", 2-sided, 18-sectors per track
SectorsPerFAT dw 0x0009 ; 9 sectors per FAT
SectorsPerTrack dw 0x0012 ; 18 sectors per track
NumHeads dw 0x0002 ; 2 heads (disk sides)
HiddenSectors dd 0x00000000 ; No hidden sectors
TotalSectorsLarge dd 0x00000000 ; Sectors fit in TotalSectorsSmall so this is 0
DriveNumber db 0x00 ; The drive number is saved here.
Flags db 0x00 ; Flags
Signature db 0x29 ; Signature of 0x29
VolumeID dd 0xDEAD0539 ; Random volume ID
VolumeLabel db "BOOT DISK " ; The volume label
SystemID db "FAT12 " ; The file system ID (FAT12)
main:
; Disable interrupts
cli
; Set up segment registers
xor ax, ax
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
; Set up stack
mov ss, ax
mov sp, 0xFFFF
; Enable interrupts
sti
times 510-($-$$) db 0
dw 0xAA55
The BPB in the code shows that the volume label is "BOOT DISK", but when I go to explorer (Windows ME) is shows no volume label >:(
I've also tried formating the a floopy in Win ME and placing my code (with BPB) in the floppy. Then I go to a Hex editor and find that the BPB in my code is at 0x0000 and the BPB that Win ME on the floppy is at 0x2600 ???
Can someone pls tell me how to format a floppy with FAT12 in Windows ME or what format Win ME uses when it formats a floppy (because all it says is "FAT").
I also need to know how to access the BPB.
Thanks in advance.