What does the infamous sector zero at SCSI (or SASI) ID zero look like?

As you might know, this sector is where the BlackBox' configuration is saved. This configuration takes up 256 bytes.

The configuration starts with nine entries. One each for D1: through D9:. Each entry consists of 18 characters.

1st - 10th byte:
The name of the partition.

11th byte:
Bit 7:    0 = Use partition
          1 = Use SIO or FloppyBoard diskdrive
Bits 6-1: The partition's position in the partitionlist, starting with 16.
12th byte:
Bit 7: 1 = Partition is write protected
Bit 6: 1 = UltraSpeed on for SIO drive
Bit 5: 1 = Partition uses double density
Bit 4: If bit 7 of the 11th byte is set, switch in:
       0 = SIO drive  1 = FloppyBoard drive
Bit 3: 1 = UltraSpeed on for FloppyBoard drive
Bit 2, 1, 0: Position in the controllerlist
13th, 14th and 15th Byte:

Low, middle and high byte of the starting sector of the partition:

If you are using 256 bytes per sector on the harddrive, this number is the starting sectornumber you see in the BlackBox menu, minus one. If you are using 512 bytes per sector on the harddrive, this number is the starting sectornumber you see in the BlackBox menu, minus one, devided by two.

For example:

Let's say your starting sector number is 17:

If you're using 256 sectors on the harddrive side, 17-1=16, the character stored here has the ATASCII code of 16. But if you are using 512 byte sectors, 16:2=8, the character stored here has the ATASCII code of 8. The maximum number you can enter here - via the menu - is 16777215. If somebody ever wants to upgrade the BlackBox ROM, (s)he might want to increase this number to 33554431 if 512 byte sectors are used.

16777215 sectors means we have an addressing range of 4 Gigabyte.
33554431 sectors means we have an addressing range of 8 Gigabyte.

16th and 17th byte and bits 1 and 0 of the 18th byte:

Low and middle byte and high bits of the length of the partition in sectors plus one. This is the number of sectors DOS sees, so it doesn't matter if you are using 256 or 512 byte sectors on the harddrive.

Let's do the math:

2 bytes makes 256 times 256 sectors makes 65536 sectors.
65536 sectors times 256 bytes are 16777216 bytes or 16384 kilobyte or 16MB. 2 extra bits tell us we have to multiply this number by 4. 4 times 16MB makes 64MB.

The highest number you can enter here is 262143. That's one sector short of 64MB.

The rest of the 18th byte:
Bits 7-4: SIO drive number
Bits 3-2: FloppyBoard drive number

Next is the word "BlackBox" followed by a SPACE. I guess this is to make sure this is BlackBox configuration stuff.

The next 64 bytes make up the controllerlist. There are 8 bytes for each of the 8 possible SCSI/SASI devices.

1st byte:
Bits 7-5: Local Unit Number (LUN)
Bit 4:    0 = SCSI  1 = SASI
Bit 3:    0 = 256 bytes per sector  1 = 512 bytes per sector
Bits 2-0: SCSI/SASI ID number
2nd and 3th byte:

Low and high byte of the number of cylinders.

4th byte:
Bits 7-4: Number of heads
Bits 3-0: Step rate
5th and 6th byte:

Reduce Write Current cylinder (low and high bytes)

7th and 8th byte:

Write Precompensation cylinder (low and high bytes)

Thanks to Matthias Reichl for informing me about these 4 bytes and for reminding me that there is a lot of information in the BlackBox manual.

There is no easy way to confirm this. The BlackBox manual does give the impression that the above assumption is true though. According to Matthias this information is only used on older harddrives. So let's not worry about those 4 bytes.

The last 21 bytes are decoded like this:

The first two bytes never changed, no matter what I changed in the configuration, they were always both zero.

3th byte:
Bit 7: 1 = I/O Sound on
Bit 6: 1 = RS232 port on in pre 1.30 BlackBox ROM versions.  Has been moved to the 8th byte (see below).  That's what the BlackBox manual says.  My BlackBox (ROM version 2.16) tells me bit 6 is always 1
Bit 5: 1 = Printer port on
Bit 4: 1 = P: Linefeed on
Bit 3-0: 0000 respond to P1:
         0001 respond to P2:
         0010 respond to P3:
         0011 respond to P4:
         0100 respond to P5:
         0101 respond to P6:
         0110 respond to P7:
         0111 respond to P8:
         1000 respond to all printer numbers

