The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/fs/msdosfs/bootsect.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*      $NetBSD: bootsect.h,v 1.4 2006/08/14 14:06:26 gdt Exp $ */
    2 
    3 /*
    4  * Written by Paul Popelka (paulp@uts.amdahl.com)
    5  *
    6  * You can do anything you want with this software, just don't say you wrote
    7  * it, and don't remove this notice.
    8  *
    9  * This software is provided "as is".
   10  *
   11  * The author supplies this software to be publicly redistributed on the
   12  * understanding that the author is not responsible for the correct
   13  * functioning of this software in any circumstances and is not liable for
   14  * any damages caused by this software.
   15  *
   16  * October 1992
   17  */
   18 #ifndef _MSDOSFS_BOOTSECT_H_
   19 #define _MSDOSFS_BOOTSECT_H_
   20 
   21 /*
   22  * Format of a boot sector.  This is the first sector on a DOS floppy disk
   23  * or the fist sector of a partition on a hard disk.  But, it is not the
   24  * first sector of a partitioned hard disk.
   25  */
   26 struct bootsector33 {
   27         u_int8_t        bsJump[3];              /* jump inst E9xxxx or EBxx90 */
   28         int8_t          bsOemName[8];           /* OEM name and version */
   29         int8_t          bsBPB[19];              /* BIOS parameter block */
   30         int8_t          bsDriveNumber;          /* drive number (0x80) */
   31         int8_t          bsBootCode[479];        /* pad so struct is 512b */
   32         u_int8_t        bsBootSectSig0;
   33         u_int8_t        bsBootSectSig1;
   34 #define BOOTSIG0        0x55
   35 #define BOOTSIG1        0xaa
   36 };
   37 
   38 struct extboot {
   39         int8_t          exDriveNumber;          /* drive number (0x80) */
   40         int8_t          exReserved1;            /* reserved */
   41         int8_t          exBootSignature;        /* ext. boot signature (0x29) */
   42 #define EXBOOTSIG       0x29
   43         int8_t          exVolumeID[4];          /* volume ID number */
   44         int8_t          exVolumeLabel[11];      /* volume label */
   45         int8_t          exFileSysType[8];       /* fs type (FAT12 or FAT16) */
   46 };
   47 
   48 struct bootsector50 {
   49         u_int8_t        bsJump[3];              /* jump inst E9xxxx or EBxx90 */
   50         int8_t          bsOemName[8];           /* OEM name and version */
   51         int8_t          bsBPB[25];              /* BIOS parameter block */
   52         int8_t          bsExt[26];              /* Bootsector Extension */
   53         int8_t          bsBootCode[448];        /* pad so structure is 512b */
   54         u_int8_t        bsBootSectSig0;
   55         u_int8_t        bsBootSectSig1;
   56 #define BOOTSIG0        0x55
   57 #define BOOTSIG1        0xaa
   58 };
   59 
   60 struct bootsector710 {
   61         u_int8_t        bsJump[3];              /* jump inst E9xxxx or EBxx90 */
   62         int8_t          bsOEMName[8];           /* OEM name and version */
   63         int8_t          bsBPB[53];              /* BIOS parameter block */
   64         int8_t          bsExt[26];              /* Bootsector Extension */
   65         int8_t          bsBootCode[420];        /* pad so structure is 512b */
   66         u_int8_t        bsBootSectSig0;
   67         u_int8_t        bsBootSectSig1;
   68 #define BOOTSIG0        0x55
   69 #define BOOTSIG1        0xaa
   70 };
   71 #ifdef  atari
   72 /*
   73  * The boot sector on a gemdos fs is a little bit different from the msdos fs
   74  * format. Currently there is no need to declare a separate structure, the
   75  * bootsector33 struct will do.
   76  */
   77 #if 0
   78 struct bootsec_atari {
   79         u_int8_t        bsBranch[2];            /* branch inst if auto-boot     */
   80         int8_t          bsFiller[6];            /* anything or nothing          */
   81         int8_t          bsSerial[3];            /* serial no. for mediachange   */
   82         int8_t          bsBPB[19];              /* BIOS parameter block         */
   83         int8_t          bsBootCode[482];        /* pad so struct is 512b        */
   84 };
   85 #endif
   86 #endif /* atari */
   87 
   88 union bootsector {
   89         struct bootsector33 bs33;
   90         struct bootsector50 bs50;
   91         struct bootsector710 bs710;
   92 };
   93 
   94 #if 0
   95 /*
   96  * Shorthand for fields in the bpb.
   97  */
   98 #define bsBytesPerSec   bsBPB.bpbBytesPerSec
   99 #define bsSectPerClust  bsBPB.bpbSectPerClust
  100 #define bsResSectors    bsBPB.bpbResSectors
  101 #define bsFATS          bsBPB.bpbFATS
  102 #define bsRootDirEnts   bsBPB.bpbRootDirEnts
  103 #define bsSectors       bsBPB.bpbSectors
  104 #define bsMedia         bsBPB.bpbMedia
  105 #define bsFATsecs       bsBPB.bpbFATsecs
  106 #define bsSectPerTrack  bsBPB.bpbSectPerTrack
  107 #define bsHeads         bsBPB.bpbHeads
  108 #define bsHiddenSecs    bsBPB.bpbHiddenSecs
  109 #define bsHugeSectors   bsBPB.bpbHugeSectors
  110 #endif
  111 
  112 #endif /* _MSDOSFS_BOOTSECT_H_ */

Cache object: e96f723581d98fdaed43f9cc52002e41


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.