.nolist ;******************************************************************************************************************************** ;* * ;* File: MBR.inc * ;* * ;* This file contains constants and structures related to the Master Boot Record. * ;* * ;* It was written for MASM, but shouldn't be too difficult to adapt for other assemblers. * ;* * ;* The information for this is from many scattered sources, because there is no single great source. * ;* * ;* Authors: * ;* - Neil G. Dickson * ;* * ;******************************************************************************************************************************** .radix 16 MBR_ENTRY0_OFFSET equ 1BE MBR_ENTRY1_OFFSET equ 1CE MBR_ENTRY2_OFFSET equ 1DE MBR_ENTRY3_OFFSET equ 1EE MBR_PARTITION_ACTIVE equ 80 ;active=bootable MBR_PARTTYPE_DISABLED equ 00 ;means that the entry is not present MBR_PARTTYPE_FAT12 equ 01 MBR_PARTTYPE_XENIX_ROOT equ 02 ;probably obsolete MBR_PARTTYPE_XENIX_USR equ 03 ;obsolete MBR_PARTTYPE_FAT16S equ 04 ;for <32MB MBR_PARTTYPE_EXTENDED equ 05 ;this is an extended partition to store extra logical partitions (only start location used in entry) ;comments below, about MBR_PARTTYPE_EXTENDED_LBA apply here too MBR_PARTTYPE_FAT16L equ 06 ;for >=32MB MBR_PARTTYPE_OS2_HPFS equ 07 ;these 4 conflict MBR_PARTTYPE_NTFS equ 07 ;these 4 conflict MBR_PARTTYPE_ADVANCED_UNIX equ 07 ;these 4 conflict MBR_PARTTYPE_QNX equ 07 ;these 4 conflict MBR_PARTTYPE_OS2_BOOT equ 0A MBR_PARTTYPE_FAT32 equ 0B MBR_PARTTYPE_FAT32_LBA equ 0C MBR_PARTTYPE_FAT16L_LBA equ 0E ;for >=32MB MBR_PARTTYPE_EXTENDED_LBA equ 0F ;format for 1st sector of partition is same as that of MBR (except empty up until MBR_ENTRY0_OFFSET, where table starts) ;an extended partition can contain an extended partition MBR_PARTTYPE_HIDDEN_FAT16L equ 16 ;for >=32MB MBR_PARTTYPE_HIDDEN_NTFS equ 17 MBR_PARTTYPE_LINUX_SWAP equ 82 MBR_PARTTYPE_EXT2 equ 83 ;these 3 partly conflict (all are "Linux Native") MBR_PARTTYPE_EXT3 equ 83 ;these 3 partly conflict (all are "Linux Native") MBR_PARTTYPE_REISER equ 83 ;these 3 partly conflict (all are "Linux Native") ;apparently a few other Linux filesystems use this number ;many more, but I don't care about most of them: Ralf Brown's Interrupt List contains a very large list of them PARTITIONENTRY struct IsBootable byte ? ;80h if bootable, else 00h FirstDH byte ? ;CHS format for INT13h FirstCL byte ? ; FirstCH byte ? ; PartitionType byte ? LastDH byte ? ;CHS format for INT13h LastCL byte ? ; LastCH byte ? ; FirstSector dword ? ;LBA format NumSectors dword ? PARTITIONENTRY ends .radix 10 .list