If bit 5 is 0 then bits 3-0 are 0000.

(BTW if your BlackBox is equipt with a BlackBox Enhancer - which is sold separately, but is also included in the FloppyBoard - you can use P9: to get the printer to print all the ATARI characters just as they appear on your screen. Since a couple of years, Bob Puff/CSS has been shipping all BlackBoxes with ROM version 2.16. Versions starting with a 2 have FloppyBoard support, versions starting with a 1 do not.)

4th byte:
Bit 7: 1 = Printer spooler enabled
Bit 6: 0 = Use BlackBox' internal RAM  1 = Use XE banks
Bit 5: 1 = XE banks available
Bit 4: 1 = BlackBox internally has 64kB RAM available
Bits 3-0: Never changed
5th, 6th and 7th byte:

Low, middle and high byte of the sectornumber where the partitionlist can be found. This is the actual sector number. So if you are using 512 byte sectors, this number is multiplied by 2 before it is displayed in the "Port Statuses" page.

8th byte:

Controls the RS232 port from BlackBox ROM version 1.30 on up.

Bits 7 and 6: 00 Off
              01 On
              10 Flow (flow control, also known as hardware handshake, on)
Bits 5-0 are always zero.
9th byte:

Always zero.

10th through 13th byte:

Each byte stands for one FloppyBoard drive. The 10th byte is for FloppyBoard drive 0 and so on. The following goes for each of them:

Bit 7: I have no clue, but it's set on one of my 1.44 meg drives and reset on the other.
Bits 6 and 5: 00 = XF
              01 = Perc
              10 = ATR

Apparently, the XF551, the Percom and ATR8000/8500 double sided drives all use a different order in which the sectors are put on the disk.  Maybe someone could add a PC disk setting, so we can look at a PC disk with a sector editor.

Bits 4 and 3: step rate  00 = 3
                         01 = 6
                         10 = 12

Bits 2-0: 000 = undefined
          001 = 180kB
          010 = 360kB (5.25")
          011 = 1.2 MB
          100 = 360kB (3.5")
          101 = 720kB
          110 = 1.44MB
          111 = 1 meg (8")

If the Percom block is read, this byte shows up as the 9th byte.  This byte has been called "translation control", "drive select" and "drive present".
14th through 19th:

Never changed.

20th and 21th byte make up the checksum. See the BlackBox manual for the checksum routine the BlackBox uses.

On a 512 byte per sector drive, the rest of sector zero is empty, as is sector number one.

I've used a patched version of my CD Data Reader to read the configuration data off of sector zero. After decoding everything, I have confirmed my suspicions with the BlackBox manual (the on-line version unfortunately doesn't seem to be as detailed as the paper one you get with the BlackBox). I wasn't able to confirm the stuff that concerns the FloppyBoard, since neither the BlackBox manual nor the FloppyBoard manual mention the bits/bytes/addresses the FloppyBoard uses.

The partitionlist

The partitionlist starts with 36 unused characters. On my harddrive, these are all ATASCII code 255, but my entire harddrive was formatted with ATASCII code 255. So there might be ATASCII code 0's on your harddrive. What is next depends on how many partitions you have declared in the partitionlist. Unused parts of the partitionlist sectors contain the same character as empty sectors.

All entries in the partitionlist are 18 characters long and are built simular to those in the controllerlist. With the following exceptions:

- Bit 7 of the 11th byte is never set
- Bit 4 of the 12th byte is never set

The BlackBox manual tells us, the partitionlist uses 14 sectors. The partitionlist is stored in the first 256 bytes of (what the harddrive thinks is) a sector. This means that on 512 bytes per sector systems, the upper halves of the partitionlist sectors are unused. Of the 256 bytes, the last three bytes are not used, so that the first byte in each sector is the first byte of a partitionlist entry. Each sector (as seen on the harddrive side) contains 14 entries of 18 characters each, making 252 bytes. Only the first sector used for the partitionlist has 12 entries. Since only the first 252 bytes of a sector are used, on 512 byte sectors it looks (on the DOS/Atari side) like every second sector is unused. I guess that means, the partitionlist takes up 14 sectors (on the DOS/Atari side, as opposed to the harddrive side) only on 512 byte harddrives, on 256 byte harddrives (which are becomming very rare), it probably only takes up 7 sectors.