Welcome to hypercone.com on July 10 2009.
This is an internet experiment running to monitor browsing habbits of individuals through wikipedia contents.

AmigaDOS

From Wikipedia, the free encyclopedia

Jump to: navigation, search

AmigaDOS provides the disk operating system portion of the AmigaOS. This includes file systems, file and directory manipulation, the command-line interface, file redirection and so on.

In AmigaOS 1.x, the AmigaDOS portion was based on a TRIPOS port by MetaComCo, written in BCPL. Because BCPL does not use native pointers, as do C and most other low-level programming languages and assembler programs, using more advanced functionality of the operating system was difficult and prone to errors. The third-party AmigaDOS Resource Project[1] (ARP, formerly the AmigaDOS Replacement Project[2]), a project begun by Amiga developer Charlie Heath, replaced many of the BCPL utilities with smaller and often more sophisticated equivalents written in C and assembler, and provided a wrapper library, arp.library, which eliminated the interfacing problems in applications by automatically performing conversions from native pointers (such as those used by C or assembler) to BCPL equivalents and vice versa for all AmigaDOS functions.

From AmigaOS 2.x onwards, AmigaDOS was rewritten in C, retaining 1.x compatibility where possible.

Starting with AmigaOS 4.0, the DOS abandoned completely any legacy with BCPL, and starting from AmigaOS 4.1 it has been rewritten with full 64-bit support.

Contents

[edit] Console

The Amiga console is a standard Amiga virtual device and it is piloted by Console. Handler. It could be accessed as quite as any other device by invoking it with colons CON:.

The Amiga console evolved from a primitive interface present in 1.1, and became stable with OS 1.2 and 1.3 when it was introduced AmigaShell, driven by NewConsole.Handler. First Amiga console has various features that were up to date when it was created in 1985, like Command Template Help, redirection to null ("NIL:"), ANSI color terminal. The New Console Handler introduced the device NEWCON: that allowed many more features, like for example Command History, pipelines, automatic creation of files when output was redirected, and its design was so advanced that when internet became popular, the console could also receive redirection from Amiga internet stacks as quite this redirection stream was a standard Amiga Device ("TCP:", example: "copy file to tcp:site/port"), etc.

Amiga console has had a standard character set since 1985. Differently from other system of its age, Amiga did not implemented a character set of its own; the developers wisely decided to implement an International Organization for Standardization ANSIISO compliant one. The Amiga character set is ISO-8859-1 (latin 1), which includes the ASCII character set (first 128 characters), and it is also used in e-Mail and WWW standards.

[edit] Euro currency character

ISO-8859-1 standard does not support the Euro currency character (""), as it was created many years before the introduction of that currency. Modern Amiga character sets includes that character by using ISO-8859-15 (latin-9, latin-0) character set and optionally remapping the keyboard.

Modern Amiga systems like AmigaOS and MorphOS are about to introduce UNICODE as character set, but legacy programs are incapable of supporting it.

MorphOS supports UNICODE internally and uses various character sets to maintain retro-compatibility with ancient Amiga programs.

[edit] Line feed

As in Unix systems, the Amiga console accepts only Linefeed ("LF") as an end-of-line ("EOL") character.

Amiga console has support for accented characters as well as for characters created by combinations of "dead keys" on the keyboard.

[edit] Syntax of AmigaDOS commands

This is an example of typical AmigaDOS command syntax:

AmigaShellPrompt> DIR Df0:
This shows the content of a directory of a floppy disk and elencates directories but without entering the directory tree.
AmigaShellPrompt> DIR SYS: OPT A
AmigaShellPrompt> DIR SYS: ALL
The argument word "OPT A" or also the argument word "ALL" show the entire content of a volume or device, entering and expanding all directory trees. "Sys:" is the obliged name that indicates the boot device, whatever it could be, floppy, hard disk or CD. Note that Amiga uses always the slash character ("/") in command arguments or also directory paths.

[edit] Command redirection

AmigaDOS can redirect output of a command to printer, null device, files, pipes, and to special Amiga devices.

AmigaShellPrompt> DIR >Speak: ALL
Redirects the output of "dir" command of the current device to speech synthesis handler, reading the content of the entire volume or disk with natural voice. Note the colon character ":" that indicates the AmigaOS considers the speech synthesis handler (that is just a software device driver piloting the Amiga audio chip Paula) as this software handler was like as any other Amiga standard device. This a normal behavior of AmigaOS for any kind of physical or virtual drives, volumes, handlers and devices.

[edit] Command template

