Difference between revisions of "MINI-UNIX"

From Computer History Wiki
Jump to: navigation, search
(Internal changes: ROOTDEV and SWAPDEV unused)
(User-visible compatibility: Exact size limit)
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
'''MINI-UNIX''' is a somewhat limited variant of [[UNIX Sixth Edition|V6 Unix]] written by Heinz Lycklama, for use on models of the [[PDP-11]] such as the [[PDP-11/05]] which did not have [[memory management]] (which was required for early Unix versions from 4 onward). Although it is not full Unix, it retains a large amount of the functionality of the original.
+
'''MINI-UNIX''' is a somewhat limited variant of [[UNIX Sixth Edition|V6 Unix]] written by Heinz Lycklama, for use on models of the [[PDP-11]] such as the [[PDP-11/05]] which did not have [[memory management]] (which was required for early Unix versions from [[UNIX Fourth Edition]] onward). Although it is not full Unix, it retains a large amount of the functionality of the original.
  
 
Most V6 [[application]]s run without [[source code|source]] modification on MINI-UNIX, although it is not [[object code|binary]]-compatible with V6. This is a result of the lack of memory management in the machines which run MINI-UNIX; the [[kernel]], and [[user]] commands (as [[process]]es), share a single PDP-11 [[address space]], with the kernel in low memory, and the processes (one at a time) in high memory.
 
Most V6 [[application]]s run without [[source code|source]] modification on MINI-UNIX, although it is not [[object code|binary]]-compatible with V6. This is a result of the lack of memory management in the machines which run MINI-UNIX; the [[kernel]], and [[user]] commands (as [[process]]es), share a single PDP-11 [[address space]], with the kernel in low memory, and the processes (one at a time) in high memory.
Line 5: Line 5:
 
There was a second, earlier, stripped-down variant of V6 for PDP-11's without memory management, [[LSX]]; it differed from MINI-UNIX in being targeted at machines with more limited amounts of [[main memory]] (a real concern with early machines, which often came with limited amounts). MINI-UNIX was targeted at machines with the full 56KB possible on such PDP-11's.
 
There was a second, earlier, stripped-down variant of V6 for PDP-11's without memory management, [[LSX]]; it differed from MINI-UNIX in being targeted at machines with more limited amounts of [[main memory]] (a real concern with early machines, which often came with limited amounts). MINI-UNIX was targeted at machines with the full 56KB possible on such PDP-11's.
  
MINI-UNIX did not originally support the [[LSI-11]], but there are no significant architectural differences between the LSI-11 and other 'small' PDP-11's, so MINI-UNIX was historically brought up on the LSI-11. (The main significant difference is that in the LSI-11, access to the [[Processor Status Word|PS]] requires use of special [[instruction]]s; see [[Running UNIX V6 on an -11/23|here]] for other issues.)
+
MINI-UNIX did not originally support the [[LSI-11]], but there are no significant architectural differences between the LSI-11 and other 'small' PDP-11's, so MINI-UNIX was historically brought up on the LSI-11. (The main significant difference is that in the LSI-11, access to the [[Processor Status Word|PS]] requires use of special [[instruction]]s; see [[Running UNIX V6 on an -11/23|here]] for other issues.)
  
 
That version has since apparently been lost; however, because of the wide availability of the LSI-11 in the vintage computer community, MINI-UNIX has recently been ported to the LSI-11 again, to provide a Unix experience on those machines. (See link below.)  
 
That version has since apparently been lost; however, because of the wide availability of the LSI-11 in the vintage computer community, MINI-UNIX has recently been ported to the LSI-11 again, to provide a Unix experience on those machines. (See link below.)  
Line 18: Line 18:
 
* prof()
 
* prof()
  
[[Pipe]]s are not supported, not only because of space in the [[operating system|OS]], but because a process swap-out and -in will be required every time a different stage needs to run, leading to poor performance.
+
[[Pipe]]s are not supported, not only because of space in the [[operating system|OS]], but because a process [[swapping|swap]]-out and -in will be required every time a different stage needs to run, leading to poor performance.
  
 
Although pipes are not supported, the [[command processor|shell]] supports the pipe command syntax ('|'), by use of temporary files (modulo the amount of free space on the disk, of course).
 
