From: alph@wsinfo01.win.tue.nl (G.J.W. Hagenaars)
Newsgroups: comp.os.linux
Subject: New; FAQ.TEX (part 2)
Date: 23 Jul 92 07:53:43 GMT
Reply-To: alph@win.tue.nl


%---------------second part of faq.tex follows------------------------

%---------------------------------------------------------------------
\section{Some classical problems}\label{classical}

\begin{question} While running du I get "Kernel panic:
free\_inode: bit already cleared".  Also, du produces an ENOENT
error for all the files in certain of my directories.  What's going
on?\end{question}
\answer These are both consistent with a bad file-system.  That's
relatively easy to produce by not syncing before rebooting, as Linux
usually has 1.5Mb of buffer space held in memory (unless you have
$\leq$ 4Mb RAM, in which case the buffers are only about 0.5Mb). Also
Linux doesn't do anything special about the bit-map blocks, and as
they are used often, those are the thing most likely to be in memory.
If you reboot, and they haven't been written to disk ...

Just do an {\tt fsck} on the device, the {\tt -a} flag might repair it
otherwise, the only thing to do is to reinstall the filesystem from
the Images.

A {\tt sync} is done only every 30 seconds normally (standard unix
practice), so do one by hand (some people think you should do 3 {\tt
sync}s after each other, but that's superstition), or by logging out
from the startup-shell, which automatically syncs the system.
Unmounting a filesystem also syncs it (but of course you can never
unmount root).

Another (sad) possibility is that you have bad blocks on your disk.
Not very probable, as they would have to be in the inode-tables, just
a couple of blocks in size. Again there aren't programs available to
read a disk for bad sectors and put them in some kind of
"bad-sector-file".  On IDE drives this is no problem (bad sectors are
automatically mapped away).

\begin{question} How can I partition my hard-drive to use
Linux?\end{question}
\answer There are (at least) two ways to answer this. The easy way is
probably to use a program which will do it for you, such as the MS-DOS
{\tt fdisk}, Minix {\tt fdisk}, Xenix/Unix {\tt fdisk}, or programs
such as {\tt edpart.exe} or {\tt part.exe}. With the 0.95a
distribution, there is {\tt pfdisk}. To use it have a look in the
beginner's guide written by I. Reid, it's clear and it had worked for
me like a charm. In the mcc-interim release there is also {\sf
fdisk-0.92}, which runs under Linux and manages partition tables (it
also creates extended partitions).

On the other hand, you can use a disk editor and modify the contents
of the partition table directly. This has been already done, and an
extensive explanatory note can be found in the mailing-list archives
(25th Jan. 92). You must also edit the bpb on the Dos partition you
are shrinking, otherwise Dos will step on Linux.

BTW It might be useful to set three (3) separated partitions for
Linux, one for the root, another one for the usr and a third one for
swap, as an illustration, my root partition is 10Mb, the usr is 22Mb
and instead of a swap partition I use a swap file. As an experience I
have used MS-DOS {\tt fdisk} to partition my two hd and got no
peculiar difficulties.

You can, as long as you stay within the 64Mb per filesystem limit,
have swap, root, etc, ... all on there.

\begin{question} I heard something about repartition a hard disk
without deleting everything on it, any clue?\end{question}
\answer It's not a program but a partition procedure which requires
\begin{itemize}
\item a partitionning program
\item a sector editor
\end{itemize}
The procedure itself can be found (at least) in digest\#132 Vol2.

\begin{question} What must I do to {\tt mkfs} a floppy?\end{question}
\answer blocks are of size 1kb so 1.44 floppy is 1440 blocks. The
floppy has to be formatted before this will work.

\begin{question} When I try to ({\tt un}){\tt compress} many files in
one command, the command partially fails?\end{question}
\answer This is a bug, many partial fixes are floating around but ..
You can solve it by a bash command\\ {\tt
for~i~in~whateverfiles;do~compress~\$i;~done} Another possibility is to
download the new {\tt tar} and {\tt compress} binaries (at {\tt tsx} {\sf
/pub/linux/binaries/usr.bin}).

\begin{question} I have some trouble with tar/untar; any
clue?\end{question}
\answer The {\tt tar} provided on .95a disk is broken. Use the one
available at {\tt tsx-11} in {\sf /pub/linux/binaries/usr.bin}

\begin{question} I can do this as root but not as non-root, is it a
bug?\end{question}
\answer Except for an early {\tt make} utility, the problem is caused
by an incorrect permission flag. The most common problems are about
{\sf /tmp} which should be 1777 and {\sf /dev/ttys?} which might be 766. So as
root do\\ {\tt chmod~1777~/tmp~;~chmod~766~/dev/ttys?}

\begin{question} When I use {\tt make} as non root, it doesn't work,
why?\end{question}
\answer ?????, the message is either (null) setuid ..., or (null)
setgid... This was a known bug in the first port of Gnu-make to Linux.
May be this is fixed in the gmake-3.62 version enclosed in {\sf
gmake-3.62.tar.Z} (at {\tt tsx-11} in {\sf pub/linux/binaries}).In fact the one
provided in mcc-interim is correct.

BTW This problem does not exist with the {\tt pmake} (make for BSD 4.3
Reno and BSD 4.4) package.

\begin{question} du reports twice the size showed with ls -l, is it a bug?\end{question}
\answer No it is not, the report is 512 bytes multiple (due to POSIX
requirement), for kb you just add the {\tt -k} flag. You can add a
{\tt du} function in your .profile which does this automatically,
something like\\ {\tt du()\{~/usr/bin/du~-k~\$*\}}
                                      
\begin{question} Sometimes, I get "mount can't open lock file"; what
does this mean?\end{question}
\answer This can happen for two reasons:
\begin{enumerate}
\item You try to {\tt mount} something as non-root. In that case you
can either retry as root, or set the setuid bit to mount. \item You
are root. {\tt mount} wants to open {\sf /etc/mtab} and {\sf
/etc/mtab\~\ }- the first one for reading, the second as lock file. If
there is already a {\sf mtab\~\ } remove it. This can happen if you
used once gnuemacs on {\sf mtab}.\\ To forbid that case, just add the
following entry in your {\sf /etc/rc} file:\\ {\tt rm~-f~/etc/mtab}
\end{enumerate}

\begin{question} When I try mount /dev/hd?? /user, I get
error~2.\end{question}
\answer Be sure, that your mount point {\sf /user} does exist; if not
perform a\\ {\tt mkdir~/user}.

\begin{question} Since I have upgrade my Linux kernel, ps won't
work anymore, why?\end{question}
\answer Each time you upgrade (or re-compile the kernel), you should
perform a\\ {\tt ps~-U}\\ ({\tt~-U} is for update the
{\sf /etc/psdatabase}).

Every time you boot a new kernel you have to do a\\ {\tt ps~U}\\ to
update the {\sf psdatabase}, after doing this you can remove the
system file or do a\\ {\tt make~clean}.\\

The pathname to the system binary {\sf /usr/src/linux/tools/system} is
stored in the {\sf psdatabase}, so you only have to specify it if you
have moved your source tree or if you are creating the {\sf
psdatabase} for the first time. The {\sf psdatabase} is always {\sf
/etc/psdatabase}. The system file is obtained in compiling the Linux
kernel (which I assume is rooted in {\sf /usr/src/linux}).

BTW: For 0.96 you should download the new {\sf ps} it's at {\tt
tsx-11} in
{\sf /pub/linux/sources/bin/ps096b.tar.Z}

