- Remove old files.

- Port to NetBSD
XXX: *untested*
This commit is contained in:
christos 2001-09-10 18:27:41 +00:00
parent 574892a487
commit de3ce7e7b1
6 changed files with 1085 additions and 625 deletions

View File

@ -1,9 +1,13 @@
# $NetBSD: Makefile,v 1.2 1997/10/10 19:51:57 christos Exp $
# Id: Makefile,v 1.3 1997/02/22 16:06:35 peter Exp
#
PROG=newfs_msdos
MAN=newfs_msdos.8
# $NetBSD: Makefile,v 1.3 2001/09/10 18:27:41 christos Exp $
# From: $FreeBSD: src/sbin/newfs_msdos/Makefile,v 1.5 2001/03/26 14:33:18 ru Exp $
CPPFLAGS+= -I${.CURDIR}/../../sys/msdosfs
PROG= newfs_msdos
MAN= newfs_msdos.8
LDADD+= -lutil
DPADD+= ${LIBUTIL}
.if ${MACHINE} == "pc98"
CFLAGS+= -DPC98
.endif
.include <bsd.prog.mk>

View File

@ -1,55 +0,0 @@
# $NetBSD: Makefile.boot,v 1.2 1998/01/09 08:04:02 perry Exp $
#
###################################################################
#
# Everything below is solely intented for maintenance.
# As you can see, it requires as86/ld86 from the ``bcc'' package.
#
# For this reason, the bootcode.h target puts the result into
# ${.CURDIR}
AS86= as86
LD86= ld86
AS86FLAGS= -0
LD86FLAGS= -0 -s
CLEANFILES+= *.obj *.bin *.com
.SUFFIXES: .asm .obj .bin .com
.asm.obj:
${AS86} ${AS86FLAGS} -o ${.TARGET} ${.IMPSRC}
.obj.bin:
${LD86} ${LD86FLAGS} -T 0x7c00 -o ${.PREFIX}.tmp ${.IMPSRC}
dd bs=32 skip=1 of=${.TARGET} if=${.PREFIX}.tmp
rm -f ${.PREFIX}.tmp
# .com file is just for testing
.obj.com:
${LD86} ${LD86FLAGS} -T 0x100 -o ${.PREFIX}.tmp ${.IMPSRC}
dd bs=32 skip=1 of=${.TARGET} if=${.PREFIX}.tmp
rm -f ${.PREFIX}.tmp
## Do NOT depend this on bootcode.bin unless you've installed the
## bcc package!
bootcode.h: ## bootcode.bin
@echo converting bootcode.bin into bootcode.h...
@perl -e 'if(read(STDIN,$$buf,512)<512) { \
die "Read error on .bin file\n"; \
} \
@arr = unpack("C*",$$buf); \
print "#ifndef BOOTCODE_H\n"; \
print "#define BOOTCODE_H 1\n\n"; \
print "/*\n * This file has been generated\n"; \
print " * automatically. Do not edit.\n */\n\n"; \
print "static unsigned char bootcode[512] = {\n"; \
for($$i=0; $$i<512; $$i++) { \
printf "0x%02x, ",$$arr[$$i]; \
if($$i % 12 == 11) {print "\n";} \
} \
print "};\n\n"; \
print "#endif /* BOOTCODE_H */\n";' \
< bootcode.bin > ${.CURDIR}/bootcode.h
.include <bsd.prog.mk>

View File

