This is only a preview of the January 1992 issue of Silicon Chip. You can view 43 of the 96 pages in the full issue, including the advertisments. For full access, purchase the issue for $10.00 or subscribe for access to the latest issues. Articles in this series:
Items relevant to "Build A 4-Channel Guitar Mixer":
Articles in this series:
Items relevant to "Experiments For Your Games Card":
Articles in this series:
Articles in this series:
Articles in this series:
|
COMPUTER BITS
BY JENNIFER BONNITCHA
What to do when things go wrong
Most times when you use your computer, things
go according to plan and the desired result is
achieved. From time to time, however, things go
horribly wrong and knowing how to fix the
problem is quite an art.
You can divide most computer problems neatly into two categories: (1)
those causing physical damage, and
(2) those which are logical. Physical
damage in terms of computer files
means that something affects the
physical location of the file on a disc,
thus preventing a part of the file from
being written to or read. Logical damage, on the other hand, is contentrelated and this can mean that a DOS
area (for example the File Allocation
Table - FAT) or the contents are corrupt.
Most computer users have at some
time had the experience of a program
terminating unexpectedly- for example the Unrecoverable Application
a little data loss through to corrupted
files.
Graceful program termination generally closes any open files, deletes
any temporary files created during
the session, frees-up allocated memory
and restores the original hardware/
software interrupt table values, if altered. In order of importance, the first
process - closing open files - is vital.
Deleting temporary files is a neat and
tidy way to end a session, while releasing memory and restoring the interrupt table are very important unless
you decide to turn the computer off or
perform a restart.
If DOS and your program don't cooperate in the removal of temporary
"If DOS and your program don't co-operate in
the removal of temporary files, then you most
definitely should remove them yourself so that
they don't tie up disc space."
Error from Windows 3. Programs
which terminate in a graceful, orderly
manner seldom, if ever, cause problems. Inelegant, awkward terminations can occur when you choose the
Abort option from DOS during a critical stage of the program, the system
locks up or you lose power or reboot
your computer during program execution.
You may end up with anything from
40
SILICON CHIP
files, then you most definitely should
remove them yourself so that they
don't tie up disc space.
Open files
When DOS closes a file, any information or instructions pending for
the file are written, the directory time/
date stamp is updated, as is the FAT,
and finally the file handles are freed.
It is imperative that DOS and the pro-
gram cooperate when closing files
since when a program closes a file it
directs DOS to write all information
the program holds in its buffers. DOS,
on the other hand, writes all information and updates the directory entry
and FAT. If only DOS closes a file,
there is the chance information may
be "trapped" in the program's buffers.
If a program stops before it closes a
file, you lose information, the subdirectory information may not be correct and the FAT may not be updated
correctly. IfDOS stops during file closing, information may or may not be
recorded, the subdirectory entry may
not be correct and the FAT may or may
not contain the correct chain entries
for the file. In combination, disagreement between the file, subdirectory
entry and FAT causes logical inconsistency, thus the disc is logically damaged. While this can cause considerable problems, there is hope!
Unexpected program termination
has one saving grace - you can usually guess how much data may have
been lost. Word processing and
spreadsheet programs generally lose
the most recent revisions while database and accounting programs may
have pieces lost. You may find that
the file has been corrupted or is littered with garbage. In the case of a
database, you may also find that any
related files could be affected.
The most important question in this
instance is: could DOS and the program clean-up prior to termination?
While the current information is lost,
the system's integrity should be intact.
Memory disagreements
As mentioned above, when a program terminates in an orderly fashion, memory used by the program is
freed for further use. Memory (or RAM)
is used both by DOS (and freed automatically) and a program (which it
should free on termination). Note that
DOS 5 handles memory allocation in a
different way. This article describes
earlier versions to avoid complication. A future article will describe the
differences in DOS 5.
When a program starts, DOS , depending on the program type, allocates conventional RAM to the program:
COM: first 64K
EXE: whatever is established by the
linker that creates the EXE file. This
information is stored in the file's preamble.
Any other memory used by the pro-
mer. If the problem was a disc error,
the program halts immediately and
DOS bypasses the clean-up stage!
The Ctrl C/Ctrl Break combination
may cause a program to terminate prematurely. DOS will restore any changes
to the, interrupt table, however if the
program made any modifications, you
should restart DOS to reset the interrupt table. This is not a bad idea in
any case, just to be sure.
How far is too far?
Knowing when to turn off your computer or restart DOS is part of the art.
Try to make sure all foreground and
background programs have terminated, the system is at the DOS prompt
and that the disc
drives have completed any writing
"Unexpected program termination activity. Remember,
however, that the
has one saving grace - you can
system prompt is
usually guess how much data may not
always a guarantee of completion.
have been lost."
When you run backgram is requested when necessary, ground programs, including TSRs
then freed. Since DOS can't automati- (Terminate and Stay Resident procally free any other memory when a grams), the DOS prompt won't indiprogram ends, memory must be freed cate an idle system.
explicitly by the program. Thus, if a
Since the computer is processing
program stops suddenly, RAM can be in the background, any work taking
trapped. Although programmers by place is out of view. The DOS prompt
and large are careful to include a is an indication that any foreground
"clean up" routine for unexpected work is complete, while the backprogram termination, programs can't ground program could still be chugging away. Don't always trust the disc
handle all problems.
activity light either, since this is meant
Why is_it so?
as an indicator rather than the absoYou can put the blame on three lute truth. You may notice the light
remains on when audible disc access
different occurrences: critical errors,
CPU exceptions and the Ctrl C/Ctrl is complete.
This is particularly true for floppy
Break key combination.
Badly behaved programs usui).lly disc drives. When a disc is selected
cause the CPU exception, giving help- the drive light is turned on and then
ful responses like divide by zero, di- turned off again when deselected. The
vide overflow and unrecognised in- difference between light on and acstruction errors. The price you pay is tual activity is between half to one
the loss of any un-saved work and the second; likewise when deselected.
possibility of inconsistencies between The light may stay on until the motor
stops completely.
the FAT and directory entries.
The hard disc drive, on the other
Critical errors are generated by devices such as open disc drive doors hand, spins continuously, so the light
and off-line printers. The DOS com- is a better indicator of use. Also, since
mand processor, COMMAND.COM, in- the light only goes on during actual
tercepts the problem and displays the read and write operations, you may
device not ready message together find the inte:i;nal processing is taking
with the option to Abort, Retry, Ig- place between read/write operations
nore or Fail. Should you decide to and so the light is extinguished.
Abort or Fail, DOS returns control to
We'll look at more troubleshooting
the program; the next reaction de- tips next month and discuss ways of
SC
pends on the ability of the program- repairing damaged files.
GAS LASER
INTRODUCTORY KIT
8
:~i~i
~~~~d a"~l~!:f:~ : t~~s~~~i~~i.~7n°:hrs~~~eC?t~
LASER INTRODUCTORY OFFER". The tubes are used but
have plenty of life left in them. They are GUARANTEED! You
I~~~~:~~:·ann!i7:u~
0
i~~~;•1i:~\~!.';~:~~hst~~~~~
at about 3mW, and one of our reliable and efficient 12V
UNIVERSAL LASER POWER SUPPLY KITS. A tube and the
supply will easily slide into inexpensive 50mm SWV pipe,
which makes for a compact self powered laser head. Casing
is not supplied. Several of our customers reported that AT
NIGHT, THE BEAM FROM THE SIEMENS WAS VISIBLE
UP TO 4km AWAYI The kit comes with full instructions and
it even includes a prewound transformer. The unlimited
applications include laser pointers, surveying, optical
experiments, medical field, holography, and fascinatinR
laser dis~lays. Wr, are still offering this "TRIO
$149
~.ft~1~i~1~ 6~:R PICTURE)
PASSIVE
INFRARED
SENSORS
Experimenters delight! A
brand new SmW 780nM•
820nM infra red laser
diodes supplied with a
collimating lens, heatsink,
laser diode data, a suitable
driver circuit and the
components for this circuit.
Visible in low light. Excellent for IR sights, data links,
high quality audio links,
~~~t~~ro~~~~.eter
s59
What are the expensive
parts in a Passive element
movement detector, as per
~u~iiiaJu:r:1eme:t htY~
sensor, plus a fresnet lens
plus a white filter. We can
supply
these
three
components for:
5
ONLY
or 10 for $80
9,90
For all the abovemen•
tloned components!
We can supply the same kit
with a used, tested laser
diode for $35. Limited
stock.
DECIMAL
KEY PADS
Positive
snap
action
switches
on a
self
adhesive
backing.
No connectors
provided.
Limited
quantity.
BIGGER LASER
TUBES
For the more serious
applications we have some
brand new, large 4mW and
l0mW tubes. Both the
tubes are of exceptional
quality and would normally
cost about three times this
price. Call for a special deal
for a tube and supply
s155
10mW ONLY $386
co~~~ag~•tv
5
1,30
EA.
or 10 for $10
LCD DISPLAY MODULES
~
~~~ul~~~i\t s~~.':,. ~~~::l!~
!1~~!~u::ricb[~~di~~:y
control circuitry already mounted underneath the PCB. Both
the units have provision for backlighting, and only require
a few milliamperes at SV to operate. We include
comprehensive information. AT A SMALL FRACTION OF
THEIR REAL VALUE.
~~t~hb'::~~lt:h~~: line module (16 X 2),
s22 .50
s35
!1u;'~'::t~~~~~g2 (~~exd~flay module,
We will atso have other LCD modules available, at similar
low prices. A backlighting inverter kit is also available for $8.
Melbourne Distributor: Electronics World
(03) 723 3860 or (03) 723 3094
Closed from 24/12/91 till 14/ 1/ 92
OATLEY ELECTRONICS
PO BOX 89, OATLEY , NSW 2223
Telephone: (02) 579 4985
Fax : (02) 570 7910
Certified p &p : S6 in Au st. NZ (Airmail) : S10
JANUARY 1992
41
|