\begin{question} Since Linux 0.96b I have a lot of core file all over
my disk. How can I sweep them away?\end{question}
\answer Use the following command\\ {\tt
find~$\backslash$~-name~core~-exec~rm~\{\}~$\backslash$;}

%---------------------------------------------------------------------

\section{Installation hints}\label{instalhints}

Special gcc information are located in section~\ref{gccinfo}. A
special section is devoted to it since it's \em the \em compiler of
Linux. I have sectionned this part in Misc/Device Major-Minor/Serial
Information.

\subsection{Miscellaneous information}

\begin{question} I've got all the things on site ??? but I don't know
what goes where. \end{question}
\answer Read this carefully, it's a mess right know and I hope this
problem will be fixed when the ABC-release will be out. It heavily
relies on the compiler you use:
\begin{enumerate}
\item The following information are for those using gcc-1.40 or
previous release (1.37): {\sf include.tar.Z} goes to {\sf
/usr/include}; {\sf system.tar.Z} contains the latest sources of the
system files ({\tt mkswap}, {\tt mkfs}, {\tt fsck} and {\tt fdisk}).
In version 0.12 {\sf utilbin.tar.Z} has been replaced by {\sf
fileutil.tar.Z} and {\sf utils.tar.Z} which contains a new {\tt tar}
to handle the symbolic links, make, uemacs kermit and minor programs
(sed,...). Other utilities have been ported separately.
\item For those who use gcc-2.1 there are nearly everything in the
package that you can find at banjo in {\sf pub/Linux/GCC} in the {\sf
2.1shared.tar.Z} file. You could find more sources in {\sf
system095a.tar.Z} file (at {\tt tsx-11} in {\sf sources/system/system0.95a})
\item The 'mcc-interim' release comes with gcc 2.1, which it installs
in the correct place.  If you have {\tt tar} and {\tt compress}
(remember use the good one ..), you can install {\tt gcc} from the
'interim' {\sf comp.image} and g++ from the {\sf comp2.image} even if
you don't have the rest of the 'interim' version.
\end{enumerate}