Although pipes are not supported, the [[command processor|shell]] supports the pipe command syntax ('|'), by use of temporary files (modulo the amount of free space on the disk, of course).
Line 26: Line 26:
 
The removal of ptrace() means there is no interactive [[debug]]ging; this is not a major hardship, as the lack of memory management means that a buggy user program can crash the system anyway.
 
The removal of ptrace() means there is no interactive [[debug]]ging; this is not a major hardship, as the lack of memory management means that a buggy user program can crash the system anyway.
  
The maximum file size supported is 1MB; 'large' files are supported, but not 'huge' files (those with two levels of indirect blocks).
+
MINI-UNIX uses the same [[file system]] as V6; this allows MINI-UNIX packs to be 'mounted' on V6 systems (either real, or simulated), which is very convenient for working on them. The maximum file size supported is 1MB (512*256*8 = 1,048,576 bytes); 'large' files are supported, but not 'huge' files (those with two levels of indirect blocks).
 
 
'Read-ahead' has also been removed from the [[file system]] implementation; this saves on address space in the kernel at the cost of a slight degradation of performance.
 
  
 
===Modified commands===
 
===Modified commands===
Line 44: Line 42:
 
Because of the way user commands are run in high memory in a single address space, user commands are [[relocatable binary|linked]] to run at a high [[address]] (usually 060000, instead of at 0 as on standard V6.
 
Because of the way user commands are run in high memory in a single address space, user commands are [[relocatable binary|linked]] to run at a high [[address]] (usually 060000, instead of at 0 as on standard V6.
  
Thus, 24KB (notionally) is normally allocated to hold the kernel (with a modest number of processes and [[disk]] [[buffer]]s), leaving 32KB available for user commands/applications. (The "notionally" is because that 24KB also includes the 'user' structure: a per-process [[swapping|swappable]] data area, 1KB in size (it includes the process' kernel [[stack]]); thus 23KB is actually available for the kernel.)
+
Thus, 24KB (notionally) is normally allocated to hold the kernel (with a modest number of processes and [[disk]] [[buffer]]s), leaving 32KB available for user commands/applications. (The "notionally" is because that 24KB also includes the 'user' structure: a per-process swappable data area, stored at 056000 - i.e. contiguous with the process, for swapping; 1KB in size (it includes the process' kernel [[stack]]). Thus 23KB is actually available for the kernel.)
  
 
This division can be altered, albeit painfully (all the command binaries have to be re-linked to the new boundary address), to allow the size of the kernel to vary.
 
This division can be altered, albeit painfully (all the command binaries have to be re-linked to the new boundary address), to allow the size of the kernel to vary.
Line 54: Line 52:
 
Based as it is on V6, given the close match in the system-call interface, one might think that the internals are a close match to V6. That is not quite true: there are some significant differences. A thorough comparison has not been performed, but here are some significant differences that have been found.
 
Based as it is on V6, given the close match in the system-call interface, one might think that the internals are a close match to V6. That is not quite true: there are some significant differences. A thorough comparison has not been performed, but here are some significant differences that have been found.
  
The swapping area is not allocated 'as needed' through an allocation map; rather, each active process is statically pre-allocated a large enough block to hold a maximum-sized process. Along with this, process ID's are constrained to be in the range [1-NPROC]; they may thus be used directly as indexes (e.g. above).
+
The interface from the I/O system to [[device driver]]s is mostly the same, so that existing V6 device drivers can generally be basically be 'dropped in', almost un-modified. In particular, the interface to 'character' (un-structured) devices is identical, as is that to the 'tty' driver; the interface to the block device buffer system (for [[mass storage]] devices) is also identical. The two minor aspects that are changed are:
 
 
The interface to the I/O system is mostly the same, so that existing V6 [[device driver]]s can basically be 'dropped in', almost un-modified. In particular, the interface to 'character (un-structured) devices is identical, as is that to the 'tty' driver; the interface to the block device buffer system (for [[mass storage]] devices) is also identical. The two minor aspects that are changed are:
 
  
 
* since the system is limited to less than 64KB of memory, the 'extended memory' field in block device buffer header is not present;
 
* since the system is limited to less than 64KB of memory, the 'extended memory' field in block device buffer header is not present;
 
* 'raw devices' (which can do [[Direct Memory Access|DMA]] transfers directly from the device to a buffer in the user process' memory) are not supported.
 
* 'raw devices' (which can do [[Direct Memory Access|DMA]] transfers directly from the device to a buffer in the user process' memory) are not supported.
 +
 +
The swapping area is not allocated 'as needed' through an allocation map; rather, each active process is statically pre-allocated a large enough block to hold a maximum-sized process. Along with this, process ID's are constrained to be in the range [1-NPROC]; they may thus be used directly as indexes (e.g. above).
  
 
The defined constants ROOTDEV and SWAPDEV (in param.h) don't actually do anything, as they are not used; the variables rootdev and swapdev still exist, and are used as in V6, but always contain '0'.
 
The defined constants ROOTDEV and SWAPDEV (in param.h) don't actually do anything, as they are not used; the variables rootdev and swapdev still exist, and are used as in V6, but always contain '0'.
  
The [[scheduler]] is a simple round-robin time-slicing one.
+
'Read-ahead' has also been removed from the file system implementation; this saves on address space in the kernel at the cost of a slight degradation of performance. The [[scheduler]] is a simple round-robin time-slicing one.
  
 
==External links==
 
==External links==
  
* [http://ana-3.lcs.mit.edu/~jnc/tech/unix/Mini/Mini.html Running MINI-UNIX on the LSI-11]
+
* [https://www.tuhs.org/Archive/Documentation/TechReports/Heinz_Tech_Memos/TM-77-1352-1_The_MINI-UNIX_19770103.pdf The MINI-UNIX System] (TM 77-1352-1)
 +
* [https://www.tuhs.org/cgi-bin/utree.pl?file=Mini-Unix Mini-Unix] - file tree at [[The Unix Heritage Society|TUHS]]
 +
** [https://www.tuhs.org/cgi-bin/utree.pl?file=Mini-Unix/usr/source source] - for most commands
 +
** [https://www.tuhs.org/cgi-bin/utree.pl?file=Mini-Unix/usr/sys/source source] - a few other MINI-UNIX-specific things
 +
** [https://www.tuhs.org/cgi-bin/utree.pl?file=Mini-Unix/usr/sys/mxsys mxsys] - OS source
 
* [http://www.tavi.co.uk/unixhistory/mini-unix/munix-documents.zip MINI-UNIX documents]
 
* [http://www.tavi.co.uk/unixhistory/mini-unix/munix-documents.zip MINI-UNIX documents]
 +
** [http://www.tavi.co.uk/unixhistory/mini-unix/Mini-UNIX_Memo.txt The MINI-UNIX System]
 +
** [http://ana-3.lcs.mit.edu/~jnc/tech/unix/Mini/20Regenerating_System_Software.pdf Regenerating System Software]
 +
** [http://ana-3.lcs.mit.edu/~jnc/tech/unix/Mini/01Setting_Up_Mini-UNIX.pdf Setting Up Mini-UNIX] - lightly edited version of the V6 one
 
* [https://www.tuhs.org/cgi-bin/utree.pl?file=Mini-Unix/usr/doc/new/ MINI-UNIX documents source]
 
* [https://www.tuhs.org/cgi-bin/utree.pl?file=Mini-Unix/usr/doc/new/ MINI-UNIX documents source]
 +
* [http://ana-3.lcs.mit.edu/~jnc/tech/unix/Mini/Mini.html Running MINI-UNIX on the LSI-11]
  
 
{{Nav Unix}}
 
{{Nav Unix}}

Latest revision as of 20:16, 21 June 2023

MINI-UNIX is a somewhat limited variant of V6 Unix written by Heinz Lycklama, for use on models of the PDP-11 such as the PDP-11/05 which did not have memory management (which was required for early Unix versions from UNIX Fourth Edition onward). Although it is not full Unix, it retains a large amount of the functionality of the original.

Most V6 applications run without source modification on MINI-UNIX, although it is not binary-compatible with V6. This is a result of the lack of memory management in the machines which run MINI-UNIX; the kernel, and user commands (as processes), share a single PDP-11 address space, with the kernel in low memory, and the processes (one at a time) in high memory.

There was a second, earlier, stripped-down variant of V6 for PDP-11's without memory management, LSX; it differed from MINI-UNIX in being targeted at machines with more limited amounts of main memory (a real concern with early machines, which often came with limited amounts). MINI-UNIX was targeted at machines with the full 56KB possible on such PDP-11's.

MINI-UNIX did not originally support the LSI-11, but there are no significant architectural differences between the LSI-11 and other 'small' PDP-11's, so MINI-UNIX was historically brought up on the LSI-11. (The main significant difference is that in the LSI-11, access to the PS requires use of special instructions; see here for other issues.)

That version has since apparently been lost; however, because of the wide availability of the LSI-11 in the vintage computer community, MINI-UNIX has recently been ported to the LSI-11 again, to provide a Unix experience on those machines. (See link below.)

User-visible compatibility

MINI-UNIX supports almost all the standard V6 system calls, with the exception of:

  • pipe()
  • ptrace()
  • getid()/setgid()
  • prof()

Pipes are not supported, not only because of space in the OS, but because a process swap-out and -in will be required every time a different stage needs to run, leading to poor performance.

Although pipes are not supported, the shell supports the pipe command syntax ('|'), by use of temporary files (modulo the amount of free space on the disk, of course).

There is no support for command images with 'pure texts', or for so-called 'split I+D' mode.

The removal of ptrace() means there is no interactive debugging; this is not a major hardship, as the lack of memory management means that a buggy user program can crash the system anyway.

MINI-UNIX uses the same file system as V6; this allows MINI-UNIX packs to be 'mounted' on V6 systems (either real, or simulated), which is very convenient for working on them. The maximum file size supported is 1MB (512*256*8 = 1,048,576 bytes); 'large' files are supported, but not 'huge' files (those with two levels of indirect blocks).

Modified commands

Only a few commands have significant changes:

  • Shell - no use of OS-provided pipes
  • Linker 'ld' - minor modification to change target address
  • Debugger 'db' - minor modification to change program address

A few other commands have minor changes, but they are not of any great consequence. (See Section 4 of the "The MINI-UNIX System" memorandum for details.) Some have been slightly modified to fit into the 32KB available for user processes.

Implementation details

Because of the way user commands are run in high memory in a single address space, user commands are linked to run at a high address (usually 060000, instead of at 0 as on standard V6.

Thus, 24KB (notionally) is normally allocated to hold the kernel (with a modest number of processes and disk buffers), leaving 32KB available for user commands/applications. (The "notionally" is because that 24KB also includes the 'user' structure: a per-process swappable data area, stored at 056000 - i.e. contiguous with the process, for swapping; 1KB in size (it includes the process' kernel stack). Thus 23KB is actually available for the kernel.)

This division can be altered, albeit painfully (all the command binaries have to be re-linked to the new boundary address), to allow the size of the kernel to vary.

MINI-UNIX uses the standard C compiler, which generate EIS instructions. On PDP-11 CPU models which do not support the EIS, an simulation package is available which is called into action when a trap is produced by an unknown instruction.

Internal changes

Based as it is on V6, given the close match in the system-call interface, one might think that the internals are a close match to V6. That is not quite true: there are some significant differences. A thorough comparison has not been performed, but here are some significant differences that have been found.

The interface from the I/O system to device drivers is mostly the same, so that existing V6 device drivers can generally be basically be 'dropped in', almost un-modified. In particular, the interface to 'character' (un-structured) devices is identical, as is that to the 'tty' driver; the interface to the block device buffer system (for mass storage devices) is also identical. The two minor aspects that are changed are:

  • since the system is limited to less than 64KB of memory, the 'extended memory' field in block device buffer header is not present;
  • 'raw devices' (which can do DMA transfers directly from the device to a buffer in the user process' memory) are not supported.

The swapping area is not allocated 'as needed' through an allocation map; rather, each active process is statically pre-allocated a large enough block to hold a maximum-sized process. Along with this, process ID's are constrained to be in the range [1-NPROC]; they may thus be used directly as indexes (e.g. above).

The defined constants ROOTDEV and SWAPDEV (in param.h) don't actually do anything, as they are not used; the variables rootdev and swapdev still exist, and are used as in V6, but always contain '0'.

'Read-ahead' has also been removed from the file system implementation; this saves on address space in the kernel at the cost of a slight degradation of performance. The scheduler is a simple round-robin time-slicing one.

External links