Subject: Hard disk file system

From: "Michael Zapf" <[email-masked]>
Date: Mon, 25 Apr 2011 15:17:59 -0000

Hi all,

two observations and questions which I found while studying the hard disks file systems:

- The VIB is in sector 0, and the allocation map extends from sector 1 to sector 31 (max). I found that the sectors until 63 (0x3f) are pre-allocated, and it seems as if on 0x20 there is a copy of the VIB and from 0x21 to 0x3f there is a copy of the allocation map. But they are not in sync; obviously the copy was created after formatting the drive and left untouched since then. 

=> Question: If I want to insert a file into the file system, I only have to update the original data (sectors 0-31) and need not care about the copy (32-63)?

- There seems to be some free space before the first files. After the allocation map there are the subdirectory information blocks and their associated file indexes.

=> Question: I did not find any explicit value for the reservation in the file system. What is the usual space to keep reserved for the subdirectories before the first file information blocks and file contents start?

Michael

---

From: Tony Knerr <[email-masked]>
Date: Tue, 26 Apr 2011 06:31:29 -0400

Hi Michael,

I can only speak to the first question. It is only necessary to update 
the original data (0-31) for file operations.
The copy (32-63) is best used occasionally for backup operations to 
guard against the original data becoming corrupted.
There are utilities for the Geneve (don't remember the name offhand) and 
TI (DU2K) to perform the backup and restore operations.

Tony

On 4/25/2011 11:17 AM, Michael Zapf wrote:
> - The VIB is in sector 0, and the allocation map extends from sector 1 
> to sector 31 (max). I found that the sectors until 63 (0x3f) are 
> pre-allocated, and it seems as if on 0x20 there is a copy of the VIB 
> and from 0x21 to 0x3f there is a copy of the allocation map. But they 
> are not in sync; obviously the copy was created after formatting the 
> drive and left untouched since then.
>
> => Question: If I want to insert a file into the file system, I only 
> have to update the original data (sectors 0-31) and need not care 
> about the copy (32-63)?
>
> - There seems to be some free space before the first files. After the 
> allocation map there are the subdirectory information blocks and their 
> associated file indexes.
>
> => Question: I did not find any explicit value for the reservation in 
> the file system. What is the usual space to keep reserved for the 
> subdirectories before the first file information blocks and file 
> contents start?
>
> Michael
>
> _

---

From: ti99_forever <[email-masked]>
Date: Tue, 26 Apr 2011 04:17:14 -0700 (PDT)

As for the 2nd question, I don't know for some disk managers. MDM5, the format routine allowed you to specify the number of pre-allocated sectors for directories and file descriptor records - should be documented in the MDM5 manual.

--- On Tue, 4/26/11, Tony Knerr <[email-masked]> wrote:

From: Tony Knerr <[email-masked]>
Subject: Re: [TI994A] Hard disk file system
To: [email-masked]
Date: Tuesday, April 26, 2011, 6:31 AM

  

    Hi Michael,

    I can only speak to the first question. It is only necessary to
    update the original data (0-31) for file operations. 

    There are utilities for the Geneve (don't remember the name offhand)
    and TI (DU2K) to perform the backup and restore operations.

    Tony 

      
          
            Hi all,

              two observations and questions which I found while
              studying the hard disks file systems:

              - The VIB is in sector 0, and the allocation map extends
              from sector 1 to sector 31 (max). I found that the sectors
              until 63 (0x3f) are pre-allocated, and it seems as if on
              0x20 there is a copy of the VIB and from 0x21 to 0x3f
              there is a copy of the allocation map. But they are not in
              sync; obviously the copy was created after formatting the
              drive and left untouched since then. 

              => Question: If I want to insert a file into the file
              system, I only have to update the original data (sectors
              0-31) and need not care about the copy (32-63)?

              - There seems to be some free space before the first
              files. After the allocation map there are the subdirectory
              information blocks and their associated file indexes.

              => Question: I did not find any explicit value for the
              reservation in the file system. What is the usual space to
              keep reserved for the subdirectories before the first file
              information blocks and file contents start?

              Michael

          _

---

From: Insane Multitasker <[email-masked]>
Date: Tue, 26 Apr 2011 12:29:09 -0500

There was a MIRROR command in MDOS but due to code space limitations and 34 sector/track formatting, the command was removed and a stand-alone program created to store sectors 0-31 within a file on any device.  

To: [email-masked]
From: [email-masked]
Date: Tue, 26 Apr 2011 06:31:29 -0400
Subject: Re: [TI994A] Hard disk file system

Hi Michael,

I can only speak to the first question. It is only necessary to update the original data (0-31) for file operations. 
The copy (32-63) is best used occasionally for backup operations to guard against the original data becoming corrupted.
There are utilities for the Geneve (don't remember the name offhand) and TI (DU2K) to perform the backup and restore operations.

Tony 

Hi all,

Michael

_

---

From: "Michael Zapf" <[email-masked]>
Date: Tue, 26 Apr 2011 19:09:58 -0000

Hello Tim,

> There was a MIRROR command in MDOS but due to code space limitations 
> and 34 sector/track formatting, the command was removed and a 
> stand-alone program created to store sectors 0-31 within a file on
> any device.  

ah, OK, I think I remember that one.

Regarding my second question, it seems as if directory information blocks and file information blocks are stored as early as possible (on the next free AUs). On my test image I found that the FIB of the first file is located at AU 0x21 (on 0x20 we have the file index of the root directory), but the data chain tells me that the contents of the file are at 0x0800 and 0801.

Is this value 0x0800 stored somewhere in the file system? Or is it hard coded in the DSR, to make the DSR first look for space at higher locations? (And then try at lower locations if there is no free space beyond 0x800?)

Michael

---

From: Insane Multitasker <[email-masked]>
Date: Tue, 26 Apr 2011 23:44:08 -0500

If you check the VIB, I believe there is a byte that tells the DSR how many AUs to pre-allocate for directories/FDIRs.  I am fairly certain MDOS holds to this when allocating AUs for files and firectories.  IMHO, this should have been a word value to allow for larger numbers of reserved AUs.  I would also have compacted FDR/FDIR/DIR sectors versus simply allocating them on AU boundaries.  ;)
 
Ben may be right in stating MDM5 contains code to set this value.  I do not recall if my SCSI formatter sets the byte; I suspect I set the value to 0xff.  

> From: [email-masked]
> Date: Tue, 26 Apr 2011 19:09:58 +0000
> Subject: [TI994A] Re: Hard disk file system
> 
> Hello Tim,
> 
> ------------------------------------
> 
> Yahoo! Groups Links
> 
> 
>

---

From: "Michael Zapf" <[email-masked]>
Date: Wed, 27 Apr 2011 08:27:31 -0000

Hi Tim,

> If you check the VIB, I believe there is a byte that tells ...

right, absolutely: byte 0x0d (Reserved AUs). I seems to have overlooked that, just reading "Reserved". 

Thanks!

Michael

---

From: "Michael Zapf" <[email-masked]>
Date: Thu, 28 Apr 2011 18:34:26 -0000

I did some tests with MDM5 and found that the value at 0x0d indeed specifies the number of reserved AUs. But not directly (it is just one byte); it must be multiplied by 64 (0x40, or shifted left by 6 positions).

So if this byte is 0x15, file contents are stored at AU 0x0540 and higher.

Michael

---

From: Insane Multitasker <[email-masked]>
Date: Fri, 29 Apr 2011 00:47:55 -0500

From MDOS and if you have the time, you will most likely find this originated in the HFDC DSR source:
 
File:HDS2.MDOS.HD.GETAU   Page: 3 Date: 10-30-04  Time: 01:41:46
       MOV  @VOLUME,R10
       SLA  R10,3             offset into drive parms
       MOVB @3+CYLPLT-8(R10),R0  dir aus reserved / 64
       SRL  R0,8
       SLA  R0,6              AU # to start search for file allocation
 
Why it was done this way may warrant further inspection. Since the SCSI
(and possibly IDE) may not follow this convention, I'd be careful about
assuming all devices operate in the same manner.  (Other VIB bytes,
like drive parameters, differ or are ignored).

> Date: Thu, 28 Apr 2011 18:34:26 +0000

---

From: "Michael Zapf" <[email-masked]>
Date: Fri, 29 Apr 2011 08:37:53 -0000

Hi Tim,
  
> Why it was done this way may warrant further inspection. Since the 
> SCSI (and possibly IDE) may not follow this convention, I'd be 
> careful about assuming all devices operate in the same manner.  
> (Other VIB bytes, like drive parameters, differ or are ignored).

As I mentioned, I have this Java-based tool TIImageTool I keep working on. Up to now I was able to add a TIFILES file to a disk image, and now I want to provide this feature for hard disk images as well.

That is, I just want to make sure I do not corrupt the image. As I understood, this setting "reserved AU" is just a hint for the DSR where to start searching. I believe that if I stay with the HFDC handling this will not produce a broken image, as long as I care for correct allocation and pointers, even when other DSRs handle it differently.

Michael