The command template of AmigaDOS was small but useful. AmigaDOS was one of the early DOS providing this help for the users.

AmigaShellPrompt> DIR?
The question mark character "?" invokes the command template.

Output is:

OPT/K ?
This minimal help tells the user that he could use the argument word OPT with the command DIR. "OPT" is facultative (/K), and needs to receive a character key as argument to perform additional functions of that DOS command.

It could be considered a very poor help feature, but when this template help function was created in 1985 AmigaDOS was one of the few system providing this facility. Amigans often enhanced AmigaShell with new console handlers, such as Bash or Zshell portings from Linux world, or Kingcon: replacement of the normal Amiga console device CON:. These shells featured a complete set of help tools explaining all commands, their syntax, the complete templates, command history, etcetera.

If we invoke the template on the command Copy that is used in AmigaDOS to copy files we will obtain this output:

AmigaShellPrompt> Copy ?
FROM, TO/A, ALL/S, QUIET/S
This string means that the user must use this command in conjunction with FROM and TO arguments, and provide an obliged path to teach the DOS where are the files. Argument TO is to be typed obligatory (/A). The argument keywords ALL and QUIET are switches (/S) and change the results of the command COPY. ALL if used, copies all files of a directory. QUIET argument disables the "echo" of the command, so it will perform the entire operation of copying files without prompting the user with ongoing operations status.

The minimal help shown in the window of CLI/Shell then informs the user of the correct command template and that he must enter a string like this:

Copy FROM df0:myfile TO dh0:mydata/myfile
or also:
Copy df0:myfile TO dh0:mydata/myfile

Example shown copies a file named myfile FROM Floppy Disk TO Hard Disk directory called mydata. Syntax of Amiga commands is often structured by its creators to being close enough to human language.

[edit] Command Break and pausing console output

AmigaDOS can terminate a program and breaking it by invoking Ctrl+C combination of keys.

Pressing space on the keyboard suspends the Console Output, and it can be resumed by pressing the ← Backspace key.

[edit] Wildcard characters

Like other operating systems AmigaDOS also provides wildcard characters, that are substitutes for any character, or any sequence of random characters in a string.

Here follows an example of wildcard characters in AmigaDOS commands:

AmigaShellPrompt> DIR #?.info
searches the current directory for any file containing ".info" at its end as suffix, and displays only these files in the output.

[edit] Scripting

AmigaDOS also has the feature of dealing with batch programming, which it calls "script" programming, and has a number of commands such as Echo, If, Then, EndIf, Val, Skip, etcetera, to deal with structured script programming. Scripts are text-based files and can be created with AmigaDOS's internal text editor program, called Ed, or with any other third-party text editor. To invoke a script program, AmigaDOS uses the command Execute.

AmigaShellPrompt> Execute myscript
executes the script called "myscript".

This method of executing scripts keeps the console window busy until the script has finished its scheduled job. Users cannot interact with the console window until the script ends or until they interrupt it.

While:

AmigaShellPrompt> Run Execute myscript
The AmigaDOS command "Run" executes any DOS command or any kind of program and keeps the console free for further input.

If the protection bit "S" (meaning "Script") is set on, then AmigaDOS is able to recognize and automatically run the script by simply invoking its name.

[edit] Protection bits