\begin{question} It seems that \$\#@! ported on Linux don't run
correctly \end{question}
\answer Possible, but check first if the size of your file corresponds
to the one on the ftp sites, if it is then check the BUGLIST available
on the main Linux sites. If the bug is not reported, do a complete
report of the error, try to correct it and send your result to
{\tt johnsonm@stolaf.edu}

\begin{question} Does anyone port this to Linux?, if not i'll compile
it.\end{question}
\answer First check on the sites, have a look to the info-sheet
monthly post and also available on sites. Have a look in the ``old''
digest files and mail-archives of linux-activists, these are kept at
least at {\tt tsx-11} and {\tt nic} possibly at {\tt tupac}. Look also at the
GNU\footnote{GNU stands for GNU's Not Unix, which (besides being a
recursive acronym) is a project started by the Free Software
Foundation (the FSF) to write a freely distributable version of Unix.
The GNU kernel is named HURD, and is based on Mach.  It is currently
being written, and is not yet done.  Many of the GNU utilities,
however, are completed and are much more functional than the original
Unix utilities.  Since they are freely available, Linux is using them
as well.} utilities to see if someone has already written a freely
distribuable version. Ask then on the list/news.

\begin{question} I've ported XXX to Linux, what should I do to add it
in the standard distribution?\end{question}
\answer Read first the previous Q/A, then to make something available
to others you have to contact Alan Clegg ({\tt abc@banjo.concert.net})
about putting your code in the ABC-Release of Linux. The ABC-Release
is a standardized set of Linux sources and binaries that will be
available in an easy installable format, and which will be maintained
in a standard way. Submissions should conform to the Linux File System
standard version 1.0 (this file is kept at banjo.concert.net in {\sf
/pub/Linux/docs}).

BTW Whenever you submit binaries, please do NOT link them with shared
libraries.

\begin{question} I want to port XXX to Linux, what are the
flags?\end{question}
\answer Recall that Linux implements subset of SYSV and POSIX, so {\tt
-DUSG} and {\tt -DPOSIX} work in general. Moreover throw away most of
the ld flags such as {\tt -lg}, since the {\sf libg.a} is missing for
some version of {\tt gcc} (see section~\ref{gccinfo} for more
details).

\begin{question} Linux lacks on XXXX/ Linux has a bug in XXX, what are
the rules to enhance/correct the kernel?\end{question}
\answer Before anything check if some one else is working on that
subject, contact those people, since end february a BUGLIST (thanks to
Michael Johnson) is kept on the major sites. Test your improvment (it
should work is NOT enough), then send the patches in cdiffs form to
Linus and/or the list, moreover the localization must be clear. This
does NOT mean that bug-reports and patches are not accepted. Moreover,
you should sent a brief note to Michael: {\tt johnsonm@stolaf.edu}; contact
also {\tt abc@banjo.concert.net} he organizes the ABC-Release.

\subsection{Major/Minor device number}\label{majorminor}

