Compare commits
22 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
801837e2de | ||
|
|
9afa2418d8 | ||
|
|
886c253793 | ||
|
|
da29a8a271 | ||
|
|
ddf8a3aa4d | ||
|
|
126b31d3d0 | ||
|
|
784af12074 | ||
|
|
ffa4d7423a | ||
|
|
90b72ba7a8 | ||
|
|
db2eb776cc | ||
|
|
2bf18b811f | ||
|
|
116fcea5be | ||
|
|
d991abdd34 | ||
|
|
dd9c147444 | ||
|
|
60a4f87b0b | ||
|
|
16a468ccec | ||
|
|
f55f1f3e52 | ||
|
|
47627954a0 | ||
|
|
72cab7a281 | ||
|
|
93a8d9f260 | ||
|
|
665ce9d4e1 | ||
|
|
3b3ea9dc32 |
|
|
@ -33,7 +33,7 @@ SUBDIR= add_route arp ash at awk \
|
|||
unstack update uud uue version vol wc \
|
||||
whereis which who write writeisofs fetch \
|
||||
xargs yacc yes zdump zmodem pkgin_cd \
|
||||
mktemp worldstone updateboot
|
||||
mktemp worldstone updateboot update_bootcfg
|
||||
|
||||
.if ${ARCH} == "i386"
|
||||
SUBDIR+= atnormalize dosread fdisk loadfont \
|
||||
|
|
|
|||
|
|
@ -29,6 +29,10 @@ BINDIR= /usr/bin
|
|||
LINKS+= ${BINDIR}/elvis ${BINDIR}/vi
|
||||
.endif
|
||||
|
||||
.if !exists(${BINDIR}/ex)
|
||||
LINKS+= ${BINDIR}/elvis ${BINDIR}/ex
|
||||
.endif
|
||||
|
||||
MAN.elvis=
|
||||
MAN.ctags=
|
||||
MAN.ref=
|
||||
|
|
|
|||
|
|
@ -74,6 +74,34 @@ warn()
|
|||
echo -e "\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b ! $1"
|
||||
}
|
||||
|
||||
check_mbr()
|
||||
{
|
||||
# check for potential problems with old mbr.
|
||||
disk=`echo -n "/dev/$primary" | sed 's/p[0-3]//'`
|
||||
minix_primaries=`echo -n "" | fdisk "$disk" | grep "MINIX" | wc -l`
|
||||
if [ "$minix_primaries" -gt 1 ]
|
||||
then
|
||||
# old mbr + bootxx will not work with several partitions of
|
||||
# the same type.
|
||||
dd if=/usr/mdec/mbr of=temp_mbr_netbsd bs=1 count=440 2>/dev/null
|
||||
dd if="$disk" bs=1 count=440 2>/dev/null | cmp - temp_mbr_netbsd >/dev/null
|
||||
if [ "$?" -ne 0 ]
|
||||
then
|
||||
echo ""
|
||||
echo "Warning: you have MBR which doesn't support multiple MINIX 3 partitions!"
|
||||
echo "You will be able to boot from the first one only!"
|
||||
echo -n "Do you want to install new MBR into $disk? [Y] "
|
||||
read ok
|
||||
if [ "$ok" = Y -o "$ok" = y -o "$ok" = "" ]
|
||||
then
|
||||
installboot_nbsd -m "$disk" /usr/mdec/mbr >/dev/null
|
||||
fi
|
||||
fi
|
||||
rm temp_mbr_netbsd
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
# No options.
|
||||
while getopts '' opt; do usage; done
|
||||
shift `expr $OPTIND - 1`
|
||||
|
|
@ -323,13 +351,15 @@ echo " --- Step 4: Reinstall choice ------------------------------------------"
|
|||
echo "You have selected an existing MINIX 3 partition."
|
||||
echo "Type F for full installation (to overwrite entire partition)"
|
||||
echo "Type R for a reinstallation (existing /home will not be affected)"
|
||||
echo "Type B to reinstall/upgrade bootloader (no data affected)"
|
||||
echo ""
|
||||
echo -n "(F)ull or (R)einstall? [R] "
|
||||
echo -n "(F)ull, (R)einstall or (B)ootloader install? [R] "
|
||||
read conf
|
||||
case "$conf" in
|
||||
"") confirm="ok"; auto="r"; ;;
|
||||
[Rr]*) confirm="ok"; auto="r"; ;;
|
||||
[Ff]*) confirm="ok"; auto="" ;;
|
||||
[Bb]*) confirm="ok"; bootreinstall="ok" ;;
|
||||
esac
|
||||
|
||||
else echo ""
|
||||
|
|
@ -340,6 +370,184 @@ echo " --- Step 4: Reinstall choice ------------------------------------------"
|
|||
|
||||
done
|
||||
|
||||
if [ "$bootreinstall" = "ok" ]
|
||||
then
|
||||
echo ""
|
||||
echo " --- Step 5: Reinstall bootloader ----------------------------------"
|
||||
echo ""
|
||||
|
||||
echo "WARNING: This procedure uses your current /usr to store your /."
|
||||
echo "Once the procedure starts, it has to finish"
|
||||
echo "to restore your / partition. Please make sure it is not interrupted."
|
||||
echo ""
|
||||
|
||||
echo -n "It's recommended to run fsck before you continue, run? [Y/n] "
|
||||
read ok
|
||||
if [ "$ok" = "y" -o "$ok" = "Y" -o "$ok" = "" ]
|
||||
then
|
||||
fsck.mfs -a "/dev/$root" >/dev/null
|
||||
fsck.mfs -a "/dev/$usr" >/dev/null
|
||||
fi
|
||||
|
||||
# If there is no ELF stuff and not enough space after repartitioning,
|
||||
# user will fall into trouble. So at first copy new stuff.
|
||||
mount "/dev/$root" /mnt >/dev/null || exit
|
||||
|
||||
# grep, stat, etc in chroot
|
||||
mount "/dev/$usr" /mnt/usr >/dev/null || exit
|
||||
|
||||
cp -pf /bin/update_bootcfg /mnt/bin/ && \
|
||||
cp -pf /etc/boot.cfg.default /mnt/etc/ && \
|
||||
cp -pf /boot_monitor /mnt/ || exit
|
||||
|
||||
if [ ! -d /mnt/boot/minix_default -o ! -r /mnt/boot/minix_default/kernel ]
|
||||
then
|
||||
if [ -r /mnt/boot.cfg ]
|
||||
then
|
||||
echo ""
|
||||
echo "There is no /boot/minix_default/, but /boot.cfg exists."
|
||||
echo -n "Do you want to copy minix_default from CD? [Y/n] "
|
||||
else
|
||||
echo ""
|
||||
echo -n "There is no /boot/minix_default/, do you want to copy it from CD? [Y/n] "
|
||||
fi
|
||||
read ok
|
||||
if [ "$ok" = "y" -o "$ok" = "Y" -o "$ok" = "" ]
|
||||
then
|
||||
if [ -e /mnt/boot/minix_default ]
|
||||
then
|
||||
echo "Old /boot/minix_default moved to /boot/minix_default_old"
|
||||
mv /mnt/boot/minix_default /mnt/boot/minix_default_old
|
||||
fi
|
||||
|
||||
cp -rfp /boot/minix_default /mnt/boot/ || exit
|
||||
fi
|
||||
fi
|
||||
|
||||
echo " * Updating /boot.cfg"
|
||||
|
||||
chroot /mnt update_bootcfg
|
||||
|
||||
umount /mnt/usr && umount /mnt || exit
|
||||
|
||||
# Check if enough space for new boot
|
||||
let bootspace=`devsize /dev/$primary`-`devsize /dev/$root`-`devsize /dev/$home`-`devsize /dev/$usr` >/dev/null
|
||||
if [ $bootspace -lt $BOOTXXSECTS ]
|
||||
then
|
||||
echo ""
|
||||
echo "Root partition size will be reduced by up to 16Kb to fit new bootloader."
|
||||
echo "This is not a problem."
|
||||
|
||||
free_space=`df /dev/$root | awk '{print $3}' | tail -n 1`
|
||||
# round 16 => 20
|
||||
if [ "$free_space" -le 20 ]
|
||||
then
|
||||
echo ""
|
||||
echo "Not enough space on /dev/$root, you need at least 20Kb to use new bootloader!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ROOTSECTS=`expr \`devsize /dev/$root\` - $BOOTXXSECTS + $bootspace`
|
||||
|
||||
free_space=`df /dev/$usr | awk '{print $3}' | tail -n 1`
|
||||
required_space=`df /dev/$root | awk '{print $4}' | tail -n 1`
|
||||
|
||||
if [ "$required_space" -gt "$free_space" ]
|
||||
then
|
||||
echo ""
|
||||
echo "You don't have enough free space on /dev/$usr to backup /dev/$root!"
|
||||
echo "${free_space}Kb available, ${required_space} required."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir /mnt/root && mkdir /mnt/usr || exit
|
||||
|
||||
echo "Re-mounting your current / and /usr"
|
||||
|
||||
mount "/dev/$root" /mnt/root || exit
|
||||
mount "/dev/$usr" /mnt/usr || exit
|
||||
|
||||
mkdir /mnt/usr/tmp/root_backup || exit
|
||||
|
||||
echo " * Copying / contents"
|
||||
|
||||
cp -rfp /mnt/root/* /mnt/usr/tmp/root_backup
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo ""
|
||||
echo "Failed to backup root partition, aborting!"
|
||||
rm -rf /mnt/usr/tmp/root_backup
|
||||
# umount shouldn't fail here, but if it will, next
|
||||
# "rm -rf" will serve for user's pleasure.
|
||||
umount /mnt/root >/dev/null || exit
|
||||
umount /mnt/usr >/dev/null || exit
|
||||
rm -rf /mnt/root /mnt/usr
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo " * Copying done"
|
||||
|
||||
umount /mnt/root
|
||||
umount /mnt/usr
|
||||
|
||||
add_subpart=""
|
||||
minix_subparts=`echo -n "" | fdisk /dev/$primary | grep "MINIX" | wc -l`
|
||||
if [ "$minix_subparts" -gt 3 ]
|
||||
then
|
||||
echo ""
|
||||
echo "You have additional subpartition except /, /usr and /home."
|
||||
echo "Partition type will be set to MINIX (81), you can change it later using part."
|
||||
echo -n "Do you want to continue? [Y/n] "
|
||||
read ok
|
||||
[ "$ok" = "n" -o "$ok" = "N" ] && exit
|
||||
add_subpart="81:exist"
|
||||
fi
|
||||
|
||||
echo " * Repartitioning"
|
||||
|
||||
partition /dev/$primary $BOOTXXSECTS 81:${ROOTSECTS}* 81:exist 81:exist $add_subpart || exit
|
||||
|
||||
echo " * mkfs on new /"
|
||||
|
||||
mkfs.mfs "/dev/$root" || exit
|
||||
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo "Failed to repartition /dev/$primary"
|
||||
rmdir /mnt/root
|
||||
rmdir /mnt/usr
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mount "/dev/$usr" /mnt/usr || exit
|
||||
mount "/dev/$root" /mnt/root || exit
|
||||
|
||||
echo " * Filling new / filesystem"
|
||||
|
||||
mv /mnt/usr/tmp/root_backup/* /mnt/root/ || exit
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo "Failed to copy old root data! It is in /tmp/root_backup/"
|
||||
fi
|
||||
|
||||
rmdir /mnt/usr/tmp/root_backup/
|
||||
|
||||
umount /mnt/root
|
||||
umount /mnt/usr
|
||||
fi
|
||||
|
||||
check_mbr
|
||||
installboot_nbsd -f /dev/$primary /usr/mdec/bootxx_minixfs3 >/dev/null || exit 1
|
||||
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo "Warning: failed to remove /tmp/root_backup!"
|
||||
fi
|
||||
|
||||
echo "New boot installed successfully! You can reboot now."
|
||||
exit
|
||||
fi
|
||||
|
||||
rmdir $TMPMP
|
||||
|
||||
nohome="0"
|
||||
|
|
@ -456,29 +664,7 @@ blocksizebytes="`expr $blocksize '*' 1024`"
|
|||
|
||||
bootsectors=$BOOTXXSECTS
|
||||
|
||||
# check for potential problems with old mbr.
|
||||
# space for bootxx has been checked earlier.
|
||||
minix_primaries=`echo -n "" | fdisk /dev/$primary | grep "MINIX" | wc -l`
|
||||
if [ "$minix_primaries" -gt 1 ]
|
||||
then
|
||||
# old mbr + bootxx will not work with several partitions of
|
||||
# the same type.
|
||||
disk=`echo -n "/dev/$primary" | sed 's/p[0-3]//'`
|
||||
dd if=/usr/mdec/mbr of=temp_mbr_netbsd bs=1 count=440 2>/dev/null
|
||||
dd if="$disk" bs=1 count=440 | cmp - temp_mbr_netbsd >/dev/null
|
||||
if [ "$?" -ne 0 ]
|
||||
then
|
||||
echo "Warning: you have MBR which doesn't support multiple MINIX 3 partitions!"
|
||||
echo "You will be able to boot from the first one only!"
|
||||
echo -n "Do you want to install new MBR into $disk? [Y] "
|
||||
read ok
|
||||
if [ "$ok" = Y -o "$ok" = y -o "$ok" = "" ]
|
||||
then
|
||||
installboot_nbsd -m "$disk" /usr/mdec/mbr >/dev/null
|
||||
fi
|
||||
fi
|
||||
rm temp_mbr_netbsd
|
||||
fi
|
||||
check_mbr
|
||||
|
||||
echo "
|
||||
You have selected to (re)install MINIX 3 in the partition /dev/$primary.
|
||||
|
|
|
|||
5
commands/update_bootcfg/Makefile
Normal file
5
commands/update_bootcfg/Makefile
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
SCRIPTS= update_bootcfg.sh
|
||||
BINDIR= /bin
|
||||
MAN=
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
63
commands/update_bootcfg/update_bootcfg.sh
Executable file
63
commands/update_bootcfg/update_bootcfg.sh
Executable file
|
|
@ -0,0 +1,63 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
ROOT=`printroot -r`
|
||||
DEFAULTCFG=/etc/boot.cfg.default
|
||||
LOCALCFG=/etc/boot.cfg.local
|
||||
TMP=/boot.cfg.temp
|
||||
|
||||
filter_missing_entries()
|
||||
{
|
||||
while read line
|
||||
do
|
||||
if ! echo "$line" | grep -s -q 'multiboot'
|
||||
then
|
||||
echo "$line"
|
||||
continue
|
||||
fi
|
||||
|
||||
# Check if kernel presents
|
||||
kernel=`echo "$line" | sed -n 's/.*multiboot[[:space:]]*\(\/[^[:space:]]*\).*/\1/p'`
|
||||
if [ ! -r "$kernel" ]
|
||||
then
|
||||
echo "Warning: config contains entry for \"$kernel\" which is missing! Entry skipped." 1>&2
|
||||
else
|
||||
echo "$line"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
if [ ! -b "$ROOT" ]
|
||||
then
|
||||
echo root device $ROOT not found
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rootdevname=`echo $ROOT | sed 's/\/dev\///'`
|
||||
|
||||
if [ -r $DEFAULTCFG ]
|
||||
then
|
||||
default_cfg=`cat $DEFAULTCFG`
|
||||
# Substitute variables like $rootdevname
|
||||
echo "$default_cfg" | while read line; do eval echo \"$line\" | filter_missing_entries >> $TMP; done
|
||||
fi
|
||||
|
||||
if [ -e /boot/minix_latest -a -d /boot/minix_latest -o -h /boot/minix_latest ]
|
||||
then
|
||||
latest=`basename \`stat -f "%Y" /boot/minix_latest\``
|
||||
fi
|
||||
|
||||
[ -d /boot/minix ] && for i in `ls /boot/minix/`
|
||||
do
|
||||
build_name="`basename $i`"
|
||||
if [ "$build_name" != "$latest" ]
|
||||
then
|
||||
echo "menu=Start MINIX 3 ($build_name):load_mods $i/mod*;multiboot $i/kernel rootdevname=$rootdevname" >> /$TMP
|
||||
fi
|
||||
done
|
||||
|
||||
[ -r $LOCALCFG ] && cat $LOCALCFG | filter_missing_entries >> $TMP
|
||||
|
||||
mv $TMP /boot.cfg
|
||||
|
||||
sync
|
||||
|
|
@ -21,17 +21,6 @@
|
|||
#include "e1000_reg.h"
|
||||
#include "e1000_pci.h"
|
||||
|
||||
PRIVATE u16_t pcitab_e1000[] =
|
||||
{
|
||||
E1000_DEV_ID_82540EM,
|
||||
E1000_DEV_ID_82541GI_LF,
|
||||
E1000_DEV_ID_ICH10_D_BM_LM,
|
||||
E1000_DEV_ID_ICH10_R_BM_LF,
|
||||
E1000_DEV_ID_82574L,
|
||||
E1000_DEV_ID_82571EB_COPPER,
|
||||
0,
|
||||
};
|
||||
|
||||
PRIVATE int e1000_instance;
|
||||
PRIVATE e1000_t e1000_state;
|
||||
|
||||
|
|
@ -236,9 +225,10 @@ PRIVATE void e1000_init_pci()
|
|||
*===========================================================================*/
|
||||
PRIVATE int e1000_probe(e1000_t *e, int skip)
|
||||
{
|
||||
int i, r, devind;
|
||||
u16_t vid, did;
|
||||
int r, devind, ioflag;
|
||||
u16_t vid, did, cr;
|
||||
u32_t status[2];
|
||||
u32_t base, size;
|
||||
u32_t gfpreg, sector_base_addr;
|
||||
char *dname;
|
||||
|
||||
|
|
@ -256,24 +246,11 @@ PRIVATE int e1000_probe(e1000_t *e, int skip)
|
|||
{
|
||||
E1000_DEBUG(3, ("%s: probe() devind %d vid 0x%x did 0x%x\n",
|
||||
e->name, devind, vid, did));
|
||||
if (vid != 0x8086)
|
||||
goto get_next;
|
||||
|
||||
for (i = 0; pcitab_e1000[i] != 0; i++)
|
||||
{
|
||||
if (did != pcitab_e1000[i])
|
||||
continue;
|
||||
else
|
||||
if (!skip)
|
||||
break;
|
||||
}
|
||||
if (pcitab_e1000[i] != 0)
|
||||
{
|
||||
if (!skip)
|
||||
break;
|
||||
skip--;
|
||||
}
|
||||
skip--;
|
||||
|
||||
get_next:
|
||||
if (!(r = pci_next_dev(&devind, &vid, &did)))
|
||||
{
|
||||
return FALSE;
|
||||
|
|
@ -296,6 +273,7 @@ get_next:
|
|||
break;
|
||||
|
||||
case E1000_DEV_ID_82540EM:
|
||||
case E1000_DEV_ID_82545EM:
|
||||
e->eeprom_done_bit = (1 << 4);
|
||||
e->eeprom_addr_off = 8;
|
||||
break;
|
||||
|
|
@ -322,15 +300,26 @@ get_next:
|
|||
}
|
||||
/* Read PCI configuration. */
|
||||
e->irq = pci_attr_r8(devind, PCI_ILR);
|
||||
e->regs = vm_map_phys(SELF, (void *) pci_attr_r32(devind, PCI_BAR),
|
||||
0x20000);
|
||||
|
||||
/* Verify mapped registers. */
|
||||
|
||||
if ((r = pci_get_bar(devind, PCI_BAR, &base, &size, &ioflag)) != OK)
|
||||
panic("failed to get PCI BAR (%d)", r);
|
||||
if (ioflag) panic("PCI BAR is not for memory");
|
||||
|
||||
e->regs = vm_map_phys(SELF, (void *) base, size);
|
||||
if (e->regs == (u8_t *) -1) {
|
||||
panic("failed to map hardware registers from PCI");
|
||||
}
|
||||
|
||||
/* FIXME: enable DMA bus mastering if necessary. This is disabled by
|
||||
* default on VMware. Eventually, the PCI driver should deal with this.
|
||||
*/
|
||||
cr = pci_attr_r16(devind, PCI_CR);
|
||||
if (!(cr & PCI_CR_MAST_EN))
|
||||
pci_attr_w16(devind, PCI_CR, cr | PCI_CR_MAST_EN);
|
||||
|
||||
/* Optionally map flash memory. */
|
||||
if (did != E1000_DEV_ID_82540EM &&
|
||||
did != E1000_DEV_ID_82545EM &&
|
||||
did != E1000_DEV_ID_82540EP &&
|
||||
pci_attr_r32(devind, PCI_BAR_2))
|
||||
{
|
||||
|
|
@ -556,7 +545,7 @@ e1000_t *e;
|
|||
panic("failed to allocate TX buffers");
|
||||
}
|
||||
/* Setup transmit descriptors. */
|
||||
for (i = 0; i < E1000_RXDESC_NR; i++)
|
||||
for (i = 0; i < E1000_TXDESC_NR; i++)
|
||||
{
|
||||
e->tx_desc[i].buffer = tx_buff_p + (i * E1000_IOBUF_SIZE);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ service e1000
|
|||
DEVIO # 21
|
||||
;
|
||||
pci device 8086/100e;
|
||||
pci device 8086/100f;
|
||||
pci device 8086/107c;
|
||||
pci device 8086/10cd;
|
||||
pci device 8086/10d3;
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
#define E1000_DEV_ID_82544GC_COPPER 0x100C
|
||||
#define E1000_DEV_ID_82544GC_LOM 0x100D
|
||||
#define E1000_DEV_ID_82540EM 0x100E
|
||||
#define E1000_DEV_ID_82545EM 0x100F
|
||||
#define E1000_DEV_ID_82540EM_LOM 0x1015
|
||||
#define E1000_DEV_ID_82540EP_LOM 0x1016
|
||||
#define E1000_DEV_ID_82540EP 0x1017
|
||||
|
|
|
|||
|
|
@ -133,6 +133,7 @@ struct pci_device pci_device_table[]=
|
|||
{ 0x5333, 0x8a01, "S3 Virge/DX or /GX" },
|
||||
{ 0x8086, 0x1004, "Intel 82543GC Gigabit Ethernet Controller" },
|
||||
{ 0x8086, 0x100E, "Intel PRO/1000 MT Desktop Adapter" },
|
||||
{ 0x8086, 0x100F, "Intel PRO/1000 MT 82545EM" },
|
||||
{ 0x8086, 0x1029, "Intel EtherExpressPro100 ID1029" },
|
||||
{ 0x8086, 0x1030, "Intel Corporation 82559 InBusiness 10/100" },
|
||||
{ 0x8086, 0x1031, "Intel Corporation 82801CAM PRO/100 VE" },
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
/* Minix release and version numbers. */
|
||||
#define OS_RELEASE "3"
|
||||
#define OS_VERSION "2.0"
|
||||
#define OS_VERSION "2.0a"
|
||||
|
||||
/* This file sets configuration parameters for the MINIX kernel, FS, and PM.
|
||||
* It is divided up into two main sections. The first section contains
|
||||
|
|
|
|||
|
|
@ -364,3 +364,13 @@ PUBLIC short cpu_load(void)
|
|||
*last_idle = *current_idle;
|
||||
return load;
|
||||
}
|
||||
|
||||
PUBLIC void busy_delay_ms(int ms)
|
||||
{
|
||||
u64_t cycles = ms_2_cpu_time(ms), tsc0, tsc, tsc1;
|
||||
read_tsc_64(&tsc0);
|
||||
tsc1 = tsc0 + cycles;
|
||||
do { read_tsc_64(&tsc); } while(tsc < tsc1);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -63,6 +63,62 @@ PUBLIC __dead void arch_monitor(void)
|
|||
monitor();
|
||||
}
|
||||
|
||||
#define KBCMDP 4 /* kbd controller port (O) */
|
||||
#define KBC_PULSE0 0xfe /* pulse output bit 0 */
|
||||
#define IO_KBD 0x060 /* 8042 Keyboard */
|
||||
|
||||
void
|
||||
reset(void)
|
||||
{
|
||||
uint8_t b;
|
||||
/*
|
||||
* The keyboard controller has 4 random output pins, one of which is
|
||||
* connected to the RESET pin on the CPU in many PCs. We tell the
|
||||
* keyboard controller to pulse this line a couple of times.
|
||||
*/
|
||||
outb(IO_KBD + KBCMDP, KBC_PULSE0);
|
||||
busy_delay_ms(100);
|
||||
outb(IO_KBD + KBCMDP, KBC_PULSE0);
|
||||
busy_delay_ms(100);
|
||||
|
||||
/*
|
||||
* Attempt to force a reset via the Reset Control register at
|
||||
* I/O port 0xcf9. Bit 2 forces a system reset when it
|
||||
* transitions from 0 to 1. Bit 1 selects the type of reset
|
||||
* to attempt: 0 selects a "soft" reset, and 1 selects a
|
||||
* "hard" reset. We try a "hard" reset. The first write sets
|
||||
* bit 1 to select a "hard" reset and clears bit 2. The
|
||||
* second write forces a 0 -> 1 transition in bit 2 to trigger
|
||||
* a reset.
|
||||
*/
|
||||
outb(0xcf9, 0x2);
|
||||
outb(0xcf9, 0x6);
|
||||
busy_delay_ms(500); /* wait 0.5 sec to see if that did it */
|
||||
|
||||
/*
|
||||
* Attempt to force a reset via the Fast A20 and Init register
|
||||
* at I/O port 0x92. Bit 1 serves as an alternate A20 gate.
|
||||
* Bit 0 asserts INIT# when set to 1. We are careful to only
|
||||
* preserve bit 1 while setting bit 0. We also must clear bit
|
||||
* 0 before setting it if it isn't already clear.
|
||||
*/
|
||||
b = inb(0x92);
|
||||
if (b != 0xff) {
|
||||
if ((b & 0x1) != 0)
|
||||
outb(0x92, b & 0xfe);
|
||||
outb(0x92, b | 0x1);
|
||||
busy_delay_ms(500); /* wait 0.5 sec to see if that did it */
|
||||
}
|
||||
|
||||
/* Triple fault */
|
||||
x86_triplefault();
|
||||
|
||||
/* Give up on resetting */
|
||||
while(1) {
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE __dead void arch_bios_poweroff(void)
|
||||
{
|
||||
u32_t cr0;
|
||||
|
|
@ -218,36 +274,35 @@ PUBLIC void fpu_init(void)
|
|||
}
|
||||
}
|
||||
|
||||
PUBLIC void save_local_fpu(struct proc *pr)
|
||||
PUBLIC void save_local_fpu(struct proc *pr, int retain)
|
||||
{
|
||||
/* Save process FPU context. If the 'retain' flag is set, keep the FPU
|
||||
* state as is. If the flag is not set, the state is undefined upon
|
||||
* return, and the caller is responsible for reloading a proper state.
|
||||
*/
|
||||
|
||||
if(!is_fpu())
|
||||
return;
|
||||
|
||||
/* Save changed FPU context. */
|
||||
if(osfxsr_feature) {
|
||||
fxsave(pr->p_fpu_state.fpu_save_area_p);
|
||||
fninit();
|
||||
} else {
|
||||
fnsave(pr->p_fpu_state.fpu_save_area_p);
|
||||
if (retain)
|
||||
(void) frstor(pr->p_fpu_state.fpu_save_area_p);
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC void save_fpu(struct proc *pr)
|
||||
{
|
||||
#ifdef CONFIG_SMP
|
||||
if (cpuid == pr->p_cpu) {
|
||||
if (get_cpulocal_var(fpu_owner) == pr) {
|
||||
disable_fpu_exception();
|
||||
save_local_fpu(pr);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (cpuid != pr->p_cpu) {
|
||||
int stopped;
|
||||
|
||||
/* remember if the process was already stopped */
|
||||
stopped = RTS_ISSET(pr, RTS_PROC_STOP);
|
||||
|
||||
/* stop the remote process and force it's context to be saved */
|
||||
/* stop the remote process and force its context to be saved */
|
||||
smp_schedule_stop_proc_save_ctx(pr);
|
||||
|
||||
/*
|
||||
|
|
@ -257,27 +312,35 @@ PUBLIC void save_fpu(struct proc *pr)
|
|||
*/
|
||||
if (!stopped)
|
||||
RTS_UNSET(pr, RTS_PROC_STOP);
|
||||
}
|
||||
#else
|
||||
if (get_cpulocal_var(fpu_owner) == pr) {
|
||||
disable_fpu_exception();
|
||||
save_local_fpu(pr);
|
||||
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (get_cpulocal_var(fpu_owner) == pr) {
|
||||
disable_fpu_exception();
|
||||
save_local_fpu(pr, TRUE /*retain*/);
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC void restore_fpu(struct proc *pr)
|
||||
PUBLIC int restore_fpu(struct proc *pr)
|
||||
{
|
||||
int failed;
|
||||
|
||||
if(!proc_used_fpu(pr)) {
|
||||
fninit();
|
||||
pr->p_misc_flags |= MF_FPU_INITIALIZED;
|
||||
} else {
|
||||
if(osfxsr_feature) {
|
||||
fxrstor(pr->p_fpu_state.fpu_save_area_p);
|
||||
failed = fxrstor(pr->p_fpu_state.fpu_save_area_p);
|
||||
} else {
|
||||
frstor(pr->p_fpu_state.fpu_save_area_p);
|
||||
failed = frstor(pr->p_fpu_state.fpu_save_area_p);
|
||||
}
|
||||
|
||||
if (failed) return EINVAL;
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
PUBLIC void cpu_identify(void)
|
||||
|
|
@ -609,31 +672,9 @@ u32_t params_size, params_offset, mon_ds;
|
|||
|
||||
PUBLIC int arch_get_params(char *params, int maxsize)
|
||||
{
|
||||
int size = 0;
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
/*
|
||||
* FIXME
|
||||
* This is a TEMPORARY change until we can pass boot
|
||||
* command line to multiboot kernels from the boot
|
||||
* monitor
|
||||
*
|
||||
* '\0' separated list of command line options
|
||||
*/
|
||||
char cmdline[] = "no_apic=0\0acpi=1";
|
||||
|
||||
if (maxsize < sizeof(cmdline) - 1)
|
||||
panic("cmdline (%d) exceeds maxsize (%d)",
|
||||
sizeof(cmdline), maxsize);
|
||||
memcpy(params, cmdline, sizeof(cmdline));
|
||||
size = sizeof(cmdline);
|
||||
params[size+1] = '\0';
|
||||
#endif
|
||||
|
||||
phys_copy(seg2phys(mon_ds) + params_offset, vir2phys(params + size),
|
||||
MIN(maxsize - size, params_size));
|
||||
phys_copy(seg2phys(mon_ds) + params_offset, vir2phys(params),
|
||||
MIN(maxsize, params_size));
|
||||
params[maxsize-1] = '\0';
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -224,6 +224,17 @@ PUBLIC void exception_handler(int is_nested, struct exception_frame * frame)
|
|||
panic("Copy involving a user pointer failed unexpectedly!");
|
||||
}
|
||||
}
|
||||
|
||||
/* Pass any error resulting from restoring FPU state, as a FPU
|
||||
* exception to the process.
|
||||
*/
|
||||
if (((void*)frame->eip >= (void*)fxrstor &&
|
||||
(void *)frame->eip <= (void*)__fxrstor_end) ||
|
||||
((void*)frame->eip >= (void*)frstor &&
|
||||
(void *)frame->eip <= (void*)__frstor_end)) {
|
||||
frame->eip = (reg_t) __frstor_failure;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if(frame->vector == PAGE_FAULT_VECTOR) {
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@ _PROTOTYPE( void exception, (struct exception_frame * frame));
|
|||
/* klib386.s */
|
||||
_PROTOTYPE( __dead void monitor, (void) );
|
||||
_PROTOTYPE( __dead void reset, (void) );
|
||||
_PROTOTYPE( __dead void x86_triplefault, (void) );
|
||||
_PROTOTYPE( void int86, (void) );
|
||||
_PROTOTYPE( reg_t read_cr0, (void) );
|
||||
_PROTOTYPE( reg_t read_cr2, (void) );
|
||||
|
|
@ -98,8 +99,11 @@ _PROTOTYPE( void fninit, (void));
|
|||
_PROTOTYPE( void clts, (void));
|
||||
_PROTOTYPE( void fxsave, (void *));
|
||||
_PROTOTYPE( void fnsave, (void *));
|
||||
_PROTOTYPE( void fxrstor, (void *));
|
||||
_PROTOTYPE( void frstor, (void *));
|
||||
_PROTOTYPE( int fxrstor, (void *));
|
||||
_PROTOTYPE( int __fxrstor_end, (void *));
|
||||
_PROTOTYPE( int frstor, (void *));
|
||||
_PROTOTYPE( int __frstor_end, (void *));
|
||||
_PROTOTYPE( int __frstor_failure, (void *));
|
||||
_PROTOTYPE( unsigned short fnstsw, (void));
|
||||
_PROTOTYPE( void fnstcw, (unsigned short* cw));
|
||||
|
||||
|
|
|
|||
|
|
@ -499,13 +499,13 @@ ENTRY(mem_rdw)
|
|||
|
||||
|
||||
/*===========================================================================*/
|
||||
/* reset */
|
||||
/* x86_triplefault */
|
||||
/*===========================================================================*/
|
||||
/*
|
||||
* PUBLIC void reset();
|
||||
* PUBLIC void x86_triplefault();
|
||||
* Reset the system by loading IDT with offset 0 and interrupting.
|
||||
*/
|
||||
ENTRY(reset)
|
||||
ENTRY(x86_triplefault)
|
||||
lidt idt_zero
|
||||
int $3 /* anything goes, the 386 will not like it */
|
||||
.data
|
||||
|
|
@ -608,21 +608,29 @@ ENTRY(fnsave)
|
|||
ret
|
||||
|
||||
/*===========================================================================*/
|
||||
/* fxrstor */
|
||||
/* fxrstor */
|
||||
/*===========================================================================*/
|
||||
ENTRY(fxrstor)
|
||||
mov 4(%esp), %eax
|
||||
fxrstor (%eax) /* Do not change the operand! (gas2ack) */
|
||||
fxrstor (%eax)
|
||||
ENTRY(__fxrstor_end)
|
||||
xor %eax, %eax
|
||||
ret
|
||||
|
||||
/*===========================================================================*/
|
||||
/* frstor */
|
||||
/* frstor */
|
||||
/*===========================================================================*/
|
||||
ENTRY(frstor)
|
||||
mov 4(%esp), %eax
|
||||
frstor (%eax) /* Do not change the operand! (gas2ack) */
|
||||
frstor (%eax)
|
||||
ENTRY(__frstor_end)
|
||||
xor %eax, %eax
|
||||
ret
|
||||
|
||||
/* Shared exception handler for both fxrstor and frstor. */
|
||||
ENTRY(__frstor_failure)
|
||||
mov $1, %eax
|
||||
ret
|
||||
|
||||
/*===========================================================================*/
|
||||
/* read_cr0 */
|
||||
|
|
|
|||
|
|
@ -540,7 +540,7 @@ PRIVATE void vm_suspend(struct proc *caller, const struct proc *target,
|
|||
*===========================================================================*/
|
||||
PUBLIC void delivermsg(struct proc *rp)
|
||||
{
|
||||
int r;
|
||||
int r = OK;
|
||||
|
||||
assert(rp->p_misc_flags & MF_DELIVERMSG);
|
||||
assert(rp->p_delivermsg.m_source != NONE);
|
||||
|
|
@ -553,13 +553,12 @@ PUBLIC void delivermsg(struct proc *rp)
|
|||
rp->p_name,
|
||||
rp->p_endpoint);
|
||||
r = EFAULT;
|
||||
} else {
|
||||
/* Indicate message has been delivered; address is 'used'. */
|
||||
rp->p_delivermsg.m_source = NONE;
|
||||
rp->p_misc_flags &= ~MF_DELIVERMSG;
|
||||
r = OK;
|
||||
}
|
||||
|
||||
/* Indicate message has been delivered; address is 'used'. */
|
||||
rp->p_delivermsg.m_source = NONE;
|
||||
rp->p_misc_flags &= ~MF_DELIVERMSG;
|
||||
|
||||
if(!(rp->p_misc_flags & MF_CONTEXT_SET)) {
|
||||
rp->p_reg.retreg = r;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -548,7 +548,9 @@ LABEL(copr_not_available)
|
|||
push %ebp
|
||||
mov $0, %ebp
|
||||
call _C_LABEL(context_stop)
|
||||
jmp _C_LABEL(copr_not_available_handler)
|
||||
call _C_LABEL(copr_not_available_handler)
|
||||
/* reached upon failure only */
|
||||
jmp _C_LABEL(switch_to_user)
|
||||
|
||||
copr_not_available_in_kernel:
|
||||
pushl $0
|
||||
|
|
|
|||
|
|
@ -316,7 +316,7 @@ PRIVATE void announce(void)
|
|||
#ifdef _VCS_REVISION
|
||||
"(" _VCS_REVISION ")\n"
|
||||
#endif
|
||||
"Copyright 2010, Vrije Universiteit, Amsterdam, The Netherlands\n",
|
||||
"Copyright 2012, Vrije Universiteit, Amsterdam, The Netherlands\n",
|
||||
OS_RELEASE, OS_VERSION);
|
||||
printf("MINIX is open source software, see http://www.minix3.org\n");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1878,14 +1878,22 @@ PUBLIC void copr_not_available_handler(void)
|
|||
local_fpu_owner = get_cpulocal_var_ptr(fpu_owner);
|
||||
if (*local_fpu_owner != NULL) {
|
||||
assert(*local_fpu_owner != p);
|
||||
save_local_fpu(*local_fpu_owner);
|
||||
save_local_fpu(*local_fpu_owner, FALSE /*retain*/);
|
||||
}
|
||||
|
||||
/*
|
||||
* restore the current process' state and let it run again, do not
|
||||
* schedule!
|
||||
*/
|
||||
restore_fpu(p);
|
||||
if (restore_fpu(p) != OK) {
|
||||
/* Restoring FPU state failed. This is always the process's own
|
||||
* fault. Send a signal, and schedule another process instead.
|
||||
*/
|
||||
*local_fpu_owner = NULL; /* release FPU */
|
||||
cause_sig(proc_nr(p), SIGFPE);
|
||||
return;
|
||||
}
|
||||
|
||||
*local_fpu_owner = p;
|
||||
context_stop(proc_addr(KERNEL));
|
||||
restore_user_context(p);
|
||||
|
|
|
|||
|
|
@ -32,9 +32,9 @@ _PROTOTYPE( void cycles_accounting_init, (void) );
|
|||
_PROTOTYPE( void context_stop, (struct proc * p) );
|
||||
/* this is a wrapper to make calling it from assembly easier */
|
||||
_PROTOTYPE( void context_stop_idle, (void) );
|
||||
_PROTOTYPE( void restore_fpu, (struct proc *) );
|
||||
_PROTOTYPE( int restore_fpu, (struct proc *) );
|
||||
_PROTOTYPE( void save_fpu, (struct proc *) );
|
||||
_PROTOTYPE( void save_local_fpu, (struct proc *) );
|
||||
_PROTOTYPE( void save_local_fpu, (struct proc *, int retain) );
|
||||
_PROTOTYPE( void fpu_sigcontext, (struct proc *, struct sigframe *fr, struct sigcontext *sc) );
|
||||
|
||||
/* main.c */
|
||||
|
|
@ -230,6 +230,7 @@ _PROTOTYPE(void disable_fpu_exception, (void));
|
|||
_PROTOTYPE(void release_fpu, (struct proc * p));
|
||||
_PROTOTYPE(void arch_pause,(void));
|
||||
_PROTOTYPE(short cpu_load, (void));
|
||||
_PROTOTYPE(void busy_delay_ms, (int ms));
|
||||
|
||||
/* utility.c */
|
||||
_PROTOTYPE( void cpu_print_freq, (unsigned cpu));
|
||||
|
|
|
|||
|
|
@ -168,12 +168,12 @@ PUBLIC void smp_sched_handler(void)
|
|||
RTS_SET(p, RTS_PROC_STOP);
|
||||
}
|
||||
if (flgs & SCHED_IPI_SAVE_CTX) {
|
||||
/* all context have been save already, FPU remains */
|
||||
/* all context has been saved already, FPU remains */
|
||||
if (proc_used_fpu(p) &&
|
||||
get_cpulocal_var(fpu_owner) == p) {
|
||||
disable_fpu_exception();
|
||||
save_local_fpu(p);
|
||||
/* we re preparing to migrate somewhere else */
|
||||
save_local_fpu(p, FALSE /*retain*/);
|
||||
/* we're preparing to migrate somewhere else */
|
||||
release_fpu(p);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,8 @@ FORWARD _PROTOTYPE(void adjust_proc_slot, (struct proc *rp,
|
|||
struct proc *from_rp));
|
||||
FORWARD _PROTOTYPE(void adjust_priv_slot, (struct priv *privp,
|
||||
struct priv *from_privp));
|
||||
FORWARD _PROTOTYPE(void swap_fpu_state, (struct proc *a_rp,
|
||||
struct proc *b_orig_rp, struct proc *b_copy_rp));
|
||||
FORWARD _PROTOTYPE(void swap_proc_slot_pointer, (struct proc **rpp,
|
||||
struct proc *src_rp, struct proc *dst_rp));
|
||||
|
||||
|
|
@ -109,6 +111,10 @@ PUBLIC int do_update(struct proc * caller, message * m_ptr)
|
|||
adjust_priv_slot(priv(src_rp), &orig_src_priv);
|
||||
adjust_priv_slot(priv(dst_rp), &orig_dst_priv);
|
||||
|
||||
/* Swap FPU state. Can only be done after adjusting the process slots. */
|
||||
swap_fpu_state(src_rp, dst_rp, &orig_dst_proc);
|
||||
swap_fpu_state(dst_rp, src_rp, &orig_src_proc);
|
||||
|
||||
/* Swap global process slot addresses. */
|
||||
swap_proc_slot_pointer(get_cpulocal_var_ptr(ptproc), src_rp, dst_rp);
|
||||
|
||||
|
|
@ -140,12 +146,13 @@ PUBLIC int do_update(struct proc * caller, message * m_ptr)
|
|||
*===========================================================================*/
|
||||
PRIVATE void adjust_proc_slot(struct proc *rp, struct proc *from_rp)
|
||||
{
|
||||
/* Preserve endpoints, slot numbers, priv structure, and IPC. */
|
||||
/* Preserve endpoints, slot numbers, priv structure, IPC, FPU pointer. */
|
||||
rp->p_endpoint = from_rp->p_endpoint;
|
||||
rp->p_nr = from_rp->p_nr;
|
||||
rp->p_priv = from_rp->p_priv;
|
||||
priv(rp)->s_proc_nr = from_rp->p_nr;
|
||||
rp->p_caller_q = from_rp->p_caller_q;
|
||||
rp->p_fpu_state.fpu_save_area_p = from_rp->p_fpu_state.fpu_save_area_p;
|
||||
|
||||
/* preserve scheduling */
|
||||
rp->p_scheduler = from_rp->p_scheduler;
|
||||
|
|
@ -169,6 +176,24 @@ PRIVATE void adjust_priv_slot(struct priv *privp, struct priv *from_privp)
|
|||
privp->s_alarm_timer = from_privp->s_alarm_timer;
|
||||
}
|
||||
|
||||
/*===========================================================================*
|
||||
* swap_fpu_state *
|
||||
*===========================================================================*/
|
||||
PRIVATE void swap_fpu_state(struct proc *a_rp, struct proc *b_orig_rp,
|
||||
struct proc *b_copy_rp)
|
||||
{
|
||||
/* Copy the FPU state from process B's copied slot, using B's original FPU
|
||||
* save area alignment, into process A's slot.
|
||||
*/
|
||||
int align;
|
||||
|
||||
align = (int) ((char *) b_orig_rp->p_fpu_state.fpu_save_area_p -
|
||||
(char *) &b_orig_rp->p_fpu_state.fpu_image);
|
||||
|
||||
memcpy(a_rp->p_fpu_state.fpu_save_area_p,
|
||||
b_copy_rp->p_fpu_state.fpu_image + align, FPU_XFP_SIZE);
|
||||
}
|
||||
|
||||
/*===========================================================================*
|
||||
* swap_proc_slot_pointer *
|
||||
*===========================================================================*/
|
||||
|
|
|
|||
|
|
@ -5,17 +5,6 @@
|
|||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#ifndef __NBSD_LIBC
|
||||
#include <minix/config.h>
|
||||
#include <minix/const.h>
|
||||
#include <minix/sysutil.h>
|
||||
|
||||
void __bad_assertion(const char *mess) {
|
||||
panic("%s", mess);
|
||||
}
|
||||
|
||||
#else /* NBSD_LIBC */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
|
|
@ -24,14 +13,10 @@ __assert13(file, line, function, failedexpr)
|
|||
const char *file, *function, *failedexpr;
|
||||
int line;
|
||||
{
|
||||
|
||||
(void)fprintf(stderr,
|
||||
"assertion \"%s\" failed: file \"%s\", line %d%s%s%s\n",
|
||||
failedexpr, file, line,
|
||||
function ? ", function \"" : "",
|
||||
function ? function : "",
|
||||
function ? "\"" : "");
|
||||
abort();
|
||||
(void)printf("%s:%d: assert \"%s\" failed", file, line, failedexpr);
|
||||
if(function) printf(", function \"%s\"", function);
|
||||
printf("\n");
|
||||
panic("assert failed");
|
||||
/* NOTREACHED */
|
||||
}
|
||||
|
||||
|
|
@ -44,5 +29,3 @@ __assert(file, line, failedexpr)
|
|||
__assert13(file, line, NULL, failedexpr);
|
||||
/* NOTREACHED */
|
||||
}
|
||||
|
||||
#endif /* NBSD_LIBC */
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ openpty(int *amaster, int *aslave, char *name, struct termios *term,
|
|||
for (cp = cp2 = TTY_OLD_SUFFIX TTY_NEW_SUFFIX; *cp2; cp2++) {
|
||||
line[5] = 'p';
|
||||
line[9] = *cp2;
|
||||
if ((master = open(line, O_RDWR, 0)) == -1) {
|
||||
if ((master = open(line, O_RDWR | O_NOCTTY, 0)) == -1) {
|
||||
if (errno != ENOENT)
|
||||
continue; /* busy */
|
||||
if ((size_t)(cp2 - cp + 1) < sizeof(TTY_OLD_SUFFIX))
|
||||
|
|
@ -120,7 +120,7 @@ openpty(int *amaster, int *aslave, char *name, struct termios *term,
|
|||
#ifndef __minix
|
||||
revoke(line) == 0 &&
|
||||
#endif
|
||||
(slave = open(line, O_RDWR, 0)) != -1) {
|
||||
(slave = open(line, O_RDWR | O_NOCTTY, 0)) != -1) {
|
||||
#ifndef __minix
|
||||
gotit:
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -15,7 +15,9 @@ acksize \- print text, data, and bss size of a program
|
|||
# \\$2
|
||||
..
|
||||
.SH EXAMPLES
|
||||
.EX "acksize file" "Print the size of \fIfile\fP"
|
||||
.TP 20
|
||||
.B acksize file
|
||||
# Print the size of \fIfile\fP
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
The text, data, bss, and total sizes for each argument are printed.
|
||||
|
|
|
|||
|
|
@ -15,9 +15,15 @@ at \- execute commands at a later time
|
|||
# \\$2
|
||||
..
|
||||
.SH EXAMPLES
|
||||
.EX "at 2315 Jan 31 myfile" "Myfile executed Jan 31 at 11:15 pm"
|
||||
.EX "at 0900" "Job input read from \fIstdin\fR"
|
||||
.EX "at 0711 4 29 " "Read from \fIstdin\fR, exec on April 29"
|
||||
.TP 20
|
||||
.B at 2315 Jan 31 myfile
|
||||
# Myfile executed Jan 31 at 11:15 pm
|
||||
.TP 20
|
||||
.B at 0900
|
||||
# Job input read from \fIstdin\fR
|
||||
.TP 20
|
||||
.B at 0711 4 29
|
||||
# Read from \fIstdin\fR, exec on April 29
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBAt\fR prepares a file to be executed later at the specified time by
|
||||
|
|
|
|||
|
|
@ -15,7 +15,9 @@ banner \- print a banner
|
|||
# \\$2
|
||||
..
|
||||
.SH EXAMPLES
|
||||
.EX "banner happy birthday" "Print a banner saying happy birthday"
|
||||
.TP 20
|
||||
.B banner happy birthday
|
||||
# Print a banner saying happy birthday
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fIBanner\fR prints its arguments on \fIstdout\fR using a matrix
|
||||
|
|
|
|||
|
|
@ -16,9 +16,15 @@ basename, dirname \- strip off file prefixes and suffixes
|
|||
# \\$2
|
||||
..
|
||||
.SH EXAMPLES
|
||||
.EX "basename /user/ast/file.c" "Strips path to yield \fIfile.c\fP"
|
||||
.EX "basename /user/file.c .c" "Strips path and \fI.c\fP to yield \fIfile\fP"
|
||||
.EX "dirname /user/file.c" "Strips basename to yield \fI/user\fP"
|
||||
.TP 20
|
||||
.B basename /user/ast/file.c
|
||||
# Strips path to yield \fIfile.c\fP
|
||||
.TP 20
|
||||
.B basename /user/file.c .c
|
||||
# Strips path and \fI.c\fP to yield \fIfile\fP
|
||||
.TP 20
|
||||
.B dirname /user/file.c
|
||||
# Strips basename to yield \fI/user\fP
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
.I Basename
|
||||
|
|
|
|||
|
|
@ -15,7 +15,9 @@ cal \- print a calendar
|
|||
# \\$2
|
||||
..
|
||||
.SH EXAMPLES
|
||||
.EX "cal 3 1992" "Print March 1992"
|
||||
.TP 20
|
||||
.B cal 3 1992
|
||||
# Print March 1992
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fICal\fR prints a calendar for a month or year. The year can be
|
||||
|
|
|
|||
|
|
@ -15,10 +15,16 @@ cdiff \- context diff
|
|||
# \\$2
|
||||
..
|
||||
.SH OPTIONS
|
||||
.FL "\-c" "Provide \fIn\fR lines of context"
|
||||
.TP 5
|
||||
.B \-c
|
||||
# Provide \fIn\fR lines of context
|
||||
.SH EXAMPLES
|
||||
.EX "cdiff old new >f" "Write context diff on \fIf\fR"
|
||||
.EX "cdiff \-c1 old new >f" "Use only 1 line of context"
|
||||
.TP 20
|
||||
.B cdiff old new >f
|
||||
# Write context diff on \fIf\fR
|
||||
.TP 20
|
||||
.B cdiff \-c1 old new >f
|
||||
# Use only 1 line of context
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fICdiff\fR produces a context diff by first running \fIdiff\fR and then
|
||||
|
|
|
|||
|
|
@ -15,10 +15,16 @@ chgrp \- change group
|
|||
# \\$2
|
||||
..
|
||||
.SH OPTIONS
|
||||
.FL "\-R" "Change directory hierarchies"
|
||||
.TP 5
|
||||
.B \-R
|
||||
# Change directory hierarchies
|
||||
.SH EXAMPLES
|
||||
.EX "chgrp system file1 file2" "Make \fIsystem\fR the group of the files"
|
||||
.EX "chrgp \-R other dir1" "Make \fIother\fR the group of all files below dir1"
|
||||
.TP 20
|
||||
.B chgrp system file1 file2
|
||||
# Make \fIsystem\fR the group of the files
|
||||
.TP 20
|
||||
.B chrgp \-R other dir1
|
||||
# Make \fIother\fR the group of all files below dir1
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
The group field (and optionally owner field) of the named files is changed to
|
||||
|
|
|
|||
|
|
@ -15,13 +15,25 @@ chmod \- change access mode for files
|
|||
# \\$2
|
||||
..
|
||||
.SH OPTIONS
|
||||
.FL "\-R" "Change hierarchies recursively"
|
||||
.TP 5
|
||||
.B \-R
|
||||
# Change hierarchies recursively
|
||||
.SH EXAMPLES
|
||||
.EX "chmod 755 file" "Owner: rwx Group: r\-x Others: r\-x"
|
||||
.EX "chmod +x file1 file2" "Make \fIfile1\fR and \fIfile2\fR executable"
|
||||
.EX "chmod a\-w file" "Make \fIfile\fR read only"
|
||||
.EX "chmod u+s file" "Turn on SETUID for \fIfile\fR"
|
||||
.EX "chmod \-R o+w dir" "Allow writing for all files in dir"
|
||||
.TP 20
|
||||
.B chmod 755 file
|
||||
# Owner: rwx Group: r\-x Others: r\-x
|
||||
.TP 20
|
||||
.B chmod +x file1 file2
|
||||
# Make \fIfile1\fR and \fIfile2\fR executable
|
||||
.TP 20
|
||||
.B chmod a\-w file
|
||||
# Make \fIfile\fR read only
|
||||
.TP 20
|
||||
.B chmod u+s file
|
||||
# Turn on SETUID for \fIfile\fR
|
||||
.TP 20
|
||||
.B chmod \-R o+w dir
|
||||
# Allow writing for all files in dir
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
The given mode is applied to each file in the file list. If the \fB\-R\fR
|
||||
|
|
|
|||
|
|
@ -15,8 +15,12 @@ cksum \- display file checksum and size
|
|||
# \\$2
|
||||
..
|
||||
.SH EXAMPLES
|
||||
.EX "cksum" "Display CRC and size of \fIstdin\fR"
|
||||
.EX "cksum *.c" "Display CRC and size of \fI.c\fP files"
|
||||
.TP 20
|
||||
.B cksum
|
||||
# Display CRC and size of \fIstdin\fR
|
||||
.TP 20
|
||||
.B cksum *.c
|
||||
# Display CRC and size of \fI.c\fP files
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
.I Cksum
|
||||
|
|
|
|||
|
|
@ -15,11 +15,19 @@ cmp \- compare two files
|
|||
# \\$2
|
||||
..
|
||||
.SH OPTIONS
|
||||
.FL "\-l" "Loud mode. Print bytes that differ (in octal)"
|
||||
.FL "\-s" "Silent mode. Print nothing, just return exit status"
|
||||
.TP 5
|
||||
.B \-l
|
||||
# Loud mode. Print bytes that differ (in octal)
|
||||
.TP 5
|
||||
.B \-s
|
||||
# Silent mode. Print nothing, just return exit status
|
||||
.SH EXAMPLES
|
||||
.EX "cmp file1 file2" "Tell whether the files are the same"
|
||||
.EX "cmp \-l file1 file2" "Print all corresponding bytes that differ"
|
||||
.TP 20
|
||||
.B cmp file1 file2
|
||||
# Tell whether the files are the same
|
||||
.TP 20
|
||||
.B cmp \-l file1 file2
|
||||
# Print all corresponding bytes that differ
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
Two files are compared.
|
||||
|
|
|
|||
|
|
@ -15,12 +15,22 @@ comm \- print lines common to two sorted files
|
|||
# \\$2
|
||||
..
|
||||
.SH OPTIONS
|
||||
.FL "\-1" "Suppress column 1 (lines present only in \fIfile1\fP)"
|
||||
.FL "\-2" "Suppress column 2 (lines present only in \fIfile2\fP)"
|
||||
.FL "\-3" "Suppress column 3 (lines present in both files)"
|
||||
.TP 5
|
||||
.B \-1
|
||||
# Suppress column 1 (lines present only in \fIfile1\fP)
|
||||
.TP 5
|
||||
.B \-2
|
||||
# Suppress column 2 (lines present only in \fIfile2\fP)
|
||||
.TP 5
|
||||
.B \-3
|
||||
# Suppress column 3 (lines present in both files)
|
||||
.SH EXAMPLES
|
||||
.EX "comm file1 file2" "Print all three columns"
|
||||
.EX "comm \-12 file1 file2" "Print only lines common to both files"
|
||||
.TP 20
|
||||
.B comm file1 file2
|
||||
# Print all three columns
|
||||
.TP 20
|
||||
.B comm \-12 file1 file2
|
||||
# Print only lines common to both files
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
Two sorted files are read and compared.
|
||||
|
|
|
|||
|
|
@ -15,14 +15,28 @@ compress, uncompress, zcat \- compress a file using modified Lempel-Ziv coding
|
|||
# \\$2
|
||||
..
|
||||
.SH OPTIONS
|
||||
.FL "\-c" "Put output on \fIstdout\fR instead of on \fIfile.Z\fR"
|
||||
.FL "\-d" "Decompress instead of compress"
|
||||
.FL "\-f" "Force output even if there is no saving"
|
||||
.FL "\-v" "Verbose mode"
|
||||
.TP 5
|
||||
.B \-c
|
||||
# Put output on \fIstdout\fR instead of on \fIfile.Z\fR
|
||||
.TP 5
|
||||
.B \-d
|
||||
# Decompress instead of compress
|
||||
.TP 5
|
||||
.B \-f
|
||||
# Force output even if there is no saving
|
||||
.TP 5
|
||||
.B \-v
|
||||
# Verbose mode
|
||||
.SH EXAMPLES
|
||||
.EX "compress <infile >outfile" "Compress 1 file"
|
||||
.EX "compress x y z" "Compress 3 files to \fIx.Z\fR, \fIy.Z\fR, and \fIz.Z\fR"
|
||||
.EX "compress \-d file.Z" "Decompress \fIfile.Z\fR to \fIfile\fR"
|
||||
.TP 20
|
||||
.B compress <infile >outfile
|
||||
# Compress 1 file
|
||||
.TP 20
|
||||
.B compress x y z
|
||||
# Compress 3 files to \fIx.Z\fR, \fIy.Z\fR, and \fIz.Z\fR
|
||||
.TP 20
|
||||
.B compress \-d file.Z
|
||||
# Decompress \fIfile.Z\fR to \fIfile\fR
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
The listed files (or \fIstdin\fR, if none are given) are compressed
|
||||
|
|
|
|||
|
|
@ -15,7 +15,9 @@ crc \- print the checksum of the file data
|
|||
# \\$2
|
||||
..
|
||||
.SH EXAMPLES
|
||||
.EX "crc *.c" "Print checksums of all the C programs"
|
||||
.TP 20
|
||||
.B crc *.c
|
||||
# Print checksums of all the C programs
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
The checksum of each argument is computed and printed, along with the file
|
||||
|
|
|
|||
|
|
@ -15,9 +15,15 @@ dd \- convert and copy a file
|
|||
# \\$2
|
||||
..
|
||||
.SH EXAMPLES
|
||||
.EX "dd if=/dev/fd0 of=/dev/fd1" "Copy disk 0 to disk 1"
|
||||
.EX "dd if=x of=y bs=1w skip=4" "Copy \fIx\fP to \fIy\fP, skipping 4 words"
|
||||
.EX "dd if=x of=y count=3" "Copy three 512\-byte blocks"
|
||||
.TP 20
|
||||
.B dd if=/dev/fd0 of=/dev/fd1
|
||||
# Copy disk 0 to disk 1
|
||||
.TP 20
|
||||
.B dd if=x of=y bs=1w skip=4
|
||||
# Copy \fIx\fP to \fIy\fP, skipping 4 words
|
||||
.TP 20
|
||||
.B dd if=x of=y count=3
|
||||
# Copy three 512\-byte blocks
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
This command is intended for copying partial files.
|
||||
|
|
|
|||
|
|
@ -12,9 +12,15 @@ dev2name \- obtain device name given its number
|
|||
\\$2
|
||||
..
|
||||
.SH OPTIONS
|
||||
.FL "\fImajor\fR" "Major device number for which to obtain device name"
|
||||
.FL "\fIminor\fR" "Minor device number for which to obtain device name"
|
||||
.FL "\fIdeviceno\fR" "Full device number for which to obtain device name (specifies the minor device number in the low-order byte and the major device number in the remainder)"
|
||||
.TP 5
|
||||
.B \fImajor\fR
|
||||
# Major device number for which to obtain device name
|
||||
.TP 5
|
||||
.B \fIminor\fR
|
||||
# Minor device number for which to obtain device name
|
||||
.TP 5
|
||||
.B \fIdeviceno\fR
|
||||
# Full device number for which to obtain device name (specifies the minor device number in the low-order byte and the major device number in the remainder)
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
This utility locates a file in \fB/dev\fR that represents the device with the specified major/minor device number and prints its name to the standard output. The exit code is zero if such a device is found and non-zero if no such device was found.
|
||||
|
|
|
|||
|
|
@ -15,7 +15,9 @@ dhrystone \- integer benchmark
|
|||
# \\$2
|
||||
..
|
||||
.SH EXAMPLES
|
||||
.EX "dhrystone" "Run the dhrystone benchmark"
|
||||
.TP 20
|
||||
.B dhrystone
|
||||
# Run the dhrystone benchmark
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
Many years ago, a floating-point benchmark called \fIwhetstone\fR was
|
||||
|
|
|
|||
|
|
@ -15,12 +15,22 @@ dosdir \- list an MS-DOS directory [IBM]
|
|||
# \\$2
|
||||
..
|
||||
.SH OPTIONS
|
||||
.FL "\-l" "Long listing"
|
||||
.FL "\-r" "Recursively descend and print subdirectories"
|
||||
.TP 5
|
||||
.B \-l
|
||||
# Long listing
|
||||
.TP 5
|
||||
.B \-r
|
||||
# Recursively descend and print subdirectories
|
||||
.SH EXAMPLES
|
||||
.EX "dosdir \-l A" "List root directory on drive A"
|
||||
.EX "dosdir \-r C x/y" "Recursively list directory \fIx/y\fR"
|
||||
.EX "dosdir \-r fd1" "List device \fI/dev/fd1\fR"
|
||||
.TP 20
|
||||
.B dosdir \-l A
|
||||
# List root directory on drive A
|
||||
.TP 20
|
||||
.B dosdir \-r C x/y
|
||||
# Recursively list directory \fIx/y\fR
|
||||
.TP 20
|
||||
.B dosdir \-r fd1
|
||||
# List device \fI/dev/fd1\fR
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
.I Dosdir
|
||||
|
|
|
|||
|
|
@ -15,10 +15,16 @@ dosread \- read a file from an MS-DOS diskette [IBM]
|
|||
# \\$2
|
||||
..
|
||||
.SH OPTIONS
|
||||
.FL "\-a" "ASCII file"
|
||||
.TP 5
|
||||
.B \-a
|
||||
# ASCII file
|
||||
.SH EXAMPLES
|
||||
.EX "dosread C g/adv >adv" "Read file \fIg/adv\fR from hard disk"
|
||||
.EX "dosread \-a A prog.c >x" "Read ASCII file \fIprog.c\fR from drive A"
|
||||
.TP 20
|
||||
.B dosread C g/adv >adv
|
||||
# Read file \fIg/adv\fR from hard disk
|
||||
.TP 20
|
||||
.B dosread \-a A prog.c >x
|
||||
# Read ASCII file \fIprog.c\fR from drive A
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
.I Dosread
|
||||
|
|
|
|||
|
|
@ -15,10 +15,16 @@ doswrite \- write a file onto an MS-DOS diskette [IBM]
|
|||
# \\$2
|
||||
..
|
||||
.SH OPTIONS
|
||||
.FL "\-a" "ASCII file"
|
||||
.TP 5
|
||||
.B \-a
|
||||
# ASCII file
|
||||
.SH EXAMPLES
|
||||
.EX "doswrite A x/y <z" "Write file \fIz\fR to disk as \fIx/y\fR"
|
||||
.EX "doswrite \-a B f" "Copy \fIstdin\fR to \s-2MS-DOS\s+2 file \fIf\fR"
|
||||
.TP 20
|
||||
.B doswrite A x/y <z
|
||||
# Write file \fIz\fR to disk as \fIx/y\fR
|
||||
.TP 20
|
||||
.B doswrite \-a B f
|
||||
# Copy \fIstdin\fR to \s-2MS-DOS\s+2 file \fIf\fR
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
.I Doswrite
|
||||
|
|
|
|||
|
|
@ -15,9 +15,13 @@ expand \- convert tabs to spaces
|
|||
# \\$2
|
||||
..
|
||||
.SH OPTIONS
|
||||
.FL "\-\fIt\fR" "Tab stop positions"
|
||||
.TP 5
|
||||
.B \-\fIt\fR
|
||||
# Tab stop positions
|
||||
.SH EXAMPLES
|
||||
.EX "expand \-16,32,48,64" "Expand \fIstdin\fR with tabs every 16 columns"
|
||||
.TP 20
|
||||
.B expand \-16,32,48,64
|
||||
# Expand \fIstdin\fR with tabs every 16 columns
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fIExpand\fR replaces tabs in the named files with the equivalent numbers
|
||||
|
|
|
|||
|
|
@ -15,7 +15,9 @@ factor \- factor an integer less than 2**31
|
|||
# \\$2
|
||||
..
|
||||
.SH EXAMPLES
|
||||
.EX "factor 450180" "Print the prime factors of 450180"
|
||||
.TP 20
|
||||
.B factor 450180
|
||||
# Print the prime factors of 450180
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fIFactor\fR prints the prime factors of its argument in increasing order.
|
||||
|
|
|
|||
|
|
@ -15,7 +15,9 @@ file \- make a guess as to a file's type based on contents
|
|||
# \\$2
|
||||
..
|
||||
.SH EXAMPLES
|
||||
.EX "file a.out ar.h" "Guess at types"
|
||||
.TP 20
|
||||
.B file a.out ar.h
|
||||
# Guess at types
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fIFile\fR reads the first block of a file and tries to make an
|
||||
|
|
|
|||
|
|
@ -15,10 +15,16 @@ fold \- fold long lines
|
|||
# \\$2
|
||||
..
|
||||
.SH OPTIONS
|
||||
.FL "\-\fIn\fR" "How long should the output lines be"
|
||||
.TP 5
|
||||
.B \-\fIn\fR
|
||||
# How long should the output lines be
|
||||
.SH EXAMPLES
|
||||
.EX "fold \-60" "Fold \fIstdin\fR to 60 characters"
|
||||
.EX "fold file" "Fold \fIfile\fP to 80 characters"
|
||||
.TP 20
|
||||
.B fold \-60
|
||||
# Fold \fIstdin\fR to 60 characters
|
||||
.TP 20
|
||||
.B fold file
|
||||
# Fold \fIfile\fP to 80 characters
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fIFold\fR takes copies its input from the named file (or \fIstdin\fR,
|
||||
|
|
|
|||
|
|
@ -15,7 +15,9 @@ fortune \- print a fortune
|
|||
# \\$2
|
||||
..
|
||||
.SH EXAMPLES
|
||||
.EX "fortune" "Print a fortune"
|
||||
.TP 20
|
||||
.B fortune
|
||||
# Print a fortune
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fIFortune\fR prints a fortune at random from the fortunes file,
|
||||
|
|
|
|||
|
|
@ -15,16 +15,34 @@ fsck \- perform file system consistency check
|
|||
# \\$2
|
||||
..
|
||||
.SH OPTIONS
|
||||
.FL "\-a" "Automatically repair inconsistencies"
|
||||
.FL "\-c" "Check and list only the specified i-nodes
|
||||
.FL "\-l" "List the files and directories in the filesytem
|
||||
.FL "\-r" "Prompt user for repairs if inconsistencies are found
|
||||
.FL "\-s" "List the superblock of the file system"
|
||||
.TP 5
|
||||
.B \-a
|
||||
# Automatically repair inconsistencies
|
||||
.TP 5
|
||||
.B \-c
|
||||
# Check and list only the specified i-nodes
|
||||
.TP 5
|
||||
.B \-l
|
||||
# List the files and directories in the filesytem
|
||||
.TP 5
|
||||
.B \-r
|
||||
# Prompt user for repairs if inconsistencies are found
|
||||
.TP 5
|
||||
.B \-s
|
||||
# List the superblock of the file system
|
||||
.SH EXAMPLES
|
||||
.EX "fsck /dev/c0d0p3" "Check file system on \fI/dev/c0d0p3\fR"
|
||||
.EX "fsck \-a /dev/at0" "Automatically fix errors on \fI/dev/at0\fR"
|
||||
.EX "fsck \-l /dev/fd0" "List the contents of \fI/dev/fd0\fR"
|
||||
.EX "fsck \-c 2 3 /dev/c0d0p2" "Check and list \fI/dev/c0d0p2\fR i-nodes 2 & 3"
|
||||
.TP 20
|
||||
.B fsck /dev/c0d0p3
|
||||
# Check file system on \fI/dev/c0d0p3\fR
|
||||
.TP 20
|
||||
.B fsck \-a /dev/at0
|
||||
# Automatically fix errors on \fI/dev/at0\fR
|
||||
.TP 20
|
||||
.B fsck \-l /dev/fd0
|
||||
# List the contents of \fI/dev/fd0\fR
|
||||
.TP 20
|
||||
.B fsck \-c 2 3 /dev/c0d0p2
|
||||
# Check and list \fI/dev/c0d0p2\fR i-nodes 2 & 3
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fIFsck\fR performs consistency checks on the file systems which reside
|
||||
|
|
|
|||
|
|
@ -15,11 +15,19 @@ head \- print the first few lines of a file
|
|||
# \\$2
|
||||
..
|
||||
.SH OPTIONS
|
||||
.FL "\-n \fIn\fR" "How many lines to print"
|
||||
.FL "\-\fIn\fR" "How many lines to print (backwards-compatible)"
|
||||
.TP 5
|
||||
.B \-n \fIn\fR
|
||||
# How many lines to print
|
||||
.TP 5
|
||||
.B \-\fIn\fR
|
||||
# How many lines to print (backwards-compatible)
|
||||
.SH EXAMPLES
|
||||
.EX "head \-n 6" "Print first 6 lines of \fIstdin\fR"
|
||||
.EX "head \-1 file1 file2" "Print first line of two files"
|
||||
.TP 20
|
||||
.B head \-n 6
|
||||
# Print first 6 lines of \fIstdin\fR
|
||||
.TP 20
|
||||
.B head \-1 file1 file2
|
||||
# Print first line of two files
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
The first few lines of one or more files are printed.
|
||||
|
|
|
|||
|
|
@ -15,14 +15,28 @@ ifdef \- remove #ifdefs from a file
|
|||
# \\$2
|
||||
..
|
||||
.SH OPTIONS
|
||||
.FL "\-D" "Define symbol permanently"
|
||||
.FL "\-I" "Ignore symbol"
|
||||
.FL "\-U" "Undefine symbol permanently"
|
||||
.FL "\-d" "Define symbol. It may be #undef'ed later"
|
||||
.FL "\-t" "Produce a table of the symbols on \fIstdout\fR"
|
||||
.TP 5
|
||||
.B \-D
|
||||
# Define symbol permanently
|
||||
.TP 5
|
||||
.B \-I
|
||||
# Ignore symbol
|
||||
.TP 5
|
||||
.B \-U
|
||||
# Undefine symbol permanently
|
||||
.TP 5
|
||||
.B \-d
|
||||
# Define symbol. It may be #undef'ed later
|
||||
.TP 5
|
||||
.B \-t
|
||||
# Produce a table of the symbols on \fIstdout\fR
|
||||
.SH EXAMPLES
|
||||
.EX "ifdef \-DUNIX file.c >newfile.c" "Define \fIUNIX\fR"
|
||||
.EX "ifdef \-D_MINIX \-UDOS <x.c >y.c "Define \fI_MINIX\fR, undefine \fIDOS\fR"
|
||||
.TP 20
|
||||
.B ifdef \-DUNIX file.c >newfile.c
|
||||
# Define \fIUNIX\fR
|
||||
.TP 20
|
||||
.B ifdef \-D_MINIX \-UDOS <x.c >y.c
|
||||
# Define \fI_MINIX\fR, undefine \fIDOS\fR
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fIIfdef\fR
|
||||
|
|
|
|||
|
|
@ -15,13 +15,25 @@ kill \- send a signal to a process
|
|||
# \\$2
|
||||
..
|
||||
.SH OPTIONS
|
||||
.FL "\-\fIn\fR" "Signal number to send"
|
||||
.FL "\-\fINAME\fR" "Named signal to send"
|
||||
.TP 5
|
||||
.B \-\fIn\fR
|
||||
# Signal number to send
|
||||
.TP 5
|
||||
.B \-\fINAME\fR
|
||||
# Named signal to send
|
||||
.SH EXAMPLES
|
||||
.EX "kill 35" "Send signal 15 to process 35"
|
||||
.EX "kill \-9 40" "Send signal 9 to process 40"
|
||||
.EX "kill \-2 0" "Send signal 2 to whole terminal process group"
|
||||
.EX "kill \-HUP -123" "Send a hangup to process group 123"
|
||||
.TP 20
|
||||
.B kill 35
|
||||
# Send signal 15 to process 35
|
||||
.TP 20
|
||||
.B kill \-9 40
|
||||
# Send signal 9 to process 40
|
||||
.TP 20
|
||||
.B kill \-2 0
|
||||
# Send signal 2 to whole terminal process group
|
||||
.TP 20
|
||||
.B kill \-HUP -123
|
||||
# Send a hangup to process group 123
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
A signal is sent to a given process.
|
||||
|
|
|
|||
|
|
@ -17,15 +17,31 @@ last, uptime \- display recent on-line session records, show uptime
|
|||
# \\$2
|
||||
..
|
||||
.SH OPTIONS
|
||||
.FL "\-f" "Use \fIfile\fR instead of /usr/adm/wtmp"
|
||||
.FL "\-r" "Search backwards only to last reboot"
|
||||
.FL "\-u" "Print uptime since last reboot"
|
||||
.FL "\-\fIn\fP" "Print a maximum of \fIn\fR lines"
|
||||
.TP 5
|
||||
.B \-f
|
||||
# Use \fIfile\fR instead of /usr/adm/wtmp
|
||||
.TP 5
|
||||
.B \-r
|
||||
# Search backwards only to last reboot
|
||||
.TP 5
|
||||
.B \-u
|
||||
# Print uptime since last reboot
|
||||
.TP 5
|
||||
.B \-\fIn\fP
|
||||
# Print a maximum of \fIn\fR lines
|
||||
.SH EXAMPLES
|
||||
.EX "last reboot" "When was the system last rebooted?"
|
||||
.EX "last ast" "When was the last login for ast?"
|
||||
.EX "last \-10 tty00 tty01" "Display last 10 logins on tty00 or tty01"
|
||||
.EX "uptime" "Display uptime (likewise \fBlast \-u\fR)"
|
||||
.TP 20
|
||||
.B last reboot
|
||||
# When was the system last rebooted?
|
||||
.TP 20
|
||||
.B last ast
|
||||
# When was the last login for ast?
|
||||
.TP 20
|
||||
.B last \-10 tty00 tty01
|
||||
# Display last 10 logins on tty00 or tty01
|
||||
.TP 20
|
||||
.B uptime
|
||||
# Display uptime (likewise \fBlast \-u\fR)
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
.I Last
|
||||
|
|
|
|||
|
|
@ -15,7 +15,9 @@ loadfont \- load a font into the video card
|
|||
# \\$2
|
||||
..
|
||||
.SH EXAMPLES
|
||||
.EX "loadfont iso1.fnt" "Loads the ISO 8859-1 (Latin-1) font"
|
||||
.TP 20
|
||||
.B loadfont iso1.fnt
|
||||
# Loads the ISO 8859-1 (Latin-1) font
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
.I Loadfont
|
||||
|
|
|
|||
|
|
@ -15,7 +15,9 @@ loadkeys \- load a keyboard map into the keyboard driver
|
|||
# \\$2
|
||||
..
|
||||
.SH EXAMPLES
|
||||
.EX "loadkeys spanish.map" "Load a map for a Spanish keyboard"
|
||||
.TP 20
|
||||
.B loadkeys spanish.map
|
||||
# Load a map for a Spanish keyboard
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
.I Loadkeys
|
||||
|
|
|
|||
|
|
@ -15,7 +15,9 @@ login \- log into the computer
|
|||
# \\$2
|
||||
..
|
||||
.SH EXAMPLES
|
||||
.EX "login ast" "Login as ast"
|
||||
.TP 20
|
||||
.B login ast
|
||||
# Login as ast
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fILogin\fR allows a logged in user to login as someone else without first
|
||||
|
|
|
|||
|
|
@ -17,21 +17,47 @@ mail \- send and receive electronic mail
|
|||
# \\$2
|
||||
..
|
||||
.SH OPTIONS
|
||||
.FL "\-e" "Exit with status TRUE or FALSE to indicate if there is mail in mailbox"
|
||||
.FL "\-p" "Print all mail and then exit"
|
||||
.FL "\-q" "Quit program if SIGINT received"
|
||||
.FL "\-r" "Reverse print order, i.e., print oldest first"
|
||||
.FL "\-f" "Use \fIfile\fR instead of \fI/usr/spool/mail/user\fR as mailbox"
|
||||
.TP 5
|
||||
.B \-e
|
||||
# Exit with status TRUE or FALSE to indicate if there is mail in mailbox
|
||||
.TP 5
|
||||
.B \-p
|
||||
# Print all mail and then exit
|
||||
.TP 5
|
||||
.B \-q
|
||||
# Quit program if SIGINT received
|
||||
.TP 5
|
||||
.B \-r
|
||||
# Reverse print order, i.e., print oldest first
|
||||
.TP 5
|
||||
.B \-f
|
||||
# Use \fIfile\fR instead of \fI/usr/spool/mail/user\fR as mailbox
|
||||
.PP
|
||||
.FL "\-d" "Force use of the shell variable \fIMAILER\fR"
|
||||
.FL "\-t" "Show distribution list as Dist: header in message"
|
||||
.FL "\-v" "Verbose mode (passed on to \fIMAILER\fR)"
|
||||
.FL "\-s" "Use Subject: \fIsubject\fR"
|
||||
.TP 5
|
||||
.B \-d
|
||||
# Force use of the shell variable \fIMAILER\fR
|
||||
.TP 5
|
||||
.B \-t
|
||||
# Show distribution list as Dist: header in message
|
||||
.TP 5
|
||||
.B \-v
|
||||
# Verbose mode (passed on to \fIMAILER\fR)
|
||||
.TP 5
|
||||
.B \-s
|
||||
# Use Subject: \fIsubject\fR
|
||||
.SH EXAMPLES
|
||||
.EX "mail ast" "Send a message to \fIast\fR"
|
||||
.EX "mail" "Read your mail"
|
||||
.EX "cat mail.cdiff | mail -s ''Here's the diff!'' asw " "Pipe program output to mail with a subject line"
|
||||
.EX "mail -f /usr/spool/mail/asw" "How root can read asw's mail"
|
||||
.TP 20
|
||||
.B mail ast
|
||||
# Send a message to \fIast\fR
|
||||
.TP 20
|
||||
.B mail
|
||||
# Read your mail
|
||||
.TP 20
|
||||
.B cat mail.cdiff | mail -s ''Here's the diff!'' asw
|
||||
# Pipe program output to mail with a subject line
|
||||
.TP 20
|
||||
.B mail -f /usr/spool/mail/asw
|
||||
# How root can read asw's mail
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fIMail\fR is an extremely simple electronic mail program. It can be used
|
||||
|
|
|
|||
|
|
@ -15,18 +15,40 @@ mkfs \- make a file system
|
|||
# \\$2
|
||||
..
|
||||
.SH OPTIONS
|
||||
.FL "\-L" "Make a listing on standard output"
|
||||
.FL "\-d" "Use mod time of \fImkfs\fR binary for all files"
|
||||
.FL "\-o" "Use a drive other than 0 or 1 (safety precaution)"
|
||||
.FL "\-t" "Do not test if file system fits on the medium"
|
||||
.FL "\-1" "Make a version 1 file system (for backward compatibility)"
|
||||
.FL "\-i" "Number of i-nodes (files)"
|
||||
.FL "\-B" "Filesystem block size (in bytes)"
|
||||
.FL "\-b" "Filesystem size (in blocks)"
|
||||
.TP 5
|
||||
.B \-L
|
||||
# Make a listing on standard output
|
||||
.TP 5
|
||||
.B \-d
|
||||
# Use mod time of \fImkfs\fR binary for all files
|
||||
.TP 5
|
||||
.B \-o
|
||||
# Use a drive other than 0 or 1 (safety precaution)
|
||||
.TP 5
|
||||
.B \-t
|
||||
# Do not test if file system fits on the medium
|
||||
.TP 5
|
||||
.B \-1
|
||||
# Make a version 1 file system (for backward compatibility)
|
||||
.TP 5
|
||||
.B \-i
|
||||
# Number of i-nodes (files)
|
||||
.TP 5
|
||||
.B \-B
|
||||
# Filesystem block size (in bytes)
|
||||
.TP 5
|
||||
.B \-b
|
||||
# Filesystem size (in blocks)
|
||||
.SH EXAMPLES
|
||||
.EX "mkfs /dev/fd1 proto" "Make a file system on \fI/dev/fd1\fR"
|
||||
.EX "mkfs -b 360 /dev/fd1" "Make empty 360 block file system"
|
||||
.EX "mkfs /dev/fd1 360" "Alternate way to specify the size"
|
||||
.TP 20
|
||||
.B mkfs /dev/fd1 proto
|
||||
# Make a file system on \fI/dev/fd1\fR
|
||||
.TP 20
|
||||
.B mkfs -b 360 /dev/fd1
|
||||
# Make empty 360 block file system
|
||||
.TP 20
|
||||
.B mkfs /dev/fd1 360
|
||||
# Alternate way to specify the size
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
.I Mkfs
|
||||
|
|
|
|||
|
|
@ -15,17 +15,37 @@ mkproto \- create a MINIX 3 prototype file
|
|||
# \\$2
|
||||
..
|
||||
.SH OPTIONS
|
||||
.FL "\-b" "Number of blocks in the prototype is \fIn\fR"
|
||||
.FL "\-d" "Indent the prototype file using \fIstr\fR instead of tab"
|
||||
.FL "\-g" "Use \fIn\fR as the gid for all files and directories"
|
||||
.FL "\-i" "Number of i-nodes in the prototype is \fIn\fR"
|
||||
.FL "\-p" "Use \fInnn\fR (3 octal digits) as the protection mode"
|
||||
.FL "\-s" "Use the same uid, gid and mode as the source files have"
|
||||
.FL "\-t" "Use the string \fIroot\fR as the path prefix for every file"
|
||||
.FL "\-u" "Use \fIn\fR as the uid for all files and directories"
|
||||
.TP 5
|
||||
.B \-b
|
||||
# Number of blocks in the prototype is \fIn\fR
|
||||
.TP 5
|
||||
.B \-d
|
||||
# Indent the prototype file using \fIstr\fR instead of tab
|
||||
.TP 5
|
||||
.B \-g
|
||||
# Use \fIn\fR as the gid for all files and directories
|
||||
.TP 5
|
||||
.B \-i
|
||||
# Number of i-nodes in the prototype is \fIn\fR
|
||||
.TP 5
|
||||
.B \-p
|
||||
# Use \fInnn\fR (3 octal digits) as the protection mode
|
||||
.TP 5
|
||||
.B \-s
|
||||
# Use the same uid, gid and mode as the source files have
|
||||
.TP 5
|
||||
.B \-t
|
||||
# Use the string \fIroot\fR as the path prefix for every file
|
||||
.TP 5
|
||||
.B \-u
|
||||
# Use \fIn\fR as the uid for all files and directories
|
||||
.SH EXAMPLES
|
||||
.EX "mkproto \-b360" "Make a 360K prototype of this directory"
|
||||
.EX "mkproto \-u2 \-g1 \-p644" "Give all files uid 2, gid 1 and mode 644"
|
||||
.TP 20
|
||||
.B mkproto \-b360
|
||||
# Make a 360K prototype of this directory
|
||||
.TP 20
|
||||
.B mkproto \-u2 \-g1 \-p644
|
||||
# Give all files uid 2, gid 1 and mode 644
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fIMkproto\fR creates an \fImkfs\fR prototype file for the specified
|
||||
|
|
|
|||
|
|
@ -15,13 +15,25 @@ mount \- mount a file system
|
|||
# \\$2
|
||||
..
|
||||
.SH OPTIONS
|
||||
.FL "\-r" "File system is mounted read-only"
|
||||
.FL "\-t" "File system type"
|
||||
.FL "\-n" "Don't update mtab"
|
||||
.FL "\-o" "Options passed to FS server"
|
||||
.TP 5
|
||||
.B \-r
|
||||
# File system is mounted read-only
|
||||
.TP 5
|
||||
.B \-t
|
||||
# File system type
|
||||
.TP 5
|
||||
.B \-n
|
||||
# Don't update mtab
|
||||
.TP 5
|
||||
.B \-o
|
||||
# Options passed to FS server
|
||||
.SH EXAMPLES
|
||||
.EX "mount /dev/fd1 /user" "Mount diskette 1 on \fI/user\fP"
|
||||
.EX "mount \-t procfs none /proc" "Mount proc file system on \fI/proc\fP"
|
||||
.TP 20
|
||||
.B mount /dev/fd1 /user
|
||||
# Mount diskette 1 on \fI/user\fP
|
||||
.TP 20
|
||||
.B mount \-t procfs none /proc
|
||||
# Mount proc file system on \fI/proc\fP
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
The file system contained on the special file \fIspecial\fP is mounted on
|
||||
|
|
|
|||
|
|
@ -15,16 +15,34 @@ nm \- print name list
|
|||
# \\$2
|
||||
..
|
||||
.SH OPTIONS
|
||||
.FL "\-d" "Print the offsets in decimal instead of in hex"
|
||||
.FL "\-g" "Print only external symbols"
|
||||
.FL "\-n" "Sort numerically rather than alphabetically"
|
||||
.FL "\-o" "Prepend file name to each line rather than only once"
|
||||
.FL "\-p" "Do not sort, print in symbol-table order"
|
||||
.FL "\-r" "Sort in reverse order"
|
||||
.FL "\-u" "Print only undefined symbols"
|
||||
.TP 5
|
||||
.B \-d
|
||||
# Print the offsets in decimal instead of in hex
|
||||
.TP 5
|
||||
.B \-g
|
||||
# Print only external symbols
|
||||
.TP 5
|
||||
.B \-n
|
||||
# Sort numerically rather than alphabetically
|
||||
.TP 5
|
||||
.B \-o
|
||||
# Prepend file name to each line rather than only once
|
||||
.TP 5
|
||||
.B \-p
|
||||
# Do not sort, print in symbol-table order
|
||||
.TP 5
|
||||
.B \-r
|
||||
# Sort in reverse order
|
||||
.TP 5
|
||||
.B \-u
|
||||
# Print only undefined symbols
|
||||
.SH EXAMPLES
|
||||
.EX "nm \-n a.out" "Print all symbols in numerical order"
|
||||
.EX "nm \-dg a.out" "Print globals alphabetically in decimal"
|
||||
.TP 20
|
||||
.B nm \-n a.out
|
||||
# Print all symbols in numerical order
|
||||
.TP 20
|
||||
.B nm \-dg a.out
|
||||
# Print globals alphabetically in decimal
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fINm\fR prints the symbol table of executable files when it is available.
|
||||
|
|
|
|||
|
|
@ -15,17 +15,37 @@ od \- octal dump
|
|||
# \\$2
|
||||
..
|
||||
.SH OPTIONS
|
||||
.FL "\-b" "Dump bytes in octal"
|
||||
.FL "\-c" "Dump bytes as ASCII characters"
|
||||
.FL "\-d" "Dump words in decimal"
|
||||
.FL "\-h" "Print addresses in hex (default is octal)"
|
||||
.FL "\-o" "Dump words in octal (default)"
|
||||
.FL "\-v" "Verbose (list duplicate lines)"
|
||||
.FL "\-x" "Dump words in hex"
|
||||
.TP 5
|
||||
.B \-b
|
||||
# Dump bytes in octal
|
||||
.TP 5
|
||||
.B \-c
|
||||
# Dump bytes as ASCII characters
|
||||
.TP 5
|
||||
.B \-d
|
||||
# Dump words in decimal
|
||||
.TP 5
|
||||
.B \-h
|
||||
# Print addresses in hex (default is octal)
|
||||
.TP 5
|
||||
.B \-o
|
||||
# Dump words in octal (default)
|
||||
.TP 5
|
||||
.B \-v
|
||||
# Verbose (list duplicate lines)
|
||||
.TP 5
|
||||
.B \-x
|
||||
# Dump words in hex
|
||||
.SH EXAMPLES
|
||||
.EX "od \-ox file" "Dump \fIfile\fP in octal and hex"
|
||||
.EX "od \-d file +1000" "Dump \fIfile\fP starting at byte 01000"
|
||||
.EX "od \-c file +10.b" "Dump \fIfile\fP starting at block 10"
|
||||
.TP 20
|
||||
.B od \-ox file
|
||||
# Dump \fIfile\fP in octal and hex
|
||||
.TP 20
|
||||
.B od \-d file +1000
|
||||
# Dump \fIfile\fP starting at byte 01000
|
||||
.TP 20
|
||||
.B od \-c file +10.b
|
||||
# Dump \fIfile\fP starting at block 10
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
.I Od
|
||||
|
|
|
|||
|
|
@ -15,12 +15,22 @@ paste \- paste multiple files together
|
|||
# \\$2
|
||||
..
|
||||
.SH OPTIONS
|
||||
.FL "\-d" "Set delimiter used to separate columns to \fIlist\fR.
|
||||
.FL "\-s" "Print files sequentially, file \fIk\fR on line \fIk\fR.
|
||||
.TP 5
|
||||
.B \-d
|
||||
# Set delimiter used to separate columns to \fIlist\fR.
|
||||
.TP 5
|
||||
.B \-s
|
||||
# Print files sequentially, file \fIk\fR on line \fIk\fR.
|
||||
.SH EXAMPLES
|
||||
.EX "paste file1 file2" "Print \fIfile1\fR in col 1, \fIfile2\fR in col 2"
|
||||
.EX "paste \-s f1 f2" "Print \fIf1\fR on line 1 and \fIf2\fR on line 2"
|
||||
.EX "paste -d : file1 file2" "Print the lines separated by a colon"
|
||||
.TP 20
|
||||
.B paste file1 file2
|
||||
# Print \fIfile1\fR in col 1, \fIfile2\fR in col 2
|
||||
.TP 20
|
||||
.B paste \-s f1 f2
|
||||
# Print \fIf1\fR on line 1 and \fIf2\fR on line 2
|
||||
.TP 20
|
||||
.B paste -d : file1 file2
|
||||
# Print the lines separated by a colon
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fIPaste\fR concatenates corresponding lines of the given input files
|
||||
|
|
|
|||
|
|
@ -9,8 +9,12 @@ ping \- send ICMP ECHO_REQUEST packets to network hosts
|
|||
# \\$2
|
||||
..
|
||||
.SH EXAMPLES
|
||||
.EX "ping 192.168.1.1" "Ping host 192.168.1.1"
|
||||
.EX "ping www.minix3.org 500" "Ping www.minix3.org with 500 byte IP packets"
|
||||
.TP 20
|
||||
.B ping 192.168.1.1
|
||||
# Ping host 192.168.1.1
|
||||
.TP 20
|
||||
.B ping www.minix3.org 500
|
||||
# Ping www.minix3.org with 500 byte IP packets
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
Sends ICMP ECHO_REQUEST packets to the specified host and waits for a ECHO_REPLY.
|
||||
|
|
|
|||
|
|
@ -15,17 +15,37 @@ pr \- print a file
|
|||
# \\$2
|
||||
..
|
||||
.SH OPTIONS
|
||||
.FL "\-M" "Use MINIX style line number"
|
||||
.FL "\-f" "Do not fold long lines"
|
||||
.FL "\-h" "Take next argument as page header"
|
||||
.FL "\-l" "Sets page length in lines"
|
||||
.FL "\-n" "Number the output lines"
|
||||
.FL "\-t" "Do not print page header or trailer"
|
||||
.FL "\-w" "Sets line length in characters"
|
||||
.TP 5
|
||||
.B \-M
|
||||
# Use MINIX style line number
|
||||
.TP 5
|
||||
.B \-f
|
||||
# Do not fold long lines
|
||||
.TP 5
|
||||
.B \-h
|
||||
# Take next argument as page header
|
||||
.TP 5
|
||||
.B \-l
|
||||
# Sets page length in lines
|
||||
.TP 5
|
||||
.B \-n
|
||||
# Number the output lines
|
||||
.TP 5
|
||||
.B \-t
|
||||
# Do not print page header or trailer
|
||||
.TP 5
|
||||
.B \-w
|
||||
# Sets line length in characters
|
||||
.SH EXAMPLES
|
||||
.EX "pr \-w85 \-l60 file" "Use 85 character line, 60 line page"
|
||||
.EX "pr \-3 file" "List \fIfile\fP three columns to a page"
|
||||
.EX "pr +4 file" "Start printing with page 4"
|
||||
.TP 20
|
||||
.B pr \-w85 \-l60 file
|
||||
# Use 85 character line, 60 line page
|
||||
.TP 20
|
||||
.B pr \-3 file
|
||||
# List \fIfile\fP three columns to a page
|
||||
.TP 20
|
||||
.B pr +4 file
|
||||
# Start printing with page 4
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
.I Pr
|
||||
|
|
|
|||
|
|
@ -15,7 +15,9 @@ prep \- prepare a text file for statistical analysis
|
|||
# \\$2
|
||||
..
|
||||
.SH EXAMPLES
|
||||
.EX "prep infile >outfile" "Prepare \fIinfile\fR"
|
||||
.TP 20
|
||||
.B prep infile >outfile
|
||||
# Prepare \fIinfile\fR
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fIPrep\fR strips off most of the troff commands from a text file and then
|
||||
|
|
|
|||
|
|
@ -15,14 +15,28 @@ ps \- process status
|
|||
# \\$2
|
||||
..
|
||||
.SH OPTIONS
|
||||
.FL "\-a" "Print all processes with controlling terminals"
|
||||
.FL "\-l" "Give long listing"
|
||||
.FL "\-x" "Include processes without a terminal"
|
||||
.FL "\-E" "Print kernel endpoint numbers where pids are normally printed"
|
||||
.TP 5
|
||||
.B \-a
|
||||
# Print all processes with controlling terminals
|
||||
.TP 5
|
||||
.B \-l
|
||||
# Give long listing
|
||||
.TP 5
|
||||
.B \-x
|
||||
# Include processes without a terminal
|
||||
.TP 5
|
||||
.B \-E
|
||||
# Print kernel endpoint numbers where pids are normally printed
|
||||
.SH EXAMPLES
|
||||
.EX "ps " "Show user's own processes in short format"
|
||||
.EX "ps \-axlE" "Print all processes and tasks in long format"
|
||||
.EX "ps \axlE" "Same -- the '\-' is optional"
|
||||
.TP 20
|
||||
.B ps
|
||||
# Show user's own processes in short format
|
||||
.TP 20
|
||||
.B ps \-axlE
|
||||
# Print all processes and tasks in long format
|
||||
.TP 20
|
||||
.B ps \axlE
|
||||
# Same -- the '\-' is optional
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fIPs\fR prints the status of active processes. Normally only the caller's own
|
||||
|
|
|
|||
|
|
@ -15,7 +15,9 @@ pwd \- print working directory
|
|||
# \\$2
|
||||
..
|
||||
.SH EXAMPLES
|
||||
.EX "pwd " "Print the name of the working directory"
|
||||
.TP 20
|
||||
.B pwd
|
||||
# Print the name of the working directory
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
The full path name of the current working directory is printed.
|
||||
|
|
|
|||
|
|
@ -15,11 +15,19 @@ readall \- read a device quickly to check for bad blocks
|
|||
# \\$2
|
||||
..
|
||||
.SH OPTIONS
|
||||
.FL "\-b" "Produce shell script on \fIstdout\fR that calls \fIbadblocks\fR"
|
||||
.FL "\-t" "Just print device size"
|
||||
.TP 5
|
||||
.B \-b
|
||||
# Produce shell script on \fIstdout\fR that calls \fIbadblocks\fR
|
||||
.TP 5
|
||||
.B \-t
|
||||
# Just print device size
|
||||
.SH EXAMPLES
|
||||
.EX "readall /dev/hd0" "Read all of \fI/dev/hd0\fR"
|
||||
.EX "readall -b /dev/hd1 >s" "Generate shell script on \fIs\fR"
|
||||
.TP 20
|
||||
.B readall /dev/hd0
|
||||
# Read all of \fI/dev/hd0\fR
|
||||
.TP 20
|
||||
.B readall -b /dev/hd1 >s
|
||||
# Generate shell script on \fIs\fR
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fIReadall\fR reads all of the named device in large chunks.
|
||||
|
|
|
|||
|
|
@ -15,16 +15,34 @@ rz \- receive a file using the zmodem protocol
|
|||
# \\$2
|
||||
..
|
||||
.SH OPTIONS
|
||||
.FL "\-a" "CP/M to UNIX conventions"
|
||||
.FL "\-b" "Binary file"
|
||||
.FL "\-e" "Escape for all control characters"
|
||||
.FL "\-p" "Protect file if it already exists"
|
||||
.FL "\-q" "Quiet; opposite of verbose"
|
||||
.FL "\-t" "Set \fItimeout\fR in tenths of a second"
|
||||
.FL "\-v" "Verbose; opposite of quiet"
|
||||
.FL "\-y" "Yes, clobber existing files"
|
||||
.TP 5
|
||||
.B \-a
|
||||
# CP/M to UNIX conventions
|
||||
.TP 5
|
||||
.B \-b
|
||||
# Binary file
|
||||
.TP 5
|
||||
.B \-e
|
||||
# Escape for all control characters
|
||||
.TP 5
|
||||
.B \-p
|
||||
# Protect file if it already exists
|
||||
.TP 5
|
||||
.B \-q
|
||||
# Quiet; opposite of verbose
|
||||
.TP 5
|
||||
.B \-t
|
||||
# Set \fItimeout\fR in tenths of a second
|
||||
.TP 5
|
||||
.B \-v
|
||||
# Verbose; opposite of quiet
|
||||
.TP 5
|
||||
.B \-y
|
||||
# Yes, clobber existing files
|
||||
.SH EXAMPLES
|
||||
.EX "rz </dev/tty01 >/dev/tty01" "Receive a file"
|
||||
.TP 20
|
||||
.B rz </dev/tty01 >/dev/tty01
|
||||
# Receive a file
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
The XMODEM, YMODEM, and ZMODEM family of file transfer programs are widely
|
||||
|
|
|
|||
|
|
@ -15,8 +15,12 @@ shar \- shell archiver
|
|||
# \\$2
|
||||
..
|
||||
.SH EXAMPLES
|
||||
.EX "shar *.c >s" "Collect C programs in shell archive"
|
||||
.EX "sh <s" "Extract files from a shell archive"
|
||||
.TP 20
|
||||
.B shar *.c >s
|
||||
# Collect C programs in shell archive
|
||||
.TP 20
|
||||
.B sh <s
|
||||
# Extract files from a shell archive
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
The named files are collected together into a shell archive written onto
|
||||
|
|
|
|||
|
|
@ -15,7 +15,9 @@ sleep \- suspend execution for a given number of seconds
|
|||
# \\$2
|
||||
..
|
||||
.SH EXAMPLES
|
||||
.EX "sleep 10" "Suspend execution for 10 sec."
|
||||
.TP 20
|
||||
.B sleep 10
|
||||
# Suspend execution for 10 sec.
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
The caller is suspended for the indicated number of seconds.
|
||||
|
|
|
|||
|
|
@ -15,22 +15,52 @@ sort \- sort a file of ASCII lines
|
|||
# \\$2
|
||||
..
|
||||
.SH OPTIONS
|
||||
.FL "\-b" "Skip leading blanks when making comparisons"
|
||||
.FL "\-c" "Check to see if a file is sorted"
|
||||
.FL "\-d" "Dictionary order: ignore punctuation"
|
||||
.FL "\-f" "Fold upper case onto lower case"
|
||||
.FL "\-i" "Ignore nonASCII characters"
|
||||
.FL "\-m" "Merge presorted files"
|
||||
.FL "\-n" "Numeric sort order"
|
||||
.FL "\-o" "Next argument is output file"
|
||||
.FL "\-r" "Reverse the sort order"
|
||||
.FL "\-t" "Following character is field separator"
|
||||
.FL "\-u" "Unique mode (delete duplicate lines)"
|
||||
.TP 5
|
||||
.B \-b
|
||||
# Skip leading blanks when making comparisons
|
||||
.TP 5
|
||||
.B \-c
|
||||
# Check to see if a file is sorted
|
||||
.TP 5
|
||||
.B \-d
|
||||
# Dictionary order: ignore punctuation
|
||||
.TP 5
|
||||
.B \-f
|
||||
# Fold upper case onto lower case
|
||||
.TP 5
|
||||
.B \-i
|
||||
# Ignore nonASCII characters
|
||||
.TP 5
|
||||
.B \-m
|
||||
# Merge presorted files
|
||||
.TP 5
|
||||
.B \-n
|
||||
# Numeric sort order
|
||||
.TP 5
|
||||
.B \-o
|
||||
# Next argument is output file
|
||||
.TP 5
|
||||
.B \-r
|
||||
# Reverse the sort order
|
||||
.TP 5
|
||||
.B \-t
|
||||
# Following character is field separator
|
||||
.TP 5
|
||||
.B \-u
|
||||
# Unique mode (delete duplicate lines)
|
||||
.SH EXAMPLES
|
||||
.EX "sort \-nr file" "Sort keys numerically, reversed"
|
||||
.EX "sort +2 \-4 file" "Sort using fields 2 and 3 as key"
|
||||
.EX "sort +2 \-t: \-o out" "Field separator is \fI:\fP"
|
||||
.EX "sort +.3 \-.6" "Characters 3 through 5 form the key"
|
||||
.TP 20
|
||||
.B sort \-nr file
|
||||
# Sort keys numerically, reversed
|
||||
.TP 20
|
||||
.B sort +2 \-4 file
|
||||
# Sort using fields 2 and 3 as key
|
||||
.TP 20
|
||||
.B sort +2 \-t: \-o out
|
||||
# Field separator is \fI:\fP
|
||||
.TP 20
|
||||
.B sort +.3 \-.6
|
||||
# Characters 3 through 5 form the key
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
.I Sort
|
||||
|
|
|
|||
|
|
@ -15,7 +15,9 @@ spell \- print all words in a file not present in the dictionary
|
|||
# \\$2
|
||||
..
|
||||
.SH EXAMPLES
|
||||
.EX "spell document" "Print the spelling errors on \fIstdout\fR"
|
||||
.TP 20
|
||||
.B spell document
|
||||
# Print the spelling errors on \fIstdout\fR
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fISpell\fR is the
|
||||
|
|
|
|||
|
|
@ -15,10 +15,16 @@ split \- split a large file into several smaller files
|
|||
# \\$2
|
||||
..
|
||||
.SH OPTIONS
|
||||
.FL "\-\fIn\fP" "Number of lines per piece (default: 1000)"
|
||||
.TP 5
|
||||
.B \-\fIn\fP
|
||||
# Number of lines per piece (default: 1000)
|
||||
.SH EXAMPLES
|
||||
.EX "split \-200 file" "Split \fIfile\fP into pieces of 200 lines each"
|
||||
.EX "split file z" "Split \fIfile\fP into \fIzaa\fP, \fIzab\fP, etc."
|
||||
.TP 20
|
||||
.B split \-200 file
|
||||
# Split \fIfile\fP into pieces of 200 lines each
|
||||
.TP 20
|
||||
.B split file z
|
||||
# Split \fIfile\fP into \fIzaa\fP, \fIzab\fP, etc.
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
.I Split
|
||||
|
|
|
|||
|
|
@ -15,7 +15,9 @@ sum \- compute the checksum and block count of a file
|
|||
# \\$2
|
||||
..
|
||||
.SH EXAMPLES
|
||||
.EX "sum /user/ast/xyz" "Checksum \fI/user/ast/xyz"
|
||||
.TP 20
|
||||
.B sum /user/ast/xyz
|
||||
# Checksum \fI/user/ast/xyz
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
.I Sum
|
||||
|
|
|
|||
|
|
@ -19,14 +19,28 @@ svc, ci, co, svclog \- shell version control system
|
|||
# \\$2
|
||||
..
|
||||
.SH OPTIONS
|
||||
.FL "\-l" "For \fIci\fR, checkin, checkout again, and lock file"
|
||||
.FL "\-l" "For \fIco\fR, checkout file and then lock the archive"
|
||||
.FL "\-u" "After checking in, do not delete the file"
|
||||
.FL "\-r" "Check out revision \fIrev\fR instead most recent revision
|
||||
.TP 5
|
||||
.B \-l
|
||||
# For \fIci\fR, checkin, checkout again, and lock file
|
||||
.TP 5
|
||||
.B \-l
|
||||
# For \fIco\fR, checkout file and then lock the archive
|
||||
.TP 5
|
||||
.B \-u
|
||||
# After checking in, do not delete the file
|
||||
.TP 5
|
||||
.B \-r
|
||||
# Check out revision \fIrev\fR instead most recent revision
|
||||
.SH EXAMPLES
|
||||
.EX "ci \-u file" "Check in \fIfile\fR"
|
||||
.EX "co \-l file" "Check out \fIfile\fR and lock archive"
|
||||
.EX "co \-r 2 file" "Check out version 2"
|
||||
.TP 20
|
||||
.B ci \-u file
|
||||
# Check in \fIfile\fR
|
||||
.TP 20
|
||||
.B co \-l file
|
||||
# Check out \fIfile\fR and lock archive
|
||||
.TP 20
|
||||
.B co \-r 2 file
|
||||
# Check out version 2
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fISvc\fR is the Shell Version Control system, patterned on RCS.
|
||||
|
|
|
|||
|
|
@ -15,27 +15,67 @@ sz \- send a file using the zmodem protocol
|
|||
# \\$2
|
||||
..
|
||||
.SH OPTIONS
|
||||
.FL "\-L" "Use \fIn\fR-byte packets"
|
||||
.FL "\-N" "Overwrite if source is newer/longer"
|
||||
.FL "\-b" "Binary file"
|
||||
.FL "\-c" "Send command for execution"
|
||||
.FL "\-d" "Convert dot to slash in names"
|
||||
.FL "\-e" "Escape for all control characters"
|
||||
.FL "\-f" "Send full path name"
|
||||
.FL "\-i" "Send command and return immediately"
|
||||
.FL "\-l" "Flow control every \fIn\fR packets"
|
||||
.FL "\-n" "Overwrite destination if source is newer"
|
||||
.FL "\-o" "Use old (16-bit) checksum"
|
||||
.FL "\-p" "Protect file if it already exists"
|
||||
.FL "\-q" "Quiet; opposite of verbose"
|
||||
.FL "\-r" "Resume interrupt file transfer"
|
||||
.FL "\-t" "Set \fItimeout\fR in tenths of a second"
|
||||
.FL "\-u" "Unlink file after successful transmission"
|
||||
.FL "\-v" "Verbose; opposite of quiet"
|
||||
.FL "\-y" "Yes, clobber existing files"
|
||||
.FL "\-+" "Append to an existing file"
|
||||
.TP 5
|
||||
.B \-L
|
||||
# Use \fIn\fR-byte packets
|
||||
.TP 5
|
||||
.B \-N
|
||||
# Overwrite if source is newer/longer
|
||||
.TP 5
|
||||
.B \-b
|
||||
# Binary file
|
||||
.TP 5
|
||||
.B \-c
|
||||
# Send command for execution
|
||||
.TP 5
|
||||
.B \-d
|
||||
# Convert dot to slash in names
|
||||
.TP 5
|
||||
.B \-e
|
||||
# Escape for all control characters
|
||||
.TP 5
|
||||
.B \-f
|
||||
# Send full path name
|
||||
.TP 5
|
||||
.B \-i
|
||||
# Send command and return immediately
|
||||
.TP 5
|
||||
.B \-l
|
||||
# Flow control every \fIn\fR packets
|
||||
.TP 5
|
||||
.B \-n
|
||||
# Overwrite destination if source is newer
|
||||
.TP 5
|
||||
.B \-o
|
||||
# Use old (16-bit) checksum
|
||||
.TP 5
|
||||
.B \-p
|
||||
# Protect file if it already exists
|
||||
.TP 5
|
||||
.B \-q
|
||||
# Quiet; opposite of verbose
|
||||
.TP 5
|
||||
.B \-r
|
||||
# Resume interrupt file transfer
|
||||
.TP 5
|
||||
.B \-t
|
||||
# Set \fItimeout\fR in tenths of a second
|
||||
.TP 5
|
||||
.B \-u
|
||||
# Unlink file after successful transmission
|
||||
.TP 5
|
||||
.B \-v
|
||||
# Verbose; opposite of quiet
|
||||
.TP 5
|
||||
.B \-y
|
||||
# Yes, clobber existing files
|
||||
.TP 5
|
||||
.B \-+
|
||||
# Append to an existing file
|
||||
.SH EXAMPLES
|
||||
.EX "sz file </dev/tty01 >/dev/tty01" "Send \fIfile\fR"
|
||||
.TP 20
|
||||
.B sz file </dev/tty01 >/dev/tty01
|
||||
# Send \fIfile\fR
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
XMODEM, YMODEM, and ZMODEM are a family of protocols that are widely used
|
||||
|
|
|
|||
|
|
@ -15,14 +15,28 @@ tail \- print the last few lines of a file
|
|||
# \\$2
|
||||
..
|
||||
.SH OPTIONS
|
||||
.FL "\-c" "The count refers to characters"
|
||||
.FL "\-f" "On FIFO or special file, keep reading after EOF"
|
||||
.FL "\-n" "The count refers to lines"
|
||||
.TP 5
|
||||
.B \-c
|
||||
# The count refers to characters
|
||||
.TP 5
|
||||
.B \-f
|
||||
# On FIFO or special file, keep reading after EOF
|
||||
.TP 5
|
||||
.B \-n
|
||||
# The count refers to lines
|
||||
.SH EXAMPLES
|
||||
.EX "tail \-n 6" "Print last 6 lines of \fIstdin\fR"
|
||||
.EX "tail \-c 20 file" "Print the last 20 characters of \fIfile\fR"
|
||||
.EX "tail \-n 1 file1 file2" "Print last line of two files"
|
||||
.EX "tail \-n +8 file" "Print the tail starting with line 8"
|
||||
.TP 20
|
||||
.B tail \-n 6
|
||||
# Print last 6 lines of \fIstdin\fR
|
||||
.TP 20
|
||||
.B tail \-c 20 file
|
||||
# Print the last 20 characters of \fIfile\fR
|
||||
.TP 20
|
||||
.B tail \-n 1 file1 file2
|
||||
# Print last line of two files
|
||||
.TP 20
|
||||
.B tail \-n +8 file
|
||||
# Print the tail starting with line 8
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
The last few lines of one or more files are printed.
|
||||
|
|
|
|||
|
|
@ -15,11 +15,19 @@ tee \- divert stdin to a file
|
|||
# \\$2
|
||||
..
|
||||
.SH OPTIONS
|
||||
.FL "\-a" "Append to the files, rather than overwriting"
|
||||
.FL "\-i" "Ignore interrupts"
|
||||
.TP 5
|
||||
.B \-a
|
||||
# Append to the files, rather than overwriting
|
||||
.TP 5
|
||||
.B \-i
|
||||
# Ignore interrupts
|
||||
.SH EXAMPLES
|
||||
.EX "cat file1 file2 | tee x" "Save and display two files"
|
||||
.EX "pr file | tee x | lp" "Save the output of \fIpr\fP on \fIx\fP"
|
||||
.TP 20
|
||||
.B cat file1 file2 | tee x
|
||||
# Save and display two files
|
||||
.TP 20
|
||||
.B pr file | tee x | lp
|
||||
# Save the output of \fIpr\fP on \fIx\fP
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
.I Tee
|
||||
|
|
|
|||
|
|
@ -19,11 +19,21 @@ term \- turn PC into a dumb terminal [IBM]
|
|||
# \\$2
|
||||
..
|
||||
.SH EXAMPLES
|
||||
.EX "term 2400" "Talk to modem at 2400 baud"
|
||||
.EX "term 1200 7 even" "1200 baud, 7 bits/char, even parity"
|
||||
.EX "term 8 9600 /dev/tty01" "9600 baud, 8 bits/char, no parity, use tty01"
|
||||
.EX "term -atdt12345 /dev/tty01" "Start with a command to dial out"
|
||||
.EX "term -cH'echo Hello World!' ..." "Bind a shell command to the 'H' key"
|
||||
.TP 20
|
||||
.B term 2400
|
||||
# Talk to modem at 2400 baud
|
||||
.TP 20
|
||||
.B term 1200 7 even
|
||||
# 1200 baud, 7 bits/char, even parity
|
||||
.TP 20
|
||||
.B term 8 9600 /dev/tty01
|
||||
# 9600 baud, 8 bits/char, no parity, use tty01
|
||||
.TP 20
|
||||
.B term -atdt12345 /dev/tty01
|
||||
# Start with a command to dial out
|
||||
.TP 20
|
||||
.B term -cH'echo Hello World!' ...
|
||||
# Bind a shell command to the 'H' key
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fITerm\fR allows
|
||||
|
|
|
|||
|
|
@ -15,7 +15,9 @@ termcap \- print the current termcap entry
|
|||
# \\$2
|
||||
..
|
||||
.SH EXAMPLES
|
||||
.EX "termcap" "Print the termcap entry"
|
||||
.TP 20
|
||||
.B termcap
|
||||
# Print the termcap entry
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fITermcap\fR reads the /etc/termcap entry corresponding to the
|
||||
|
|
|
|||
|
|
@ -17,8 +17,12 @@ time \- report how long a command takes
|
|||
The -C option tells time to report the cpu cycle counter
|
||||
difference.
|
||||
.SH EXAMPLES
|
||||
.EX "time a.out" "Report how long \fIa.out\fR takes"
|
||||
.EX "time ls \-l *.c" "Report how long \fIls\fR takes"
|
||||
.TP 20
|
||||
.B time a.out
|
||||
# Report how long \fIa.out\fR takes
|
||||
.TP 20
|
||||
.B time ls \-l *.c
|
||||
# Report how long \fIls\fR takes
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
The command is executed and the real time, user time, and system time (in
|
||||
|
|
|
|||
|
|
@ -15,12 +15,22 @@ tr \- translate character codes
|
|||
# \\$2
|
||||
..
|
||||
.SH OPTIONS
|
||||
.FL "\-c" "Complement the set of characters in \fIstring1\fR"
|
||||
.FL "\-d" "Delete all characters specified in \fIstring1\fR"
|
||||
.FL "\-s" "Squeeze all runs of characters in \fIstring1\fR to one character"
|
||||
.TP 5
|
||||
.B \-c
|
||||
# Complement the set of characters in \fIstring1\fR
|
||||
.TP 5
|
||||
.B \-d
|
||||
# Delete all characters specified in \fIstring1\fR
|
||||
.TP 5
|
||||
.B \-s
|
||||
# Squeeze all runs of characters in \fIstring1\fR to one character
|
||||
.SH EXAMPLES
|
||||
.EX "tr \(fmA\-Z\(fm \(fma\-z\(fm <x >y " "Convert upper case to lower case"
|
||||
.EX "tr \-d \(fm0123456789\(fm <f1 >f2 " "Delete all digits from \fIf1\fR"
|
||||
.TP 20
|
||||
.B tr \(fmA\-Z\(fm \(fma\-z\(fm <x >y
|
||||
# Convert upper case to lower case
|
||||
.TP 20
|
||||
.B tr \-d \(fm0123456789\(fm <f1 >f2
|
||||
# Delete all digits from \fIf1\fR
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
.I Tr
|
||||
|
|
@ -51,6 +61,10 @@ upper and xdigit. If any of these keywords is encountered between backets and
|
|||
colons, it is replaced by respectively alphanumeric characters, alphabetic
|
||||
characters, decimal digits, lowercase letters, uppercase letters and
|
||||
hexadecimal digits. The following are equivalent with the given examples:
|
||||
.EX "tr \(fm[:upper:]\(fm \(fm[:lower:]\(fm <x >y " "Convert upper case to lower case"
|
||||
.EX "tr \-d \(fm[:digit:]\(fm <f1 >f2 " "Delete all digits from \fIf1\fR"
|
||||
.TP 20
|
||||
.B tr \(fm[:upper:]\(fm \(fm[:lower:]\(fm <x >y
|
||||
# Convert upper case to lower case
|
||||
.TP 20
|
||||
.B tr \-d \(fm[:digit:]\(fm <f1 >f2
|
||||
# Delete all digits from \fIf1\fR
|
||||
|
||||
|
|
|
|||
|
|
@ -15,8 +15,12 @@ tsort \- topological sort [IBM]
|
|||
# \\$2
|
||||
..
|
||||
.SH EXAMPLES
|
||||
.EX "lorder *.s | tsort" "Give library ordering"
|
||||
.EX "ar cr libc.a \`lorder *.s | tsort\`" "Build library"
|
||||
.TP 20
|
||||
.B lorder *.s | tsort
|
||||
# Give library ordering
|
||||
.TP 20
|
||||
.B ar cr libc.a \`lorder *.s | tsort\`
|
||||
# Build library
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fITsort\fR accepts a file of lines containing ordered pairs and builds a
|
||||
|
|
|
|||
|
|
@ -15,9 +15,13 @@ tty \- print the device name of this tty
|
|||
# \\$2
|
||||
..
|
||||
.SH OPTIONS
|
||||
.FL "\-s" "Silent mode, only the exit status is affected."
|
||||
.TP 5
|
||||
.B \-s
|
||||
# Silent mode, only the exit status is affected.
|
||||
.SH EXAMPLES
|
||||
.EX "tty " "Print the tty name"
|
||||
.TP 20
|
||||
.B tty
|
||||
# Print the tty name
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
Print the name of the controlling tty. If the flag \fB\-s\fR is given,
|
||||
|
|
|
|||
|
|
@ -15,8 +15,12 @@ umount \- unmount a mounted file system
|
|||
# \\$2
|
||||
..
|
||||
.SH EXAMPLES
|
||||
.EX "umount /dev/fd1" "Unmount diskette 1"
|
||||
.EX "umount /mnt" "Unmount the file system mounted on /mnt"
|
||||
.TP 20
|
||||
.B umount /dev/fd1
|
||||
# Unmount diskette 1
|
||||
.TP 20
|
||||
.B umount /mnt
|
||||
# Unmount the file system mounted on /mnt
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
This command unmounts a file system identified by
|
||||
|
|
|
|||
|
|
@ -17,16 +17,34 @@ uname, arch \- system info
|
|||
# \\$2
|
||||
..
|
||||
.SH OPTIONS
|
||||
.FL "\-s" "System name"
|
||||
.FL "\-n" "Node/network name"
|
||||
.FL "\-r" "Operating system release"
|
||||
.FL "\-v" "Operating system version"
|
||||
.FL "\-m" "Machine type"
|
||||
.FL "\-p" "Processor family"
|
||||
.FL "\-a" "Short for \fB\-snrvm\fR"
|
||||
.TP 5
|
||||
.B \-s
|
||||
# System name
|
||||
.TP 5
|
||||
.B \-n
|
||||
# Node/network name
|
||||
.TP 5
|
||||
.B \-r
|
||||
# Operating system release
|
||||
.TP 5
|
||||
.B \-v
|
||||
# Operating system version
|
||||
.TP 5
|
||||
.B \-m
|
||||
# Machine type
|
||||
.TP 5
|
||||
.B \-p
|
||||
# Processor family
|
||||
.TP 5
|
||||
.B \-a
|
||||
# Short for \fB\-snrvm\fR
|
||||
.SH EXAMPLES
|
||||
.EX "uname -n" "Print the name of the system"
|
||||
.EX "arch" "Print the name of the system architecture"
|
||||
.TP 20
|
||||
.B uname -n
|
||||
# Print the name of the system
|
||||
.TP 20
|
||||
.B arch
|
||||
# Print the name of the system architecture
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fIUname\fP and \fIarch\fP give information about the system. The options
|
||||
|
|
|
|||
|
|
@ -15,9 +15,13 @@ unexpand \- convert spaces to tabs
|
|||
# \\$2
|
||||
..
|
||||
.SH OPTIONS
|
||||
.FL "\-a" "All spaces are unexpanded"
|
||||
.TP 5
|
||||
.B \-a
|
||||
# All spaces are unexpanded
|
||||
.SH EXAMPLES
|
||||
.EX "unexpand oldfile >newfile" "Convert leading spaces to tabs"
|
||||
.TP 20
|
||||
.B unexpand oldfile >newfile
|
||||
# Convert leading spaces to tabs
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fIUnexpand\fR replaces spaces in the named files with tabs.
|
||||
|
|
|
|||
|
|
@ -15,12 +15,22 @@ uud, uudecode \- decode a binary file encoded with uue
|
|||
# \\$2
|
||||
..
|
||||
.SH OPTIONS
|
||||
.FL "\-n" "Do not verify checksums"
|
||||
.FL "\-s" "Name of directory where \fI.uue\fR file is"
|
||||
.FL "\-t" "Name of directory where output goes"
|
||||
.TP 5
|
||||
.B \-n
|
||||
# Do not verify checksums
|
||||
.TP 5
|
||||
.B \-s
|
||||
# Name of directory where \fI.uue\fR file is
|
||||
.TP 5
|
||||
.B \-t
|
||||
# Name of directory where output goes
|
||||
.SH EXAMPLES
|
||||
.EX "uud file.uue " "Re-create the original file"
|
||||
.EX "uud \- <file.uue" "The \- means use \fIstdin\fR"
|
||||
.TP 20
|
||||
.B uud file.uue
|
||||
# Re-create the original file
|
||||
.TP 20
|
||||
.B uud \- <file.uue
|
||||
# The \- means use \fIstdin\fR
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fIUud\fR decodes a file encoded with \fIuue\fR or
|
||||
|
|
|
|||
|
|
@ -15,11 +15,19 @@ uue, uuencode \- encode a binary file to ASCII (e.g., for mailing)
|
|||
# \\$2
|
||||
..
|
||||
.SH OPTIONS
|
||||
.FL "\-\fIn\fR" "How many lines to put in each file"
|
||||
.TP 5
|
||||
.B \-\fIn\fR
|
||||
# How many lines to put in each file
|
||||
.SH EXAMPLES
|
||||
.EX "uue file" "Encode \fIfile\fR to \fIfile.uue\fR"
|
||||
.EX "uue file \- >x" "Encode \fIfile\fR and write on \fIstdout\fR"
|
||||
.EX "uue \-800 file" "Output on \fIfile.uaa\fR, \fIfile.uab\fR etc."
|
||||
.TP 20
|
||||
.B uue file
|
||||
# Encode \fIfile\fR to \fIfile.uue\fR
|
||||
.TP 20
|
||||
.B uue file \- >x
|
||||
# Encode \fIfile\fR and write on \fIstdout\fR
|
||||
.TP 20
|
||||
.B uue \-800 file
|
||||
# Output on \fIfile.uaa\fR, \fIfile.uab\fR etc.
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fIUuencode\fR is a famous program that converts an arbitrary (usually binary)
|
||||
|
|
|
|||
|
|
@ -15,12 +15,22 @@ wc \- count characters, words, and lines in a file
|
|||
# \\$2
|
||||
..
|
||||
.SH OPTIONS
|
||||
.FL "\-c" "Print character count"
|
||||
.FL "\-l" "Print line count"
|
||||
.FL "\-w" "Print word count"
|
||||
.TP 5
|
||||
.B \-c
|
||||
# Print character count
|
||||
.TP 5
|
||||
.B \-l
|
||||
# Print line count
|
||||
.TP 5
|
||||
.B \-w
|
||||
# Print word count
|
||||
.SH EXAMPLES
|
||||
.EX "wc file1 file2" "Print all three counts for both files"
|
||||
.EX "wc \-l file" "Print line count only"
|
||||
.TP 20
|
||||
.B wc file1 file2
|
||||
# Print all three counts for both files
|
||||
.TP 20
|
||||
.B wc \-l file
|
||||
# Print line count only
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
.I Wc
|
||||
|
|
|
|||
|
|
@ -15,7 +15,9 @@ whereis \- examine system directories for a given file
|
|||
# \\$2
|
||||
..
|
||||
.SH EXAMPLES
|
||||
.EX "whereis stat.h" "Prints: \fI/usr/include/sys/stat.h\fR"
|
||||
.TP 20
|
||||
.B whereis stat.h
|
||||
# Prints: \fI/usr/include/sys/stat.h\fR
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fIWhereis\fR searches a fixed set of system
|
||||
|
|
|
|||
|
|
@ -15,7 +15,9 @@ which \- examine $PATH to see which file will be executed
|
|||
# \\$2
|
||||
..
|
||||
.SH EXAMPLES
|
||||
.EX "which a.out" "Tells which \fIa.out\fR will be executed"
|
||||
.TP 20
|
||||
.B which a.out
|
||||
# Tells which \fIa.out\fR will be executed
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
The $PATH shell variable controls the
|
||||
|
|
|
|||
|
|
@ -15,7 +15,9 @@ who \- print list of currently logged in users
|
|||
# \\$2
|
||||
..
|
||||
.SH EXAMPLES
|
||||
.EX "who " "Print user names, terminals and times"
|
||||
.TP 20
|
||||
.B who
|
||||
# Print user names, terminals and times
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fIWho\fR prints a list of currently logged in users. For each one,
|
||||
|
|
|
|||
|
|
@ -15,11 +15,19 @@ write \- send a message to a logged-in user
|
|||
# \\$2
|
||||
..
|
||||
.SH OPTIONS
|
||||
.FL "\-c" "Use cbreak mode"
|
||||
.FL "\-v" "Verbose mode"
|
||||
.TP 5
|
||||
.B \-c
|
||||
# Use cbreak mode
|
||||
.TP 5
|
||||
.B \-v
|
||||
# Verbose mode
|
||||
.SH EXAMPLES
|
||||
.EX "write ast" "Send a message to ast"
|
||||
.EX "write ast tty00" "Send a message to ast on tty00"
|
||||
.TP 20
|
||||
.B write ast
|
||||
# Send a message to ast
|
||||
.TP 20
|
||||
.B write ast tty00
|
||||
# Send a message to ast on tty00
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fIWrite\fR lets a user send messages to another logged-in user.
|
||||
|
|
|
|||
|
|
@ -15,7 +15,9 @@ yes \- an endless stream of the same word
|
|||
# \\$2
|
||||
..
|
||||
.SH EXAMPLES
|
||||
.EX "yes | script" "Answer yes to all questions from the script"
|
||||
.TP 20
|
||||
.B yes | script
|
||||
# Answer yes to all questions from the script
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fIYes\fP sends out an endless stream of y's, each on one line. One
|
||||
|
|
|
|||
|
|
@ -2,13 +2,27 @@
|
|||
.TH ELVIS 1x
|
||||
.CD "elvis \(en clone of the Berkeley vi editor"
|
||||
.SX "elvis \fR[\fB\(enRerv\fR] [\fB\(ent \fItag\fR] \fR[\fIfile\fR] ..."
|
||||
.FL "\(enR" "Set the read-only option"
|
||||
.FL "\(ene" "Start up emulating \fIex\fR"
|
||||
.FL "\(enr" "Tell the user to use \fIelvrec\fR instead
|
||||
.FL "\(ent" "Start editing at the given tag"
|
||||
.FL "\(env" "Start up emulating \fIvi\fR"
|
||||
.EX "elvis" "Call the editor"
|
||||
.EX "elvis prog.c" "edit \fIprog.c\fR"
|
||||
.TP 5
|
||||
.B \(enR
|
||||
# Set the read-only option
|
||||
.TP 5
|
||||
.B \(ene
|
||||
# Start up emulating \fIex\fR
|
||||
.TP 5
|
||||
.B \(enr
|
||||
# Tell the user to use \fIelvrec\fR instead
|
||||
.TP 5
|
||||
.B \(ent
|
||||
# Start editing at the given tag
|
||||
.TP 5
|
||||
.B \(env
|
||||
# Start up emulating \fIvi\fR
|
||||
.TP 20
|
||||
.B elvis
|
||||
# Call the editor
|
||||
.TP 20
|
||||
.B elvis prog.c
|
||||
# edit \fIprog.c\fR
|
||||
.PP
|
||||
\fIElvis\fR is a full-screen editor closely modeled on the famous Berkeley
|
||||
\fIvi\fR editor.
|
||||
|
|
|
|||
|
|
@ -3,9 +3,15 @@
|
|||
.CD "mined \(en \*(M2 editor"
|
||||
.SX "mined\fR [\fIfile\fR]
|
||||
.FL "\fR(none)"
|
||||
.EX "mined /user/ast/book.3" "Edit an existing file"
|
||||
.EX "mined" "Call editor to create a new file"
|
||||
.EX "ls \(enl | mined" "Use \fImined\fR as a pager to inspect listing"
|
||||
.TP 20
|
||||
.B mined /user/ast/book.3
|
||||
# Edit an existing file
|
||||
.TP 20
|
||||
.B mined
|
||||
# Call editor to create a new file
|
||||
.TP 20
|
||||
.B ls \(enl | mined
|
||||
# Use \fImined\fR as a pager to inspect listing
|
||||
.PP
|
||||
\fIMined\fR is a simple screen editor.
|
||||
At any instant, a window of 24 lines is visible on the screen.
|
||||
|
|
|
|||
|
|
@ -15,19 +15,43 @@ backup \- backup files
|
|||
# \\$2
|
||||
..
|
||||
.SH OPTIONS
|
||||
.FL "\-d" "At top level, only directories are backed up"
|
||||
.FL "\-j" "Do not copy junk: \fI *.Z, *.bak, a.out, core\fR, etc"
|
||||
.FL "\-m" "If device full, prompt for new diskette"
|
||||
.FL "\-n" "Do not backup top-level directories"
|
||||
.FL "\-o" "Do not copy \fI*.o\fR files"
|
||||
.FL "\-r" "Restore files"
|
||||
.FL "\-s" "Do not copy \fI*.s\fR files"
|
||||
.FL "\-t" "Preserve creation times"
|
||||
.FL "\-v" "Verbose; list files being backed up"
|
||||
.FL "\-z" "Compress the files on the backup medium"
|
||||
.TP 5
|
||||
.B \-d
|
||||
# At top level, only directories are backed up
|
||||
.TP 5
|
||||
.B \-j
|
||||
# Do not copy junk: \fI *.Z, *.bak, a.out, core\fR, etc
|
||||
.TP 5
|
||||
.B \-m
|
||||
# If device full, prompt for new diskette
|
||||
.TP 5
|
||||
.B \-n
|
||||
# Do not backup top-level directories
|
||||
.TP 5
|
||||
.B \-o
|
||||
# Do not copy \fI*.o\fR files
|
||||
.TP 5
|
||||
.B \-r
|
||||
# Restore files
|
||||
.TP 5
|
||||
.B \-s
|
||||
# Do not copy \fI*.s\fR files
|
||||
.TP 5
|
||||
.B \-t
|
||||
# Preserve creation times
|
||||
.TP 5
|
||||
.B \-v
|
||||
# Verbose; list files being backed up
|
||||
.TP 5
|
||||
.B \-z
|
||||
# Compress the files on the backup medium
|
||||
.SH EXAMPLES
|
||||
.EX "backup \-mz . /f0" "Backup current directory compressed"
|
||||
.EX "backup /bin /usr/bin" "Backup bin from RAM disk to hard disk"
|
||||
.TP 20
|
||||
.B backup \-mz . /f0
|
||||
# Backup current directory compressed
|
||||
.TP 20
|
||||
.B backup /bin /usr/bin
|
||||
# Backup bin from RAM disk to hard disk
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fIBackup\fR (recursively) backs up the contents of a given directory and its
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user