Protection bits are flags that files, links and directories have in the filesystem. To change them one can either use the command Protect, or use the Information entry from the Icons menu in Workbench on selected files. AmigaDOS supports the following set of protection bits (abbreviated as HSPARWED):

  • H = Hold (reentrant commands with P-bit set will automatically become resident on first execution. Requires E, P and R bits set to work. Does not mean "Hide". See below.)
  • S = Script (Batch file. Requires E and R bits set to work. Without S bit scripts can still be launched using the Execute command.)
  • P = Pure (indicates reentrant commands that can be made resident in RAM and then no longer need to be loaded any time from flash drives, hard disks or any other media device. Requires E and R bits set to work.)
  • A = Archive (Archived bit, used by various backup programs to indicate that a file has been backed up)
  • R = Read (Permission to read the file, link or content of directory)
  • W = Write (Permission to write the file, link or inside a directory)
  • E = Execute (Permission to execute the file or enter the directory. All commands need this bit set, or they won't run. Requires R bit set to work.)
  • D = Delete (Permission to delete the file, link or directory)

The H-bit has often been misunderstood to mean "Hide", something that doesn't make any sense as files with the H-bit set remain visible in all respects, there are no options for C:List or C:Dir to display files with H-bit set any differently than other files. Where this misunderstanding has its origin is unclear.

Demonstration of H-bit in action:

AmigaPrompt> which list
Workbench:C/List
AmigaPrompt> list workbench:c/list
Directory "workbench:c" on Thursday 30-Oct-08
list                              6464 --p-rwed 25-Feb-02 22:30:00
1 file - 14 blocks used
AmigaPrompt> which list
Workbench:C/List
AmigaPrompt> protect workbench:c/list +h
AmigaPrompt> which list
Workbench:C/List
AmigaPrompt> list workbench:c/list
Directory "workbench:c" on Thursday 30-Oct-08
list                              6464 h-p-rwed 25-Feb-02 22:30:00
1 file - 14 blocks used
AmigaPrompt> which list
RES list
Notice how the list command becomes resident after execution when the H-bit is set.

[edit] Local and global variables

As any other DOS, Amiga deals with environmental variables as used in batch programming.

There are both global and local variables, and they are referred to with a dollar sign in front of the variable name, for example $myvar. Global variables are available system-wide; local variables are only valid in the current shell. In case of name collision, local variables have precedence over global variables. Global variables can be set using the command SetEnv, while local variables can be set using the command Set. There are also the commands GetEnv and Get that can be used to print out global and local variables.

The examples below demonstrate simple usage:

AmigaShellPrompt> setenv foo blapp
AmigaShellPrompt> echo $foo
blapp
AmigaShellPrompt> set foo bar
AmigaShellPrompt> echo $foo
bar
AmigaShellPrompt> getenv foo
blapp
AmigaShellPrompt> get foo
bar
AmigaShellPrompt> type ENV:foo
blapp
AmigaShellPrompt> setenv save foo $foo
AmigaShellPrompt> type ENV:foo
bar
AmigaShellPrompt> type ENVARC:foo
bar
Note the save flag of the SetEnv command and how global variables are available in the filesystem

Global variables are kept as files in ENV:, and optionally saved on disk in ENVARC: to survive reboot and power cycling. ENV: is by default an assign to RAM:Env, and ENVARC: is an assign to SYS:Prefs/Env-archive where SYS: refers to the boot device. On bootup, the content of ENVARC: is copied to ENV: for accessibility.

When programming AmigaDOS scripts, one must keep in mind that global variables are system-wide. All script-internal variables shall be set using local variables, or one risks conflicts over global variables between scripts. Also, global variables require filesystem access, which typically makes them slower to access than local variables.

Since ENVARC: is also used to store other system settings than just string variables (such as system settings, default icons and more), it tends to grow large over time, and copying everything over to ENV: located on RAM disk becomes expensive. This has led to alternative ways to set up ENV: by using dedicated ramdisk handlers that only copy files over from ENVARC: when the files are requested. Examples of such handlers are [1] and [2].

A rather insane example demonstrating creative abuse of global variables as well as Lab and Skip, the AmigaDOS variant of the infamous GOTO. [3]

[edit] Case sensitivity

AmigaDOS is in general case-insensitive. File names like "MyProg", "myprog", "MYPROG" and "MyPrOg" are considered the same, and so are directory, volume and device names. Indicating a device as "Dh0:", "DH0:" or "dh0:" always refers to the same partition. However, for file and directory names, this is file system-dependent, and some file systems allow case sensitivity as a flag upon formatting. An example of such a file system is Smart File System. This is very convenient when dealing with software ported over from the mostly case-sensitive Un*x world, but causes much confusion for native Amiga applications, which assume case insensitivity. Advanced users will hence typically only use the case sensitivity flag for file systems used for software originating from Un*x.

Note also that re-casing of file, directory and volume names is allowed using ordinary methods; the commands "rename foo Foo" and "relabel Bar: bAr:" are valid and do exactly what is expected, in contrast to for example on Linux, where "mv foo Foo" results in the error message "mv: `foo' and `Foo' are the same file" on case-insensitive filesystems like VFAT.

[edit] Conventions of names of devices

Partitions and physical drives are typically referred to as DF0: (floppy drive 0), DH0: (Device hard disk 0 or HD0: hard drive 0), etc. However, unlike many operating systems, outside of built-in physical hardware devices like DF0: or HD0: the name of the single floppy disks, or the volumes or partition own names are totally arbitrary; for example a hard disk partition could be named HARDDISK or A, or MyDisk or any other name when it was partitioned. Volume names then will be recognized as have the same format as device names, so a disk partition on device DH0: called Workbench could be accessed either with the name DH0: or Workbench: (Note that once the name of the volume was set up, the system automatically adds the colon character to the name of the partition to indicate it is considered as a device as for example when showing a list of active devices. On the desktop, the name of the device appears right under device icon and without the colon. Users must indicate to the system that "Workbench" is a device "Workbench:" by always typing the colon ":" when they are entering information in a requester form or into AmigaShell command based interface windows. This is mandatory.). If the partition is the same that started the boot sequence, it could also be accessed as Sys:. So there could various ways to indicate and access the partition that made the boot. In addition, virtual volume names could be set with the "assign" command to any directory or device; for example programs often assigned a virtual volume name to their installation directory; an example might be a fictionary worprocessor called FooBarWriter assigning FooBar: to DH0:Productivity/FooBarWriter. This allows for easy relocation of installed programs.

[edit] Conventions of names and typical behaviour of virtual devices

The physical device DF0: shares the same floppy drive mechanics with PC0:, which is the CrossDOS virtual device capable of reading PC formatted floppy disks. When any PC formatted floppy disk is inserted into the floppy drive, then the DF0: floppy Amiga icon will change to indicate that the disk is unknown to the normal Amiga device, and it will show four question marks ???? as the standard "unknown" volume name, while the PC0: icon will appear revealing the name of the PC formatted disk. Any disk change with Amiga formatted disks will invert this behaviour.

[edit] File systems

The AmigaOS supports various file systems and variants.

The first filesystem was simply called Amiga FileSystem, and was suitable mainly for floppy disks, because it did not support autoboot from hard disks. It was soon replaced by FastFileSystem (FFS), and hence the original filesystem was de facto recognized with the name of "Old" FileSystem (OFS).

The new FastFileSystem was soon expanded to recognize cached partitions, international partitions allowing accented characters in file and partition names, and finally long names in files, up to 108 characters.

Since AmigaOS 4.0, a new version of FastFileSystem called FastFileSystem2 (FFS2) is available which can expand its features and capabilities with the aid of plug-ins. Amiga also supports two filesystems from third-party manufacturers: Professional FileSystem, a filesystem with an easy structure, based on metadata, allowing high internal coherence, capable of defragmenting itself on the fly, and not requiring unmounting before being mounted again; and Smart File System (SFS) which is a very interesting journaling filesystem which performs journaled activities during system inactivities, and has been chosen by MorphOS as its standard filesystem.

The AmigaOS version of Smart FileSystem is a fork of the original SFS adopted by MorphOS, and is not compatible 100% with it.

Other filesystems like FAT16 and FAT32 from Windows or ext2 from Linux are available through system libraries or third-party modules or even from the Aminet freeware software repository.

AmigaOS 4.1 adopted a new filesystem called JXFS capable of supporting partitions over one terabyte in size.

[edit] Official variants of Amiga file systems

Old File System / Fast File System

  • OFS (DOS0)
  • FFS (DOS1)
  • OFS International (DOS2)
  • FFS International (DOS3)
  • OFS Directory Caching (DOS4)
  • FFS Directory Caching (DOS5)

Fast File System 2 (AmigaOS4.0)

  • OFS Long filenames (DOS6)
  • FFS Long filenames (DOS7)

[edit] Fast File System2 plug-ins

With the first update of AmigaOS 4.0 in 2007, the first two plug-ins for FFS2 were released:

  • fs_plugin_cache: increments performances of FFS2 by introducing a new method of data buffering.
  • fs_plugin_encrypt: data encryption plug-in for partitions using Blowfish algorithm.

[edit] Filename extensions

Amiga has only one obliged filename extension for filenames and that is ".info" which is appended as a suffix to filenames of icons. If a filename called myprog exists, then myprog.info is the file containing icons, its position on the desktop (AmigaOS is capable to "snapshot" icons in places defined by the user), program metadata such as options and keywords, and other information about the file.

There is no mandatory issue in Amiga to indicate programs and projects (datafiles) with extensions. Any user can rename files with any suffix if he likes to, or if there is the need to rename files for a matter of precision. Amiga will recognize an executable by using the first sequence of bytes in the binary header of file (magic cookie number), and it will recognize the datafiles by the icons, or by its information again contained in headers. A list of files like "data1", "data2", "data3", etc, will be considered the same even if it has been renamed "data1.lbm, "data2.jpg", "data3.lbm".

Amiga will open the correct software for any kind of file depending from the info contained in its icon, or by using data types.

[edit] References

Personal tools

Visit joltnews for the latest headlines
Visit bloit.com for company information
Geed Media does computer consulting on long island.
This page viewed times. See Logs