\begin{question} What are the device minor/major
numbers?\end{question}
\answer
\begin{center}Memory devices: Major = 1 (characted devices)
minor\end{center}
\begin{tabbing}
ABCDEFGHIJK\=\kill
0       \>/dev/ram\\
1       \>/dev/mem\\
2       \>/dev/kmem\\
3       \>/dev/null\\
4       \>/dev/port (implemented, but untested - don't play with it)
\end{tabbing}
example: {\tt mknod~/dev/null~c~1~3}
\begin{center}Floppy disks: Major = 2 (block devices)\end{center}
$minor~=~drive~+~4\times type$, $drive = 0,1,2,3$ for A,B,C or D-diskette
\begin{tabbing}
ABCDEFGHIJK\=LMN\=\kill
type    \>1: \>360kB floppy in 360kb drive (5.25'')\\
        \>2: \>1.2Mb floppy in 1.2Mb drive (5.25'')\\
        \>3: \>360kb floppy in 720kb/1.44Mb drive (3.5'')\\
        \>4: \>720kb floppy in 720kb/1.44Mb drive (3.5'')\\
        \>5: \>360kb floppy in 1.2Mb drive (5.25'')\\
        \>6: \>720kb floppy in 1.2Mb drive (5.25'')\\
        \>7: \>1.44Mb floppy in 1.44Mb drive (3.5'')\\
\end{tabbing}
Thus minor nr for a 1.44Mb floppy in B is: $1 + 4\times 7 = 29$, and
to read an old 360kb floppy in a 1.2Mb A-drive you need to use $0 +
4\times 5 = 20$.

Example: {\tt mknod~/dev/PS0~b~2~28} (b for block: 2 for floppy, 28
for 1.44 in A)

\begin{center}Hard disks: Major = 3 (block devices) minor\end{center}
\begin{tabbing}
ABCDEFGHIJK\=LMNOPQRSTU\=\kill
0       \>{\sf /dev/hda}  \>-- The whole hd0, including partition
                               table sectors etc.\\
1       \>{\sf /dev/hda1} \>-- first partition on hd0\\
...\\
4       \>{\sf /dev/hda4} \>-- fourth partition on hd0\\
5       \>{\sf /dev/hda5} \>-- Extended partition\\
64      \>{\sf /dev/hdb}  \>-- The whole hd1, again including
                               partition table info\\
65      \>{\sf /dev/hdb1} \>-- first partition on hd1\\
...\\
68      \>{\sf /dev/hdb4} \>-- fourth partition on hd1\\
69      \>{\sf /dev/hdb5} \>-- extended partition on hd1\\
\end{tabbing}

NOTE! Be \em very \em careful with {\sf /dev/hda} and {\sf /dev/hdb}
-- you seldom need them, and if you write to them you can destroy the
partition tables: something you probably don't want.  The only things
that use {\sf /dev/hda} are things like {\tt fdisk} etc..

NOTE 2!! The names for hd's are no longer the same as under minix,
there is a straightforward correspondance, but I think minix orders
the partitions in some way (so that the partition numbers will be in
the same order as the partitions are physically on the disk).  Linux
doesn't order anything: it has the partitions in the same order as in
the partition table (i.e. {\sf /dev/hd?1} might be physically after
{\sf /dev/hd?2}).

NOTE 3!! Extended partitions are recently detected, use them VERY
carefully, they should work, but backup everything before.

\begin{center}Tty's: Major = 4 (character devices) minor\end{center}
\begin{tabbing}
ABCDEFGHIJK\=LMNOPQRSTU\=\kill
0        \>{\sf /dev/tty0}  \>-- general console 1\\
63       \>                 \>-- reserved for virtual console\\
64--127  \>                 \>-- reserved for serial io\\
128--    \>                 \>-- reserved for pty's\\
\end{tabbing}
And more particularly we have:
\begin{tabbing}
ABCDEFGHIJK\=LMNOPQRSTU\=\kill
64      \>{\sf /dev/ttys1}  \>-- com1\\
65      \>{\sf /dev/ttys2}  \>-- com2\\
66      \>{\sf /dev/ttys3}  \>-- com3\\
67      \>{\sf /dev/ttys4}  \>-- com4\\
\end{tabbing}
\begin{center}lp: Major=6 (character devices) minor since
095c+\end{center}
\begin{tabbing}
ABCDEFGHIJK\=LMNOPQRSTU\=\kill
0       \>{\sf /dev/lp0}\\
1       \>{\sf /dev/lp1}\\
2       \>{\sf /dev/lp2}\\
\end{tabbing}
\begin{center}Scsi: Major = 8 (block devices)\end{center}
Minors are assigned in increments of 16 to SCSI disks as they are
found, scanning  from host 0, ID 0 to host n, ID `7, excluding the
host ID. For more information read the SCSI.note file available with
patches for SCSI (see also section~\ref{scsiinfo}).

NOTE 4!! all the numbers given are in decimal form (the one you can
see if you perform {\tt ls~-l} on {\sf /dev}).

\begin{question} (Chuck Boyer) Could some one clear up the devices
meaning?\end{question}
\answer (Jim Winstead Jr)\\ {\sf port}\\ This allows programs to
access the hardware ports directly.  Not something you generally mess
around with much.\\ {\sf ptyp0-3\\ ptypa...tty}\\ These are
the pseudo-tty `master' devices.  Each pty connection uses a
slave-master set of tty devices.\\ {\sf tty0...\\ tty[1-8]} are
the virtual consoles associated with Alt-F[1-8].  {\sf tty0} is the
current virtual console (so writing something to {\sf tty0} goes to
the current vc).\\ {\sf tty64} [I've figured out is the modem
connection]\\ Yes, that would correspond to COM1 under DOS.  However,
the tty64 name is obsolete - {\sf ttys[1-4]} should be used instead.\\
{\sf ttyp0...\\ ttypa...}\\ These are the pseudo-tty `slave'
devices.\\ {\sf ttys1...}\\ These are the serial devices.  {\sf ttys1}
corresponds to COM1 under DOS, {\sf ttys2} corresponds to COM2, etc.

\subsection{Special Serial}

Douglas E. Quale:\\ This has come up a couple of times already
(including the case of serial mice as well), but for the record {\tt
stty} acts on stdin not stdout.  Old stty's (from V7 through BSD4.3)
used stdout, but this is suboptimal and doesn't conform to POSIX.  The
GNU stty you are likely using on Linux uses stdin, as does the stty
distributed with BSD Networking Release 2.  (Also, {\tt stty~-a} is
more informative about possible parameters, although it's pretty hard
for me to remember what 90% of that stuff does without refering to the
man page.)

\begin{question} Is there a list somewhere where I can get help with
serial communications under Linux?\end{question}
\answer (Jim Gifford -- {\tt jgifford@attmail.com})\\
There is a new list for the discussion of serial communications under
Linux.  It is for problems, drivers, new developments, etc... with the
Linux serial devices. The list is: {\tt linux-serial@stolaf.edu} To join,
send mail to {\tt linux-serial-request@stolaf.edu} I hope that this list
will prove beneficial to the improvement of Linux. This list is
maintained by Michael K. Johnson as {\tt -serial-request@stolaf.edu}

\begin{question} When I run kermit under Linux, I get "Warning, Read
access to lock directory denied". What am I doing wrong?\end{question}
\answer Nothing, you just need to create {\sf /usr/spool/uucp} (kermit
4.6?) or {\sf /usr/spool/locks} (this is for the kermit5A), which is
where kermit like to lock files.

\begin{question} What are the major, minor numbers for the serial
ports under Linux?\end{question}
\answer See section~\ref{majorminor}

\begin{question} can anyone give me a sample /etc/inittab entry for
login from a pc attached to serial line /dev/ttys2?\end{question}
\answer (Humberto)\\ First set up the modem to turn off echo and
enable auto answer, I do this in kermit by connecting to the modem and
typing {\tt ate0s0=1} followed by enter. Then setup {\sf inittab} to
spawn getty on the modem ttys2:console:/etc/getty -m 1200 ttys2

Then it should work. Some modems can be permanently set to disable
echo and set auto answer, see your manual.

(Jim Weigand)\\ disable all messages. This will prevent getty from
hanging up your modem.
\begin{tabbing}
ABCDEFGHIJK\=LMNOPQRSTU\=\kill
Set       \>For:\\
ATE0      \>No echo\\
ATQ1      \>No messages\\
ATS0=2    \>Answer 2nd ring\\
ATS7=60   \>1 minute to answer (shorter if 2400 baud)\\
\end{tabbing}
You can use kermit to set these. Do an AT\&W to save for power-up.

(Michael K. Johnson)\\
If you would rather not save these commands as defaults to come up on
power-up, perhaps because you want to use your current modem settings
under a DOS communications package, you can also shove these command
out {\sf ttys?} from {\sf /etc/rc} (or {\sf /etc/rc.local}) using the
command:\\ {\tt echo~"$<$modem\_settings$>$"~$>$~/dev/ttys?}

\begin{question} How do I set parameters like parity for serial
login?\end{question}
\answer Use {\tt stty} and redirect output to serial line. ex:\\ {\tt
stty~parodd~$>$~/dev/ttys2}\\ which gives ttys2 odd parity. type {\tt
stty} by itself to get an idea of possible parameters. Or {\tt man~stty} as
well :)

%---------------------------------------------------------------------
\section{More hints}\label{morehints}

This part is recent and try to keep track of the different information
that appeared in {\tt comp.os.linux} and on the list since beginning of
March. I tried to update it for v0.96, so there might be some
mistakes. Moreover take care to use the correct library and include
stuff, and the ad-hoc gcc you use !!!

\begin{question} How can I backup my Hd under Linux?\end{question}
\answer I know at least two ways. One possibility is {\tt tar} and
{\tt mtools}, another possibility is the diskbackup/diskrestore of
Diamano Bolla (digest37 vol.\#2) which saves big hd to floppies using
the stdin/stdout. These utilities have been uploaded to the major
sites in file {\sf disksplit.tar.Z}. An example usage (Roger Binns)
is:\\ {\tt tar~cvf~-~bin~dev~usr~etc~..~|~compress~|~diskbackup}\\ and
to restore:\\ {\tt diskrestore~|~uncompress~|~tar~xvf~-}

BTW: Don't use the previous version (digest44 vol.\#1) with 0.95a

\begin{question} Where is `which'?\end{question}
\answer It depends on the {\sf sh} you are running: in {\sf bash}:
{\tt type~-path}, in {\sf tcsh} it's a builtin\\
for {\sf ash} and {\sf rc} you can try the following (untested by me)
script from Kevin Brown:
\begin{verbatim}
\#!/bin/sh
for i in `echo $PATH | sed 's/:/ /g'` ; do
  for j in ""$@" ; do
        if test -x "$i/$j" ; then
           echo "$i/$j"
         fi
  done
done
\end{verbatim}

\begin{question} How to use setterm: for the novice?\end{question}
\answer The {\tt setterm} utility provides access to most of Virtual
Consoles (VCs) functionality.  You can set your screen up to blank at
10 minutes using:\\ {\tt setterm~-blank~10}\\ You can set colors, and
clear the screen. For a full list of commands, just type {\tt setterm}
with no arguments.\\ There are a few tricks with the screen dumper can
really make VCs go a long way.  Here are a few of the common ones that
I use:\\ {\tt setterm~dump}\\ Dumps the contents of the current VC to
{\sf screen.dump} (in the current dir).\\ {\tt setterm dump 4}\\ Dumps
the contents of VC 4 to {\sf screen.dump}\\ {\tt
setterm~-file~mydumpfile~-dump~4}\\ Dump the contents of VC 4 to the
file {\sf mydumpfile}\\ {\tt setterm~-file~/dev/tty0~-dump~4}\\ Dumps
the contents of VC 4 to the current VC.\\{\tt
setterm~-file~/dev/tty4~-dump}\\ Dumps the contents of the current VC
to VC 4.\\ {\tt setterm~-file~/dev/ttys1~-dump}\\ Dumps the contents
of the current VC to the serial port. Handy if you are logged on and
want to paste a screen full without having to resort to doing a file
transfer.\\ {\tt setterm~-file~mydumpfile~-append~4}\\ Appends to
instead of overwriting the dump file.  Useful if you have several
screens you wish to concatenate.

\begin{question} I've tried clear/reset which exist on most of unix
but it doesn't work, have I missed something?\end{question}
\answer {\tt setterm~-clear} or {\tt setterm~-reset} will solve your
missing.  For clear, you can also write a small script (which use the
cl: part of {\sf /etc/termcap} wrt your TERM), or use {\sf bash} where
ctrl-l will do it for you.

\begin{question} I know there are VC, but where is the setterm
stuff?\end{question}
\answer It's in the current distribution (i.e. on the images), the
source can be found in {\sf virtcons.tar.Z} at {\tt nic}.

\begin{question} I know there are shared libraries; does there exist
an easy way to check an executable for sharing?\end{question}
\answer (Josh Yelon \& HJ Lu)\\
(J.Y.) An executable which shares a library is linked with an
(ordinary, non-shared) ``stub'' version of the library. One of the
first thing this stub does (when the executable is run) is to ask the
kernel to load the (big) ``shared version'' of the library (which is
usually named {\sf /lib/lib.XX.XX}). The upshot of this is that in the
code for the stub (part of the executable), is the string
``/lib/lib.XX.XX''; which can be searched by using {\tt strings} or
{\tt grep}.\\
(HJ. L.) if you have gcc2.11a or later the shared image is changed to
{\sf /lib/libxxxx\_vyy\_zzz}. And you should better use {\tt nm} to
find {\sf \_\_shared\_lib} (nm failed on stripped executable). You can
also write a function for ``file'', which can even check the version
number ....\\
(Claude Morin) Finally, there exists at {\tt tsx-11} {\sf ldd.tar.Z} If you
follow the instructions, you will be able to type {\tt
ldd~$<$executable$>$} to List the Dynamic Dependencies of the
executables. In other words {\tt ldd} prints the name of the shared
libraries needed by the executable, nothing appears for static one.
Notice that {\tt ldd} does not work for executables linked before the
installation of {\sf ldd}.

\begin{question} What is the rdev program provided in the
images?\end{question}
\answer It's a program from Werner Almesberger of ETH. With no
argument it prints the first line of {\sf /etc/mtab}. With one
argument, a boot-image, it prints the device configured as the root
device, and with two arguments, a boot image and a device, it sets the
device as default root in the specified image.

\begin{question} How to start Linux from drive B?\end{question}
\answer There is a DOS utility called {\sf boot\_b.exe} (look at DOS
ftp). Another simple way is to open the box and invert the cables.

\begin{question} The program boot\_b works fine \em but \em once the
first disk is read the system go back to the first drive, any
hints?\end{question}
\answer Yes, change the bootimage in just the same way that you change
it to boot on the hard drive, execept that the major/minor pair is
different. All these information are in the file {\sf INSTALL-0.10}.
Remember that if you use a sun or other endian machine, you will need
to reverse the byte order when you run the filter program (also in the
same file).

\begin{question} How can I get Linux to boot directly from the
harddisk?\end{question}
\answer Right now, this can be done via the shoelace stuff or the
bootany package, or by the bootlin package from {\tt
coutand@imag.imag.fr}
If you choose shoelace \em please \em do read the next Q/A (and also
the {\sf README} provided with the shoelace stuff)

\begin{question} I use shoelace, but I want to change my root
partition, what is the process to get rid of it?\end{question}
\answer With Norton utility you can put back a standard boot sector.
Another possibility is to restore the old boot sector (the one you
should have backup \em before \em installing shoelace).

\begin{question} Sometimes, when I want to remove a directory, I get
an error message, is it a (known) bug?\end{question}
\answer No, There is no bug at all, you probaly have another shell on
another VC whose working directory is either the one you try to
remove, either a subdirectory of it.

\begin{question} I've seen the login but I missed the passwd binaries,
where can I find them?\end{question}
\answer You should find it in {\sf shadow.tar.Z} (only sources), at
least at {\tt tsx-11} in the {\sf usr.bin} directory. Many people have reported
some troubles with the \em OLD \em shadow-passwd ({\sf
shadow-bin.tar.Z} and {\sf shadow-src.tar.Z}, so do not use them
anymore); an alternative might be the mcc-interim which contains
standard passwd binary. There is also the Peter Orbaek's {\sf
admutil-1.?.tar.Z} which contains source for {\tt shutdown}, {\tt su},
{\tt chsh}, {\tt passwd} and a system V {\sf init} compatible.

