53#include "../version.h"
56#define _WIN32_WINNT 0x0400
59#define __LITTLE_ENDIAN 1234
60#define __BIG_ENDIAN 4321
61#define __BYTE_ORDER __LITTLE_ENDIAN
63#define __attribute__(x)
66#include <linux/hdreg.h>
83#if __BYTE_ORDER == __BIG_ENDIAN
85#include <asm/byteorder.h>
89#define CF_LE_W __le16_to_cpu
90#define CF_LE_L __le32_to_cpu
91#define CT_LE_W __cpu_to_le16
92#define CT_LE_L __cpu_to_le32
94#define CF_LE_W(v) ((((v) & 0xff) << 8) | (((v) >> 8) & 0xff))
95#define CF_LE_L(v) (((unsigned)(v)>>24) | (((unsigned)(v)>>8)&0xff00) | \
96 (((unsigned)(v)<<8)&0xff0000) | ((unsigned)(v)<<24))
97#define CT_LE_W(v) CF_LE_W(v)
98#define CT_LE_L(v) CF_LE_L(v)
103#define CF_LE_W(v) (v)
104#define CF_LE_L(v) (v)
105#define CT_LE_W(v) (v)
106#define CT_LE_L(v) (v)
112typedef unsigned char __u8;
113typedef unsigned short __u16;
114typedef unsigned int __u32;
125static int is_device = 0;
127#define open WIN32open
128#define close WIN32close
129#define read WIN32read
130#define write WIN32write
131#define llseek WIN32llseek
133#define O_SHORT_LIVED _O_SHORT_LIVED
136#define O_BACKUP 0x10000
137#define O_SHARED 0x20000
139static int WIN32open(
const char *
path,
int oflag, ...)
144 DWORD creationDisposition;
151 securityAttributes.
nLength =
sizeof(securityAttributes);
202 if ((pmode & 0222) == 0)
217 if ((fh =
CreateFile(
path, desiredAccess, shareMode, &securityAttributes,
233static int WIN32close(
int fd)
242static int WIN32read(
int fd,
void *
buf,
unsigned int len)
253 return (
int)actualLen;
256static int WIN32write(
int fd,
void *
buf,
unsigned int len)
264 return (
int)actualLen;
282int fsctl(
int fd,
int code)
296#define O_SHORT_LIVED 0
297#define O_SEQUENTIAL 0
308#include <linux/unistd.h>
309#if defined(__alpha) || defined(__ia64__)
317# error _llseek system call not present
338#define TEST_BUFFER_BLOCKS 16
339#define HARD_SECTOR_SIZE 512
340#define SECTORS_PER_BLOCK ( BLOCK_SIZE / HARD_SECTOR_SIZE )
347#define die( str ) fatal_error( "%s: " str "\n" )
352#define mark_sector_bad( sector ) mark_FAT_sector( sector, FAT_BAD )
359 return (
a +
b - 1) /
b;
374#define ATTR_UNUSED (ATTR_VOLUME | ATTR_ARCH | ATTR_SYS | ATTR_HIDDEN)
378#define FAT_EOF (atari_format ? 0x0fffffff : 0x0ffffff8)
379#define FAT_BAD 0x0ffffff7
381#define MSDOS_EXT_SIGN 0x29
382#define MSDOS_FAT12_SIGN "FAT12 "
383#define MSDOS_FAT16_SIGN "FAT16 "
384#define MSDOS_FAT32_SIGN "FAT32 "
386#define BOOT_SIGN 0xAA55
388#define MAX_CLUST_12 ((1 << 12) - 16)
389#define MAX_CLUST_16 ((1 << 16) - 16)
392#define MAX_CLUST_32 ((1 << 28) - 16)
394#define FAT12_THRESHOLD 4078
396#define OLDGEMDOS_MAX_SECTORS 32765
397#define GEMDOS_MAX_SECTORS 65531
398#define GEMDOS_MAX_SECTOR_SIZE (16*1024)
400#define BOOTCODE_SIZE 448
401#define BOOTCODE_FAT32_SIZE 420
454#define fat32 fstype._fat32
455#define oldfat fstype._oldfat
512 "This is not a bootable disk. Please insert a bootable floppy and\r\n"
513 "press any key to try again ... \r\n";
515#define MESSAGE_OFFSET 29
556static long do_check (
char *
buffer,
int try,
unsigned int current_block);
592 if (((cluster * 3) & 0x1) == 0)
594 fat[3 * cluster / 2] = (
unsigned char) (
value & 0x00ff);
595 fat[(3 * cluster / 2) + 1] = (
unsigned char) ((
fat[(3 * cluster / 2) + 1] & 0x00f0)
596 | ((
value & 0x0f00) >> 8));
600 fat[3 * cluster / 2] = (
unsigned char) ((
fat[3 * cluster / 2] & 0x000f) | ((
value & 0x000f) << 4));
601 fat[(3 * cluster / 2) + 1] = (
unsigned char) ((
value & 0x0ff0) >> 4);
608 fat[(2 * cluster) + 1] = (
unsigned char) (
value >> 8);
613 fat[4 * cluster] = (
unsigned char) (
value & 0x000000ff);
614 fat[(4 * cluster) + 1] = (
unsigned char) ((
value & 0x0000ff00) >> 8);
615 fat[(4 * cluster) + 2] = (
unsigned char) ((
value & 0x00ff0000) >> 16);
616 fat[(4 * cluster) + 3] = (
unsigned char) ((
value & 0xff000000) >> 24);
620 die(
"Bad FAT size (not 12, 16, or 32)");
635 die (
"Invalid cluster number in mark_FAT_sector: probably bug!");
650 die (
"seek failed during testing for blocks");
657 printf (
"Unexpected values in do_check: probably bugs\n");
692 printf (
"Searching for bad blocks ");
718 die (
"bad blocks before data-area: cannot make fs");
740 unsigned long blockno;
744 die (
"Can't open file of bad blocks");
746 while (!
feof (listfile))
748 fscanf (listfile,
"%ld\n", &blockno);
772 if (
read (
fd, &ch, 1) < 1)
802 die(
"unable to get length for '%s'");
808 die(
"unable to get length for '%s'");
827 while (low < high - 1)
829 const loff_t mid = (low + high) / 2;
853 if ((
f = setmntent (MOUNTED,
"r")) ==
NULL)
855 while ((mnt = getmntent (
f)) !=
NULL)
857 die (
"%s contains a mounted file system.");
873 bs.dir_entries[0] = (
char) 0;
874 bs.dir_entries[1] = (
char) 2;
886 die (
"unable to get geometry for '%s'");
888 bs.secs_track = geometry.SectorsPerTrack;
889 bs.heads = geometry.TracksPerCylinder;
890 switch (geometry.MediaType) {
893 bs.cluster_size = (
char) 2;
894 bs.dir_entries[0] = (
char) 112;
895 bs.dir_entries[1] = (
char) 0;
900 bs.dir_entries[0] = (
char) 224;
901 bs.dir_entries[1] = (
char) 0;
905 bs.cluster_size = (
char) 2;
906 bs.dir_entries[0] = (
char) 112;
907 bs.dir_entries[1] = (
char) 0;
911 bs.dir_entries[0] = (
char) 0;
912 bs.dir_entries[1] = (
char) 2;
927 struct hd_geometry geometry;
928 struct floppy_struct
param;
930 if ((0 == device_num) || ((device_num & 0xff00) == 0x0200))
969 die (
"unable to get diskette geometry for '%s'");
977 bs.cluster_size = (
char) 2;
978 bs.dir_entries[0] = (
char) 112;
979 bs.dir_entries[1] = (
char) 0;
984 bs.cluster_size = (
char) 2;
985 bs.dir_entries[0] = (
char) 112;
986 bs.dir_entries[1] = (
char) 0;
992 bs.dir_entries[0] = (
char) 224;
993 bs.dir_entries[1] = (
char) 0;
998 bs.cluster_size = (
char) 2;
999 bs.dir_entries[0] = (
char) 224;
1000 bs.dir_entries[1] = (
char) 0;
1007 bs.dir_entries[0] = (
char) 224;
1008 bs.dir_entries[1] = (
char) 0;
1012 if (0 == device_num)
1015 goto floppy_default;
1018 else if ((device_num & 0xff00) == 0x0700)
1021 if (
ioctl (
dev, BLKGETSIZE, &loop_size))
1022 die (
"unable to get loop geometry for '%s'");
1023 loop_size = loop_size >> 1;
1031 bs.cluster_size = (
char) 2;
1032 bs.dir_entries[0] = (
char) 112;
1033 bs.dir_entries[1] = (
char) 0;
1040 bs.cluster_size = (
char) 2;
1041 bs.dir_entries[0] = (
char) 112;
1042 bs.dir_entries[1] = (
char) 0;
1050 bs.dir_entries[0] = (
char) 224;
1051 bs.dir_entries[1] = (
char) 0;
1058 bs.cluster_size = (
char) 2;
1059 bs.dir_entries[0] = (
char) 224;
1060 bs.dir_entries[1] = (
char) 0;
1068 bs.dir_entries[0] = (
char) 224;
1069 bs.dir_entries[1] = (
char) 0;
1073 printf(
"Loop device does not match a floppy size, using "
1074 "default hd params\n");
1085 if (
ioctl (
dev, HDIO_GETGEO, &geometry))
1086 die (
"unable to get drive geometry for '%s'");
1087 bs.secs_track =
CT_LE_W(geometry.sectors);
1091 bs.dir_entries[0] = (
char) 0;
1092 bs.dir_entries[1] = (
char) 2;
1110 unsigned num_sectors;
1129 bs.dir_entries[0] =
bs.dir_entries[1] = (
char) 0;
1159 (
char *)&
bs.fat32.boot_code :
1160 (
char *)&
bs.oldfat.boot_code) -
1165 printf (
"Warning: message too long; truncated\n");
1178 printf(
"Boot jump code is %02x %02x\n",
1179 bs.boot_jump[0],
bs.boot_jump[1] );
1185 die(
"On FAT32 at least 2 reserved sectors are needed.");
1199 unsigned fatlength12, fatlength16, fatlength32;
1200 unsigned maxclust12, maxclust16, maxclust32;
1201 unsigned clust12, clust16, clust32;
1214 printf(
"%d sectors for FAT+data, starting with %d sectors/cluster\n",
1215 fatdata,
bs.cluster_size );
1218 printf(
"Trying with %d sectors/cluster:\n",
bs.cluster_size );
1228 clust12 = (fatdata -
nr_fats*fatlength12)/
bs.cluster_size;
1233 printf(
"FAT12: #clu=%u, fatlen=%u, maxclu=%u, limit=%u\n",
1235 if (clust12 > maxclust12-2) {
1238 printf(
"FAT12: too much clusters\n" );
1247 clust16 = (fatdata -
nr_fats*fatlength16)/
bs.cluster_size;
1252 printf(
"FAT16: #clu=%u, fatlen=%u, maxclu=%u, limit=%u\n",
1254 if (clust16 > maxclust16-2) {
1256 printf(
"FAT16: too much clusters\n" );
1264 "FAT16: would be misdetected as FAT12\n" :
1265 "FAT16: too much clusters\n" );
1275 clust32 = (fatdata -
nr_fats*fatlength32)/
bs.cluster_size;
1280 printf(
"FAT32: #clu=%u, fatlen=%u, maxclu=%u, limit=%u\n",
1282 if (clust32 > maxclust32) {
1285 printf(
"FAT32: too much clusters\n" );
1293 bs.cluster_size <<= 1;
1294 }
while (
bs.cluster_size &&
bs.cluster_size <= maxclustsize);
1299 size_fat = (clust16 > clust12) ? 16 : 12;
1306 cluster_count = clust12;
1316 "16 bit FAT! The filesystem will be\n"
1317 "misinterpreted as having a 12 bit FAT without "
1318 "mount option \"fat=16\".\n" );
1321 fprintf(
stderr,
"This filesystem has an unfortunate size. "
1322 "A 12 bit FAT cannot provide\n"
1323 "enough clusters, but a 16 bit FAT takes up a little "
1324 "bit more space so that\n"
1325 "the total number of clusters becomes less than the "
1326 "threshold value for\n"
1327 "distinction between 12 and 16 bit FATs.\n" );
1328 die(
"Make the file system a bit smaller manually." );
1331 cluster_count = clust16;
1338 cluster_count = clust32;
1341 bs.fat32.fat32_length =
CT_LE_L(fatlength32);
1346 die(
"FAT not 12, 16 or 32 bits");
1350 unsigned clusters, maxclust;
1358 size_fat = (num_sectors == 1440 || num_sectors == 2400 ||
1359 num_sectors == 2880 || num_sectors == 5760) ? 12 : 16;
1375 printf(
"Sector size must be %d to have less than %d log. sectors\n",
1395 printf(
"ss=%d: #clu=%d, fat_len=%d, maxclu=%d\n",
1401 clusters <= maxclust-2)
1404 printf( clusters > maxclust-2 ?
1405 "Too many clusters\n" :
"FAT too big\n" );
1409 die(
"With this sector size, the maximum number of FAT entries "
1410 "would be exceeded." );
1416 die(
"Would need a sector size > 16k, which GEMDOS can't work with");
1418 cluster_count = clusters;
1434 bs.fat32.version[0] = 0;
1435 bs.fat32.version[1] = 0;
1444 die(
"Backup boot sector must be after sector 1");
1446 die(
"Backup boot sector must be a reserved sector");
1449 printf(
"Using sector %d as backup boot sector (0 = none)\n",
1452 memset( &
bs.fat32.reserved2, 0,
sizeof(
bs.fat32.reserved2) );
1458 die(
"GEMDOS can't handle more than 65531 sectors" );
1460 printf(
"Warning: More than 32765 sector need TOS 1.04 "
1463 if (num_sectors >= 65536)
1465 bs.sectors[0] = (
char) 0;
1466 bs.sectors[1] = (
char) 0;
1471 bs.sectors[0] = (
char) (num_sectors & 0x00ff);
1472 bs.sectors[1] = (
char) ((num_sectors & 0xff00) >> 8);
1483 die (
"Too many clusters for file system - try more sectors per cluster");
1485 die (
"Attempting to create a too large file system");
1496 die (
"Too few blocks for viable file system");
1500 printf(
"%s has %d head%s and %d sector%s per track,\n",
1504 printf(
"using 0x%02x media descriptor, with %d sectors;\n",
1505 (
int) (
bs.media), num_sectors);
1506 printf(
"file system has %d %d-bit FAT%s and %d sector%s per cluster.\n",
1508 (
int) (
bs.cluster_size), (
bs.cluster_size != 1) ?
"s" :
"");
1509 printf (
"FAT size is %d sector%s, and provides %d cluster%s.\n",
1511 cluster_count, (cluster_count != 1) ?
"s" :
"");
1513 printf (
"Root directory contains %d slots.\n",
1514 (
int) (
bs.dir_entries[0]) + (
int) (
bs.dir_entries[1]) * 256);
1520 printf(
"no volume label.\n");
1526 die (
"unable to allocate space for FAT image in memory");
1542 (((
int)
bs.dir_entries[1]*256+(
int)
bs.dir_entries[0]) *
1547 die (
"unable to allocate space for root directory in memory");
1558 (
ctime->tm_min << 5) + (
ctime->tm_hour << 11)));
1560 ((
ctime->tm_mon+1) << 5) +
1561 ((
ctime->tm_year-80) << 9)));
1576 die(
"Out of memory");
1598 die(
"Out of memory" );
1608 if (info_sector) free (info_sector); \
1613#define seekto(pos,errstr) \
1615 loff_t __pos = (pos); \
1616 if (llseek (dev, __pos, SEEK_SET) != __pos) \
1617 error ("seek to " errstr " failed whilst writing tables"); \
1620#define writebuf(buf,size,errstr) \
1622 int __size = (size); \
1623 if (write (dev, buf, __size) != __size) \
1624 error ("failed whilst writing " errstr); \
1640 seekto( 0,
"start of device" );
1645 seekto( 0,
"boot sector" );
1656 "backup boot sector" );
1689Usage: mkdosfs [-A] [-c] [-C] [-v] [-I] [-l bad-block-file] [-b backup-boot-sector]\n\
1690 [-m boot-msg-file] [-n volume-name] [-i volume-id]\n\
1691 [-s sectors-per-cluster] [-S logical-sector-size] [-f number-of-FATs]\n\
1692 [-F fat-size] [-r root-dir-entries] [-R reserved-sectors]\n\
1693 /dev/name [blocks]\n");
1706 if (!(
f =
fopen(
"/proc/hardware",
"r" ))) {
1707 perror(
"/proc/hardware" );
1715 if (
strncmp(
p,
"Atari ", 6 ) == 0)
1732 char *listfile =
NULL;
1735 static char dev_buf[] =
"\\\\.\\X:";
1737 struct stat statbuf;
1759 "Win32 port by Jens-Uwe Mager <jum@anubis.han.de>\n"
1773 if (*tmp || backup_boot < 2 || backup_boot > 0xffff)
1775 printf (
"Bad location for backup boot sector : %s\n",
optarg);
1790 if (*tmp || nr_fats < 1 || nr_fats > 4)
1815 printf(
"Volume ID must be a hexadecimal number\n");
1884 printf (
"Warning: message too long; truncated\n");
1886 if ( msgfile !=
stdin )
1897 if (*tmp || root_dir_entries < 16 || root_dir_entries > 32768)
1899 printf (
"Bad number of root directory entries : %s\n",
optarg);
1906 if (*tmp || reserved_sectors < 1 || reserved_sectors > 0xffff)
1908 printf (
"Bad number of reserved sectors : %s\n",
optarg);
1920 printf (
"Bad number of sectors per cluster : %s\n",
optarg);
1943 printf(
"Unknown option: %c\n",
c );
1971 die(
"Need intended size with -C." );
1983 if (
check && listfile)
1984 die (
"-c and -l are incompatible");
1990 die (
"unable to open %s");
1994 die(
"unable to lock %s");
2004 die(
"unable to create %s");
2008 die(
"seek failed" );
2010 die(
"write failed" );
2012 die(
"seek failed" );
2021 die (
"unable to stat %s");
2035 (statbuf.
st_rdev & 0xff3f) == 0x0300 ||
2036 (statbuf.
st_rdev & 0xff0f) == 0x0800 ||
2037 (statbuf.
st_rdev & 0xff3f) == 0x0d00 ||
2038 (statbuf.
st_rdev & 0xff3f) == 0x1600 )
2040 die (
"Will not try to make filesystem on '%s'");
2058 die(
"unable to dismount %s");
2060 die(
"unable to unlock %s");
int strcmp(const char *String1, const char *String2)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
char * strcpy(char *DstString, const char *SrcString)
char * strncpy(char *DstString, const char *SrcString, ACPI_SIZE Count)
int getopt(int nargc, char *const *nargv, const char *ostr)
#define IOCTL_DISK_GET_DRIVE_GEOMETRY
BOOL WINAPI DeviceIoControl(IN HANDLE hDevice, IN DWORD dwIoControlCode, IN LPVOID lpInBuffer OPTIONAL, IN DWORD nInBufferSize OPTIONAL, OUT LPVOID lpOutBuffer OPTIONAL, IN DWORD nOutBufferSize OPTIONAL, OUT LPDWORD lpBytesReturned OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
#define ReadFile(a, b, c, d, e)
#define INVALID_HANDLE_VALUE
#define FILE_ATTRIBUTE_NORMAL
static const WCHAR version[]
BOOL WINAPI GetFileInformationByHandle(HANDLE hFile, LPBY_HANDLE_FILE_INFORMATION lpFileInformation)
BOOL WINAPI SetEndOfFile(HANDLE hFile)
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
GLint GLint GLint GLint GLint x
GLboolean GLboolean GLboolean b
GLenum GLuint GLenum GLsizei const GLchar * buf
GLboolean GLboolean GLboolean GLboolean a
GLuint GLenum GLsizei GLsizei GLint GLint GLboolean packed
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_Check_return_ _CRTIMP int __cdecl getc(_Inout_ FILE *_File)
_CRTIMP void __cdecl perror(_In_opt_z_ const char *_ErrMsg)
_Check_return_ _CRTIMP int __cdecl feof(_In_ FILE *_File)
_Check_return_ _CRTIMP int __cdecl fscanf(_Inout_ FILE *_File, _In_z_ _Scanf_format_string_ const char *_Format,...)
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
_Check_return_opt_ _CRTIMP int __cdecl fflush(_Inout_opt_ FILE *_File)
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
_Check_return_opt_ _CRTIMP char *__cdecl fgets(_Out_writes_z_(_MaxCount) char *_Buf, _In_ int _MaxCount, _Inout_ FILE *_File)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
_Check_return_ long __cdecl strtol(_In_z_ const char *_Str, _Out_opt_ _Deref_post_z_ char **_EndPtr, _In_ int _Radix)
LONG WINAPI _llseek(HFILE hFile, LONG lOffset, int iOrigin)
double __cdecl trunc(double)
static char volume_name[]
static int size_fat_by_user
static int start_data_block
static unsigned int currently_testing
static void setup_tables(void)
static int sectors_per_cluster
static time_t create_time
static char * program_name
static void check_atari(void)
static int count_blocks(char *filename)
#define TEST_BUFFER_BLOCKS
#define SECTORS_PER_BLOCK
static int ignore_full_disk
static int reserved_sectors
#define mark_sector_bad(sector)
static void mark_FAT_cluster(int cluster, unsigned int value)
static char * device_name
#define seekto(pos, errstr)
#define GEMDOS_MAX_SECTORS
static int start_data_sector
static unsigned char * info_sector
__u8 boot_code[BOOTCODE_SIZE]
static long do_check(char *buffer, int try, unsigned int current_block)
static struct msdos_boot_sector bs
static _syscall5(int, _llseek, uint, fd, ulong, hi, ulong, lo, loff_t *, res, uint, wh)
static void mark_FAT_sector(int sector, unsigned int value)
static struct msdos_dir_entry * root_dir
static void write_tables(void)
static void get_list_blocks(char *filename)
char dummy_boot_code[BOOTCODE_SIZE]
#define BOOTCODE_FAT32_SIZE
static void check_mount(char *device_name)
char dummy_boot_jump_m68k[2]
#define GEMDOS_MAX_SECTOR_SIZE
static void establish_params(int device_num, int size)
struct fat32_fsinfo __attribute__
static void check_blocks(void)
#define writebuf(buf, size, errstr)
static int root_dir_entries
static unsigned char * fat
struct msdos_volume_info vi
#define OLDGEMDOS_MAX_SECTORS
static int sector_size_set
static char * blank_sector
static int valid_offset(int fd, loff_t offset)
static void fatal_error(const char *fmt_string) __attribute__((noreturn))
static void alarm_intr(int alnum)
static loff_t llseek(int fd, loff_t offset, int whence)
#define memcpy(s1, s2, n)
#define TRUNCATE_EXISTING
#define FILE_FLAG_BACKUP_SEMANTICS
#define FILE_FLAG_RANDOM_ACCESS
#define FILE_FLAG_DELETE_ON_CLOSE
#define FILE_FLAG_SEQUENTIAL_SCAN
#define sprintf(buf, format,...)
static const struct access_res create[16]
#define FILE_ATTRIBUTE_READONLY
#define FSCTL_LOCK_VOLUME
#define FSCTL_UNLOCK_VOLUME
#define FSCTL_DISMOUNT_VOLUME
#define FILE_ATTRIBUTE_TEMPORARY
_Check_return_ _CRTIMP size_t __cdecl strspn(_In_z_ const char *_Str, _In_z_ const char *_Control)
_CRT_RESTORE_GCC_WARNINGS _CRT_DISABLE_GCC_WARNINGS _Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
_CRTIMP struct tm *__cdecl localtime(const time_t *_Time)
LPVOID lpSecurityDescriptor
struct msdos_volume_info vi
__u8 boot_code[BOOTCODE_SIZE]
DWORD WINAPI GetLastError(void)
#define ERROR_BROKEN_PIPE
void int int ULONGLONG int va_list * ap