- Timestamp:
- 07/15/2017 03:12:10 PM (7 years ago)
- Branches:
- master
- Children:
- ea232f9
- Parents:
- 7d0d347
- Location:
- include
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
include/biosdefs.h
r7d0d347 r8973acd 64 64 struct bpb { /* BIOS parameter block returned by B_GBPB */ 65 65 66 uint16_trecsiz; /* physical sector size in bytes */67 uint16_tclsiz; /* cluster size in sectors */68 uint16_tclsizb; /* cluster size in bytes */69 uint16_trdlen; /* root directory length in sectors */70 uint16_tfsiz; /* FAT size in sectors */71 uint16_tfatrec; /* sector number of 1st sector of 2nd FAT */72 uint16_tdatrec; /* sector number of 1st data sector */73 uint16_tnumcl; /* number of data clusters on disk */66 int16_t recsiz; /* physical sector size in bytes */ 67 int16_t clsiz; /* cluster size in sectors */ 68 int16_t clsizb; /* cluster size in bytes */ 69 int16_t rdlen; /* root directory length in sectors */ 70 int16_t fsiz; /* FAT size in sectors */ 71 int16_t fatrec; /* sector number of 1st sector of 2nd FAT */ 72 int16_t datrec; /* sector number of 1st data sector */ 73 int16_t numcl; /* number of data clusters on disk */ 74 74 uint16_t bflags; /* flags */ 75 uint16_tntracks; /* number of tracks */76 uint16_tnsides; /* number of sides (heads) */77 uint16_tdspc; /* sectors per cylinder */78 uint16_tdspt; /* sectors per track */79 uint16_thidden; /* number of hidden files */75 int16_t ntracks; /* number of tracks */ 76 int16_t nsides; /* number of sides (heads) */ 77 int16_t dspc; /* sectors per cylinder */ 78 int16_t dspt; /* sectors per track */ 79 int16_t hidden; /* number of hidden files */ 80 80 int8_t serno[3]; /* disk serial number */ 81 81 int8_t nada; /* --- filler - nothing here --- */ … … 84 84 #define BPBSIZE 32 /* length of a BPB */ 85 85 86 #define B_FAT16 0x0001 /* flag for using 16 bit FAT entries */86 #define B_FAT16 0x0001u /* flag for using 16 bit FAT entries */ 87 87 88 88 /* … … 94 94 struct dirent { /* Directory entry */ 95 95 96 int8_t fname[8]; 97 int8_t fext[3]; 98 int8_t atrib;/* attribute byte */99 int8_t unused[10]; 100 uint16_t crtime; 101 uint16_t crdate; 102 uint16_t bclust; 103 int32_t flen;/* 'LLHH' file length */96 int8_t fname[8]; /* file name */ 97 int8_t fext[3]; /* file extension */ 98 uint8_t atrib; /* attribute byte */ 99 int8_t unused[10]; /* unused space */ 100 uint16_t crtime; /* 'LLHH' creation time */ 101 uint16_t crdate; /* 'LLHH' creation date */ 102 uint16_t bclust; /* 'LLHH' starting cluster number */ 103 uint32_t flen; /* 'LLHH' file length */ 104 104 }; 105 105 106 106 #define DENTSIZE (sizeof (struct dirent)) 107 107 108 #define F_RDONLY 0x01 /* Read only file */109 #define F_HIDDEN 0x02 /* Hidden file */110 #define F_SYSTEM 0x04 /* System file */111 #define F_VOLUME 0x08 /* Volume label */112 #define F_SUBDIR 0x10 /* Sub-directory */113 #define F_ARCHIV 0x20 /* Archived */108 #define F_RDONLY 0x01u /* Read only file */ 109 #define F_HIDDEN 0x02u /* Hidden file */ 110 #define F_SYSTEM 0x04u /* System file */ 111 #define F_VOLUME 0x08u /* Volume label */ 112 #define F_SUBDIR 0x10u /* Sub-directory */ 113 #define F_ARCHIV 0x20u /* Archived */ 114 114 115 115 /* … … 123 123 struct dirent de; /* directory entry image for file */ 124 124 uint16_t modefl; /* fcb flags */ 125 uint16_t clsec;/* current sector in cluster */126 uint16_t curcls;/* current cluster */127 uint16_t offset;/* current offset into sector */128 int 32_t curlsn; /* current logical sector number in file */129 int 32_t curdsn; /* current logical sector number on disk */125 int16_t clsec; /* current sector in cluster */ 126 int16_t curcls; /* current cluster */ 127 int16_t offset; /* current offset into sector */ 128 int16_t curlsn; /* current logical sector number in file */ 129 int16_t curdsn; /* current logical sector number on disk */ 130 130 int32_t curlen; /* current file length in bytes */ 131 int 32_t asects; /* allocated file length in sectors */131 int16_t asects; /* allocated file length in sectors */ 132 132 }; 133 133 134 #define FC_EOF 0x8000 /* end of file */135 #define FC_BAD 0x4000 /* bad FAT entry encountered */136 #define FC_ERR 0x2000 /* error encountered */137 #define FC_OPN 0x1000 /* file open */134 #define FC_EOF 0x8000u /* end of file */ 135 #define FC_BAD 0x4000u /* bad FAT entry encountered */ 136 #define FC_ERR 0x2000u /* error encountered */ 137 #define FC_OPN 0x1000u /* file open */ 138 138 139 #define FC_CR 0x0800 /* create mode */140 #define FC_AP 0x0400 /* append mode */141 #define FC_WR 0x0200 /* write mode */142 #define FC_RD 0x0100 /* read mode */139 #define FC_CR 0x0800u /* create mode */ 140 #define FC_AP 0x0400u /* append mode */ 141 #define FC_WR 0x0200u /* write mode */ 142 #define FC_RD 0x0100u /* read mode */ 143 143 144 #define FC_EX 0x0080 /* exclusive mode */145 #define FC_TR 0x0040 /* truncate mode */146 #define FC_NB 0x0020 /* non-blocking mode */147 #define FC_BF 0x0010 /* binary file mode */144 #define FC_EX 0x0080u /* exclusive mode */ 145 #define FC_TR 0x0040u /* truncate mode */ 146 #define FC_NB 0x0020u /* non-blocking mode */ 147 #define FC_BF 0x0010u /* binary file mode */ 148 148 149 149 #define FC_RW (FC_RD | FC_WR) /* read-write mode */ -
include/fcntl.h
r7d0d347 r8973acd 15 15 */ 16 16 17 #define O_RDONLY 0x0000 /* Read-only value */18 #define O_WRONLY 0x0001 /* Write-only value */19 #define O_RDWR 0x0002 /* Read-write value */17 #define O_RDONLY 0x0000u /* Read-only value */ 18 #define O_WRONLY 0x0001u /* Write-only value */ 19 #define O_RDWR 0x0002u /* Read-write value */ 20 20 21 #define O_NDELAY 0x0004 /* Non-blocking I/O flag */22 #define O_APPEND 0x0008 /* Append mode flag (write only at end) */21 #define O_NDELAY 0x0004u /* Non-blocking I/O flag */ 22 #define O_APPEND 0x0008u /* Append mode flag (write only at end) */ 23 23 24 #define O_CREAT 0x0100 /* File creation flag (uses 3rd argument) */25 #define O_TRUNC 0x0200 /* File truncation flag */26 #define O_EXCL 0x0400 /* Exclusive access flag */24 #define O_CREAT 0x0100u /* File creation flag (uses 3rd argument) */ 25 #define O_TRUNC 0x0200u /* File truncation flag */ 26 #define O_EXCL 0x0400u /* Exclusive access flag */ 27 27 28 #define O_RAW 0x8000 /* Raw (binary) I/O flag for getc and putc */28 #define O_RAW 0x8000u /* Raw (binary) I/O flag for getc and putc */ 29 29 30 30 /* -
include/fspars.h
r7d0d347 r8973acd 24 24 25 25 #define MAXFAT 7 /* maximum number of fat sectors */ 26 #define WDPSEC 256 /* words per sector */27 26 #define MAXDIRNT 224 /* maximum number of directory entries */ 28 27 -
include/io.h
r7d0d347 r8973acd 15 15 16 16 typedef int16_t (*chclo)(io_arg arg); 17 typedef int16_t (*devop)(int8_t *name, int16_t flag, int16_t mode, struct channel *chp, struct devtabl *dp);17 typedef int16_t (*devop)(int8_t *name, uint16_t flag, struct channel *chp, struct devtabl *dp); 18 18 19 19 struct channel { /* channel table entry */ 20 20 21 int 8_t c_read; /* read routine index */22 int 8_t c_write; /* write routine index */23 int 8_t c_ioctl; /* ioctl routine index */24 int 8_t c_seek; /* seek routine index */21 int16_t c_read; /* read routine index */ 22 int16_t c_write; /* write routine index */ 23 int16_t c_ioctl; /* ioctl routine index */ 24 int16_t c_seek; /* seek routine index */ 25 25 chclo c_close; /* close function pointer */ 26 26 io_arg c_arg; /* argument to channel driver */ … … 29 29 struct device { /* device control structure */ 30 30 31 int 8_t d_read; /* read routine code */32 int 8_t d_write; /* write routine code */33 int 8_t d_ioctl; /* ioctl routine code */34 int 8_t d_seek; /* seek routine code */31 int16_t d_read; /* read routine code */ 32 int16_t d_write; /* write routine code */ 33 int16_t d_ioctl; /* ioctl routine code */ 34 int16_t d_seek; /* seek routine code */ 35 35 devop d_open; /* special open function */ 36 36 }; … … 41 41 struct device *d_dev; /* pointer to device structure */ 42 42 io_arg d_arg; /* argument to device driver */ 43 int16_t d_kind; /* kind of device */ 43 44 }; -
include/stdio.h
r7d0d347 r8973acd 16 16 #define fputc putc 17 17 18 #define _BUSY 0x01 19 #define _ALLBUF 0x02 20 #define _DIRTY 0x04 21 #define _EOF 0x08 22 #define _IOERR 0x10 18 #define _BUSY 0x01u 19 #define _ALLBUF 0x02u 20 #define _DIRTY 0x04u 21 #define _EOF 0x08u 22 #define _IOERR 0x10u 23 23 24 24 typedef struct { … … 27 27 int8_t *_bend; /* last character in buffer + 1 */ 28 28 int8_t *_buff; /* address of buffer */ 29 int 8_t _flags; /* {_BUSY, _ALLBUF, _DIRTY, _EOF, _IOERR}*/30 int8_t _unit; /* fd token returned by open*/29 int16_t _unit; /* fd token returned by open */ 30 uint8_t _flags; /* {_BUSY, _ALLBUF, _DIRTY, _EOF, _IOERR} */ 31 31 int8_t _bytbuf; /* single byte buffer for unbuffered streams */ 32 32 int8_t _pad; /* pad for alignment -- possibly use later */ … … 45 45 #define clearerr(fp) ((fp)->_flags &= ~(_IOERR | _EOF)) 46 46 #define fileno(fp) ((fp)->_unit) 47 48 #define O_RDONLY 0x0000 /* Read-only value */49 #define O_WRONLY 0x0001 /* Write-only value */50 #define O_RDWR 0x0002 /* Read-write value */51 52 #define O_NDELAY 0x0004 /* Non-blocking I/O flag */53 #define O_APPEND 0x0008 /* Append mode flag (write only at end) */54 55 #define O_CREAT 0x0100 /* File creation flag (uses 3rd argument) */56 #define O_TRUNC 0x0200 /* File truncation flag */57 #define O_EXCL 0x0400 /* Exclusive access flag */58 59 #define O_RAW 0x8000 /* Raw (binary) I/O flag for getc and putc */
Note:
See TracChangeset
for help on using the changeset viewer.