1 /* Data structures used in disk8 */
3 #ifndef D8_STRUCTURES_H
4 #define D8_STRUCTURES_H
6 /* Our basic data type representing one 12 bit word */
7 typedef unsigned short int p8word
;
10 * This represents one 256 word block system memory or file system block.
11 * Contents can be accessed by the diskblocks[] member as well.
27 unsigned int device_number
:4;
28 unsigned int file_size
: 8; /* In system blocks */
29 unsigned int dummy
: 4;
31 os8_file_name_t file_name
;
37 /* Minus the number of entries in this segment (block) */
40 /* Starting block number of first file in this segment */
41 p8word first_file_start
;
43 /* Link to next segment, 0 if no next segment */
49 /* Minus the number of additional Information words */
50 p8word additional_info_neg
;
52 /* The directory data */
53 p8word entry_data
[0400-06];
55 /* End of directory word */
58 } os8_directory_segment_t
;
62 *\brief OS/8 partition header
64 * This is the major structure of a device heading.
65 * Normal volumes can start the data at block 007,
66 * system volumes mustn't touch blocks 007-067.
69 /* 000 */ os8_block_t bootblock
;
70 /* 001-006 */ os8_directory_segment_t directory
[6];
71 /* 007-012 */ os8_block_t keyboard_monitor
[4];
72 /* 013-015 */ os8_block_t usr
[3];
73 /* 016-025 */ os8_block_t device_handlers
[8];
74 /* 026 */ os8_block_t enter_processor
;
75 /* 027-050 */ os8_block_t system_scratch
[18];
76 /* 051-053 */ os8_block_t command_decoder
[3];
77 /* 054-055 */ os8_block_t save_and_date_ovl
[2];
78 /* 056 */ os8_block_t mon_errors
;
79 /* 057 */ os8_block_t chain_processor
;
80 /* 060-063 */ os8_block_t system_odt
[4];
81 /* 064 */ os8_block_t reserved_for_expansion
;
82 /* 065 */ os8_block_t ccl_reminiscences
;
83 /* 066 */ os8_block_t td8e_resident_code
;
84 /* 067 */ os8_block_t ccl_overlay
;
85 } os8_partition_header_t
;
88 /********************************************************************************
89 * Following are "private" structures not directly related to OS/8.
94 os8_partition_header_t header
;
95 os8_block_t data
[4096];
98 typedef enum {IT_UNKNOWN
=0, IT_DISK
, IT_DECTAPE
} image_type_t
;
103 * System is for boot images, beginning of data at block 070.
110 *\brief Memory representation of a disk or tape image
112 * This structure contains all working info and data
113 * associated with a disk or DECTape image.
114 * The image itself \e can contain at most two complete
115 * filesystems as RK05 disks are split into two partitions.
119 //! Size of the image in blocks
122 //! Raw byte size of the imported file
123 unsigned int raw_size
;
125 //! Type of the image, perhaps used later
129 //! All blocks in the image
130 os8_block_t data
[2*4096];
132 //! The first (and - on tape - only) partition
133 os8_partition_t part0
;
134 //! The second partition of a disk
135 os8_partition_t part1
;
144 * Tentative files should not occur at the moment!
147 FT_EMPTY
=0, //!< A \e unused file
148 FT_PERMANENT
, //!< A normal fixed file
149 FT_TENTATIVE
//!< A Open file (for writing)
152 /* Maximal number of additional information words in a directory entry */
153 #define MAX_ADDITIONAL_INFO 0200
155 typedef struct os8_dir_entry_s os8_direntry_t
;
157 struct os8_dir_entry_s
{
158 os8_filetype_t type
; //!< Filetype
159 char name
[10]; //!< ASCII file name, not used on empty files
160 int size_blocks
; //!< Size of the file in blocks
161 int start_block
; //!< First block of the file
162 os8_direntry_t
*next
; //!< Pointer to next entry
163 os8_direntry_t
*prev
; //!< Pointer to previous entry
164 p8word additional_info
[MAX_ADDITIONAL_INFO
];
170 os8_direntry_t
* entries
; //!< Linked list of entries in this directory
171 int additional_info
; //!< Size of additional info in each entry