Atari MEGA STe Technical Information Page 46

  • Download
  • Add to my manuals
  • Print
  • Page
    / 69
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 45
© Jean Louis-Guérin V1.2a September 2014 Page 46 / 69
9.5 TOS Partition Structures
This section details the content of a TOS primary partition
9.5.1 TOS Boot sector
The Boot Sector is located in the first logical sector of a logical drive (standard partition) and it
occupies one logical sector. When a logical sector contains more than one physical (512-byte) sectors,
the Boot Sector will be bigger than 512 bytes. However, only the first 512 bytes of a Boot Sector are
used, no matter how big the Boot Sector might be. The rest of the Boot Sector is zero-filled.
This sector is read by the TOS to find important information about the disk. Some parameters are
loaded from this sector to be used by the BIOS and are stored in a TOS structure called the BPB
16
(Bios Parameter Block). Eventually the Boot Sector also contains a bootstrap routine that allow
starting a relocatable program at boot time.
The fields in the Boot Sector:
Name
Offset
Bytes
Contents
BRA
$00
2
This word contains a 680x0 BRA.S instruction to the bootstrap code in
this sector if the disk is executable, otherwise it is unused.
OEM
$02
6
These six bytes are reserved for use as any necessary filler information.
SERIAL
$08
2
The low 24-bits of this long represent a unique disk serial number.
BPS
$0B
2
This is an Intel format word (big-endian) which indicates the size of a
logical sector in number of bytes.
SPC
$0D
1
This is a byte which indicates the number of sectors per cluster (must be
a power of 2). The only value supported by GEMDOS is 2.
RES
$0E
2
This is an Intel format word which indicates the number of reserved
logical sectors at the beginning of the logical drive, including the boot
sector itself. This value is usually one.
NFATS
$10
1
This is a byte indicating the number of File Allocation Table's (FAT's)
stored on the logical drive. Usually the value is two.
NDIRS
$11
2
This is an Intel format word indicating the total number of file name
entries that can be stored in the root directory of the logical drive.
NSECTS
$13
2
This is an Intel format word indicating the total number of logical sectors
on a logical drive including the reserved sectors.
MEDIA
$15
1
This byte is the media descriptor. For hard disks this value is set to $F8.
It is not used by the ST BIOS.
SPF
$16
2
This is an Intel format word indicating the size occupied by each of the
FATs in number of logical sectors
17
.
SPT
$18
2
This is an Intel format word indicating the number of sectors per track.
Not applicable to Hard Disk.
NHEADS
$1A
2
This is an Intel format word indicating the number of heads on the
media. Not applicable to Hard Disk.
NHID
$1C
2
This is an Intel format word indicating the number of hidden sectors. Not
applicable to Hard Disk.
$1E
Boot Code if Any
$1FE
2
Checksum
The grayed areas are read from the boot sector and stored in the BPB.
The last word in the boot sector (at offset $1FE) is reserved for the sector checksum. To be bootable a
Boot Sector checksum must be equal to the magic number $1234. During system initialization, the
first 512 bytes of the boot sector from a logical drive are loaded into a buffer. If the checksum is
correct, the system JSRs the first byte of the buffer. Since location of the buffer is indeterminate, any
code contained in the boot sector must be position independent.
16
The Atari BPB is based on MS-DOS version 2.x BPB.
17
Given this information, together with the number of FATs and reserved sectors listed above, we can compute where the root
directory begins. Given the number of entries in the root directory, we can also compute where the user data area of the disk
begins.
Page view 45
1 2 ... 41 42 43 44 45 46 47 48 49 50 51 ... 68 69

Comments to this Manuals

No comments