From owner-p4-projects@FreeBSD.ORG Sun Jul 8 08:01:55 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D74C916A46D; Sun, 8 Jul 2007 08:01:54 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 809A716A469 for ; Sun, 8 Jul 2007 08:01:54 +0000 (UTC) (envelope-from chub@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id 7061413C487 for ; Sun, 8 Jul 2007 08:01:54 +0000 (UTC) (envelope-from chub@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.8/8.13.8) with ESMTP id l6881sx4048541 for ; Sun, 8 Jul 2007 08:01:54 GMT (envelope-from chub@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.8/8.13.8/Submit) id l6881rI8048534 for perforce@freebsd.org; Sun, 8 Jul 2007 08:01:53 GMT (envelope-from chub@FreeBSD.org) Date: Sun, 8 Jul 2007 08:01:53 GMT Message-Id: <200707080801.l6881rI8048534@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to chub@FreeBSD.org using -f From: Brian Chu To: Perforce Change Reviews Cc: Subject: PERFORCE change 123095 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2007 08:01:55 -0000 http://perforce.freebsd.org/chv.cgi?CH=123095 Change 123095 by chub@chub-msdosfs on 2007/07/08 08:01:09 Changed bootsector declarations so that individual entities in the BPB and Extended bootsector can actually be addressed. Updated msdosfs vfs code to account for this change. Affected files ... .. //depot/projects/soc2007/chub-msdosfs2/sys/fs/msdosfs/bootsect.h#3 edit .. //depot/projects/soc2007/chub-msdosfs2/sys/fs/msdosfs/bpb.h#2 edit .. //depot/projects/soc2007/chub-msdosfs2/sys/fs/msdosfs/msdosfs_vfsops.c#2 edit Differences ... ==== //depot/projects/soc2007/chub-msdosfs2/sys/fs/msdosfs/bootsect.h#3 (text+ko) ==== @@ -1,6 +1,9 @@ /* $FreeBSD: src/sys/fs/msdosfs/bootsect.h,v 1.13 2005/09/29 14:09:46 peadar Exp $ */ /* $NetBSD: bootsect.h,v 1.9 1997/11/17 15:36:17 ws Exp $ */ +#ifndef _FS_MSDOSFS_BOOTSECT_H +#define _FS_MSDOSFS_BOOTSECT_H + /*- * Written by Paul Popelka (paulp@uts.amdahl.com) * @@ -17,6 +20,8 @@ * October 1992 */ +#include + /* * Format of a boot sector. This is the first sector on a DOS floppy disk * or the fist sector of a partition on a hard disk. But, it is not the @@ -25,7 +30,8 @@ struct bootsector33 { u_int8_t bsJump[3]; /* jump inst E9xxxx or EBxx90 */ int8_t bsOemName[8]; /* OEM name and version */ - int8_t bsBPB[19]; /* BIOS parameter block */ + // int8_t bsBPB[19]; /* BIOS parameter block */ + struct bpb33 bsBPB; /* BIOS parameter block */ int8_t bsDriveNumber; /* drive number (0x80) */ int8_t bsBootCode[479]; /* pad so struct is 512b */ u_int8_t bsBootSectSig0; @@ -34,10 +40,20 @@ #define BOOTSIG1 0xaa }; +#define EXBOOTSIG 0x29 struct extboot { int8_t exDriveNumber; /* drive number (0x80) */ int8_t exReserved1; /* reserved */ int8_t exBootSignature; /* ext. boot signature (0x29) */ + u_int32_t exVolumeID; /* volume ID number */ + int8_t exVolumeLabel[11]; /* volume label */ + int8_t exFileSysType[8]; /* fs type (FAT12 or FAT16) */ +}; + +struct byte_extboot { + int8_t exDriveNumber; /* drive number (0x80) */ + int8_t exReserved1; /* reserved */ + int8_t exBootSignature; /* ext. boot signature (0x29) */ #define EXBOOTSIG 0x29 int8_t exVolumeID[4]; /* volume ID number */ int8_t exVolumeLabel[11]; /* volume label */ @@ -47,8 +63,8 @@ struct bootsector50 { u_int8_t bsJump[3]; /* jump inst E9xxxx or EBxx90 */ int8_t bsOemName[8]; /* OEM name and version */ - int8_t bsBPB[25]; /* BIOS parameter block */ - int8_t bsExt[26]; /* Bootsector Extension */ + struct bpb50 bsBPB; /* BIOS parameter block */ + struct extboot bsExt; /* Bootsector Extension */ int8_t bsBootCode[448]; /* pad so structure is 512b */ u_int8_t bsBootSectSig0; u_int8_t bsBootSectSig1; @@ -59,8 +75,8 @@ struct bootsector710 { u_int8_t bsJump[3]; /* jump inst E9xxxx or EBxx90 */ int8_t bsOEMName[8]; /* OEM name and version */ - int8_t bsBPB[53]; /* BIOS parameter block */ - int8_t bsExt[26]; /* Bootsector Extension */ + struct bpb710 bsBPB; /* BIOS parameter block */ + struct extboot bsExt; /* Bootsector Extension */ int8_t bsBootCode[420]; /* pad so structure is 512b */ u_int8_t bsBootSectSig0; u_int8_t bsBootSectSig1; @@ -73,3 +89,6 @@ struct bootsector50 bs50; struct bootsector710 bs710; }; + +#endif +// _FS_MSDOSFS_BOOTSECT_H ==== //depot/projects/soc2007/chub-msdosfs2/sys/fs/msdosfs/bpb.h#2 (text+ko) ==== @@ -1,6 +1,9 @@ /* $FreeBSD: src/sys/fs/msdosfs/bpb.h,v 1.15 2007/01/05 05:28:57 rodrigc Exp $ */ /* $NetBSD: bpb.h,v 1.7 1997/11/17 15:36:24 ws Exp $ */ +#ifndef _FS_MSDOSFS_BPB_H +#define _FS_MSDOSFS_BPB_H + /*- * Written by Paul Popelka (paulp@uts.amdahl.com) * @@ -78,7 +81,7 @@ u_int32_t bpbRootClust; /* start cluster for root directory */ u_int16_t bpbFSInfo; /* filesystem info structure sector */ u_int16_t bpbBackup; /* backup boot sector */ - /* There is a 12 byte filler here, but we ignore it */ + u_int8_t bpbReserved[12]; /* 12 byte filler here */ }; /* @@ -153,7 +156,7 @@ u_int8_t bpbRootClust[4]; /* start cluster for root directory */ u_int8_t bpbFSInfo[2]; /* filesystem info structure sector */ u_int8_t bpbBackup[2]; /* backup boot sector */ - /* There is a 12 byte filler here, but we ignore it */ + u_int8_t bpbReserved[12]; /* 12 byte filler here */ }; /* @@ -170,3 +173,6 @@ u_int8_t fsifill3[508]; u_int8_t fsisig4[4]; }; + +#endif +// _FS_MSDOSFS_BPB_H ==== //depot/projects/soc2007/chub-msdosfs2/sys/fs/msdosfs/msdosfs_vfsops.c#2 (text+ko) ==== @@ -430,9 +430,9 @@ goto error_exit; bp->b_flags |= B_AGE; bsp = (union bootsector *)bp->b_data; - b33 = (struct byte_bpb33 *)bsp->bs33.bsBPB; - b50 = (struct byte_bpb50 *)bsp->bs50.bsBPB; - b710 = (struct byte_bpb710 *)bsp->bs710.bsBPB; + b33 = (struct byte_bpb33 *)&bsp->bs33.bsBPB; + b50 = (struct byte_bpb50 *)&bsp->bs50.bsBPB; + b710 = (struct byte_bpb710 *)&bsp->bs710.bsBPB; #ifndef MSDOSFS_NOCHECKSIG if (bsp->bs50.bsBootSectSig0 != BOOTSIG0 @@ -487,7 +487,6 @@ /* XXX - We should probably check more values here */ if (!pmp->pm_BytesPerSec || !SecPerClust - || !pmp->pm_Heads #ifdef PC98 || !pmp->pm_SecPerTrack || pmp->pm_SecPerTrack > 255) { #else