[comp.os.cpm] 8 meg limit

wilker@gauss.math.purdue.edu (Clarence Wilkerson) (01/23/91)

I believe that the 8meg limit is set in the coding of
the BDOS, and inforced in the BIOS in the sense that
certain scratch ram in the BIOS data area has a preset
size.
   I think several replacement BDOS clones, e.g.
DOSPLUS, offer larger maximum logical disk size.
   There would be some perfomance penalties for
using larger sizes, namely more directory entries
to check or larger logical block sizes.
Clarence Wilkerson

rlb@skyler.mavd.honeywell.com (Randal L. Barnes) (01/24/91)

In article <D4J8V2w163w@cynic.wimsey.bc.ca>,
pevans@cynic.wimsey.bc.ca (Phillip Evans) writes:

> Where did/does the 8 meg limit on logical disk size in CP/M come from?

It has to do with the fact that CP/M uses a 16 bit logical block pointer,
Since CP/M also uses 128 byte logical sectors (sector blocking/deblocking
routines change the physical sector size on the disk but the logical sector
size remains at 128), the maximum logical disk size is:

        65536 * 128 = 8192K

My Molecular Series 9 system has drive B set up as an 8 meg drive.
Doing a STAT B:DSK: yields the following:

            B: Drive Characteristics
        65536: 128 Byte Record Capacity
         8192: Kilobyte Drive  Capacity
         1024: 32  Byte Directory Entries
            0: Checked  Directory Entries
          256: Records/ Extent
           32: Records/ Block
          256: Sectors/ Track
            0: Reserved Tracks

-- 
Randal L. Barnes                    rlb@skyler.mavd.honeywell.com
Tea, Earl Grey, HOT!                Honeywell Military Avionics Division
                                    612/542-5021

wilker@descartes.math.purdue.edu (Clarence Wilkerson) (01/24/91)

It seems to me like RLB's reply is a good explanation of why
the maximum size of file would be 8 megs, if we can access
sectors of the file by a 16 bit integer. Why does it dictate
the max. logical size of the disk, however?
Clarence

syswtr@iowasp.physics.uiowa.edu (01/25/91)

> pevans@cynic.wimsey.bc.ca (Phillip Evans) writes:
>> Where did/does the 8 meg limit on logical disk size in CP/M come from?

  NOte that this restriction is removed in CPM3 and MPM2.  The file
size restriction is limited by the 16 bit record pointer in MPM2
(I haven't combed the CPM3 manuals that closely), but the logical
device size is limited by the cluster size.  Device size is 
expressed in terms of the number of clusters, so the maximum
device is 32767*16384 (or 65535*16384) as the largest allocation
cluster is 16K bytes.
  When you get these large devices, however, MPM2 signifigantly slows
down when doing any directory operations as it scans the (potentially)
large directory.  A little work with caching the directory can make
a world of difference...

Willy

fzsitvay@techbook.com (Frank Zsitvay) (01/25/91)

In article <4314@mentor.cc.purdue.edu> wilker@gauss.math.purdue.edu.UUCP (Clarence Wilkerson) writes:
>I believe that the 8meg limit is set in the coding of
>the BDOS, and inforced in the BIOS in the sense that
>certain scratch ram in the BIOS data area has a preset
>size.
>   I think several replacement BDOS clones, e.g.
>DOSPLUS, offer larger maximum logical disk size.
>   There would be some perfomance penalties for
>using larger sizes, namely more directory entries
>to check or larger logical block sizes.
>Clarence Wilkerson

   well, not really.   it is limited by the directory structure that is at 
the heart of all cp/m disk operations.  cp/m only allows for a maximum of
65536 128 byte blocks.  that is the maximum size of a file, or a whole
disk.
 
   there is a built in mechanism in cp/m to allow the creation of 
partitions on a single physical disk.
 
    dosplus is essentially a different operating system than cp/m,
and it allows a larger total disk space through a somewhat revamped
directory structure.
 
   zcpr3 and zsystem do it through other techniques.

-- 
fzsitvay@techbook.COM - but don't quote me on that....

American Oil Company motto - Bend over, We'll pump!!!

fzsitvay@techbook.com (Frank Zsitvay) (01/26/91)

In article <4402@mentor.cc.purdue.edu> wilker@descartes.math.purdue.edu (Clarence Wilkerson) writes:
>It seems to me like RLB's reply is a good explanation of why
>the maximum size of file would be 8 megs, if we can access
>sectors of the file by a 16 bit integer. Why does it dictate
>the max. logical size of the disk, however?
>Clarence

  well, it's like this - that same 16 bit integer that is used to address
sectors in a file is also used to address blocks in a disk.  therefore, 
the maximum available blocks on a disk is 65536, or 8192K bytes total.
   
  to access larger disks you would need a larger block pointer, something
on the order of 24 bits or 32 bits.  however, there is too much overhead
associated with maintaining two pointers, and large ones at that, in
an 8 bit system.   it is just easier to accept the 16 bit pointers and
work with them.  
-- 
fzsitvay@techbook.COM - but don't quote me on that....

American Oil Company motto - Bend over, We'll pump!!!

wilker@gauss.math.purdue.edu (Clarence Wilkerson) (01/29/91)

But the size of a disk block can be large, i.e. 1k, 4k even 16k.
Even 1k x 65535 = 64 megs.
  Of course it's hard to imagine doing a DIR to a disk with
64k 1k files.......
Clarence

john@attcan.UUCP (John Benfield) (02/14/91)

In article <1991Jan25.012406.13752@techbook.com>, fzsitvay@techbook.com (Frank Zsitvay) writes:
> In article <4314@mentor.cc.purdue.edu> wilker@gauss.math.purdue.edu.UUCP (Clarence Wilkerson) writes:
> >I believe that the 8meg limit is set in the coding of
> >the BDOS, and inforced in the BIOS in the sense that
> 
>    well, not really.   it is limited by the directory structure that is at 
> the heart of all cp/m disk operations.  cp/m only allows for a maximum of
> 65536 128 byte blocks.  that is the maximum size of a file, or a whole
> disk.

You can actually do some major diddling with the BDOS if you want and
modify the directory block size. It's a major hack, but I did it on my
Cromemco system to allow me to make use of a kludged hard disk I hotwired
in. It got a bit flaky with anything that was explicity accessing
directory records but if you're running a 'single application' box
and you need to up the file size, it's a good bet.


______Opinions stated are my own. Transcripts available by request______
      ===
    =--====  AT&T Canada Inc.             John Benfield
   =----==== 3650 Victoria Park Ave.      Network Support Analyst (MIS)
   =----==== Suite 800		    
   ==--===== Willowdale, Ontario          attmail   : ~jbenfield
    =======  M2H-3P7			  email     : uunet!attcan!john
      ===    (416) 756-5221               Compu$erve: 72137,722

____Eagles may soar, but weasels don't get sucked into jet engines._____