\begin{question} How can I setup a user account other than
root?\end{question}
\answer You can either use the {\tt adduser} program, either do it
manually. In the later case, you have to:
\begin{enumerate}
\item edit {\sf /etc/passwd} as root and add a line of the following
format:\\ {\tt user:passwd:uid:gid:user name:home directory:login
shell}\\ {\tt user} is the login name; {\tt uid} is the numeric user
id, it should be unique; {\tt gid} is the numeric group id, this
number should correspond to an entry in {\sf /etc/group}. The {\tt
passwd} field should be left blank because it is stored in an
encrypted form [to set this field just use the passwd program].
example\\ {\tt faq::200:5:Marc-Michel:/home/faq:/bin/sh}
\item Still as root, you should now create the home directory and set the
correct ownership.
\begin{verbatim}
mkdir /home/faq
chown faq /home/faq
chgrp 5 /home/faq
\end{verbatim}
\end{enumerate}

\begin{question} I've been trying to get Linux to run on my [3/4]86
box. It can't even boot. Any suggestions?\end{question}

\answer The most common error/problem is writing the bootimage to a
low density disk. It fits, but the bootstrap code will only recognize
high density disk. So try to format explicitely disk as high
density:\\
--- for 3.5'',  {\tt format~a:~/n:18~/t:80}
--- for 5.25'', {\tt format~a:~/n:15~/t:80}

