/***************************************************************************** * maker.h * * Written by, Sohail Qayum Malik * ******************************************************************************/ #define _U8 unsigned char #define _U16 unsigned int #define _S16 int #define _U32 unsigned long #define FAT_COPIES *((_U8 *)bootSector + 16) #define SECTORS_PER_FAT ((_U16 *)((_U8 *)bootSector + 22))[0] #define BYTES_PER_SECTOR ((_U16 *)((_U8 *)bootSector + 11))[0] #define SECTORS_PER_TRACK ((_U16 *)((_U8 *)bootSector + 24))[0] #define NUMBER_OF_DIRECTORY_ENTRIES ((_U16 *)((_U8 *)bootSector + 17))[0] #define MEDIA_DESCRIPTOR_TYPE *((_U8 * )bootSector + 21) #define NUMBER_OF_HEADS ((_U16 *)((_U8 *)bootSector + 26))[0] #define DIRECTORY_ENTRY_SIZE 32 #define FAT_SCAN 0 #define DRIVE 1 #define HELP 2 #define RDL 3 #define LINK 4 #define MAX_OPTIONS 5 _U8 arguments[MAX_OPTIONS]; struct directory{ _U8 name[11]; _U8 attribute; _U8 reserved[10]; _U16 time; _U16 date; _U16 link; _U32 size; }; /* Defined in lib.asm */ extern unsigned int flag; /* The number to be convert in ASCII representation of base16 */ extern void numberToAscii(unsigned int); /* Far pointer to buffer, The service number and the Number of sectors to read, The cylinder Number and sector number, The Head and the Drive. */ /* It will return the AX register, AH is status code and the AL is number of sectors read. The int 13 with service 02/03 sets the CF if there is error and then AH has the error code. */ extern int accessSectors(void far *, unsigned int, unsigned int, unsigned int); /* Far pointer to the address of FAT array. Nuber of entries in a FAT. link of a file into FAT */ extern void readFATEntry(void far *, unsigned int, unsigned int); extern void evaluateFATEntries(_U16); void directoryList(struct directory near * , _U16); /* The link into FAT, The number of sectors covered by the boot, FAT and the root directory. */ /* It accepts.... The link. The sector count which make up the FAT and the root directory. It returns the cylinder number.... in DH it returns the sector in DL and the head number in AH.... AL is zero. */ extern _U32 makeCHS(_U16, _U16); extern void CHS(void);