add remtask before addtask
[AROS.git] / rom / filesys / fat / fat_struct.h
blobcc94fab443aaab5aac0570ecd8f50eb11a46c09a
1 /*
2 * fat-handler - FAT12/16/32 filesystem handler
4 * Copyright © 2006 Marek Szyprowski
5 * Copyright © 2007-2015 The AROS Development Team
7 * This program is free software; you can redistribute it and/or modify it
8 * under the same terms as AROS itself.
10 * $Id$
13 #define FAT_MAX_SHORT_NAME 11
14 #define FAT_MAX_LONG_FILENAME 0xff
16 struct FATEBPB{
17 UBYTE bs_drvnum;
18 UBYTE bs_reserved1;
19 UBYTE bs_bootsig;
20 ULONG bs_volid;
21 UBYTE bs_vollab[FAT_MAX_SHORT_NAME];
22 UBYTE bs_filsystype[8];
23 } __attribute__ ((__packed__));
25 struct FATBootSector {
26 UBYTE bs_jmp_boot[3];
27 UBYTE bs_oem_name[8];
28 UWORD bpb_bytes_per_sect;
29 UBYTE bpb_sect_per_clust;
30 UWORD bpb_rsvd_sect_count;
31 UBYTE bpb_num_fats;
32 UWORD bpb_root_entries_count;
33 UWORD bpb_total_sectors_16;
34 UBYTE bpb_media;
35 UWORD bpb_fat_size_16;
36 UWORD bpb_sect_per_track;
37 UWORD bpb_num_heads;
38 ULONG bpb_hidden_sect;
39 ULONG bpb_total_sectors_32;
41 union {
42 struct FATEBPB ebpb;
43 struct {
44 ULONG bpb_fat_size_32;
45 UWORD bpb_extflags;
46 UWORD bpb_fs_verion;
47 ULONG bpb_root_cluster;
48 UWORD bpb_fs_info;
49 UWORD bpb_back_bootsec;
50 UBYTE bpb_reserved[12];
51 struct FATEBPB ebpb;
52 } __attribute__ ((__packed__)) ebpb32;
53 } ebpbs;
54 UBYTE pad[420];
55 UBYTE bpb_signature[2];
56 } __attribute__ ((__packed__));
58 struct FATFSInfo {
59 ULONG lead_sig;
60 UBYTE reserved1[480];
61 ULONG struct_sig;
62 ULONG free_count;
63 ULONG next_free;
64 UBYTE reserved2[12];
65 ULONG trail_sig;
66 } __attribute__ ((__packed__));
68 #define FSI_LEAD_SIG 0x41615252
69 #define FSI_STRUCT_SIG 0x61417272
70 #define FSI_TRAIL_SIG 0xaa550000
72 struct FATDirEntry {
73 UBYTE name[FAT_MAX_SHORT_NAME];
74 UBYTE attr;
75 UBYTE nt_res;
76 UBYTE create_time_tenth;
77 UWORD create_time;
78 UWORD create_date;
79 UWORD last_access_date;
80 UWORD first_cluster_hi;
81 UWORD write_time;
82 UWORD write_date;
83 UWORD first_cluster_lo;
84 ULONG file_size;
85 } __attribute__ ((__packed__));
87 #define ATTR_READ_ONLY 0x01
88 #define ATTR_HIDDEN 0x02
89 #define ATTR_SYSTEM 0x04
90 #define ATTR_VOLUME_ID 0x08
91 #define ATTR_DIRECTORY 0x10
92 #define ATTR_ARCHIVE 0x20
94 #define ATTR_LONG_NAME (ATTR_READ_ONLY | ATTR_HIDDEN | ATTR_SYSTEM | ATTR_VOLUME_ID)
95 #define ATTR_LONG_NAME_MASK (ATTR_READ_ONLY | ATTR_HIDDEN | ATTR_SYSTEM | ATTR_VOLUME_ID | ATTR_DIRECTORY | ATTR_ARCHIVE)
96 #define ATTR_VOLUME_ID_MASK (ATTR_READ_ONLY | ATTR_HIDDEN | ATTR_SYSTEM | ATTR_VOLUME_ID | ATTR_DIRECTORY)
98 struct FATLongDirEntry {
99 UBYTE order;
100 UWORD name1[5];
101 UBYTE attr;
102 UBYTE type;
103 UBYTE checksum;
104 UWORD name2[6];
105 UWORD first_cluster_lo;
106 UWORD name3[2];
107 } __attribute__ ((__packed__));