\begin{question} Does there exist games, languages (other than C), and
anything which make the system more friendly?\end{question}
\answer Yes, among other things there are rogue and yahtzee; TeX;
Prolog, Perl.. but in general, if you want some extra tool port it to
Linux (this is also a good beta-testing exercise).

\begin{question} Does emacs handle the arrows-key \end{question}
\answer Yes it does, one simple way is to put some elisp code in your
{\sf .emacs}, this is an except of mine:
\begin{verbatim}
(global-unset-key "\e[")
(setq esc-c-map(make-keymap))
(fset 'esc-c-prefix esc-c-map)
(define-key global-map "\e[" 'esc-c-prefix)
(define-key global-map "\e[B" 'next-line)
(define-key global-map "\e[A" 'previous-line)
(define-key global-map "\e[C" 'forward-char)
(define-key global-map "\e[D" 'backward-char)
\end{verbatim}
The keycode (A, B etc..) was obtained by \^\ Q followed by the
appropriate key.

\begin{question} Whenever I use uemacs 3.1X on a symlink, the symlink
does not exist anymore, why?\end{question}
\answer (Tristram Mabbs)\\ Since ue3.10, uemacs uses `safe save'
mode, writing the file to a temporary and moving it OVER the original.
In the process, this deletes the original. To prevent this just add
the following in your emacs {\sf .rc} file: {\tt set~\$ssave~FALSE}

\begin{question} Uemacs doesn't work anymore with 0.95a, whenever I
want to save a file; what can I do?\end{question}
\answer \^\ S and \^\ Q are used for flow control. One solution is
\^\ X\^\ W followed by the filename, or M-X save-file, try also \^\ XS
it could work for some version (not mine). Another possibility, if you
have downloaded the {\sf stty.tar.Z} file, is to do {\tt stty~-IXON}
before you first use uemacs (this can be included in your {\sf
.profile}). And the last is to recompile the Peter Orbaek {\sf
init-1.2} package.

\begin{question} I have an SVGA, but Linux detect an EGAc/EGAm; is it
normal?\end{question}
\answer (Jim Winstead)\\ This is correct actually. You have an EGA+
card (SVGA) with a Color/Mono monitor. The only four possibilties are
EGAc, EGAm, *MDA and *CGA (according to the code in
{\sf kernel/chr\_drv/console.c}).\\
The true test, if Linux detects your video card, is if you press
$<$RETURN$>$ at the "Press $<$RETURN$>$ to see SVGA- ..." boot-time message.
If you have a SVGA recognized card, it will ask you to choose a screen
size. If not detected, the default is 80x50 mode. \\BTW if you have no
SVGA, press the $<$space$>$ and you are in 80x25 mode.

\begin{question} How can I change the keyboard repeat
rate?\end{question}
\answer (Michael K. Johnson)\\ In {\sf boot/setup.S} there are the
lines:
\begin{verbatim}
! set the keyboard repeat rate to max
        mov     ax,\#0x0305
        mov     bx,0x0000
        int     0x16
\end{verbatim}
If you don't want to change the repeat rate at all, just comment out
these lines. If you want something in the middle, change the
\begin{verbatim}        mov     bx,0x000
\end{verbatim}
by
\begin{verbatim}        mov     bx,0x??yy
\end{verbatim}
where {\tt ??yy} is determined by (Ralf Brown's interrupt list)\\ {\tt
bh=~delay~value~(0x00~=~250ms~to~0x03=~1000ms~(one~sec))}\\ this is
the delay before the repeat is performed\\ {\tt
bl=~repeat~rate~(0x00~=30/sec~to~0x1f=2/sec;~0x0c=10/sec~[default])}

\begin{question} I compiled fdformat.c and ran it on 1.44Mb and 1.2Mb,
the results are unreadable, any clue?\end{question}
\answer (M. Pereckas)\\ {\tt fdformat} only low-level formats the
disk. To use the fdformatted disk with the DOS filesystem, run {\tt
mformat} on the disk. Mformat writes DOS filesystem information but is
unable to low-format :). In order to put a Linux filesystem on a
(low)formatted disk you have to {\tt mkfs} it.

\begin{question} Is it possible to disable the 3-fingers salute
(ctrl-alt-del)?\end{question}
\answer Yes, in {\sf kernel/sys.c} you can read the following:
\begin{verbatim}
/*
 * this indicates whether you can reboot with ctrl-alt-del: the default is yes
 */
static int C\_A\_D = 1;
\end{verbatim} there is also a small utility written by Linus in
digest242 vol\#2

\begin{question} Could some one explain the information provided at
boot-time?\end{question}
\answer (Jim Winstead Jr)\\ {\tt
$>$serial~port~at~0x03f8~is~a~16450}\\ {\tt $>$serial port at 0x02f8
is a 16450 (what's that the uart chip?)}\\ Right, the last number
should either be 8250, 16450, 16550, or 16550a, and on the two 16550
models, it will report that FIFO's have been disable (16550) or
enabled (16550a).\\ {\tt $>$8~virtual~consoles (that's how many
alt-F's I can get going?}\\ {\tt $>$ but only F1-4 actually work)}\\
You can get sessions running on Alt-F[1-8], but the `standard' {\sf
/etc/inittab} only runs {\sf getty/login} on Alt-F[1-4].  You can
start sessions on the other consoles by using `doshell' or adding
lines to {\sf /etc/inittab}.\\ {\tt $>$ 4~pty's (are these the
consoles F1-4~?)}\\ No, those are `psuedo' ttys, which programs like
MGR use to simulate tty connections.  That's probably a gross
over-simplification, but it gives you the general idea, I think.  :)\\
{\tt $>$ p\_init:~lp1~exists~(0) (is that the (l)ine (p)rinter?)}\\
Right.

%-----------------end of second part of faq.tex-----------------------
Newsgroups: comp.os.linux