home *** CD-ROM | disk | FTP | other *** search
- *******************************
- * Documentation File: TCB.doc *
- * 15 July 1987, Al Aburto *
- * CompuServe ID: 76450,23 *
- *******************************
-
- This is a program (TCB) I wrote to help me understand Exec Tasks and
- AmigaDOS Processes. The program grew as I learned, so it can stand a bit
- of improvement in structure, and efficiency of operation, otherwise it
- is 'thoroughly' debugged. However if you find any problems of any kind
- please let me know and I'll fix them.
-
- The Program (TCB), the Assembly Source Code (TCB.asm), and this
- documentation file (TCB.doc) are given to the Public Domain for use by
- ANYONE free of any charge by the author. Therefore it would be a bit 'tacky'
- to take this code (as is) and sell it for profit.
-
- This program runs from the AmigaDOS CLI and it should work properly (If
- I did my homework correctly) from Matt Dillions 'Shell' (csh) and the
- MetaComCo Shell.
-
- A List of program commands is printed by typing: 'TCB ?<cr>' from the
- CLI. To save wear and tear on the disk drive, copy the program to RAM:
- and run the program from the RAM DISK.
-
- A brief description of the program commands and outputs follows:
-
- ( 1) TCB ?<cr>
- Prints a list of program commands.
-
- ( 2) TCB<cr>
- Prints a list of all Tasks/Processes which are Running or Waiting to
- Run. The Task Name, Type, State, and Priority are printed. An
- indication is given if the Task was run from the CLI or not. The
- address of the Task Structure is also given (Task CB). If the Task
- is also a Process then the SegArray address ( pr_SegList(A0) ) is
- also given where A0 points to the Process Structure. The Initial
- pointers to the Tasks was obtained from the ExecBase structure
- ( defined in 'execbase.i' ) .
- The definition of the SegArray ( from The AmigaDOS Manual ) is a bit
- unclear. I think I understand it correctly except for the
- 'Workbench' process which does not follow the same rules as other
- processes ---the third element in SegArray points to resident code
- --- it doesn't point to a SegList as for other processes.
- If a Task is NOT also a Process then pr_CLI(A0) is undefined ( It
- need not be zero ) where A0 points to the Process Structure defined
- in 'dosextens.i'. Also for the current CLI Process the SegList is
- not defined in the SegArray (its zero) but in cli_Module(A0) where
- A0 points to the CommandLineInterface Structure defined in
- 'dosextens.i' . ( The Logic Flow Diagram For AmigaDOS must be
- Complicated ).
- Do this command several times to catch 'All' TCB known Tasks. They
- Will pop in and out or be duplicated in the print out even though
- new multitasking is Forbid() 'ened during the run. I didn't want to
- use Disable() because this is 'Touchy' code.
-
- ( 3) TCB TaskName<cr>
- This prints out the starting addresses and sizes of all code/data
- segments belonging to a given Process as defined by the Task Name.
- A Hex/ASCII dump of the first 12 bytes of code/data for each segment
- is also printed. Examples: TCB df1:Aterm, TCB CLI , TCB CON .
- This doesn't work for Workbench as I get a BPTR conversion error--In
- this case a 256 byte Hex/ASCII dump is given from the error address.
- Some programs, such as the Amiga 'Clock' program, consist of many
- code/data segments and the output will scroll rapidly off the
- screen in this case. Press the 'Space Bar' to stop the output in
- this case. Press 'Back Space' to continue. TCB checks for
- TaskNames using the Exec function _LVOFinTask() --- If the TaskName
- is not found it then checks the AmigaDOS rn_TaskArray Structures ---
- if the TaskName is not found here either it just gives up and prints
- 'Task Not Found'.
-
- ( 4) TCB T TaskName<cr>
- This does a Hex/ASCII dump of the data in the Task/Process Structure
- as defined by the given Task Name. Examples: TCB T CLI<cr> ,
- TCB T trackdisk.device<cr> , TCB T File System<cr> . 256 bytes
- of data are printed even though the Task/Process Structures are not
- this long. The dump starts at the Task/Process Structure Start
- Address. Look at 'exec/tasks.i' for the Task Structure definition.
- The CLI Process Structure (an extension of the Exec Task) is
- defined in 'libraries/dosextens.i'.
-
- ( 5) TCB C TaskName<cr>
- This does a Hex/ASCII dump of a CommandLineInterface Structure as
- defined by the input Task Name. Only works if the given Task is
- also a Process and the Process was run from the CLI.
-
- ( 6) TCB D HexAddress<cr>
- This does a 256 Byte Hex/ASCII dump beginning at the input Hex
- Address. Useful for examining segment code/data and Structures in
- detail. Forbit() and Permit() are used to prevent (hopefully)
- mysterious system GURU Alerts.
-
- ( 7) TCB B BPTR<cr>
- Converts the Hex BPTR to a Hex APTR.
-
- ( 8) TCB DS<cr>
- This prints the starting address of the DosLibrary, RootNode,
- DosInfo, rn_TaskArray, and DevList Structures.
-
- ( 9) TCB DL<cr>
- This scans the DevList Structures and prints out starting addresses,
- Type (Device, Volume, or Directory), Task address, SegList address,
- and Name of these structures.
- The Task and SegList pointers do not appear to be always meaningful.
- There appears to be inconsistencies in these structures. If the
- SegList is zero then either an invalid condition exists or the
- code has not been loaded into ram. A 'Volume' does not have a
- SegList.
-
- (10) TCB L<cr>
- This scans the Amiga Library node structures and prints out
- the Library Base address (Node Base), The Library Name,
- the Library negative size (where we find the Library Jump
- addresses), the Library positive size, and the Library ID String.
- The LIB_IDSTRING Pointer (address) is not always filled-in in the
- LIB Structures.
- I found that the icon.library Structure LIB_IDSTRING APTR is an
- odd-numbered address --- This could cause problems ......
-
- (11) TCB D<cr>
- This scans the Amiga Device Library node structures. Same info
- as in (10) is printed out.
-
- (12) TCB S SegList_HexAddress
- This scans a SegList Array (an Array of TAsk code/data segments).
- The SegList address (in Hex) is input .... Be careful here as an
- incorrect SegList input could send the program off to Limbo and
- most likely result in a system GURU Meditation (crash). A print
- of the segment code/data start address and size is given. Also the
- a Hex/ASCII dump of the first 12 bytes is done.
-
- SegList - $04 LONG ;This Is The Code/Data Size For This Segment.
- SegList + $00 BPTR ;BPTR is to the next code/data segment. The
- ;Last Segment Has a NULL BPTR here.
- SegList + $04 ---- ;Here Starts The Segment Code/Data.
- ***************************************************************************
-
- Al Aburto 76450,23
- CompuServe ID: 76450,23
-
- **************************** Das ist alles ********************************
-
-