@ -1,103 +0,0 @@
;;; $NetBSD: bootcode.asm,v 1.1 1997/03/01 19:42:56 christos Exp $
;;; Hello emacs, this looks like -*- asm -*- code, doesn't it?
;;;
;;; This forms a simple dummy boot program for use with a tool to
;;; format DOS floppies. All it does is displaying a message, and
;;; recover gracefully by re-initializing the CPU.
;;;
;;; Written by Joerg Wunsch, Dresden. Placed in the public domain.
;;; This software is provided as is, neither kind of warranty applies.
;;; Use at your own risk.
;;;
;;; (This is written in as86 syntax. as86 is part of Bruce Evans'
;;; bcc package.)
;;;
;;; Id: bootcode.asm,v 1.3 1997/02/22 16:06:36 peter Exp
;;;
;;; This code must be linked to address 0x7c00 in order to function
;;; correctly (the BIOS boot address).
;;;
;;; It's 16-bit code, and we don't care for a data segment.
use16
.text
entry _begin
_begin: jmp init ; jump to boot prog
nop ; historical baggage ;-)
;;;
;;; Reserve space for the "BIOS parameter block".
;;; This will be overwritten by the actual formatting routine.
;;;
bpb: .ascii "BSD 4.4" ; "OEM" name
.word 512 ; sector size
.byte 2 ; cluster size
.word 1 ; reserved sectors (just the boot sector)
.byte 2 ; FAT count
.word 112 ; # of entries in root dir
.word 1440 ; total number of sectors, MSDOS 3.3 or below
.byte 0xf9 ; "media descriptor"
.word 3 ; FAT size (sectors)
.word 9 ; sectors per track
.word 2 ; heads per cylinder
.word 0 ; hidden sectors
;; MSDOS 4.0++ -- only valid iff total number of sectors == 0
.word 0 ; unused
.long 0 ; total number of sectors
.short 0 ; physical drive (0, 1, ..., 0x80) %-)
.byte 0 ; "extented boot signature"
.long 0 ; volume serial number (i.e., garbage :)
.ascii " " ; label -- same as vol label in root dir
.ascii "FAT12 " ; file system ID
;;;
;;; Executable code starts here.
;;;
init:
;; First, display our message.
mov si, *message
lp1: seg cs
movb al, [si]
inc si
testb al, al
jz lp2 ; null-terminated string
movb bl, *7 ; display with regular attribute
movb ah, *0x0e ; int 0x10, fnc 0x0e -- emulate tty
int 0x10
jmp lp1
lp2: xorb ah, ah ; int 0x16, fnc 0x00 -- wait for keystroke
int 0x16
mov ax, *0x40 ; write 0x1234 to address 0x472 --
push ax ; tell the BIOS that this is a warm boot
pop dx
mov 0x72, *0x1234
jmpf 0xfff0,0xf000 ; jump to CPU initialization code
message:
.byte 7
.byte 0xc9
.byte 0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd
.byte 0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd
.byte 0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd
.byte 0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd
.byte 0xcd,0xcd,0xcd,0xcd,0xcd,0xcd
.byte 0xbb, 13, 10, 0xba
.ascii " Sorry, this disc does actually not contain "
.byte 0xba, 13, 10, 0xba
.ascii " a bootable system. "
.byte 0xba, 13, 10, 0xba
.ascii " Press any key to reboot. "
.byte 0xba, 13, 10, 0xc8
.byte 0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd
.byte 0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd
.byte 0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd
.byte 0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd
.byte 0xcd,0xcd,0xcd,0xcd,0xcd,0xcd
.byte 0xbc, 13,10
.byte 0
;; Adjust the value below after changing the length of
;; the code above!
.space 0x1fe-0x161 ; pad to 512 bytes
.byte 0x55, 0xaa ; yes, we are bootable (cheating :)
end

View File

@ -1,56 +0,0 @@
/* $NetBSD: bootcode.h,v 1.2 1998/01/09 08:04:03 perry Exp $ */
#ifndef BOOTCODE_H
#define BOOTCODE_H 1
/*
* This file has been generated
* automatically. Do not edit.
*/
static unsigned char bootcode[512] = {
0xeb, 0x3c, 0x90, 0x42, 0x53, 0x44, 0x20, 0x20, 0x34, 0x2e, 0x34, 0x00,
0x02, 0x02, 0x01, 0x00, 0x02, 0x70, 0x00, 0xa0, 0x05, 0xf9, 0x03, 0x00,
0x09, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x46, 0x41, 0x54, 0x31, 0x32, 0x20,
0x20, 0x20, 0xbe, 0x65, 0x7c, 0x2e, 0x8a, 0x04, 0x46, 0x84, 0xc0, 0x74,
0x08, 0xb3, 0x07, 0xb4, 0x0e, 0xcd, 0x10, 0xeb, 0xf0, 0x30, 0xe4, 0xcd,
0x16, 0xb8, 0x40, 0x00, 0x50, 0x5a, 0xc7, 0x06, 0x72, 0x00, 0x34, 0x12,
0xea, 0xf0, 0xff, 0x00, 0xf0, 0x07, 0xc9, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd,
0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd,
0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd,
0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd,
0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xbb, 0x0d, 0x0a, 0xba, 0x20, 0x20, 0x53,
0x6f, 0x72, 0x72, 0x79, 0x2c, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x64,
0x69, 0x73, 0x63, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20, 0x61, 0x63, 0x74,
0x75, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x63, 0x6f,
0x6e, 0x74, 0x61, 0x69, 0x6e, 0x20, 0x20, 0xba, 0x0d, 0x0a, 0xba, 0x20,
0x20, 0x61, 0x20, 0x62, 0x6f, 0x6f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20,
0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0xba, 0x0d, 0x0a,
0xba, 0x20, 0x20, 0x50, 0x72, 0x65, 0x73, 0x73, 0x20, 0x61, 0x6e, 0x79,
0x20, 0x6b, 0x65, 0x79, 0x20, 0x74, 0x6f, 0x20, 0x72, 0x65, 0x62, 0x6f,
0x6f, 0x74, 0x2e, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0xba,
0x0d, 0x0a, 0xc8, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd,
0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd,
0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd,
0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd,
0xcd, 0xbc, 0x0d, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xaa, };
#endif /* BOOTCODE_H */

View File

@ -1,137 +1,185 @@
.\" $NetBSD: newfs_msdos.8,v 1.6 1999/03/10 05:17:27 erh Exp $
.\"
.\" Copyright (c) 1997 Christos Zoulas
.\" Copyright (c) 1995, 1996 Joerg Wunsch
.\"
.\" $NetBSD: newfs_msdos.8,v 1.7 2001/09/10 18:27:42 christos Exp $
.\" Copyright (c) 1998 Robert Nordier
.\" All rights reserved.
.\"
.\" This program is free software.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" notice, this list of conditions and the following disclaimer in
.\" the documentation and/or other materials provided with the
.\" distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS
.\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY
.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
.\" GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
.\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
.\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.\" Id: mkdosfs.1,v 1.5 1997/02/22 16:06:38 peter Exp
.\" From: $FreeBSD: src/sbin/newfs_msdos/newfs_msdos.8,v 1.13 2001/08/14 10:01:48 ru Exp $
.\"
.Dd February 25, 1997
.Os
.Dd July 6, 1998
.Dt NEWFS_MSDOS 8
.Os
.Sh NAME
.Nm newfs_msdos
.Nd create an MS-DOS (FAT) file system
.Nd construct a new MS-DOS (FAT) file system
.Sh SYNOPSIS
.Nm
.Bq Fl f Ar capacity
.Bq Fl L Ar vollabel
.Ar device
.Op Fl N
.Op Fl B Ar boot
.Op Fl F Ar FAT-type
.Op Fl I Ar volid
.Op Fl L Ar label
.Op Fl O Ar OEM
.Op Fl S Ar sector-size
.Op Fl a Ar FAT-size
.Op Fl b Ar block-size
.Op Fl c Ar cluster-size
.Op Fl e Ar dirents
.Op Fl f Ar format
.Op Fl h Ar heads
.Op Fl i Ar info
.Op Fl k Ar backup
.Op Fl m Ar media
.Op Fl n Ar FATs
.Op Fl o Ar hidden
.Op Fl r Ar reserved
.Op Fl s Ar total
.Op Fl u Ar track-size
.Ar special
.Op Ar disktype
.Sh DESCRIPTION
The
.Nm
establishes a file system structure on
.Ar device
that is understood by
.Xr mount_msdos 8
and some ancient program loader.
.Ar Device
will typically be the character device node for a floppy disk drive,
.Pq e.\ g. Pa /dev/rfd0 ,
although any existing writable file or device is acceptable.
In case of a regular file it is treated as a dumped image of an
.Tn MS-DOS
file system; only the file system structure will be written to it,
and it won't be truncated.
utility creates a FAT12, FAT16, or FAT32 file system on device
.Ar special ,
using
.Xr disktab 5
entry
.Ar disktype
to determine geometry, if required.
.Pp
The options are as follows:
.Bl -tag -width 10n -offset indent
.It Fl f Ar capacity
Use defaults for a typical file system with
.Ar capacity
kilobytes.
Currently, the values 360, 720, 1200, and 1440 are recognized.
.Pp
If this option is not specified,
.Nm
attempts to determine the size of the
.Ar device .
This is not reliably possible in all cases, but is believed to work
for the more common situations.
.It Fl L Ar vollabel
Use
.Ar vollabel
to describe the file system, instead of the default
.Ql 4.4BSD .
The options are as follow:
.Bl -tag -width indent
.It Fl N
Don't create a file system: just print out parameters.
.It Fl B Ar boot
Get bootstrap from file.
.It Fl F Ar FAT-type
FAT type (one of 12, 16, or 32).
.It Fl I Ar volid
Volume ID.
.It Fl L Ar label
Volume label (up to 11 characters). The label should consist of
only those characters permitted in regular DOS (8+3) filenames.
.It Fl O Ar OEM
OEM string (up to 8 characters). The default is
.Qq Li "BSD 4.4" .
.It Fl S Ar sector-size
Number of bytes per sector. Acceptable values are powers of 2
in the range 128 through 32768.
.It Fl a Ar FAT-size
Number of sectors per FAT.
.It Fl b Ar block-size
File system block size (bytes per cluster). This should resolve to an
acceptable number of sectors per cluster (see below).
.It Fl c Ar cluster-size
Sectors per cluster. Acceptable values are powers of 2 in the range
1 through 128.
.It Fl e Ar dirents
Number of root directory entries (FAT12 and FAT16 only).
.It Fl f Ar format
Specify a standard (floppy disk) format. The standard formats
are (capacities in kilobytes): 160, 180, 320, 360, 640, 720, 1200,
1232, 1440, 2880.
.It Fl h Ar heads
Number of drive heads.
.It Fl i Ar info
Location of the file system info sector (FAT32 only).
A value of 0xffff signifies no info sector.
.It Fl k Ar backup
Location of the backup boot sector (FAT32 only). A value
of 0xffff signifies no backup sector.
.It Fl m Ar media
Media descriptor (acceptable range 0xf0 to 0xff).
.It Fl n Ar FATs
Number of FATs. Acceptable values are 1 to 16 inclusive.
The default
is 2.
.It Fl o Ar hidden
Number of hidden sectors.
.It Fl r Ar reserved
Number of reserved sectors.
.It Fl s Ar total
File system size.
.It Fl u Ar track-size
Number of sectors per track.
.El
.Sh NOTES
FAT file system parameters occupy a "Boot Sector BPB (BIOS Parameter
Block)" in the first of the "reserved" sectors which precede the actual
file system. For reference purposes, this structure is presented
below.
.Bd -literal
struct bsbpb {
u_int16_t bps; /* [-S] bytes per sector */
u_int8_t spc; /* [-c] sectors per cluster */
u_int16_t res; /* [-r] reserved sectors */
u_int8_t nft; /* [-n] number of FATs */
u_int16_t rde; /* [-e] root directory entries */
u_int16_t sec; /* [-s] total sectors */
u_int8_t mid; /* [-m] media descriptor */
u_int16_t spf; /* [-a] sectors per FAT */
u_int16_t spt; /* [-u] sectors per track */
u_int16_t hds; /* [-h] drive heads */
u_int32_t hid; /* [-o] hidden sectors */
u_int32_t bsec; /* [-s] big total sectors */
};
/* FAT32 extensions */
struct bsxbpb {
u_int32_t bspf; /* [-a] big sectors per FAT */
u_int16_t xflg; /* control flags */
u_int16_t vers; /* file system version */
u_int32_t rdcl; /* root directory start cluster */
u_int16_t infs; /* [-i] file system info sector */
u_int16_t bkbs; /* [-k] backup boot sector */
};
.Ed
.Sh EXAMPLES
.Bd -literal -offset indent
newfs_msdos /dev/ad0s1
.Ed
.Pp
The file system structure consists of three major areas:
.Bl -tag -width 10n -offset indent
.It Em The bootsector
This is the very first (512-byte) sector.
It contains executable
code that normally would bootstrap an operating system when loaded.
Since it's beyond the scope of
.Nm
to install an operating system on the medium, this boot code will only
print a message that the disk does not contain a bootable system.
Inside the
.Em bootsector
is the
.Em BIOS parameter block (BPB) ,
where several statistical parameters of the file system are being
held.
.It Em The File Allocation Table(s) (FAT)
Sectors next to the
.Em bootsector
hold the FAT, which is used to register file system allocation, as
well as keeping pointer chains for the chunks constituting one file.
There are usually two identical copies of the FAT.
.It Em The root directory
The final structure is the root directory for this medium.
It is merely a space reservation, padded with 0's, and unfortunately fixed
in its size.
.Nm
initializes it to empty, and enters a volume label record into the
very first directory slot.
.El
.Sh DIAGNOSTICS
An exit status of 0 is returned upon successful operation.
Exit status 1 is returned on any errors during file system creation,
and an exit status of 2 reflects invalid arguments given to the
program (along with an appropriate information written to diagnostic
output).
Create a file system, using default parameters, on
.Pa /dev/ad0s1 .
.Bd -literal -offset indent
newfs_msdos -f 1440 -L foo fd0
.Ed
.Pp
Create a standard 1.44M file system, with volume label
.Ar foo ,
on
.Pa /dev/fd0 .
.Sh SEE ALSO
.Xr fdformat 1 ,
.Xr fsck_msdos 8 ,
.Xr mount_msdos 8 ,
.Xr disktab 5 ,
.Xr disklabel 8 ,
.Xr fdisk 8 ,
.Xr newfs 8
.Sh BUGS
There is currently no way to specify obscure file system parameters.
Thus, only media with one of the supported capacity values can be formatted.
For the same reason, it's not possible to handle hard disk partitions.
More options should be added to allow this.
More entries should be added to the table of known formats, too.
.Pp
No attempt is made to handle media defects.
.Sh DIAGNOSTICS
Exit status is 0 on success and 1 on error.
.Sh HISTORY
The
.Nm
appeared in
.Fx 2.2 .
.Sh AUTHOR
The program has been contributed by
.if n Joerg Wunsch,
.if t J\(:org Wunsch,
Dresden.
command first appeared in
.Fx 3.0 .
.Sh AUTHORS
.An Robert Nordier Aq rnordier@FreeBSD.org .

File diff suppressed because it is too large Load Diff