508 Commits

Author SHA1 Message Date
Ben Gras
8cf6236545 . forget obsolete /usr/local/bin in $PATH
. update release.sh's notion of where packages are
  . update release.sh's notion of how many files are on root
    as -xdev won't work anymore to separate /usr from /
2010-09-20 11:08:21 +00:00
Ben Gras
59a4400972 add minix-all package to be put on cd. 2010-09-20 09:57:02 +00:00
Ben Gras
bcc76fa94e pkgsrc: save binary packages in arch- and osversion dependent dir. 2010-09-17 14:31:28 +00:00
Thomas Veerman
4e706a260a Backport failing umount attempt fix from trunk 2010-09-17 11:07:18 +00:00
Arun Thomas
954d729e75 Update PATHs for llvm and X11 2010-09-12 18:01:15 +00:00
Arun Thomas
4c11340d63 Remove packit/packman from Makefile 2010-09-12 16:55:19 +00:00
Arun Thomas
272f315ea8 Remove packman and packit manpages 2010-09-12 14:11:07 +00:00
Arun Thomas
207e88d3c4 Update release script for pkgsrc 2010-09-10 17:00:30 +00:00
David van Moolenbroek
d29833c5aa remove hardcoding of system.conf path in various service calls 2010-09-10 09:22:22 +00:00
David van Moolenbroek
6b902492ae memory driver: propagate data copy error to caller 2010-09-09 16:13:02 +00:00
David van Moolenbroek
2bda06bbb5 shutdown(8): buffer accessed beyond end during option parsing 2010-09-09 08:48:47 +00:00
David van Moolenbroek
2e209097b6 IS: delete obsolete is.h 2010-09-09 08:47:39 +00:00
Tomas Hruby
e6ebac015d APIC mode uses IO APICs
- kernel turns on IO APICs if no_apic is _not_ set or is equal 0

- pci driver must use the acpi driver to setup IRQ routing otherwise
  the system cannot work correctly except systems like KVM that use
  only legacy (E)ISA IRQs 0-15
2010-09-07 07:18:11 +00:00
Erik van der Kouwe
5cc29a6c7e Make realpath deal with double slashes 2010-09-06 07:45:32 +00:00
Tomas Hruby
ad5ecf906b asm.h not installed 2010-09-03 17:01:18 +00:00
Erik van der Kouwe
18ad0b52d3 Make hexdump ACK-compilable and add it to the base system 2010-09-03 07:37:31 +00:00
Arun Thomas
9e4e26e0c8 No more packman, easypack, packit
-Create a dummy packman script that tells users about pkgin
2010-09-03 07:27:39 +00:00
Tomas Hruby
99d9144556 PCI driver uses ACPI if APIC is used.
-  PCI must query ACPI, if (IO)APIC is in use, for the routing
   information and change the ILR (interrupt line register) of each
   device accordingly so drivers use the right IRQ.
2010-09-02 15:44:38 +00:00
Tomas Hruby
7ae6f8740d ACPI driver loaded at boot time
- the acpi driver is part of the ramdisk and if present the rc script
  starts it before pci is started as pci needs if APIC mode is turned
  on.
2010-09-02 15:44:36 +00:00
Tomas Hruby
9560b6dea8 ACPI driver
- 99% of the code is Intel's ACPICA. The license is compliant with BSD
  and GNU and virtually all systems that use ACPI use this code, For
  instance it is part of the Linux kernel.

- The only minix specific files are

  acpi.c
  osminixxf.c
  platform/acminix.h

  and

  include/minix/acpi.h

- At the moment the driver does not register interrupt hooks which I
  believe is mainly for handling PnP, events like "battery level is
  low" and power management. Should not be difficult to add it if need
  be.

- The interface to the outside world is virtually non-existent except
  a trivial message based service for PCI driver to query which device
  is connected to what IRQ line. This will evolve as more components
  start using this driver. VM, Scheduler and IOMMU are the possible
  users right now.

- because of dependency on a native 64bit (long long, part of c99) it
  is compiled only with a gnu-like compilers which in case of Minix
  includes gcc llvm-gcc and clang
2010-09-02 15:44:04 +00:00
Tomas Hruby
43a4725423 pci_*.h headers moved from drivers/pci to include/machine 2010-09-02 15:43:59 +00:00
Tomas Hruby
2440ffae49 Kernel exports DSDP and apic_enabled in machine structure
- kernel exports DSDP (the root pointer where ACPI parsing starts) and
  apic_enabled in the machine structure.

- ACPI driver uses DSDP to locate ACPI in memory. acpi_enabled tell
  PCI driver to query ACPI for IRQ routing information.
2010-09-02 15:43:56 +00:00
Tomas Hruby
344e9221ec Kernel supports up to 64 IRQs
- enough for 2 io apics (usually with 24 pins)
2010-09-02 15:43:54 +00:00
Tomas Hruby
45badf4c05 ACPI in kernel
- the ability for kernel to use ACPI tables to detect IO APICs. It is
  the bare minimum the kernel needs to know about ACPI tables.

- it will be used to find out about processors as the MPS tables are
  deprecated by ACPI and not all vendorsprovide them.
2010-09-02 15:43:51 +00:00
Thomas Veerman
e7252adc1e Clean up the created temp file after running the test. 2010-09-02 09:33:37 +00:00
Ben Gras
eca25a6cab removed redundant includes dependency from gnu-libraries. 2010-09-01 18:48:47 +00:00
Ben Gras
c6cfdbffe4 also make gcc includes before compiling gcc libraries. 2010-09-01 18:28:55 +00:00
Thomas Veerman
0b00cf70b6 - Return ENOENT when trying to add files to removed (but open) directories.
- Add test58 to test this behavior.
2010-09-01 09:07:18 +00:00
Tomas Hruby
bf6f0216d5 tools/Makefile uses padtext only when building with ack 2010-09-01 07:46:51 +00:00
Ben Gras
b3c3a1cb1e gcc compiles - add -fno-builtin so that gcc optimisations don't break things.
- kernel compile was broken with gcc as putchar() was added by gcc in
    stacktrace.c
  - add -fno-builtin everywhere to avoid such problems in the future
  - -fno-builtin in kernel now redundant
2010-08-31 16:42:44 +00:00
Ben Gras
b1847ae244 make service look in /etc/system.conf.d/<progname> first for config file.
This makes it easier to
  - have non-base system drivers (get clobbered by global system.conf)
  - have drivers as packages (can't touch global system.conf)
  - make configs part of the drivers/servers instead of in global file
    (makes system parts more self-contained)
2010-08-31 14:33:31 +00:00
Erik van der Kouwe
1f2054c89c Shutdown changes for multiboot: CTRL-ALT-DEL resets, panic halts 2010-08-30 19:01:58 +00:00
David van Moolenbroek
4448836263 ramdisk: more inodes 2010-08-30 17:08:19 +00:00
Arun Thomas
36fb30dfef cdefs.h: Allow __CONCAT() macro to be nested 2010-08-30 14:34:58 +00:00
Thomas Veerman
a4c30acd9d Improve UDS testing. Fix a few bugs. Add testing of passing file descriptors.
Contributed by Thomas Cort.
2010-08-30 13:49:49 +00:00
Thomas Veerman
e8ddc0f46e - Add support for file descriptor passing to PFS.
- For security reasons move some libc code to PFS.
- Fix a few bugs in PFS.
Contributed by Thomas Cort.
2010-08-30 13:46:44 +00:00
Thomas Veerman
13ef7f1f38 Prepare VFS to support back calls from PFS. For security reasons and to support
file descriptor passing, PFS does some back calls to VFS. For example, to
verify the validity of a path provided by a process and to tell VFS it must
copy file descriptors from one process to another.
2010-08-30 13:44:07 +00:00
Thomas Veerman
2297e26660 Prepare headers to support file descriptor passing over UNIX Domain Sockets.
Contributed by Thomas Cort.
2010-08-30 13:41:22 +00:00
Erik van der Kouwe
a0bb199f69 Release script improvements, moving towards having the ramdisk working again 2010-08-29 19:22:42 +00:00
Erik van der Kouwe
a37514163b Touch generated files to avoid dependency generation warnings and missing dependencies 2010-08-29 17:50:51 +00:00
Erik van der Kouwe
a5741a465f update /etc on make world 2010-08-27 10:09:06 +00:00
David van Moolenbroek
3e3d627b25 mdb: disassembly fix for short 8-bit values 2010-08-27 09:31:26 +00:00
Arun Thomas
a78608ec86 Fix dependency problems in the build 2010-08-26 19:54:49 +00:00
Ben Gras
c81f201c8c added missing sef_gcov.c 2010-08-25 13:23:32 +00:00
Ben Gras
5d6c2aae0a gcov support, based on work contributed by Anton Kuijsten. 2010-08-25 13:06:43 +00:00
Ben Gras
d8466ce31f libaudiodriver <minix/audio_fw.h> fixes 2010-08-25 11:18:38 +00:00
Ben Gras
1c359afad4 connect libaudiodriver. 2010-08-25 11:07:36 +00:00
Ben Gras
0f4eda33eb new base libaudiodriver out of -lcommon in drivers/audio.
- this lets the drivers that used that library be compiled easily with
   different compilers.
2010-08-25 11:03:53 +00:00
Ben Gras
cb86231930 sb16: flatten mixer, common, dsp hierarchy into 2-PROGS dir 2010-08-25 09:57:10 +00:00
Ben Gras
36fa521a0e further ramdisk size increase for gcc+gcov binaries. 2010-08-25 07:26:00 +00:00
Ben Gras
1d0e0e217d <stddef.h> - alternative definition of offsetof for gcc using builtin 2010-08-25 07:25:32 +00:00
Erik van der Kouwe
50ca7f7f8f Zero out to three stack dwords to fix boot errors 2010-08-24 12:51:11 +00:00
Ben Gras
6fb1789ba4 at_wini: fix warning, bogus PRIVATE in struct type declaration 2010-08-24 12:45:37 +00:00
David van Moolenbroek
959026c29a RS: use PM's API instead of its internals 2010-08-24 07:20:41 +00:00
Erik van der Kouwe
3211be5d14 Avoid duplicate type definitions, especially wchar_t which was inconsstent and caused trouble in libarchive 2010-08-23 17:00:04 +00:00
Erik van der Kouwe
a2647a4181 Fix buffer overflow in libarchive if a UTF-8 encoded string has codepoints that require two UTF-16 words 2010-08-23 16:32:05 +00:00
Erik van der Kouwe
d743c5c6f3 Solve buffer overflow on tab completion in ash 2010-08-23 16:30:58 +00:00
Arun Thomas
c9d500e9fd Import hexdump(1) from NetBSD 2010-08-21 13:24:09 +00:00
Arun Thomas
de231a713e Move MIN() and MAX() macros to sys/params.h 2010-08-21 13:10:41 +00:00
Arun Thomas
60a71efca8 easprintf() and evasprintf() 2010-08-21 13:07:25 +00:00
Erik van der Kouwe
292f98dc29 Minor malloc-debug fixes 2010-08-20 19:50:36 +00:00
Erik van der Kouwe
2a736d0c2e Add MALLOC_DEBUG env var to debug applications using malloc 2010-08-20 19:16:31 +00:00
Erik van der Kouwe
b337d3f8e5 move rrrrrrread_tsc from libsys to libc so anyone can use it 2010-08-20 18:43:56 +00:00
Ben Gras
205855b8ee boot ramdisk slightly bigger for gcc-compiled binaries. 2010-08-20 12:59:55 +00:00
Erik van der Kouwe
b9f5e50421 Provide boot image process main functions with a full parameter list, so that bad things don't heppen when using getenv 2010-08-20 11:07:16 +00:00
Ben Gras
02440068fc update MANPATH for gcc, X 2010-08-19 16:35:01 +00:00
Ben Gras
4b9420d7d7 mk: use ar instead of gar for gcc/clang ar. 2010-08-18 16:08:10 +00:00
Ben Gras
3e7c270f6c rc: add /sbin to $PATH for fsck.mfs 2010-08-18 16:07:54 +00:00
Arun Thomas
9a21d1a2fd Macros for symbols used in both ASM and C
-The macros take care of prepending the leading underscore when
 necessary.
2010-08-17 16:44:07 +00:00
Thomas Veerman
c8cfcab5db - Make sure there's space left in the vmnt table for another mount point.
- Increase mount point limit.
2010-08-17 10:02:50 +00:00
Erik van der Kouwe
551374c228 Add ftello function 2010-08-16 17:07:40 +00:00
Erik van der Kouwe
a3e4dcafe0 Add fseeko function 2010-08-16 17:06:08 +00:00
Ben Gras
66b8f17a29 AR=ar still needed for pkgsrc. 2010-08-14 20:28:32 +00:00
Ben Gras
b1eb16e5ff pkgsrc: no more g* prefix for binutils. 2010-08-13 13:33:51 +00:00
David van Moolenbroek
5a377144b0 diskctl(8) into commands makefile 2010-08-12 14:21:55 +00:00
David van Moolenbroek
78fc74633a diskctl(8) tool 2010-08-12 14:11:28 +00:00
David van Moolenbroek
484b2f43d6 at_wini/ahci: write cache ioctls 2010-08-12 14:09:34 +00:00
David van Moolenbroek
5998a4b2af AHCI driver: miscellaneous changes
- check the DF status flag after each command
- increase I/O timeout from 15 to 30 seconds
- share some code between ATA and ATAPI after all
- produce more accurate errors on DIOCEJECT
- rename AHCI_ID_SIZE to the more appropriate ATA_ID_SIZE
- rearrange ahci.h in a now more sensible way
2010-08-12 14:08:23 +00:00
Erik van der Kouwe
f8c56494c9 Boot monitor shouldn't report memory after 4GB; the addresses are wrong and VM can't deal with it anyways 2010-08-12 13:44:47 +00:00
David van Moolenbroek
a7ed430587 ramdisk: actually add ahci to the image, too 2010-08-11 11:30:08 +00:00
David van Moolenbroek
3f6f7672c2 ramdisk: add preliminary support for ahci 2010-08-11 11:16:44 +00:00
David van Moolenbroek
5824aab560 small fix in hgfs.8 manpage 2010-08-11 10:01:34 +00:00
David van Moolenbroek
9acaece9cc fix ptrace.2 man page 2010-08-11 08:57:48 +00:00
David van Moolenbroek
bee1f38e01 VTreeFS library 2010-08-10 20:05:51 +00:00
Erik van der Kouwe
4e95b347a7 Make it possible again to compile the tests without installing GCC first 2010-08-09 05:51:01 +00:00
David van Moolenbroek
46624d640e hgfs comment fix: inode status, not statistics 2010-08-07 11:50:15 +00:00
Tomas Hruby
f7ef192c02 Fixed warning noreturn function returns in arch_system.c 2010-08-06 12:48:26 +00:00
Tomas Hruby
58654acf08 both ack and gcc can compile klib16.S 2010-08-06 12:46:44 +00:00
Tomas Hruby
905e94f058 gas2ack filters out .code16
- .code16 tells gnu as to generate 16bit assembly ack requires -mi86 switch
2010-08-06 12:46:01 +00:00
Erik van der Kouwe
c8f70b8154 Fix tests when run as root; use bin account but current directory 2010-08-06 12:33:32 +00:00
Tomas Hruby
ac9a7f47bd Missing prototype in pre_init.c
- gcc does not like it
2010-08-06 12:26:26 +00:00
Tomas Hruby
d5482f6e75 Reverted __packed for ACK
- ack does not produce packed structures
2010-08-06 10:28:40 +00:00
Tomas Hruby
6e614336d6 __packed defined for ACK 2010-08-06 09:53:53 +00:00
Erik van der Kouwe
c3c97e66b1 Fix ar error in testsh1.sh (ar was previously renamed to aal) 2010-08-06 09:28:26 +00:00
Erik van der Kouwe
5d4ef90b2c Fix cdiff error in testsh1.sh 2010-08-06 09:27:49 +00:00
David van Moolenbroek
16f2eb25f4 AHCI driver 2010-08-05 16:37:58 +00:00
Thomas Veerman
ce41c63f41 fsck and mkfs have been moved to /sbin 2010-08-05 15:11:10 +00:00
Ben Gras
e1f30da613 pkg_install: DESTDIR support. 2010-08-05 14:51:46 +00:00
Ben Gras
56770462c2 merge datasizes and unstack 2010-08-05 14:09:06 +00:00
Ben Gras
8da0925650 release.sh - let some packages come pre-installed (right now just pkgin) 2010-08-05 13:56:51 +00:00
Erik van der Kouwe
a9d31d3169 Remove spurious space 2010-08-05 13:35:41 +00:00
Thomas Veerman
5bf3967f26 Rename mkfs to mkfs.mfs and fsck to fsck.mfs. Add /sbin to root's PATH. 2010-08-05 12:35:00 +00:00
Erik van der Kouwe
0fc71a1154 Increase NR_INODES in the FS servers to match NR_VNODES in VFS 2010-08-05 11:37:37 +00:00
Erik van der Kouwe
912b4e0cb7 Return ENOSPC when out of inodes 2010-08-05 11:37:06 +00:00
Erik van der Kouwe
42a2c1a03a Increase max number of open files to 255 (more should be possible but does not seem necessary for now) 2010-08-04 13:35:19 +00:00
Thomas Veerman
e8846c3930 Also run test56, please 2010-08-04 10:03:50 +00:00
Ben Gras
83fc90c8c3 test57: test that state isn't corrupted after a signal handler being executed. 2010-08-04 09:00:58 +00:00
Erik van der Kouwe
b43f3b6bfc This patch copies the ext2 server onto the initial ramdisk, the final
patch to allow MINIX to boot from ext2.

To create a setup with MINIX on ext2, follow these steps:

- Assumptions:
  - there exists a primary partition c0dApB with a MINIX installation
    with GRUB support (/boot/image_latest exists on /dev/c0dApB)
  - there exists a free primary partition c0dCpD

- Create an ext2 filesystem on c0dApB (from Linux, until Tthom
  has ported mke2fs)

- Follow these steps (from a MINIX CD with ext2 support, another MINIX
  installation (not c0dApB) or Linux >= 2.6.35):

  mkdir /mnt/mfs /mnt/ext2
  mount /dev/c0dApBs0 /mnt/mfs
  mount /dev/c0dApBs1 /mnt/mfs/home
  mount /dev/c0dApBs2 /mnt/mfs/usr
  mount /dev/c0dCpD /mnt/ext2
  synctree  -f /mnt/mfs /mnt/ext2
  echo root=/dev/c0dCpD > /mnt/ext2/etc/fstab

  (note: no subpartitions used because that would confuse an unmodified
  bootloader)

- Add the new MINIX installation to GRUB according to steps 7&8 in
  http://wiki.minix3.org/en/SummerOfCode2010/MultiBoot/HowTo
2010-08-04 05:18:03 +00:00
Erik van der Kouwe
4eb7340395 Silence newroot 2010-08-03 13:58:36 +00:00
Erik van der Kouwe
4989de6acc Don't write to /etc/mtab in newroot, may be an issue on read-only filesystems 2010-08-03 13:57:58 +00:00
David van Moolenbroek
256c37f7fa mount: don't always autodetect 2010-08-03 13:46:00 +00:00
Ben Gras
42bbd56673 lib: when building clang/gcc libraries: add /usr/pkg/bin to $PATH 2010-08-03 11:21:25 +00:00
Ben Gras
e1dc59bd16 test Makefile: use any gcc in path 2010-08-03 11:20:31 +00:00
Ben Gras
9ce3961b8e mtree: drop /usr/local, add some pkgsrc dirs; /usr/etc/rc: pkgsrc rc.d 2010-08-03 11:18:18 +00:00
Dirk Vogt
4523163411 Some PCI config space registers have to be accessed in with there actual
width. Without this patch DDELinux is not able to read the PCI BARs
correctly.
2010-08-03 10:03:40 +00:00
Erik van der Kouwe
a719ab7780 Auto-detect ext2 partitions in mount 2010-08-03 06:28:58 +00:00
Ben Gras
453be3b530 rename nm and strip to acknm and ackstrip
this is to force invocations of these utils for ack to be
explicitly named such, so in the future binutils can be installed
in /usr/pkg without the g- prefix.
2010-08-02 16:09:19 +00:00
Erik van der Kouwe
0f92964a2f Oops 2010-08-02 14:49:35 +00:00
Erik van der Kouwe
25397ef756 Deal all shutdown cases with multiboot as either reset or poweroff depending on their type (contributed by Feiran 'Fam' Zheng) 2010-08-02 14:41:45 +00:00
Erik van der Kouwe
ebec792700 Display fallback message in case poweroff fails (contributed by Feiran 'Fam' Zheng) 2010-08-02 14:40:26 +00:00
Erik van der Kouwe
c7859a538c Replace newroot with a call to mount, will make type autodetect easier 2010-08-02 14:15:48 +00:00
Ben Gras
3b386ad39f minor pkgsrc tweaks; allow pkgsrc to install rc scripts in /usr/pkg/etc/rc.d 2010-08-02 12:28:24 +00:00
Thomas Veerman
dff0434eaf Add support for the ext2 file system. Contributed by Evgeniy Ivanov. 2010-08-02 11:44:45 +00:00
Thomas Veerman
253b4b3fe5 - Add support for ST_NOTRUNC to struct statvfs.
- Let tests that test for long file names check for that flag, so that they can
  verify the results properly.
2010-08-02 11:16:32 +00:00
David van Moolenbroek
20eced94e7 libdriver: allow driver to break out of message loop 2010-08-01 22:07:46 +00:00
David van Moolenbroek
da597227ac put env_arg[cv] declaration in minix/sysutil.h 2010-07-29 21:16:23 +00:00
Tomas Hruby
170b420d07 driver.h - missing guardian 2010-07-29 10:53:50 +00:00
Ben Gras
4510dddae4 add the sshd group 2010-07-29 09:54:34 +00:00
Ben Gras
49fe8e24b2 rename nameserv.h 2010-07-29 08:41:22 +00:00
Ben Gras
fb96391106 rename nemserv 2010-07-29 08:39:49 +00:00
Tomas Hruby
c80138ac71 BIOS function 0xE820 for memory map detection
- this function returns a ritcher description of available memory

- is ACPI compliant, ACPI data structures are excluded from free
  memory list

- available memory exported to Minix in a backwards compatible manner

- fallback to the old method if this function not available (old
  hardware)
2010-07-29 07:21:11 +00:00
Ben Gras
a022f412b5 extra includes to make porting cleaner 2010-07-28 16:32:45 +00:00
Ben Gras
05bbf81f93 new EPFNOSUPPORT errno 2010-07-28 16:32:21 +00:00
Ben Gras
b9cea27497 kernel: deadlock test with endpoints instead of slot numbers, slightly cleaner 2010-07-28 14:14:06 +00:00
Ben Gras
5d47cafa5b pkg_install: move db dir 2010-07-28 09:59:00 +00:00
Ben Gras
e9651ae962 pkgsrc: minor changes to paths, options. 2010-07-28 09:41:15 +00:00
Erik van der Kouwe
6dec907191 Shorter reporting of contiguous identical blocks for the IS VM dump (F8) to avoid MFS frrom filling many screens 2010-07-27 18:46:08 +00:00
Arun Thomas
dafc8f1062 Add poll.h
Open Group requires this. Reported by Thomas Cort.
2010-07-27 09:21:56 +00:00
Arun Thomas
ee1cabf06c Import poll() from NetBSD's libnbcompat 2010-07-26 20:46:04 +00:00
Ben Gras
541b5c5c38 inet_pton(), patched by Thomas Cort. 2010-07-26 14:47:10 +00:00
Ben Gras
008cc7c1a7 stdio.h - define P_tmpdir 2010-07-26 14:46:35 +00:00
Ben Gras
eb057107c5 pkg_install - bpm - changes to work with minix ftp client by Gautam Tirumala. 2010-07-26 14:02:05 +00:00
Ben Gras
cf975bbc22 gcc headers: look at pkgsrc-installed gcc too 2010-07-26 12:48:48 +00:00
Ben Gras
c297701987 libarchive: sanitize out-of-range uids/gids 2010-07-26 12:44:48 +00:00
Ben Gras
149153f8ca <sys/resource.h> - define RLIM_NLIMITS 2010-07-26 10:04:45 +00:00
Ben Gras
9f0364df60 lib - sanity check for group_from_gid etc. 2010-07-24 10:40:55 +00:00
Erik van der Kouwe
df0ba02a38 Multiboot support (contributed by Feiran "Fam" Zheng);
keep in mind that GRUB needs to be patched to read MFS for now;
use /boot/image_latest to boot the last compiled image in GRUB
2010-07-23 14:24:34 +00:00
Erik van der Kouwe
9212eab21f Add padtext utility (needed for Multiboot) 2010-07-23 14:22:49 +00:00
Erik van der Kouwe
d7c70a41e5 Allow vm to split blocks in memory map (needed for multiboot, contributed by Feiran "Fam" Zheng 2010-07-23 14:22:13 +00:00
Ben Gras
1c4065cd10 pkg_install: forget about OS_RELEASE, just a properly formatted OS_VERSION. 2010-07-23 14:10:23 +00:00
Ben Gras
34a58c8d82 inet_ntop, contributed by Thomas Cort. 2010-07-23 09:54:47 +00:00
Erik van der Kouwe
3a5d923bf1 IO port is always 16 bit, even for inl 2010-07-23 07:25:21 +00:00
Erik van der Kouwe
7b9bddad1b {in,out}s[bwl] deleted in previous commit, also delete their headers 2010-07-23 07:24:34 +00:00
Erik van der Kouwe
f389ad2655 Move sensitive instructions from libc into kernel 2010-07-23 07:12:47 +00:00
Erik van der Kouwe
a06e5c383d Throw out ins[bwl] and out[bwl] from libc as they are not used 2010-07-23 07:10:47 +00:00
Ben Gras
c4bb6abc2b vsprintf: fix special yet useful case for vsprintf where n < 1.
reported by jaldhar.
2010-07-22 22:35:44 +00:00
Ben Gras
6c2c2f3c34 libfp: use ${CC} instead of cc, reported by Antoine Leca. 2010-07-22 22:24:08 +00:00
Ben Gras
fe343bb002 Make kernel ipc log scripts work for separate ${.OBJDIR}.
contributed by Antoine Leca.
2010-07-22 22:04:37 +00:00
Ben Gras
3badab8b70 vfs - split fp_fd field into fd + callnr fields 2010-07-22 14:55:28 +00:00
Ben Gras
1c2dd749eb make.conf: make pkgsrc.conf separate. 2010-07-22 14:42:20 +00:00
Arun Thomas
dbde088d98 Replace NULL macro defs with null.h include 2010-07-22 10:03:31 +00:00
Tomas Hruby
62d44dc9ef service utility fix
- of course 0 is a valid cpu
2010-07-22 09:57:14 +00:00
Ben Gras
81f6039a7f pkg_install: some uname normalisation. 2010-07-22 08:28:12 +00:00
Ben Gras
e8e2f6f6b9 profile: don't set $MANPATH explicitly as it's already in man.conf. 2010-07-22 08:26:49 +00:00
Arun Thomas
88e7725c13 string.h: Include null.h 2010-07-21 15:37:42 +00:00
Erik van der Kouwe
5bf75abb30 Parse LODS correctly in gas2ack 2010-07-21 14:47:01 +00:00
Ben Gras
122a32b928 mkboot fix, missing " 2010-07-21 14:23:52 +00:00
David van Moolenbroek
220eafe705 inet: a little more resilience against misbehaving drivers 2010-07-21 13:47:50 +00:00
Tomas Hruby
f6f20e1269 Overly restrictive assert
- not true if APIC is enabled
2010-07-21 13:46:29 +00:00
Cristiano Giuffrida
7978f9d2f3 Unbreak gcc compilation for pfs. 2010-07-21 13:39:46 +00:00
Ben Gras
63deb069bb uname: make uname -r and -v both print out full version info.
the world seems to expect this, and do this.
2010-07-21 12:47:48 +00:00
Ben Gras
f6655c171b /usr/sbin in $PATH too. 2010-07-21 10:12:03 +00:00
Ben Gras
5e5d5ab1f6 make.conf: pkgsrc fix/workaround 2010-07-21 10:00:34 +00:00
Cristiano Giuffrida
0824146978 Disable debug info on trunk. 2010-07-21 08:22:24 +00:00
Cristiano Giuffrida
03bb1e5750 Don't panic so easily on unexpected pagefault. 2010-07-20 23:51:34 +00:00
Cristiano Giuffrida
91a83fe265 Crash recovery and live update support for VM. 2010-07-20 23:03:52 +00:00
Ben Gras
0b364d00bc install new Makefile in /usr instead. 2010-07-20 22:20:43 +00:00
Cristiano Giuffrida
0d984b36ef Get rid of static spare pages after VM startup. 2010-07-20 21:59:27 +00:00
Cristiano Giuffrida
40b4e71db2 COW for physically contiguous blocks in VM 2010-07-20 18:57:25 +00:00
Ben Gras
7f343ed574 kernel: clear MF_CONTEXT_SET on kernel exit. 2010-07-20 17:13:44 +00:00
Ben Gras
eb1627049f pkg_install: record OS version for created packages. 2010-07-20 17:10:21 +00:00
Ben Gras
c0074d3aa9 kernel: fix case of EAX getting clobbered after sigreturn. 2010-07-20 17:10:09 +00:00
Arun Thomas
13be76efe5 Makefile for pkgsrc repo update/checkout
-From DragonflyBSD with minor tweaks
2010-07-20 17:09:44 +00:00
Erik van der Kouwe
8fc07701bc UPDATING update 2010-07-20 07:52:55 +00:00
Erik van der Kouwe
fb24016c30 UPDATING update 2010-07-20 07:52:46 +00:00
Tomas Hruby
f248bffc9e service utility can par cpu option in system.conf
- does not have any effect, solely for debugging SMP

- backward compatible with older RS instance
2010-07-20 07:27:45 +00:00
Cristiano Giuffrida
1b7d95df29 Generalize interface of some VM functions 2010-07-20 02:08:28 +00:00
Cristiano Giuffrida
af424b4e43 Don't always assume NOPINGREPLY as a failure in RS 2010-07-20 01:50:33 +00:00
Ben Gras
16d0609fad vm: restore sanity checks in NONCONTIGUOUS case. 2010-07-19 18:20:14 +00:00
Ben Gras
068944de36 vm: add MEMPROTECT feature in vm.h. 2010-07-19 18:19:59 +00:00
Ben Gras
77267ca28b vm: add missing USE() macros in utility.c. 2010-07-19 18:19:38 +00:00
Ben Gras
5e2c84b119 vm: allow readonly pages when sanity checking when they're supposed to be rw. 2010-07-19 18:19:16 +00:00
Ben Gras
e0701109ca kernel: make loading kernel in 2nd chunk of memory (at 1MB) the default.
(indicated by flags hardcoded in kernel that the boot monitor
interprets.)
2010-07-19 16:33:49 +00:00
Thomas Veerman
103dc9e80a Teach DESCRIBE and fsck about UNIX Domain Sockets. Contributed by Thomas Cort 2010-07-19 13:57:47 +00:00
Ben Gras
6ed6e31e80 un-duplicate sha2hl.c 2010-07-19 13:08:48 +00:00
Ben Gras
e37a6ef219 pkg_install: use /usr/sbin 2010-07-19 11:58:39 +00:00
Ben Gras
53b6f99fb0 includes: remove some prototypes of functions that aren't defined. 2010-07-19 11:39:57 +00:00
Ben Gras
4234aa2c4a pkg_install path fixes. 2010-07-19 11:30:39 +00:00
Ben Gras
069f6ed574 pkg_install: correct PKG_LOG_DIR 2010-07-19 11:28:51 +00:00
Ben Gras
373df14150 pkg_install: these manpages were moved to man. 2010-07-19 10:47:11 +00:00
Ben Gras
f08922e848 include - string functions. 2010-07-19 10:46:49 +00:00
Ben Gras
ffe7e9166e lib - extra file for libutil; strnstr and strcasestr from freebsd for libc. 2010-07-19 10:46:26 +00:00
Ben Gras
6ce51040a2 patch: fixes to use plan a (too) by Gautam Tirumala. 2010-07-19 10:40:48 +00:00
Ben Gras
34dd221af7 man - no more whoami, mdb (get installed from commands) 2010-07-18 22:19:34 +00:00
Ben Gras
dc2194efa7 man: add some pkgsrc pages; no more minix diff manpage 2010-07-18 22:15:10 +00:00
Ben Gras
ac66d329c7 mtree: add libexec; don't make any oss dirs. 2010-07-18 22:06:40 +00:00
Ben Gras
09c18bc918 lib: bugfix for mbstowcs, debugged by Gautam Tirumala. 2010-07-18 20:57:55 +00:00
Ben Gras
89df7fc91d MAKEDEV: make /dev/uds 2010-07-18 19:20:36 +00:00
Ben Gras
a46b8b84d4 aal - don't install yourself as ar; must invoke aal explicitly for ack archives.
To make switching to 'ar' for gcc/clang archives smoother in the future.
2010-07-16 15:40:04 +00:00
Ben Gras
b05c989298 kernel - prettier output for ipc errors, call names instead of trap numbers 2010-07-16 15:36:29 +00:00
Erik van der Kouwe
98725c443e Fix RS warning at start-up by inheriting scdeduling properties from init for unprivileged children of system processes 2010-07-16 14:56:05 +00:00
Tomas Hruby
7f47f4174d Fixed comments in sched
- not only PM can send sched requests. RS too.
2010-07-16 09:40:12 +00:00
Ben Gras
6955228f39 rc - also add /usr/pkg/sbin to $PATH 2010-07-16 00:44:57 +00:00
Ben Gras
693bd970e7 sha1 manpage - fix #include 2010-07-16 00:19:19 +00:00
Ben Gras
7e8ed05df4 pkgsrc pkg_install tools, ported by Gautam Tirumala. 2010-07-16 00:15:25 +00:00
Ben Gras
0f7365e6af link in new manpages 2010-07-16 00:15:03 +00:00
Ben Gras
09f03783ea man - longer default manpath for packages and llvm 2010-07-16 00:13:50 +00:00
Ben Gras
84e730cbd8 new dirs for pkgsrc; new $PATH for pkg root and llvm 2010-07-16 00:13:27 +00:00
Ben Gras
4aca722796 lib - link in new u64 functions. 2010-07-16 00:12:51 +00:00
Ben Gras
28b533cf87 includes - link in new ones 2010-07-16 00:12:32 +00:00
Ben Gras
2a556de6d2 further sha2 conversion by Gautam Tirumala 2010-07-16 00:12:16 +00:00
Ben Gras
feaa082ea8 libutil - sha1 functions. 2010-07-16 00:11:16 +00:00
Ben Gras
117bac1e2d libutil: md5 functions. 2010-07-16 00:06:00 +00:00
Ben Gras
6c66933f90 64-bit bitwise manipulation functions, by Gautam Tirumala. 2010-07-15 23:48:56 +00:00
Thomas Veerman
ee1b608bcf Add/adjust man pages for UDS. Contributed by Thomas Cort 2010-07-15 14:56:49 +00:00
Thomas Veerman
d26290a017 Add test56 to test our UDS implementation. Contributed by Thomas Cort 2010-07-15 14:52:29 +00:00
Erik van der Kouwe
739f2d7536 Fix comment 2010-07-15 14:47:08 +00:00
Ben Gras
16d01fba85 mtree: dirs for pkgsrc 2010-07-15 14:29:07 +00:00
Thomas Veerman
f531dba2d2 Add support for UNIX Domain Sockets to the C lib. Contributed by Thomas Cort 2010-07-15 14:05:23 +00:00
Thomas Veerman
5aff633a0b Make RS and VFS aware of new UDS major. Contributed by Thomas Cort 2010-07-15 13:51:38 +00:00
Thomas Veerman
ea19830de1 Add UNIX Domain Sockets internals to PFS. Contributed by Thomas Cort 2010-07-15 13:39:57 +00:00
Thomas Veerman
ecc8a52f82 Add getnucred system call. Contributed by Thomas Cort 2010-07-15 13:24:57 +00:00
Thomas Veerman
17a0731f28 Update header files to support UNIX Domain Sockets. Contributed by Thomas Cort 2010-07-15 12:48:15 +00:00
Thomas Veerman
ca0bed1400 Add EOVERFLOW error condition 2010-07-15 12:36:41 +00:00
Thomas Veerman
3404e8e4e5 Convert a few man pages to mandoc 2010-07-15 08:48:24 +00:00
Ben Gras
8a0c10fcb9 lib: mkdtemp(), contributed by by Gautam Tirumala 2010-07-14 22:45:28 +00:00
Ben Gras
2639ae9b17 libc: add db code from netbsd 2010-07-14 17:46:18 +00:00
Ben Gras
8d24932c80 lib: don't give back the same temporary filenames even if removed.
workaround for what seems to be a clang/llvm bug/assumption.
2010-07-14 15:18:50 +00:00
Ben Gras
4fcd34137c includes: header files for netbsd db code. 2010-07-14 14:52:02 +00:00
Cristiano Giuffrida
20101b3bab Remove patch leftovers. 2010-07-13 22:40:14 +00:00
Arun Thomas
e41c0b1a2d Replace paxtar with bsdtar 2010-07-13 21:35:58 +00:00
Cristiano Giuffrida
f8a8ea0a79 Dynamic configuration in system.conf for boot system services. 2010-07-13 21:11:44 +00:00
Ben Gras
f6e558f5d4 errno EFTYPE 2010-07-13 20:05:47 +00:00
Ben Gras
9bb7552df5 remove old man.1 2010-07-13 19:49:12 +00:00
Ben Gras
ba759ef03e new command: bsdtar. 2010-07-13 19:28:09 +00:00
Ben Gras
470ab03b86 libarchive port by Gautam Tirumala. 2010-07-13 19:17:02 +00:00
Ben Gras
9a14560daf netconf: recognize another rtl8169-compatible model 2010-07-13 18:44:51 +00:00
Ben Gras
8b0dbff312 test44: suid root to call getsysinfo 2010-07-13 18:27:42 +00:00
Cristiano Giuffrida
8cedace2f5 Scheduling parameters out of the kernel. 2010-07-13 15:30:17 +00:00
Ben Gras
d4e41fd1f6 top-level Makefile: include info on clang-libraries target. 2010-07-13 14:13:27 +00:00
Ben Gras
0574bb5a63 lib: clang-libraries top-level target. 2010-07-13 14:11:31 +00:00
Ben Gras
835232d504 tests: fixes to accomodate growing OPEN_MAX and a logic error 2010-07-13 12:38:58 +00:00
Cristiano Giuffrida
60549b67be Man pages for new system configuration. 2010-07-13 11:45:41 +00:00
David van Moolenbroek
1ecdac623a libsys: add standard condition spinning primitives 2010-07-12 23:14:40 +00:00
David van Moolenbroek
78a0260993 datasizes(1): gcc/clang support 2010-07-12 23:12:21 +00:00
Ben Gras
dd19f8cd07 elle: minor changes to compile with non-ack. 2010-07-12 20:09:03 +00:00
Arun Thomas
bcaf746508 Import strsep() from NetBSD's libnbcompat
Ported by Gautam Tirumala
2010-07-12 17:41:31 +00:00
Arun Thomas
652618e458 shquote() from NetBSD's libnbcompat
Ported by Gautam Tirumala
2010-07-12 17:32:57 +00:00
Ben Gras
4ff8fdba57 unstack: filter for llvm internal symbols. 2010-07-12 17:03:29 +00:00
Ben Gras
78ce6f86f7 tests: turn of optimisation when compiling the tests, less unexpected optimisations. 2010-07-12 16:22:05 +00:00
Arun Thomas
590ff06418 Fix bsd.own.mk owners/objformat for pkgsrc
Contributed by Gautam Tirumala
2010-07-12 13:48:14 +00:00
Arun Thomas
4b30979086 Install(1): Allow -c option with -d
Contributed by Gautam Tirumala
2010-07-12 13:38:13 +00:00
Ben Gras
12e9303297 kernel: compile with -mi386 under gcc/clang to not generate SSE code in-kernel. 2010-07-12 10:11:50 +00:00
Arun Thomas
1cee6fe95e Import asprintf() and vasprintf()
Ported from libnbcompat by Gautam Tirumala
2010-07-11 13:46:58 +00:00
Ben Gras
ae9fa7fdf6 rtl8169 driver: let it recognize an extra card that works too 2010-07-10 17:04:17 +00:00
Ben Gras
b4345d7598 test44: add bogus getsysinfo() to test invalid memory range request to vm
test case contributed by Roman Ignatov.
2010-07-10 00:24:43 +00:00
Kees van Reeuwijk
a5dfadeb70 Let string.h include stdint.h, since some programs, in particular llvm/clang,
assume that this happens.
2010-07-09 23:58:37 +00:00
Cristiano Giuffrida
8427d774b6 RS live update support. 2010-07-09 18:29:04 +00:00
David van Moolenbroek
895850b8cf move timers code to libsys 2010-07-09 12:58:18 +00:00
Ben Gras
8c925134f9 vm: NONCONTIGUOUS - try to make physical memory as maximally noncontiguous 2010-07-09 12:22:33 +00:00
Arun Thomas
f3ce085913 Pull in NetBSD's queue.h (for pkgsrc) 2010-07-07 14:17:25 +00:00
David van Moolenbroek
8182a9d972 libdriver: don't panic so easily 2010-07-07 11:04:33 +00:00
Cristiano Giuffrida
1f8dbed029 RS crash recovery support. 2010-07-06 22:05:21 +00:00
Ben Gras
e920c1e1df kernel: fix main prototype 2010-07-06 12:14:59 +00:00
Ben Gras
5859ad686b boot: fix clang warnings. 2010-07-06 12:11:25 +00:00
Ben Gras
e698d818c6 commands: fixes for clang errors. 2010-07-06 12:10:23 +00:00
Ben Gras
68db8ed0b9 lib: fixes for warnings that clang has for libraries. 2010-07-06 12:08:22 +00:00
Ben Gras
f6f814cb02 include, kernel: minor fixes to make compiling and linking work with clang.
(fixing warnings)
2010-07-06 11:59:19 +00:00
Ben Gras
dc47875fc7 sys.mk: remove trailing whitespace. 2010-07-06 11:48:11 +00:00
Kees van Reeuwijk
0cfdb11450 Repair errors and warnings flagged by llvm. 2010-07-06 11:29:23 +00:00
Arun Thomas
368f77ceea Fix building of image target 2010-07-06 09:19:04 +00:00
Cristiano Giuffrida
397575951e Cleanup dep file. 2010-07-05 21:04:31 +00:00
Cristiano Giuffrida
3de6a807ce Configure settings for system services dynamically with the new service edit command. 2010-07-05 19:37:08 +00:00
Ben Gras
42399159da kernel: these asserts from r7657 are not reasonable
will fire if copy needs more than one try, which is legit.
2010-07-05 17:45:16 +00:00
Ben Gras
fc8f0b9ee2 vm: better fix for clang 'unused expression' warning 2010-07-05 17:34:26 +00:00
Ben Gras
7011e7c680 mk: add recognizing CC=clang, patch by Arun 2010-07-05 17:33:34 +00:00
Ben Gras
86139e8bf2 vm: last commit should not have included wiping out these calls
(this was done temporarily to make vm work with clang; vm crashes when
the 64-bit arithmetic functions are used when compiled with clang.)
2010-07-05 14:01:34 +00:00
Ben Gras
b4bea1bfcb vm: fixes for clang warnings 2010-07-05 13:58:57 +00:00
Ben Gras
545054c608 kernel: use MF_KCALL_RESUME instead of RTS_VMREQUEST for memcopy retry.
solves tracker item 499, submitted by Roman Ignatov.
2010-07-04 23:09:24 +00:00
Kees van Reeuwijk
9fd2d72ce8 Llvm-inspired code cleanup. 2010-07-04 23:01:32 +00:00
Ben Gras
01fcee7d71 ash: make test/expr support 'file1 -ot file2' 2010-07-03 22:18:11 +00:00
David van Moolenbroek
4d3c887d6b at_wini: rename 'ata_instance' to 'instance' 2010-07-03 17:51:12 +00:00
David van Moolenbroek
4392e004f8 bring back mdb (Bug#501, reported by Roman Ignatov) 2010-07-03 10:25:19 +00:00
Erik van der Kouwe
37325bd7c5 Make service ABI backwards compatible again 2010-07-03 05:02:59 +00:00
Thomas Veerman
34a2864e27 Fix a few compile time warnings 2010-07-02 12:41:19 +00:00
David van Moolenbroek
9a37f63263 netconf: psip0 is not a driver (Bug#500, reported by Roman Ignatov) 2010-07-02 11:22:42 +00:00
Kees van Reeuwijk
630f566d3f Convert a few main() functions to a form that the clang compiler likes. 2010-07-01 22:23:25 +00:00
Cristiano Giuffrida
03f64ac97a Self update support in RS. 2010-07-01 18:48:25 +00:00
David van Moolenbroek
71dbe2d023 ramdisk rc: start disk drivers synchronously.
This eliminates a race condition between the disk driver calling
sys_statectl(SYS_STATE_CLEAR_IPC_REFS) as part of driver_announce(),
and the root MFS calling sendrec(DEV_OPEN) on the disk driver.
2010-07-01 14:35:47 +00:00
Tomas Hruby
97eb470bee Fix 2010-07-01 12:31:53 +00:00
Tomas Hruby
7920d48156 FPU cleanup
- last reference to MF_USED_FPU removed

- proc_used_fpu() used to test for MF_FPU_INITIALIZED
2010-07-01 12:23:25 +00:00
Erik van der Kouwe
b5ae3961bb Fix unintended changes in r7614 2010-07-01 11:56:02 +00:00
David van Moolenbroek
06a0260c3c PCI: add AHCI T3 and subclass values 2010-07-01 09:20:36 +00:00
David van Moolenbroek
2488cc6442 PCI: expose BAR sizes 2010-07-01 09:10:16 +00:00
Cristiano Giuffrida
9e4312453d Improve memory pinning. 2010-07-01 08:54:25 +00:00
Erik van der Kouwe
4690e8b015 Opps, forgot to svn add these files 2010-07-01 08:38:15 +00:00
Erik van der Kouwe
23284ee7bd User-space scheduling for system processes 2010-07-01 08:32:33 +00:00
Tomas Hruby
b17e3adb60 drivers/ builds in parallel (make -j N) 2010-07-01 07:39:36 +00:00
Erik van der Kouwe
5c591816cb Remove warning in inet; this situation is harmless and can be caused by a race 2010-07-01 06:14:38 +00:00
Erik van der Kouwe
5e602d3dab Put rs.single on initial ramdisk to prevent potential race when readclock terminates early 2010-07-01 06:14:06 +00:00
Ben Gras
0ad4e16985 packman: use fetch instead of urlget 2010-07-01 00:10:07 +00:00
Ben Gras
47b58b2ebb fetch command 2010-07-01 00:06:41 +00:00
Ben Gras
65be30daed libfetch - move fetch.3 to man and fetch.h to include 2010-07-01 00:05:48 +00:00
Ben Gras
429639f938 lib: added libfetch 2010-06-30 23:55:55 +00:00
Ben Gras
098412be83 small fixes for pkgsrc by Buccapatnam Tirumala, Gautam. 2010-06-30 12:18:34 +00:00
David van Moolenbroek
9313bc9a6f fix dec21140A driver (reported by zvolkov) 2010-06-29 11:45:32 +00:00
Cristiano Giuffrida
180358ffb4 Give RS a page table. 2010-06-28 22:07:49 +00:00
Cristiano Giuffrida
06700d05d1 Give RS a page table. 2010-06-28 21:53:37 +00:00
Cristiano Giuffrida
869a223d43 service clone command to clone system services on demand. 2010-06-28 21:38:29 +00:00
Ben Gras
635a8f772c memory driver: use mmap to pre-allocate ramdisks to avoid overcommit. 2010-06-28 18:12:32 +00:00
Ben Gras
f044bd10ef make ps and top use sanity checking kernel proc table retrieval 2010-06-28 11:05:34 +00:00
Ben Gras
8379b08845 library function to retrieve kernel proc table and sanity check it 2010-06-28 11:05:15 +00:00
Tomas Hruby
67fa273d00 MF_REPLY_PEND should be removed when sendrec finishes 2010-06-28 08:32:49 +00:00
Ben Gras
b9f53528ee sep ${.OBJDIR} fixes by Antoine Leica. 2010-06-27 23:47:59 +00:00
Ben Gras
6e47e2996f sep ${.OBJDIR} fixes by Antoine Leica. 2010-06-27 23:47:23 +00:00
Ben Gras
a3db59df6f sep ${.OBJDIR} fixes by Antoine Leica. 2010-06-27 23:46:23 +00:00
Ben Gras
dbfb70134c sep. ${.OBJDIR} fixes, contributed by Antoine Leica. 2010-06-27 23:45:30 +00:00
Ben Gras
831edb6614 no makewhatis. 2010-06-27 23:38:17 +00:00
David van Moolenbroek
53866b1ebb oops. 2010-06-27 17:20:17 +00:00
David van Moolenbroek
71435d15cf HGFS: statvfs support 2010-06-27 17:19:50 +00:00
Ben Gras
d24348c636 man - statvfs(5) manpage 2010-06-27 15:52:50 +00:00
Ben Gras
6ef440c03b statvfs manpage. 2010-06-27 15:40:06 +00:00
Ben Gras
f1faf0d327 no more minix whoami 2010-06-27 14:07:43 +00:00
Arun Thomas
1f20814fe8 Fix grep test 4 in testsh1 2010-06-27 10:59:14 +00:00
Cristiano Giuffrida
377f4e7e31 Fix and comment a race in SEF Init 2010-06-27 09:01:15 +00:00
Ben Gras
f200f53a0b teach packman about new id (tracker item 489) 2010-06-26 23:10:24 +00:00
Kees van Reeuwijk
5eb6f6e922 Fixed a type declaration inconsistency. 2010-06-26 21:13:36 +00:00
Arun Thomas
e2d45ae24c Update docs/UPDATING 2010-06-26 20:33:57 +00:00
Ben Gras
d2dbe5b2ae install man.conf from commands/man 2010-06-26 11:20:47 +00:00
Arun Thomas
2fc2748c5a Add missing share/mk/Makefile 2010-06-26 08:01:30 +00:00
Ben Gras
2793cb097b bigger default manpath 2010-06-26 02:47:45 +00:00
Ben Gras
b24f63f996 man.conf 2010-06-26 02:43:31 +00:00
Ben Gras
a1a12bbc34 man: throw out *whatis 2010-06-26 02:37:41 +00:00
Ben Gras
01b5238d50 getsubopt: use regular assert()s 2010-06-26 02:37:17 +00:00
Ben Gras
a187743e75 netbsd man 2010-06-26 02:35:08 +00:00
Ben Gras
24cb4e60fc no more minix man 2010-06-26 02:33:49 +00:00
Ben Gras
3f22092d45 import mdocml. 2010-06-26 02:20:06 +00:00
Ben Gras
2f3c9c04cc chrootmake: don't call makewhatis any more 2010-06-26 01:56:28 +00:00
Ben Gras
74c06cfc43 commands: less is more. 2010-06-26 01:41:19 +00:00
Ben Gras
8003edc357 don't call makewhatis 2010-06-26 01:10:04 +00:00
Ben Gras
6ebe0cdf82 no more minix more, *whatis 2010-06-26 01:08:31 +00:00
Ben Gras
aa6ff4c8be lib: setprogname() + getsubopt() 2010-06-26 00:44:24 +00:00
Arun Thomas
8e0253ac3d Make: Updates from NetBSD
Needed for pkgsrc
2010-06-25 23:25:48 +00:00
Arun Thomas
e10916476a Move mkfiles from /etc/mk to /usr/share/mk
Simplifies pkgsrc porting.
2010-06-25 19:33:56 +00:00
Arun Thomas
c0c8d25799 Rename mkfiles from minix.*.mk to bsd.*.mk
Makes things easier for pkgsrc
2010-06-25 18:29:09 +00:00
Ben Gras
9dc7c1f081 man: remove id, touch 2010-06-25 17:18:45 +00:00
Ben Gras
373aecf3cd commands: id from netbsd; touch from bsd-utils port 2010-06-25 17:14:56 +00:00
Ben Gras
bfeecdbf62 no more minix touch, id 2010-06-25 17:13:57 +00:00
Erik van der Kouwe
c0dfa2f3f1 Get rid of asynsend backup copy in VFS 2010-06-25 14:57:54 +00:00
Cristiano Giuffrida
5c7d64b981 No malloc() in VM. 2010-06-25 12:48:56 +00:00
Erik van der Kouwe
6011237232 Extra sync to reduce damage of failing shutdowns 2010-06-24 14:56:03 +00:00
Kees van Reeuwijk
25dc0fc376 Some standard Unix functions were feature-dependent on _MINIX. 2010-06-24 14:17:25 +00:00
Erik van der Kouwe
fe07e7c984 Optional IPC logging 2010-06-24 13:31:40 +00:00
Erik van der Kouwe
3985311b2e Beng's boot fix 2010-06-24 12:29:13 +00:00
Erik van der Kouwe
26ebfa1ce1 Revert bad prior reversion 2010-06-24 12:27:58 +00:00
Ben Gras
b3a0a2d86f kernel: don't initialize catch_pagefaults at the extern declaration. 2010-06-24 12:23:23 +00:00
Erik van der Kouwe
e8d30bba65 Beng's boot fix 2010-06-24 12:20:01 +00:00
Ben Gras
33c9d427fd mfs - added put_block() to statvfs loop. 2010-06-24 10:56:45 +00:00
Erik van der Kouwe
498d7d8a4c Don't use kernel responses in servers 2010-06-24 07:37:26 +00:00
Ben Gras
491efeead9 mfs - revert part of previous commit; should not have been commited 2010-06-24 00:32:17 +00:00
Ben Gras
762665cec1 some prettification for test55. 2010-06-24 00:27:26 +00:00
Ben Gras
e3354a8556 test 55 for statvfs. fix formatting bug in test54. 2010-06-24 00:06:40 +00:00
Ben Gras
6cd2d1218e mfs - statvfs call, by Buccapatnam Tirumala, Gautam. 2010-06-23 23:58:16 +00:00
Ben Gras
4b496e29bd iso9660fs - statvfs call, by Buccapatnam Tirumala, Gautam. 2010-06-23 23:57:26 +00:00
Ben Gras
13b5dd4a82 statvfs/fstatvfs entries. 2010-06-23 23:56:36 +00:00
Ben Gras
fc01683584 include, vfs: statvfs, fstatvfs calls, contributed by Buccapatnam Tirumala, Gautam. 2010-06-23 23:53:50 +00:00
Ben Gras
45e4cce8c2 libc stubs for statvfs, contributed by Buccapatnam Tirumala, Gautam. 2010-06-23 23:51:29 +00:00
Ben Gras
79d62892ad includes: statvfs support, contributed by Buccapatnam Tirumala, Gautam 2010-06-23 23:46:10 +00:00
Ben Gras
ac310cbe09 boot: restore setting stack size, and remove wrong experimental
#ifndef DOS that shouldn't have been committed.
2010-06-23 16:24:40 +00:00
Erik van der Kouwe
50539c12f5 Remove obsolete mstats call 2010-06-23 10:43:08 +00:00
Tomas Hruby
76708e9bf4 mini_receive() clean up
- for better readability xpp is substitued by sender

- makes sure that the dequeued sender has p_q_link == NULL and that
  this condition holds when enqueuing the sender again. This is a
  sanity check to make sure that the new sender is not enqueued
  already

- Before this change the dequeued sender's p_q_link may not be NULL
  and it was only set to NULL when enqueued again
2010-06-23 10:36:19 +00:00
Erik van der Kouwe
921bacd244 Fix packman for new grep, which doesn't support \+ in BREs 2010-06-23 08:12:40 +00:00
Ben Gras
f2c3cbab00 test for pwrite() (Contributed by Buccapatnam Tirumala, Gautam) 2010-06-22 22:07:23 +00:00
Ben Gras
24a5f48921 lib - a pwrite() implementation (Contributed by Buccapatnam Tirumala, Gautam) 2010-06-22 22:04:43 +00:00
Ben Gras
d78ae27865 advent: support ${.OBJDIR} != ${.CURDIR}, tracker item 486 2010-06-22 21:56:38 +00:00
Ben Gras
ddc3f62290 strptime() for minix. 2010-06-22 21:42:49 +00:00
Ben Gras
08f731bae0 original strptime. 2010-06-22 21:41:56 +00:00
Ben Gras
08e4312998 forget netbsd strptime. 2010-06-22 21:41:20 +00:00
Ben Gras
c7050eea55 original netbsd strptime 2010-06-22 21:37:54 +00:00
Ben Gras
81399e75ad no WARNS 2010-06-22 21:24:50 +00:00
Ben Gras
6189062d12 cut fixes 2010-06-22 21:24:14 +00:00
Ben Gras
988b95f150 minix cut, printf from netbsd 2010-06-22 21:22:53 +00:00
Ben Gras
ff26d9a4ff original netbsd printf, cut 2010-06-22 21:20:54 +00:00
Ben Gras
2ac57865cb no more minix cut, printf 2010-06-22 21:19:42 +00:00
Ben Gras
86e323da6b correct to S_IFSOCK 2010-06-22 16:35:48 +00:00
Ben Gras
81056ac999 stdio: j modifier for %d. (Contributed by Buccapatnam Tirumala, Gautam) 2010-06-22 16:22:17 +00:00
Ben Gras
575d055f90 rename __ss_family to ss_family. (Contributed by Buccapatnam Tirumala, Gautam) 2010-06-22 16:21:21 +00:00
Ben Gras
d6af53bec0 boot: fix dosboot build and link to build. 2010-06-22 15:45:53 +00:00
Ben Gras
d1c117ec80 easypack: don't invoke binsizes 2010-06-22 15:44:47 +00:00
Ben Gras
32c757b12c chrootmake: don't invoke binsizes. 2010-06-22 15:44:29 +00:00
Ben Gras
ee1134da9d fortune: install fortune.dat in /usr/lib 2010-06-22 15:29:35 +00:00
Ben Gras
ac6e455f16 . make sed understand \t
. install it in /bin, where minix rc expects it
2010-06-22 15:28:07 +00:00
Cristiano Giuffrida
ad1f2f2d78 Fix misplaced comment. 2010-06-22 15:10:06 +00:00
Ben Gras
0c03a6a50f binpackage: don't call binsizes. 2010-06-22 14:21:34 +00:00
Ben Gras
c8372f31f8 make: don't link with -g as nm can't read the symbol table any more. 2010-06-22 14:00:42 +00:00
Ben Gras
5946b9d41d includes: S_ISSOCK and S_ISOCK 2010-06-22 13:37:33 +00:00
Tomas Hruby
21725c107d cd subdir && $(MAKE) targets -> $(MAKE) -C subdir targets
- first step towards parallel building
2010-06-22 12:03:09 +00:00
Kees van Reeuwijk
3eed5d3bdb Sort out problems with POSIX constants. 2010-06-22 10:50:03 +00:00
Ben Gras
15210b3e06 forget about multiple zeros on non-ack compiler, tracker item 457 2010-06-22 09:40:04 +00:00
Ben Gras
556faf0d3a minix netbsd diff 2010-06-22 09:38:20 +00:00
Ben Gras
82dee9dbc3 add LC_MESSAGES 2010-06-22 09:31:16 +00:00
Ben Gras
3cb1096425 new stdbool.h 2010-06-22 09:30:52 +00:00
Ben Gras
4383596e9d includes: small fixes and additions to help compiling programs. 2010-06-22 09:30:26 +00:00
Ben Gras
e68d8eb1ff original openbsd diff 2010-06-22 00:47:52 +00:00
Ben Gras
4c0a9db684 no more minix diff 2010-06-22 00:46:55 +00:00
Ben Gras
6dd606eabf no more minix sed, patch man pages 2010-06-22 00:44:20 +00:00
Ben Gras
4269db3991 minix patch port 2010-06-22 00:41:23 +00:00
Ben Gras
f50f1bf7d6 original netbsd patch 2010-06-22 00:41:00 +00:00
Ben Gras
6657c0e58e no more minix patch 2010-06-22 00:39:57 +00:00
Ben Gras
582c0ed74d netbsd sed for minix 2010-06-22 00:36:21 +00:00
Ben Gras
707fbb966d original netbsd sed 2010-06-22 00:33:14 +00:00
Ben Gras
1b2189c205 no more minix sed. 2010-06-22 00:32:21 +00:00
Ben Gras
a89bcc465b mfs: minor cleanup of readahead: they can be private to read.c. 2010-06-21 18:25:04 +00:00
Erik van der Kouwe
e2730c3e2f Recognize Intel 82558B, contributed by Sergei Antonov 2010-06-21 17:08:37 +00:00
Ben Gras
029d91baa9 no more minix grep man pages. 2010-06-21 14:42:53 +00:00
Ben Gras
cedc0404e1 force gcc to look in ../../../include before /usr/local/include 2010-06-20 12:32:41 +00:00
Ben Gras
137495002d grep: unsigned chars to fix gcc warnings. 2010-06-20 12:31:55 +00:00
Ben Gras
28663f45d6 fixes for minix grep 2010-06-20 11:55:19 +00:00
Ben Gras
bb830fc0d3 original openbsd grep (freegrep) 2010-06-20 11:54:40 +00:00
Ben Gras
f19304bf22 oops, that was the minx grep port; undo previous commit. 2010-06-20 11:54:03 +00:00
Ben Gras
1d14529942 original openbsd freegrep 2010-06-20 11:49:38 +00:00
Ben Gras
5b40436aaf remove minix greps. 2010-06-20 11:48:00 +00:00
Ben Gras
d78494cd6e fgetln() prototype 2010-06-20 11:46:50 +00:00
Erik van der Kouwe
330374be9e Fix unlikely race (or crawl?) condition in case going from alarm to ioctl takes more than 1 second 2010-06-20 07:30:53 +00:00
Erik van der Kouwe
90285c46a2 Packman also recognizes package names with no or partial version number 2010-06-20 06:39:23 +00:00
Ben Gras
6c0fcd575e lib: getproname: only return last path component 2010-06-20 00:24:35 +00:00
Ben Gras
3cc5e1add4 lib: no visibility features; fixes gcc warnings 2010-06-20 00:24:11 +00:00
Ben Gras
2144b289de getprogname(), setprogname() prototypes 2010-06-18 14:03:13 +00:00
Ben Gras
f60593cc35 libraries: fgetln() from pkgsrc branch. 2010-06-18 14:02:00 +00:00
Tomas Hruby
6bc21b6992 Cycle counters zeroed after fork for the child 2010-06-18 14:01:34 +00:00
Erik van der Kouwe
11193f5fa4 Don't allow PM to sys_kill itself, this causes a race with RS calling waitpid during shutdown 2010-06-18 13:49:07 +00:00
Tomas Hruby
8214e5e284 Removed racy COW optimization
- enabling writing in COW once phys block is reference only once is racy if VM
  is preemptible. original memory location may get overwritten before COW copies
  the memory

- problem when DEBUG_RACE is on and a big problem for SMP
2010-06-18 12:46:18 +00:00
Cristiano Giuffrida
ad5771aa28 Don't forget about pending signals coming from the kernel. 2010-06-18 12:04:20 +00:00
Arun Thomas
042b5bf606 We have sys/cdefs.h now, so remove hacks. 2010-06-17 15:14:57 +00:00
Ben Gras
7b7091e905 zlib includes in lib/libz, install them too in /usr/include from toplevel makefile. 2010-06-17 15:05:20 +00:00
Ben Gras
ae947059e6 libraries, includes: libz: original libz source files with minix makefile. 2010-06-17 13:29:20 +00:00
Erik van der Kouwe
d59c49aecb Work around vfs/inet/eth race by avoiding non-blocking ioctl in dhcpd 2010-06-17 12:14:33 +00:00
Erik van der Kouwe
6312d7238b bzip2 is now the default for releases 2010-06-17 12:00:55 +00:00
David van Moolenbroek
0964b221e7 ash: expr -e support 2010-06-16 09:33:11 +00:00
Ben Gras
482afb8a6f <sys/mman.h>: include <minix/type.h> instead of <minix/types.h> for endpoint_t 2010-06-14 20:33:14 +00:00
Ben Gras
423db7d35a binpackage: let's use the find -prune option to skip hierarchies. 2010-06-14 20:31:52 +00:00
David van Moolenbroek
eeab8e0680 libdriver: make partition code use a contiguous buffer 2010-06-13 10:40:22 +00:00
Arun Thomas
1b2c01db1b Makefile updates:
Turn on optimization
Remove some redundancy in FLAGS
2010-06-11 16:05:36 +00:00
Ben Gras
19b790eb53 vfs: don't use a mountpoint if it's in use for anything else.
(this avoids data structure confusion if a mountpoint is reused as
a mountpoint until that's properly fixed.)
2010-06-11 11:41:56 +00:00
Thomas Veerman
4d7c317700 Fix wrong field for stack address and a typo. 2010-06-11 11:17:31 +00:00
Thomas Veerman
f838e3c204 Also install getcontext and makecontext man pages 2010-06-11 11:03:47 +00:00
Tomas Hruby
360de619c0 No linear addresses in message delivery
- removes p_delivermsg_lin item from the process structure and code
  related to it

- as the send part, the receive does not need to use the
  PHYS_COPY_CATCH() and umap_local() couple.  

- The address space of the target process is installed before
  delivermsg() is called.

- unlike the linear address, the virtual address does not change when
  paging is turned on nor after fork().
2010-06-11 08:16:10 +00:00
Arun Thomas
1bf6d23f34 Make exec() use entry point in a.out header 2010-06-10 14:59:10 +00:00
Arun Thomas
f0a158d8c1 More cleanup to remove MM and FS references 2010-06-10 14:04:46 +00:00
David van Moolenbroek
2758519ed2 Change default hostname resolution order
Hostnames that contain at least one period, are now first attempted
to be resolved as FQDNs, before adding local domains is tried.
2010-06-10 11:14:36 +00:00
Erik van der Kouwe
65764218f7 Remove dependency of release.sh on bc, du option to give overhead totals 2010-06-10 11:14:04 +00:00
Erik van der Kouwe
a8cf207549 release.sh: avoid egrep -x which the base system doesn't support 2010-06-09 14:32:19 +00:00
Arun Thomas
eec65ac664 Rename tell_fs to tell_vfs 2010-06-09 14:31:30 +00:00
Ben Gras
4fe558f44f issue.install: 3.1.8 2010-06-09 14:02:35 +00:00
Ben Gras
1ce7983ee3 lib: declarations that needed ANSIfication since prototypes are declared 2010-06-09 13:01:11 +00:00
Ben Gras
c1b4cc24e4 ash: getmode in global includes now 2010-06-09 12:58:03 +00:00
Ben Gras
61db813ff6 find: fix warnings + error 2010-06-09 12:53:51 +00:00
Ben Gras
ac34bfd42b inlcude: new prototypes 2010-06-09 12:53:09 +00:00
Ben Gras
8fea317779 man: no more minix find manpage 2010-06-09 12:30:25 +00:00
Ben Gras
6704520919 commands: import of netbsd find 2010-06-09 12:27:36 +00:00
Ben Gras
fcd2a802a8 commands/find: original netbsd find 2010-06-09 12:19:38 +00:00
Ben Gras
13d50be356 commands, man: remove minix find 2010-06-09 12:17:42 +00:00
Ben Gras
6faa2a636c ash: remove setmode() declaration from shell.h, now in library 2010-06-09 12:11:56 +00:00
Ben Gras
e216edf294 unistd.h: add setmode() prototype. 2010-06-09 12:11:33 +00:00
Ben Gras
769302d3d6 err.h: include prototypes for new err* and warn* functions. 2010-06-09 12:11:13 +00:00
Ben Gras
c046958745 crtso.S: save *argv[] and argc globally, to be used by getprogname(). 2010-06-09 12:10:31 +00:00
Ben Gras
ba9990cc00 libc: minor minix changes for new netbsd files 2010-06-09 12:09:39 +00:00
Ben Gras
60d52d68da libc: add original netbsd files 2010-06-09 12:08:32 +00:00
Ben Gras
a0147a8c32 libutil: minix efun.c 2010-06-09 12:05:53 +00:00
Ben Gras
7b87ff5b11 libutil: original netbsd efun.c 2010-06-09 12:05:04 +00:00
Ben Gras
d7490d374d includes: minix <util.h> 2010-06-09 12:03:19 +00:00
Ben Gras
b697b67d53 includes: original netbsd <util.h> 2010-06-09 12:02:20 +00:00
Thomas Veerman
be6490f4b3 Turn off debug message. 2010-06-09 11:05:16 +00:00
Ben Gras
a6e357da22 kernel: fix assert condition after a caught in-kernel pagefault 2010-06-09 10:59:57 +00:00
Thomas Veerman
a0eaaa5c9f Fix a bug in put_inode that causes corruption to the file system and another
bug that causes problems when files grow bigger than a certain threshold. Also
fix a few type and code inconsistencies.
2010-06-09 09:56:43 +00:00
Tomas Hruby
1207fcc6f0 int to endpoint_t conversions in mmap 2010-06-09 09:14:53 +00:00
Ben Gras
cccfe8e0ce lib: move tzfile.h from lib/libc/stdtime/ to include/ for general usage. 2010-06-08 19:11:42 +00:00
Kees van Reeuwijk
826b9590f2 More endpoint_t correctness.
More const correctness.
Other code cleanup.
2010-06-08 14:09:18 +00:00
Arun Thomas
4c10a31440 Remove legacy MM, FS, and FS_PROC_NR macros 2010-06-08 13:58:01 +00:00
Erik van der Kouwe
7bd7946346 Remove redundant macro cproc_addr 2010-06-08 13:38:44 +00:00
Erik van der Kouwe
78186ee5f5 Add endpoint checks in scheduling kernel calls 2010-06-08 12:04:21 +00:00
Ben Gras
49165ef796 support for ukranian (charse koi8-u) contributed by Roman Ignatov. 2010-06-08 01:04:52 +00:00
Ben Gras
31adc0a3c4 vm: junkfree feature that fills freed pages with a recognizable pattern. 2010-06-08 00:59:48 +00:00
Ben Gras
a09a8d4f3e kernel: fix for vm_init that triggered assert(ptproc == newptproc)
- zero cr3 in vm_init() to avoid switch_address_space() not doing anything.

 - add vm_stop() to disable paging on shutdown.
2010-06-07 22:21:45 +00:00
Ben Gras
277ff6f2ce e1000: map in 0x1000 of flash if 0x10000 fails. 2010-06-07 16:30:10 +00:00
Ben Gras
f448dfe063 version: trunk will become 3.1.8. 2010-06-07 15:57:14 +00:00
Thomas Veerman
4b6b1bc47a Fix typo 2010-06-07 13:46:05 +00:00
Ben Gras
a98b9ca8dc tools: fix installing includes. 2010-06-07 10:10:27 +00:00
Tomas Hruby
cbc9586c13 Lazy FPU
- FPU context is stored only if conflict between 2 FPU users or while
  exporting context of a process to userspace while it is the active
  user of FPU

- FPU has its owner (fpu_owner) which points to the process whose
  state is currently loaded in FPU

- the FPU exception is only turned on when scheduling a process which
  is not the owner of FPU

- FPU state is restored for the process that generated the FPU
  exception. This process runs immediately without letting scheduler
  to pick a new process to resolve the FPU conflict asap, to minimize
  the FPU thrashing and FPU exception hadler execution

- faster all non-FPU-exception kernel entries as FPU state is not
  checked nor saved

- removed MF_USED_FPU flag, only MF_FPU_INITIALIZED remains to signal
  that a process has used FPU in the past
2010-06-07 07:43:17 +00:00
Arun Thomas
b641afc78a VM: Remove legacy non-paging code paths 2010-06-05 14:39:40 +00:00
Erik van der Kouwe
e7e6508854 Enter package names in packman 2010-06-05 13:25:41 +00:00
Cristiano Giuffrida
354d88f883 Put initialization code where it belongs. 2010-06-04 18:08:15 +00:00
Cristiano Giuffrida
a53514d4a9 Fix range checking in safecopy. 2010-06-04 18:05:38 +00:00
Arun Thomas
8c69c6cd7f Remove gcc-4.1.1 from packages list 2010-06-04 12:36:40 +00:00
Tomas Hruby
f28acecb78 Removed a buggy assert unintentionally commted in r7044 2010-06-04 10:54:43 +00:00
Erik van der Kouwe
8afc228c48 This patch changes the release script in the following ways:
- A staging directory is always used to avoid oversized images;
- As a consequence, the zero-filling is removed so no more "out of 
  space" errors should be printed to the console;
- The root and usr partition sizes are computed so less space should be 
  wasted (the root partition gets extra 1MB zones and 64 inodes for 
  run-time though and hardlinks/holes make the used space slightly less
  than expected); USRMB (and the new ROOTMB) are now used to enforce 
  a minimum size rather than set the size;
- TMPDISK1-3 are renamed to more meaningful names (and TMPDISK2 is 
  dropped because a separate tmp directory is no longer needed);
- The ramdisks are truncated at the end to save memory (not sure 
  whether it is actually released though).
2010-06-04 05:09:44 +00:00
Erik van der Kouwe
1bb7c4d78a Create link for lstat 2010-06-04 04:44:09 +00:00
Ben Gras
2f892aca91 kernel fpu context switching: fix race condition
There seems to have been a broken assumption in the fpu context
restoring code.  It restores the context of the running process, without
guarantee that the current process is the one that will be scheduled.
This caused fpu saving for a different process to be triggered without
fpu hardware being enabled, causing an fpu exception in the kernel. This
practically only shows up with DEBUG_RACE on. Fix my thruby+me.

The fix
 . is to only set the fpu-in-use-by-this-process flag in the
   exception handler, and then take care of fpu restoring when
   actually returning to userspace

And the patch
 . translates fpu saving and restoring to c in arch_system.c,
   getting rid of a juicy chunk of assembly
 . makes osfxsr_feature private to arch_system.c
 . removes most of the arch dependent code from do_sigsend
2010-06-03 11:32:22 +00:00
2247 changed files with 340602 additions and 29113 deletions

View File

@@ -16,6 +16,7 @@ usage:
@echo " make depend # Generate required .depend files"
@echo " make gnu-includes # Install include files for GCC"
@echo " make gnu-libraries # Compile and install libraries for GCC"
@echo " make clang-libraries # Compile and install libraries for GCC with clang"
@echo " make clean # Remove all compiler results"
@echo ""
@echo "Run 'make' in tools/ to create a new MINIX configuration."
@@ -30,63 +31,72 @@ usage:
#
# etcfiles has to be done first.
.if ${COMPILER_TYPE} == "ack"
world: mkfiles includes depend libraries install
world: mkfiles includes depend libraries install etcforce
.elif ${COMPILER_TYPE} == "gnu"
world: mkfiles includes depend gnu-libraries install
world: mkfiles includes depend gnu-libraries install etcforce
.endif
mkfiles:
cp etc/mk/*.mk /etc/mk/
make -C share/mk install
includes:
cd include && $(MAKE) includes
$(MAKE) -C include includes
$(MAKE) -C lib includes
libraries:
cd lib && sh ack_build.sh obj depend all install
libraries: includes
$(MAKE) -C lib build_ack
MKHEADERS411=/usr/gnu/libexec/gcc/i386-pc-minix/4.1.1/install-tools/mkheaders
MKHEADERS443=/usr/gnu/libexec/gcc/i686-pc-minix/4.4.3/install-tools/mkheaders
MKHEADERS443_PKGSRC=/usr/pkg/gcc44/libexec/gcc/i686-pc-minix/4.4.3/install-tools/mkheaders
gnu-includes: includes
SHELL=/bin/sh; if [ -f $(MKHEADERS411) ] ; then sh -e $(MKHEADERS411) ; fi
SHELL=/bin/sh; if [ -f $(MKHEADERS443) ] ; then sh -e $(MKHEADERS443) ; fi
SHELL=/bin/sh; if [ -f $(MKHEADERS443_PKGSRC) ] ; then sh -e $(MKHEADERS443_PKGSRC) ; fi
gnu-libraries:
cd lib && sh gnu_build.sh obj depend all install
gnu-libraries: gnu-includes
$(MAKE) -C lib build_gnu
commands:
cd commands && $(MAKE) all
clang-libraries: includes
$(MAKE) -C lib build_clang
commands: includes libraries
$(MAKE) -C commands all
depend::
cd boot && $(MAKE) depend
cd commands && $(MAKE) depend
cd kernel && $(MAKE) depend
cd servers && $(MAKE) depend
cd drivers && $(MAKE) depend
$(MAKE) -C boot depend
$(MAKE) -C commands depend
$(MAKE) -C kernel depend
$(MAKE) -C servers depend
$(MAKE) -C drivers depend
etcfiles::
cd etc && $(MAKE) install
$(MAKE) -C etc install
etcforce::
$(MAKE) -C etc installforce
all::
cd boot && $(MAKE) all
cd commands && $(MAKE) all
cd tools && $(MAKE) all
$(MAKE) -C boot all
$(MAKE) -C commands all
$(MAKE) -C tools all
install::
cd boot && $(MAKE) install
cd man && $(MAKE) install makedb
cd commands && $(MAKE) install
cd share && $(MAKE) install
cd tools && $(MAKE) install
$(MAKE) -C boot install
$(MAKE) -C man install makedb
$(MAKE) -C commands install
$(MAKE) -C share install
$(MAKE) -C tools install
clean::
cd boot && $(MAKE) clean
cd commands && $(MAKE) clean
cd tools && $(MAKE) clean
cd lib && sh ack_build.sh clean
cd lib && sh gnu_build.sh clean
cd test && $(MAKE) clean
$(MAKE) -C boot clean
$(MAKE) -C commands clean
$(MAKE) -C tools clean
$(MAKE) -C lib clean_gnu
$(MAKE) -C lib clean_ack
$(MAKE) -C test clean
cleandepend::
cd boot && $(MAKE) cleandepend
cd commands && $(MAKE) cleandepend
cd tools && $(MAKE) cleandepend
$(MAKE) -C boot cleandepend
$(MAKE) -C commands cleandepend
$(MAKE) -C tools cleandepend

View File

@@ -4,8 +4,8 @@
CC:=${CC:C/^gcc/cc/}
COMPILER_TYPE:=ack
PROGS= bootblock cdbootblock bootexec boot masterboot \
jumpboot installboot edparams
PROGS= bootblock cdbootblock boot masterboot \
jumpboot installboot edparams dosboot mkfile
SRCS.bootblock= bootblock.s
CPPFLAGS.bootblock.s= ${I86CPPFLAGS}
@@ -19,20 +19,21 @@ LDFLAGS.cdbootblock= ${I86LDFLAGS}
BINDIR.cdbootblock= /usr/mdec
MAN.cdbootblock=
SRCS.bootexec= boothead.s boot.c bootimage.c rawfs86.c
SRCS.boot= boothead.s boot.c bootimage.c rawfs86.c
CPPFLAGS.boothead.s= ${I86CPPFLAGS}
CPPFLAGS.boot.c= ${I86CPPFLAGS}
CPPFLAGS.bootimage.c= ${I86CPPFLAGS}
CPPFLAGS.rawfs86.c= ${I86CPPFLAGS}
LDFLAGS.bootexec= ${I86LDFLAGS}
DPADD.bootexec= ${LIBSYS}
LDADD.bootexec= -lsys
BINDIR.bootexec= /usr/mdec
MAN.bootexec=
BINDIR.boot= /usr/mdec
LDFLAGS.boot= ${I86LDFLAGS}
DPADD.boot= ${LIBSYS}
LDADD.boot= -lsys
BINDIR.boot= /usr/mdec
MAN.boot=
realall: .PHONY bootsize
bootsize: boot
${INSTALL} -S 22kb boot
SRCS.masterboot= masterboot.s
CPPFLAGS.masterboot.s= ${I86CPPFLAGS}
LDFLAGS.masterboot= ${I86LDFLAGS}
@@ -54,18 +55,35 @@ CPPFLAGS.edparams.c= -DUNIX
BINDIR.edparams= /usr/bin
MAN.edparams=
SRCS.dosboot= doshead.s dosboot.o bootimage.o rawfs86.o
CPPFLAGS.dosboot.c= -DDOS $(I86CPPFLAGS)
LDADD.dosboot= ${I86LDFLAGS} -lsys
BINDIR.dosboot= /usr/mdec
CPPFLAGS.doshead.s= -mi386
MAN.dosboot=
SRCS.mkfile= mkfhead.s mkfile.c
CPPFLAGS.mkfile.s= ${I86CPPFLAGS}
LDADD.mkfile= ${I86LDFLAGS} -lsys
BINDIR.mkfile= /usr/mdec
MAN.mkfile=
rawfs86.c: rawfs.c
ln -f rawfs.c rawfs86.c
edparams.c: boot.c
ln -f boot.c edparams.c
dosboot.c: boot.c
ln -f boot.c dosboot.c
cdbootblock.s: bootblock.s
ln -f bootblock.s cdbootblock.s
boot: bootexec
install -S 22kb bootexec
cp bootexec boot
mkfile.com: mkfile
boot.com: dosboot
./a.out2com dosboot boot.com
CPPFLAGS= -I${MINIXSRCDIR}
AFLAGS= -I${MINIXSRCDIR}
@@ -74,6 +92,6 @@ I86LDFLAGS= -mi86 -Was-ncc -.o -com
STRIPFLAG= -s
CLEANFILES+= rawfs86.c edparams.c cdbootblock.s
CLEANFILES+= rawfs86.c edparams.c cdbootblock.s dosboot.c
.include <minix.prog.mk>
.include <bsd.prog.mk>

View File

@@ -194,7 +194,7 @@ void readblock(off_t blk, char *buf, int block_size)
}
#define istty (1)
#define alarm(n) (0)
#define alarm(n) do { } while(0)
#endif /* BIOS */
@@ -538,11 +538,30 @@ static void initialize(void)
* done to get out of the way of Minix, and to put the data area
* cleanly inside a 64K chunk if using BIOS I/O (no DMA problems).
*/
u32_t oldaddr= caddr;
u32_t memend= mem[0].base + mem[0].size;
u32_t newaddr= (memend - runsize) & ~0x0000FL;
u32_t oldaddr;
u32_t memend;
u32_t newaddr;
#if !DOS
u32_t dma64k= (memend - 1) & ~0x0FFFFL;
u32_t dma64k;
#endif
if (mem_entries) {
int i, j;
j = 0;
for(i = 0; i < mem_entries ; i++) {
if (j < 3 && emem[i].type == 1 && !emem[i].base_hi) {
mem[j].base = emem[i].base_lo;
mem[j].size = emem[i].size_lo;
j++;
}
}
}
oldaddr= caddr;
memend= mem[0].base + mem[0].size;
newaddr= (memend - runsize) & ~0x0000FL;
#if !DOS
dma64k= (memend - 1) & ~0x0FFFFL;
/* Check if data segment crosses a 64K boundary. */
@@ -572,7 +591,7 @@ static void initialize(void)
* and also keep the BIOS data area safe (1.5K), plus a bit extra for
* where we may have to put a.out headers for older kernels.
*/
if (mon_return = (mem[1].size > 512*1024L)) mem[0].size = newaddr;
if ((mon_return = (mem[1].size > 512*1024L))) mem[0].size = newaddr;
mem[0].base += 2048;
mem[0].size -= 2048;
@@ -1251,10 +1270,10 @@ static void apm_perror(char *label, u16_t ax)
printf("%s: %s\n", label, str);
}
#define apm_printf printf
#define apm_printf(args) printf args
#else
#define apm_perror(label, ax) ((void)0)
#define apm_printf
#define apm_printf(args)
#endif
static void off(void)
@@ -1276,7 +1295,7 @@ static void off(void)
}
if (be.bx != (('P' << 8) | 'M'))
{
apm_printf("APM signature not found (got 0x%04x)\n", be.bx);
apm_printf(("APM signature not found (got 0x%04x)\n", be.bx));
return;
}
@@ -1286,13 +1305,13 @@ static void off(void)
al= be.ax & 0xff;
if (al > 9)
al= (al >> 4)*10 + (al & 0xf);
apm_printf("APM version %u.%u%s%s%s%s%s\n",
apm_printf(("APM version %u.%u%s%s%s%s%s\n",
ah, al,
(be.cx & 0x1) ? ", 16-bit PM" : "",
(be.cx & 0x2) ? ", 32-bit PM" : "",
(be.cx & 0x4) ? ", CPU-Idle" : "",
(be.cx & 0x8) ? ", APM-disabled" : "",
(be.cx & 0x10) ? ", APM-disengaged" : "");
(be.cx & 0x10) ? ", APM-disengaged" : ""));
/* Connect */
be.ax= 0x5301; /* APM, Real mode interface connect */
@@ -1324,7 +1343,7 @@ static void off(void)
al= be.ax & 0xff;
if (al > 9)
al= (al >> 4)*10 + (al & 0xf);
apm_printf("Got APM connection version %u.%u\n", ah, al);
apm_printf(("Got APM connection version %u.%u\n", ah, al));
/* Enable */
be.ax= 0x5308; /* APM, Enable/disable power management */
@@ -1354,8 +1373,8 @@ static void off(void)
goto disco;
}
apm_printf("Power off sequence successfully completed.\n\n");
apm_printf("Ha, ha, just kidding!\n");
apm_printf(("Power off sequence successfully completed.\n\n"));
apm_printf(("Ha, ha, just kidding!\n"));
disco:
/* Disconnect */
@@ -1472,6 +1491,11 @@ static void ctty(char *line)
printf("No serial line support under DOS\n");
}
reset()
{
printf("No reset support under DOS\n");
}
#endif /* DOS */
#endif /* BIOS */
@@ -1607,6 +1631,8 @@ void menu(void)
case USERFUN:
case SELECT:
if (c == e->arg[0]) choice= e->value;
case NOFUN:
break;
}
}
} while (choice == nil);
@@ -1805,7 +1831,7 @@ static void execute(void)
putch('\n');
break;
case 'v':
printf(version);
printf("%s", version);
break;
case 'c':
clear_screen();
@@ -1878,6 +1904,13 @@ static void execute(void)
case R_OFF: off(); ok= 1; break;
case R_CTTY: ctty(nil); ok= 1; break;
case R_RESET: reset(); ok= 1; break;
case R_NULL:
case R_ECHO:
case R_TRAP:
case R_UNSET:
/* Handled after the switch. */
break;
}
/* Command to check bootparams: */
@@ -1957,7 +1990,7 @@ void boot(void)
#if UNIX
void main(int argc, char **argv)
int main(int argc, char **argv)
/* Do not load or start anything, just edit parameters. */
{
int i;
@@ -2029,6 +2062,7 @@ void main(int argc, char **argv)
monitor();
}
exit(0);
return 0;
}
reset() { }

View File

@@ -67,7 +67,18 @@ typedef struct { /* One chunk of free memory. */
u32_t size; /* Number of bytes. */
} memory;
typedef struct { /* One chunk of free memory. */
u32_t base_lo; /* Start byte. */
u32_t base_hi;
u32_t size_lo; /* Number of bytes. */
u32_t size_hi; /* Number of bytes. */
u32_t type;
u32_t acpi_attrs;
} e820_memory;
EXTERN memory mem[3]; /* List of available memory. */
EXTERN e820_memory emem[16]; /* List of available memory. */
EXTERN int mem_entries;
EXTERN int mon_return; /* Monitor stays in memory? */
EXTERN int cdbooted; /* Did we boot from CD? (Set by boothead.s.) */

View File

@@ -41,6 +41,8 @@
.extern _rem_part ! To pass partition info
.extern _k_flags ! Special kernel flags
.extern _mem ! Free memory list
.extern _emem ! Free memory list for E820
.extern _mem_entries ! Free memory E820 list entries
.extern _cdbooted ! Whether we booted from CD
.extern _cddevice ! Whether we booted from CD
@@ -143,6 +145,64 @@ sepID:
mov _runsize+0, ax
mov _runsize+2, dx ! 32 bit size of this process
!Determine memory using the 0xE820 BIOS function if available
mov di, #_emem
mov 20(di), #1 ! force a valid ACPI 3.X entry
.data1 o32
xor bx, bx ! zero EBX
xor bp, bp !zero bp
.data1 o32
mov dx, e820_magic
.data1 o32
mov cx, const_24 ! request 24 bytes
.data1 o32
mov ax, const_0xe820
int 0x15
jc e820_failed
.data1 o32
mov dx, e820_magic
.data1 o32
cmp dx, ax
jne e820_failed
.data1 o32
test bx, bx
je e820_failed
jmp e820_gotit
e820_next:
.data1 o32
mov ax, const_0xe820
mov 20(di), #1 ! force a valid ACPI 3.X entry
.data1 o32
mov cx, const_24 ! request 24 bytes
int 0x15
jc e820_done
.data1 o32
mov dx, e820_magic
e820_gotit:
jcxz e820_skip
cmp bp, #16
je e820_done ! we have only space for 16 entries
inc bp
add di, #24
e820_skip:
.data1 o32
test bx, bx
jne e820_next
e820_done:
mov _mem_entries, bp
jmp memory_detected
e820_failed:
! Determine available memory as a list of (base,size) pairs as follows:
! mem[0] = low memory, mem[1] = memory between 1M and 16M, mem[2] = memory
! above 16M. Last two coalesced into mem[1] if adjacent.
@@ -185,6 +245,8 @@ adj_ext:
add 14(di), bx ! Add ext mem above 16M to mem below 16M
no_ext:
memory_detected:
! Time to switch to a higher level language (not much higher)
call _boot
@@ -1534,6 +1596,15 @@ p_mcs_desc:
.data2 0xFFFF, UNSET
.data1 UNSET, 0x9A, 0x00, 0x00
e820_magic:
! .data1 0x53, 0x4D, 0x41, 0x50
.data1 0x50, 0x41, 0x4D, 0x53
const_24:
.data1 0x18, 0x0, 0x0, 0x0
const_0xe820:
.data2 0xe820
.bss
.comm old_vid_mode, 2 ! Video mode at startup
.comm cur_vid_mode, 2 ! Current video mode

View File

@@ -534,7 +534,7 @@ void exec_image(char *image)
/* Save a copy of the header for the kernel, with a_syms
* misused as the address where the process is loaded at.
*/
DEBUGEXTRA(("raw_copy(0x%x, 0x%lx, 0x%x)... ",
DEBUGEXTRA(("raw_copy(0x%lx, 0x%lx, 0x%x)... ",
aout + i * A_MINHDR, mon2abs(&hdr.process), A_MINHDR));
hdr.process.a_syms= addr;
raw_copy(aout + i * A_MINHDR, mon2abs(&hdr.process), A_MINHDR);
@@ -653,7 +653,7 @@ void exec_image(char *image)
}
if (verboseboot < VERBOSEBOOT_BASIC)
printf("(%dk)\n", totalmem/1024);
printf("(%luk)\n", totalmem/1024);
if ((n_procs= i) == 0) {
printf("There are no programs in %s\n", image);
@@ -842,7 +842,7 @@ void bootminix(void)
printf("Not enough memory to load %s\n", image);
break;
case EIO:
printf("Unsuspected EOF on %s\n", image);
printf("Unexpected EOF on %s\n", image);
case 0:
/* No error or error already reported. */;
}

View File

@@ -634,19 +634,19 @@ _dev_boundary:
xor ax, ax
ret
! int readsectors(u32_t bufaddr, u32_t sector, u8_t count)
! int biosreadsectors(u32_t bufaddr, u32_t sector, u8_t count)
! int writesectors(u32_t bufaddr, u32_t sector, u8_t count)
! Read/write several sectors from/to the Minix virtual disk. Count
! must fit in a byte. The external variable vfd is the file handle.
! Returns 0 for success, otherwise the DOS error code.
!
.define _readsectors, _writesectors
.define _biosreadsectors, _writesectors
_writesectors:
push bp
mov bp, sp
movb 13(bp), 0x40 ! Code for a file write
jmp rwsec
_readsectors:
_biosreadsectors:
push bp
mov bp, sp
movb 13(bp), 0x3F ! Code for a file read

View File

@@ -193,6 +193,9 @@ do
17,0)
des="hello" dev=hello
;;
18,0)
des="UNIX domain socket" dev=uds
;;
BAD,BAD)
des= dev=
;;

View File

@@ -1,4 +1,4 @@
SCRIPTS= DESCRIBE.sh
MAN=
.include <minix.prog.mk>
.include <bsd.prog.mk>

View File

@@ -4,4 +4,4 @@ MAN=
LINKS+= ${BINDIR}/M ${BINDIR}/U
.include <minix.prog.mk>
.include <bsd.prog.mk>

View File

@@ -23,7 +23,7 @@ case $#:$1 in
ttypa ttypb ttypc ttypd ttype ttypf \
ttyq0 ttyq1 ttyq2 ttyq3 ttyq4 ttyq5 ttyq6 ttyq7 ttyq8 ttyq9 \
ttyqa ttyqb ttyqc ttyqd ttyqe ttyqf \
eth klog random filter hello
eth klog random uds filter hello
;;
0:|1:-\?)
cat >&2 <<EOF
@@ -45,6 +45,7 @@ Where key is one of the following:
audio mixer # Make audio devices
klog # Make /dev/klog
random # Make /dev/random, /dev/urandom
uds # Make /dev/uds
kbd # Make /dev/kbd
kbdaux # Make /dev/kbdaux
filter # Make /dev/filter
@@ -250,6 +251,12 @@ do
$e mknod urandom c 16 0; $e chmod 644 urandom
$e chgrp operator random urandom
;;
uds)
# unix domain sockets device
$e mknod uds c 18 0; $e chmod 644 random
$e chgrp operator uds
$e chmod 666 uds
;;
klog)
# logging device.
$e mknod klog c 15 0

View File

@@ -1,4 +1,4 @@
SCRIPTS= MAKEDEV.sh
MAN=
.include <minix.prog.mk>
.include <bsd.prog.mk>

View File

@@ -1,44 +1,44 @@
# Makefile for commands.
.include <minix.own.mk>
.include <bsd.own.mk>
SUBDIR= aal add_route adduser advent arp ash at autil awk \
backup badblocks banner basename bigmake binpackage \
binpackages binsizes bzip2 bzip2recover cal calendar \
cat cawf cd cdiff cdprobe cgrep checkhier chmem \
cat cawf cd cdprobe checkhier chmem \
chmod chown chroot ci cksum cleantmp clear cmp co \
comm compress cp crc cron crontab cut datasizes date \
comm compress cp crc cron crontab cut date \
dd de decomp16 DESCRIBE dev2name devsize df dhcpd \
dhrystone diff dirname dis88 du dumpcore easypack \
ed eject elle elvis env expand factor fgrep file \
find finger fingerd fix fold format fortune fsck \
fsck1 ftp101 ftpd200 getty gomoku grep head host \
dhrystone diff dirname dis88 diskctl du dumpcore \
ed eject elle elvis env expand factor file \
find finger fingerd fix fold format fortune fsck.mfs \
fsck1 ftp101 ftpd200 gcov-pull getty grep gomoku head hexdump host \
hostaddr id ifconfig ifdef indent install \
intr ipcrm ipcs irdpd isoread join kill last leave \
lex life loadkeys loadramdisk logger login look lp \
lpd ls lspci M m4 mail make MAKEDEV makewhatis man \
mdb mesg mined mkdep mkdir mkdist mkfifo mkfs mknod \
mkproto modem mount mt netconf newroot nice nm nohup \
nonamed od packit packman passwd paste patch pax \
less lex life loadkeys loadramdisk logger login look lp \
lpd ls lspci M m4 mail make MAKEDEV man \
mdb mdocml mesg mined mkdep mkdir mkdist mkfifo mkfs.mfs mknod \
mkproto modem mount mt netconf newroot nice acknm nohup \
nonamed od packman passwd paste patch pax \
ping postinstall poweroff pr prep printf printroot \
profile progressbar proto pr_routes ps pwd pwdauth \
ramdisk rarpd rawspeed rcp rdate readall readclock \
readfs reboot remsync rev rget rlogin rlogind rmdir \
rotate rsh rshd sed service setup shar size \
sleep slip sort spell split srccrc stat strings strip \
sleep slip sort spell split srccrc stat strings ackstrip \
stty su sum svclog swapfs swifi sync synctree sysenv \
syslogd tail talk talkd tcpd tcpdp tcpstat tee telnet \
syslogd tail talk talkd tar tcpd tcpdp tcpstat tee telnet \
telnetd term termcap tget time tinyhalt top touch tr \
truncate tsort ttt tty udpstat umount uname unexpand \
uniq unstack update urlget uud uue version vol wc \
whatis whereis which who whoami write writeisofs \
xargs yacc yap yes zdump zic zmodem
whereis which who write writeisofs fetch \
xargs yacc yes zdump zic zmodem pkg_install pkgin_cd
.if ${ARCH} == "i386"
SUBDIR+= atnormalize dosread fdisk loadfont \
mixer autopart part partition playwave postmort \
recwave repartition screendump
recwave repartition screendump padtext
SUBDIR+= acd asmconv gas2ack
.endif
.include <minix.subdir.mk>
.include <bsd.subdir.mk>

View File

@@ -6,7 +6,6 @@ SRCS= archiver.c print.c rd.c rd_arhdr.c rd_unsig2.c sprint.c \
format.c rd_bytes.c system.c write.c long2str.c
CPPFLAGS+= -I${.CURDIR} -DAAL -DSTB -DNDEBUG -DDISTRIBUTION
LINKS+= ${BINDIR}/aal ${BINDIR}/ar
MAN=
.include <minix.prog.mk>
.include <bsd.prog.mk>

View File

@@ -22,4 +22,7 @@ struct ar_hdr {
#define AR_TOTAL 26
#define AR_SIZE 22
extern int rd_arhdr(int fd, register struct ar_hdr arhdr[]);
extern void wr_arhdr(int fd, struct ar_hdr arhdr[]);
#endif /* __ARCH_H_INCLUDED */

View File

@@ -4,7 +4,18 @@
*/
/* ar - archiver Author: Michiel Huisjes */
/* Made into arch/aal by Ceriel Jacobs
*/
*/
#include <sys/types.h>
#include <fcntl.h>
#include "rd.h"
#include "wr_bytes.h"
#include "wr_long.h"
#include "wr_int2.h"
#include "arch.h"
#include "archiver.h"
#include "print.h"
static char RcsId[] = "$Header$";
@@ -26,6 +37,9 @@ static char RcsId[] = "$Header$";
*/
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifndef S_IREAD
@@ -101,9 +115,49 @@ char *temp_arch = &temp_buf[0];
extern char *mktemp();
extern char *ctime();
usage()
/* Forward declarations. */
static void enter_name(struct outname *namep);
static void do_names(struct outhead *headp);
static void do_object(int f, long size);
static void show(char *s, char *name);
static void write_symdef(void);
static void mwrite(int fd, char *address, int bytes);
static void extract(register MEMBER *member);
static void copy_member(MEMBER *member, int from, int to, int extracting);
static void add(char *name, int fd, char *mess);
static void get(int argc, char *argv[]);
/*VARARGS2*/
void error1(BOOL quit, char *str1)
{
error(TRUE, "usage: %s %s archive [file] ...\n",
fputs(str1,stderr);
if (quit) {
unlink(temp_arch);
_exit(1);
}
}
void error2(BOOL quit, char *str1, char *str2)
{
fprintf(stderr,str1,str2);
if (quit) {
unlink(temp_arch);
_exit(1);
}
}
void error3(BOOL quit, char *str1, char *str2, char *str3)
{
fprintf(stderr,str1,str2,str3);
if (quit) {
unlink(temp_arch);
_exit(1);
}
}
void usage()
{
error3(TRUE, "usage: %s %s archive [file] ...\n",
progname,
#ifdef AAL
"[acdrtxvlu]"
@@ -113,23 +167,7 @@ usage()
);
}
/*VARARGS2*/
error(quit, str1, str2, str3, str4)
BOOL quit;
char *str1, *str2, *str3, *str4;
{
char errbuf[256];
sprint(errbuf, str1, str2, str3, str4);
write(2, errbuf, strlen(errbuf));
if (quit) {
unlink(temp_arch);
_exit(1);
}
}
char *basename(path)
char *path;
char *basename(char *path)
{
register char *ptr = path;
register char *last = NULL;
@@ -150,16 +188,14 @@ char *path;
extern unsigned int rd_unsigned2();
open_archive(name, mode)
register char *name;
register int mode;
int open_archive(char *name, int mode)
{
unsigned short magic = 0;
int fd;
if (mode == CREATE) {
if ((fd = creat(name, 0666)) < 0)
error(TRUE, "cannot creat %s\n", name);
error2(TRUE, "cannot creat %s\n", name);
magic = MAGIC_NUMBER;
wr_int2(fd, magic);
return fd;
@@ -168,15 +204,15 @@ register int mode;
if ((fd = open(name, mode)) < 0) {
if (mode == APPEND) {
close(open_archive(name, CREATE));
if (!nocr_fl) error(FALSE, "%s: creating %s\n", progname, name);
if (!nocr_fl) error3(FALSE, "%s: creating %s\n", progname, name);
return open_archive(name, APPEND);
}
error(TRUE, "cannot open %s\n", name);
error2(TRUE, "cannot open %s\n", name);
}
lseek(fd, 0L, 0);
magic = rd_unsigned2(fd);
if (magic != AALMAG && magic != ARMAG)
error(TRUE, "%s is not in ar format\n", name);
error2(TRUE, "%s is not in ar format\n", name);
return fd;
}
@@ -191,9 +227,7 @@ catch()
_exit (2);
}
main(argc, argv)
int argc;
char *argv[];
int main(int argc, char *argv[])
{
register char *ptr;
int needs_arg = 0;
@@ -280,7 +314,7 @@ char *argv[];
#ifdef AAL
tab = (struct ranlib *) malloc(512 * sizeof(struct ranlib));
tstrtab = malloc(4096);
if (!tab || !tstrtab) error(TRUE,"Out of core\n");
if (!tab || !tstrtab) error1(TRUE,"Out of core\n");
tabsz = 512;
strtabsz = 4096;
#endif
@@ -300,7 +334,7 @@ again:
if (rd_arhdr(ar_fd, &member) == 0)
return NULL;
if (member.ar_size < 0) {
error(TRUE, "archive has member with negative size\n");
error1(TRUE, "archive has member with negative size\n");
}
#ifdef AAL
if (equal(SYMDEF, member.ar_name)) {
@@ -313,9 +347,7 @@ again:
char *get_mode();
get(argc, argv)
int argc;
register char *argv[];
static void get(int argc, char *argv[])
{
register MEMBER *member;
int i = 0;
@@ -457,10 +489,7 @@ register char *argv[];
close(ar_fd);
}
add(name, fd, mess)
char *name;
int fd;
char *mess;
static void add(char *name, int fd, char *mess)
{
static MEMBER member;
register int read_chars;
@@ -468,15 +497,15 @@ char *mess;
int src_fd;
if (stat(name, &status) < 0) {
error(FALSE, "cannot find %s\n", name);
error2(FALSE, "cannot find %s\n", name);
return;
}
else if (S_ISDIR(status.st_mode)) {
error(FALSE, "%s is a directory (ignored)\n", name);
error2(FALSE, "%s is a directory (ignored)\n", name);
return;
}
else if ((src_fd = open(name, 0)) < 0) {
error(FALSE, "cannot open %s\n", name);
error2(FALSE, "cannot open %s\n", name);
return;
}
@@ -512,7 +541,7 @@ char *mess;
}
else status.st_size -= x;
if (read(src_fd, io_buffer, read_chars) != read_chars) {
error(FALSE,"%s seems to shrink\n", name);
error2(FALSE,"%s seems to shrink\n", name);
break;
}
mwrite(fd, io_buffer, x);
@@ -523,8 +552,7 @@ char *mess;
close(src_fd);
}
extract(member)
register MEMBER *member;
static void extract(register MEMBER *member)
{
int fd = 1;
char buf[sizeof(member->ar_name) + 1];
@@ -532,7 +560,7 @@ register MEMBER *member;
strncpy(buf, member->ar_name, sizeof(member->ar_name));
buf[sizeof(member->ar_name)] = 0;
if (pr_fl == FALSE && (fd = creat(buf, 0666)) < 0) {
error(FALSE, "cannot create %s\n", buf);
error2(FALSE, "cannot create %s\n", buf);
fd = -1;
}
@@ -548,9 +576,7 @@ register MEMBER *member;
if (pr_fl == FALSE) chmod(buf, member->ar_mode);
}
copy_member(member, from, to, extracting)
register MEMBER *member;
int from, to;
static void copy_member(MEMBER *member, int from, int to, int extracting)
{
register int rest;
long mem_size = member->ar_size;
@@ -572,7 +598,7 @@ int from, to;
strncpy(buf, member->ar_name, sizeof(member->ar_name));
buf[sizeof(member->ar_name)] = 0;
error(TRUE, "read error on %s\n", buf);
error2(TRUE, "read error on %s\n", buf);
}
if (to >= 0) mwrite(to, io_buffer, rest);
mem_size -= (long) rest;
@@ -607,27 +633,23 @@ register int mode;
return mode_buf;
}
wr_fatal()
void wr_fatal()
{
error(TRUE, "write error\n");
error1(TRUE, "write error\n");
}
rd_fatal()
void rd_fatal()
{
error(TRUE, "read error\n");
error1(TRUE, "read error\n");
}
mwrite(fd, address, bytes)
int fd;
register char *address;
register int bytes;
static void mwrite(int fd, char *address, int bytes)
{
if (write(fd, address, bytes) != bytes)
error(TRUE, "write error\n");
error1(TRUE, "write error\n");
}
show(s, name)
char *s, *name;
static void show(char *s, char *name)
{
MEMBER x;
char buf[sizeof(x.ar_name)+1];
@@ -645,7 +667,7 @@ char *s, *name;
* then 4 bytes giving the size of the string table, followed by the string
* table itself.
*/
write_symdef()
static void write_symdef(void)
{
register struct ranlib *ran;
register int i;
@@ -690,15 +712,12 @@ write_symdef()
* The header is put in `headp'.
*/
int
is_outhead(headp)
register struct outhead *headp;
is_outhead(register struct outhead *headp)
{
return !BADMAGIC(*headp) && headp->oh_nname != 0;
}
do_object(f, size)
long size;
static void do_object(int f, long size)
{
struct outhead headbuf;
@@ -724,8 +743,7 @@ do_object(f, size)
* name table and read and write the names one by one. Update the ranlib table
* accordingly.
*/
do_names(headp)
struct outhead *headp;
static void do_names(struct outhead *headp)
{
register char *strings;
register int nnames = headp->oh_nname;
@@ -736,7 +754,7 @@ do_names(headp)
if ( headp->oh_nchar != (unsigned int)headp->oh_nchar ||
(strings = malloc((unsigned int)headp->oh_nchar)) == (char *)0
) {
error(TRUE, "string table too big\n");
error1(TRUE, "string table too big\n");
}
rd_string(strings, headp->oh_nchar);
while (nnames) {
@@ -770,15 +788,14 @@ do_names(headp)
free(strings);
}
enter_name(namep)
struct outname *namep;
static void enter_name(struct outname *namep)
{
register char *cp;
if (tnum >= tabsz) {
tab = (struct ranlib *)
realloc((char *) tab, (tabsz += 512) * sizeof(struct ranlib));
if (! tab) error(TRUE, "Out of core\n");
if (! tab) error1(TRUE, "Out of core\n");
}
tab[tnum].ran_off = tssiz;
tab[tnum].ran_pos = offset;
@@ -786,7 +803,7 @@ enter_name(namep)
for (cp = namep->on_mptr;; cp++) {
if (tssiz >= strtabsz) {
tstrtab = realloc(tstrtab, (strtabsz += 4096));
if (! tstrtab) error(TRUE, "string table overflow\n");
if (! tstrtab) error1(TRUE, "string table overflow\n");
}
tstrtab[tssiz++] = *cp;
if (!*cp) break;

3
commands/aal/archiver.h Normal file
View File

@@ -0,0 +1,3 @@
extern void rd_fatal();
extern void wr_fatal();

View File

@@ -9,11 +9,12 @@
#else
#include <varargs.h>
#endif
#include <string.h>
extern char *long2str();
static int
integral(c)
integral(int c)
{
switch (c) {
case 'b':
@@ -39,16 +40,14 @@ integral(c)
%d = int
$ */
int
_format(buf, fmt, argp)
char *buf, *fmt;
register va_list argp;
_format(char *buf, char *fmt, va_list argp)
{
register char *pf = fmt;
register char *pb = buf;
while (*pf) {
if (*pf == '%') {
register width, base, pad, npad;
register int width, base, pad, npad;
char *arg;
char cbuf[2];
char *badformat = "<bad format>";
@@ -78,7 +77,8 @@ _format(buf, fmt, argp)
else
if (*pf == 'l') {
/* alignment ??? */
if (base = integral(*++pf)) {
base = integral(*++pf);
if (base) {
arg = long2str(va_arg(argp,long), base);
}
else {
@@ -87,7 +87,7 @@ _format(buf, fmt, argp)
}
}
else
if (base = integral(*pf)) {
if ((base = integral(*pf))) {
arg = long2str((long)va_arg(argp,int), base);
}
else

2
commands/aal/format.h Normal file
View File

@@ -0,0 +1,2 @@
extern int _format(char *buf, char *fmt, va_list argp);

View File

@@ -15,7 +15,7 @@
char *
long2str(val, base)
register long val;
register base;
register int base;
{
static char numbuf[MAXWIDTH];
static char vec[] = "0123456789ABCDEF";
@@ -38,7 +38,7 @@ long2str(val, base)
if (base < 0) { /* unsigned */
base = -base;
if (val < 0L) { /* taken from Amoeba src */
register mod, i;
register int mod, i;
overflow:
mod = 0;
for (i = 0; i < 8 * sizeof val; i++) {

View File

@@ -11,6 +11,8 @@
#endif
#include <system.h>
#include "param.h"
#include "format.h"
#include "write.h"
/*VARARGS*/
/*FORMAT0v $
@@ -20,7 +22,7 @@
%[uxbo] = unsigned int
%d = int
$ */
int
void
#if __STDC__
print(char *fmt, ...)
#else

2
commands/aal/print.h Normal file
View File

@@ -0,0 +1,2 @@
extern void print(char *fmt, ...);

View File

@@ -31,4 +31,6 @@ struct ranlib {
#define SZ_RAN 8
#define SF_RAN "44"
extern void wr_ranlib(int fd, struct ranlib ran[], long cnt);
#endif /* __RANLIB_H_INCLUDED */

View File

@@ -3,8 +3,13 @@
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
* See the copyright notice in the ACK home directory, in the file "Copyright".
*/
#include <out.h>
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
#include "out.h"
#include "object.h"
#include "rd.h"
#include "rd_bytes.h"
extern long lseek();
@@ -43,9 +48,7 @@ static long rd_base;
static int sectionnr;
static
OUTREAD(p, b, n)
char *b;
long n;
void OUTREAD(int p, char *b, long n)
{
register long l = outseek[p];
@@ -62,18 +65,17 @@ OUTREAD(p, b, n)
* Open the output file according to the chosen strategy.
*/
int
rd_open(f)
char *f;
rd_open(char *f)
{
if ((outfile = open(f, 0)) < 0)
int outfile = open(f, 0);
if (outfile < 0)
return 0;
return rd_fdopen(outfile);
}
static int offcnt;
rd_fdopen(fd)
int rd_fdopen(int fd)
{
register int i;
@@ -90,20 +92,19 @@ rd_fdopen(fd)
return 1;
}
rd_close()
void rd_close()
{
close(outfile);
outfile = -1;
}
rd_fd()
int rd_fd()
{
return outfile;
}
rd_ohead(head)
register struct outhead *head;
void rd_ohead(register struct outhead *head)
{
register long off;
@@ -135,7 +136,7 @@ rd_ohead(head)
#endif
}
rd_rew_relos(head)
void rd_rew_relos(head)
register struct outhead *head;
{
register long off = OFF_RELO(*head) + rd_base;
@@ -143,7 +144,7 @@ rd_rew_relos(head)
BEGINSEEK(PARTRELO, off);
}
rd_sect(sect, cnt)
void rd_sect(sect, cnt)
register struct outsect *sect;
register unsigned int cnt;
{
@@ -173,7 +174,7 @@ rd_sect(sect, cnt)
}
}
rd_outsect(s)
void rd_outsect(int s)
{
OUTSECT(s);
sectionnr = s;
@@ -182,7 +183,7 @@ rd_outsect(s)
/*
* We don't have to worry about byte order here.
*/
rd_emit(emit, cnt)
void rd_emit(emit, cnt)
char *emit;
long cnt;
{
@@ -190,11 +191,10 @@ rd_emit(emit, cnt)
offset[sectionnr] += cnt;
}
rd_relo(relo, cnt)
void rd_relo(relo, cnt)
register struct outrelo *relo;
register unsigned int cnt;
{
OUTREAD(PARTRELO, (char *) relo, (long) cnt * SZ_RELO);
#if ! (BYTES_REVERSED || WORDS_REVERSED)
if (sizeof(struct outrelo) != SZ_RELO)
@@ -213,9 +213,7 @@ rd_relo(relo, cnt)
}
}
rd_name(name, cnt)
register struct outname *name;
register unsigned int cnt;
void rd_name(struct outname *name, unsigned int cnt)
{
OUTREAD(PARTNAME, (char *) name, (long) cnt * SZ_NAME);
@@ -236,18 +234,13 @@ rd_name(name, cnt)
}
}
rd_string(addr, len)
char *addr;
long len;
void rd_string(char *addr, long len)
{
OUTREAD(PARTCHAR, addr, len);
}
#ifdef SYMDBUG
rd_dbug(buf, size)
char *buf;
long size;
void rd_dbug(char *buf, long size)
{
OUTREAD(PARTDBUG, buf, size);
}

10
commands/aal/rd.h Normal file
View File

@@ -0,0 +1,10 @@
/*
* Headers for rd.c
*/
#include "out.h"
extern void rd_string(char *addr, long len);
extern void rd_name(struct outname name[], unsigned int cnt);
extern int rd_fdopen(int fd);
extern void rd_ohead(register struct outhead head[]);

View File

@@ -3,12 +3,16 @@
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
* See the copyright notice in the ACK home directory, in the file "Copyright".
*/
#include <sys/types.h>
#include <unistd.h>
#include <arch.h>
#include "object.h"
#include "arch.h"
#include "archiver.h"
int
rd_arhdr(fd, arhdr)
register struct ar_hdr *arhdr;
rd_arhdr(int fd, register struct ar_hdr *arhdr)
{
char buf[AR_TOTAL];
register char *c = buf;

View File

@@ -9,16 +9,19 @@
an int!
*/
#include <sys/types.h>
#include <unistd.h>
#include "archiver.h"
#include "rd_bytes.h"
static int maxchunk = MAXCHUNK;
/*
* We don't have to worry about byte order here.
* Just read "cnt" bytes from file-descriptor "fd".
*/
int
rd_bytes(fd, string, cnt)
register char *string;
register long cnt;
void rd_bytes(int fd, char *string, long cnt)
{
while (cnt) {

2
commands/aal/rd_bytes.h Normal file
View File

@@ -0,0 +1,2 @@
extern void rd_bytes(int fd, char *string, long cnt);

View File

@@ -4,9 +4,10 @@
* See the copyright notice in the ACK home directory, in the file "Copyright".
*/
#include "object.h"
#include "rd_bytes.h"
unsigned int
rd_unsigned2(fd)
rd_unsigned2(int fd)
{
char buf[2];

View File

@@ -11,6 +11,7 @@
#endif
#include <system.h>
#include "param.h"
#include "format.h"
/*VARARGS*/
/*FORMAT1v $

View File

@@ -43,5 +43,7 @@ extern File _sys_ftab[];
#define ILL_BREAK ((char *)0)
/* system's idea of block */
#ifndef BUFSIZ
#define BUFSIZ 1024
#endif
#endif /* __SYSTEM_INCLUDED__ */

View File

@@ -5,9 +5,11 @@
*/
#include <arch.h>
#include "object.h"
#include "arch.h"
#include "write.h"
#include "wr_bytes.h"
wr_arhdr(fd, arhdr)
register struct ar_hdr *arhdr;
void wr_arhdr(int fd, struct ar_hdr *arhdr)
{
char buf[AR_TOTAL];
register char *c = buf;

View File

@@ -9,14 +9,17 @@
You have to put it in an int!
*/
#include <sys/types.h>
#include <unistd.h>
#include "wr_bytes.h"
#include "archiver.h"
static int maxchunk = MAXCHUNK;
/*
* Just write "cnt" bytes to file-descriptor "fd".
*/
wr_bytes(fd, string, cnt)
register char *string;
register long cnt;
void wr_bytes(int fd, register char *string, long cnt)
{
while (cnt) {

4
commands/aal/wr_bytes.h Normal file
View File

@@ -0,0 +1,4 @@
/*
* Exported symbols of wr_bytes.c
*/
extern void wr_bytes(int fd, register char *string, long cnt);

View File

@@ -4,8 +4,10 @@
* See the copyright notice in the ACK home directory, in the file "Copyright".
*/
#include "object.h"
#include "wr_int2.h"
#include "wr_bytes.h"
wr_int2(fd, i)
void wr_int2(int fd, int i)
{
char buf[2];

2
commands/aal/wr_int2.h Normal file
View File

@@ -0,0 +1,2 @@
extern void wr_int2(int fd, int i);

View File

@@ -4,9 +4,10 @@
* See the copyright notice in the ACK home directory, in the file "Copyright".
*/
#include "object.h"
#include "wr_bytes.h"
#include "wr_long.h"
wr_long(fd, l)
long l;
void wr_long(int fd, long l)
{
char buf[4];

2
commands/aal/wr_long.h Normal file
View File

@@ -0,0 +1,2 @@
extern void wr_long(int fd, long l);

View File

@@ -5,10 +5,10 @@
*/
#include <ranlib.h>
#include "object.h"
#include "wr_bytes.h"
#include "ranlib.h"
wr_ranlib(fd, ran, cnt)
register struct ranlib *ran;
register long cnt;
void wr_ranlib(int fd, struct ranlib *ran, long cnt)
{
#if ! (BYTES_REVERSED || WORDS_REVERSED)
if (sizeof (struct ranlib) != SZ_RAN)

View File

@@ -4,13 +4,13 @@
*/
/* $Header$ */
#include <sys/types.h>
#include <unistd.h>
#include <system.h>
#include "write.h"
int
sys_write(fp, bufptr, nbytes)
File *fp;
char *bufptr;
int nbytes;
sys_write(File *fp, char *bufptr, int nbytes)
{
if (! fp) return 0;
return write(fp->o_fd, bufptr, nbytes) == nbytes;

3
commands/aal/write.h Normal file
View File

@@ -0,0 +1,3 @@
#include "system.h"
extern int sys_write(File *fp, char *bufptr, int nbytes);

View File

@@ -1,6 +1,6 @@
# Makefile for acd
.include <minix.own.mk>
.include <bsd.own.mk>
PROG= acd
CPPFLAGS+= -DARCH=\"`arch`\" -DDESCR=\"/usr/lib/descr\"
@@ -10,4 +10,4 @@ FILES= acd.descr
FILESNAME= descr
MAN=
.include <minix.prog.mk>
.include <bsd.prog.mk>

4
commands/acknm/Makefile Normal file
View File

@@ -0,0 +1,4 @@
PROG= acknm
MAN=
.include <bsd.prog.mk>

View File

@@ -0,0 +1,4 @@
PROG= ackstrip
MAN=
.include <bsd.prog.mk>

View File

@@ -3,4 +3,4 @@ MAN=
LINKS+= ${BINDIR}/add_route ${BINDIR}/del_route
.include <minix.prog.mk>
.include <bsd.prog.mk>

View File

@@ -1,4 +1,4 @@
SCRIPTS= adduser.sh
MAN=
.include <minix.prog.mk>
.include <bsd.prog.mk>

View File

@@ -15,14 +15,20 @@ MAN=
database.o: advtext.h
setup: setup.c advent.h
${CC} ${CPPFLAGS} ${LDFLAGS} -o setup setup.c
${CC} ${CPPFLAGS} ${LDFLAGS} -o $@ ${.CURDIR}/setup.c
advtext.h advent1.dat advent2.dat advent3.dat advent4.dat: \
setup advent1.txt advent2.txt advent3.txt advent4.txt
./setup
./setup ${.CURDIR}
database.d: touch-genfiles
touch-genfiles:
[ -e advtext.h ] || touch -t 197001010000.00 advtext.h
CPPFLAGS.advent.c= -DTEXTDIR='"${TEXTDIR}"'
CLEANFILES+= ${DATFILES} advtext.h setup
.include <minix.prog.mk>
.include <bsd.prog.mk>

View File

@@ -11,28 +11,34 @@
#include <stdlib.h>
#include "advent.h"
_PROTOTYPE(int main, (void));
_PROTOTYPE(void file_error, (char *));
_PROTOTYPE(void encode, (unsigned char *));
int main()
int main(int argc, char *argv[])
{
FILE *isam, *src, *dest;
char itxt[255];
int cnt, i;
long llen;
char filename[12];
char filename[100];
char *inputprefix = ".";
static char *headername[] = {
"idx1[MAXLOC]", "idx2[MAXLOC]", "idx3[MAXOBJ]", "idx4[MAXMSG]",
};
long x29 = (1L << 29), x30 = (1L << 30);
if(argc > 1) {
inputprefix=argv[1];
}
if (!(x30 / 2 == x29 && 0L < x30 && x29 < x30)) {
fprintf(stderr, "Sorry, advent needs 32-bit `long int's.\n");
exit(EXIT_FAILURE);
}
isam = fopen("advtext.h", "w");
sprintf(filename, "%s/advtext.h", inputprefix);
isam = fopen(filename, "w");
if (!isam) {
fprintf(stderr, "Sorry, I can't open advtext.h...\n");
exit(EXIT_FAILURE);
@@ -42,7 +48,7 @@ int main()
for (i = 1; i <= 4; i++) {
cnt = -1;
llen = 0L;
sprintf(filename, "advent%d.txt", i);
sprintf(filename, "%s/advent%d.txt", inputprefix, i);
src = fopen(filename, "r");
if (!src)
file_error(filename);

View File

@@ -2,4 +2,4 @@ PROG= arp
BINMODE= 4755
MAN=
.include <minix.prog.mk>
.include <bsd.prog.mk>

View File

@@ -1,6 +1,6 @@
# Makefile for ash.
.include <minix.own.mk>
.include <bsd.own.mk>
YHEADER=1
PROG= sh
@@ -78,9 +78,9 @@ signames.c signames.h: mksignames
.ORDER: operators.c operators.h
operators.c operators.h: mkexpr unary_op binary_op
sh bltin/mkexpr bltin/unary_op bltin/binary_op
sh ${.CURDIR}/bltin/mkexpr ${.CURDIR}/bltin/unary_op ${.CURDIR}/bltin/binary_op
arith.h: arith.c
arith.c: arith.y
.include <minix.prog.mk>
.include <bsd.prog.mk>

View File

@@ -35,8 +35,8 @@
static char sccsid[] = "@(#)alias.c 8.3 (Berkeley) 5/4/95";
#endif
#endif /* not lint */
/*
#include <sys/cdefs.h>
/*
__FBSDID("$FreeBSD: src/bin/sh/alias.c,v 1.18 2004/04/06 20:06:51 markm Exp $");
*/

View File

@@ -11,6 +11,7 @@ AND2 & 2
STREQ = 4 OP_STRING
STRNE != 4 OP_STRING
NEWER -newer 4 OP_STRING
OLDER -ot 4 OP_STRING
EQ -eq 4 OP_INT
NE -ne 4 OP_INT
GT -gt 4 OP_INT

View File

@@ -279,6 +279,9 @@ expr_operator(op, sp, fs)
sp->u.num = expr_is_false(sp);
sp->type = BOOLEAN;
break;
case EXISTS:
if (fs->rcode >= 0) goto true;
goto false;
case ISREAD:
i = 04;
goto permission;
@@ -344,13 +347,18 @@ filebit:
sp->u.num = fs->rcode >= 0? fs->stat.st_size : 0L;
sp->type = INTEGER;
break;
case OLDER:
case NEWER:
if (stat(sp->u.string, &st1) != 0) {
sp->u.num = 0;
} else if (stat((sp + 1)->u.string, &st2) != 0) {
sp->u.num = 1;
} else {
sp->u.num = st1.st_mtime >= st2.st_mtime;
int isnewer = st1.st_mtime >= st2.st_mtime;
if(op == NEWER)
sp->u.num = isnewer;
else
sp->u.num = !isnewer;
}
sp->type = INTEGER;
break;

View File

@@ -5,6 +5,7 @@
# by the Ash General Public License. See the file named LICENSE.
NOT ! 3
EXISTS -e 12 OP_FILE
ISREAD -r 12 OP_FILE
ISWRITE -w 12 OP_FILE
ISEXEC -x 12 OP_FILE

View File

@@ -35,8 +35,8 @@
static char sccsid[] = "@(#)eval.c 8.9 (Berkeley) 6/8/95";
#endif
#endif /* not lint */
/*
#include <sys/cdefs.h>
/*
__FBSDID("$FreeBSD: src/bin/sh/eval.c,v 1.42 2004/04/06 20:06:51 markm Exp $");
*/

View File

@@ -35,8 +35,8 @@
static char sccsid[] = "@(#)exec.c 8.4 (Berkeley) 6/8/95";
#endif
#endif /* not lint */
/*
#include <sys/cdefs.h>
/*
__FBSDID("$FreeBSD: src/bin/sh/exec.c,v 1.24.2.1 2004/09/30 04:41:55 des Exp $");
*/

View File

@@ -35,8 +35,8 @@
static char sccsid[] = "@(#)expand.c 8.5 (Berkeley) 5/15/95";
#endif
#endif /* not lint */
/*
#include <sys/cdefs.h>
/*
__FBSDID("$FreeBSD: src/bin/sh/expand.c,v 1.46 2004/04/06 20:06:51 markm Exp $");
*/

View File

@@ -35,8 +35,8 @@
static char sccsid[] = "@(#)input.c 8.3 (Berkeley) 6/9/95";
#endif
#endif /* not lint */
/*
#include <sys/cdefs.h>
/*
__FBSDID("$FreeBSD: src/bin/sh/input.c,v 1.22 2004/04/06 20:06:51 markm Exp $");
*/

View File

@@ -35,8 +35,8 @@
static char sccsid[] = "@(#)jobs.c 8.5 (Berkeley) 5/4/95";
#endif
#endif /* not lint */
/*
#include <sys/cdefs.h>
/*
__FBSDID("$FreeBSD: src/bin/sh/jobs.c,v 1.67 2004/04/06 20:06:51 markm Exp $");
*/

View File

@@ -35,8 +35,8 @@
static char sccsid[] = "@(#)miscbltin.c 8.4 (Berkeley) 5/4/95";
#endif
#endif /* not lint */
/*
#include <sys/cdefs.h>
/*
__FBSDID("$FreeBSD: src/bin/sh/miscbltin.c,v 1.30 2004/04/06 20:06:51 markm Exp $");
*/

View File

@@ -41,8 +41,8 @@ static char const copyright[] =
static char sccsid[] = "@(#)mkinit.c 8.2 (Berkeley) 5/4/95";
#endif
#endif /* not lint */
/*
#include <sys/cdefs.h>
/*
__FBSDID("$FreeBSD: src/bin/sh/mkinit.c,v 1.17 2004/04/06 20:06:51 markm Exp $");
*/
@@ -65,10 +65,6 @@ __FBSDID("$FreeBSD: src/bin/sh/mkinit.c,v 1.17 2004/04/06 20:06:51 markm Exp $")
#include <unistd.h>
#include <errno.h>
#ifdef __minix
#define __unused
#endif
/*
* OUTFILE is the name of the output file. Output is initially written
* to the file OUTTEMP, which is then moved to OUTFILE.

View File

@@ -41,6 +41,7 @@ static char const copyright[] =
static char sccsid[] = "@(#)mksyntax.c 8.2 (Berkeley) 5/4/95";
#endif /* not lint */
#endif
#include <sys/cdefs.h>
/*
__FBSDID("$FreeBSD: src/bin/sh/mksyntax.c,v 1.23 2004/04/06 20:06:51 markm Exp $");
*/
@@ -54,10 +55,6 @@ __FBSDID("$FreeBSD: src/bin/sh/mksyntax.c,v 1.23 2004/04/06 20:06:51 markm Exp $
#include <string.h>
#include "parser.h"
#ifdef __minix
#define __unused
#endif
struct synclass {
char *name;
char *comment;

View File

@@ -35,8 +35,8 @@
static char sccsid[] = "@(#)parser.c 8.7 (Berkeley) 5/16/95";
#endif
#endif /* not lint */
/*
#include <sys/cdefs.h>
/*
__FBSDID("$FreeBSD: src/bin/sh/parser.c,v 1.51.2.1 2005/03/03 03:43:20 obrien Exp $");
*/

View File

@@ -82,15 +82,10 @@ extern char nullstr[1]; /* null string */
#endif
#ifdef __minix
#define __unused
typedef long quad_t; /* XXX */
typedef unsigned long u_quad_t; /* XXX */
#endif
mode_t getmode(void *, int /* mode_t */);
void *setmode(char *);
/*
* $PchId: shell.h,v 1.7 2006/05/22 12:47:00 philip Exp $
*/

View File

@@ -35,8 +35,8 @@
static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 5/4/95";
#endif
#endif /* not lint */
/*
#include <sys/cdefs.h>
/*
__FBSDID("$FreeBSD: src/bin/sh/var.c,v 1.26.2.1 2004/09/30 04:41:55 des Exp $");
*/

View File

@@ -5,4 +5,4 @@ SRCS= asm86.c asmconv.c parse_ack.c parse_gnu.c parse_bas.c \
tokenize.c emit_ack.c emit_gnu.c
MAN=
.include <minix.prog.mk>
.include <bsd.prog.mk>

View File

@@ -2,4 +2,4 @@ PROG= at
BINMODE= 4755
MAN=
.include <minix.prog.mk>
.include <bsd.prog.mk>

View File

@@ -1,4 +1,4 @@
PROG= atnormalize
MAN=
.include <minix.prog.mk>
.include <bsd.prog.mk>

View File

@@ -7,4 +7,4 @@ CPPFLAGS+= -I${.CURDIR}
MAN.anm=
MAN.asize=
.include <minix.prog.mk>
.include <bsd.prog.mk>

View File

@@ -1,4 +1,4 @@
PROG= autopart
MAN=
.include <minix.prog.mk>
.include <bsd.prog.mk>

View File

@@ -1,10 +1,12 @@
.include <minix.own.mk>
.include <bsd.own.mk>
PROG= awk
SRCS= awkgram.y b.c lex.c lib.c main.c parse.c proctab.c run.c tran.c
YHEADER= yes
QUIET_YACC= yes
CPPFLAGS+= -I. -I${.CURDIR}
build-tools: maketab
proctab.c: maketab
@@ -14,4 +16,4 @@ maketab: awkgram.h maketab.c
CLEANFILES= maketab proctab.c
.include <minix.prog.mk>
.include <bsd.prog.mk>

View File

@@ -3,4 +3,4 @@ MAN=
LINKS+= ${BINDIR}/backup ${BINDIR}/restore
.include <minix.prog.mk>
.include <bsd.prog.mk>

View File

@@ -2,4 +2,4 @@ PROG= badblocks
CPPFLAGS+= -I${MINIXSRCDIR}/servers
MAN=
.include <minix.prog.mk>
.include <bsd.prog.mk>

View File

@@ -1,4 +1,4 @@
PROG= banner
MAN=
.include <minix.prog.mk>
.include <bsd.prog.mk>

View File

@@ -1,4 +1,4 @@
PROG= basename
MAN=
.include <minix.prog.mk>
.include <bsd.prog.mk>

View File

@@ -1,4 +1,4 @@
SCRIPTS= bigmake.sh
MAN=
.include <minix.prog.mk>
.include <bsd.prog.mk>

View File

@@ -1,4 +1,4 @@
SCRIPTS= binpackage.sh
MAN=
.include <minix.prog.mk>
.include <bsd.prog.mk>

View File

@@ -38,12 +38,18 @@ tar=$srcdir/"`basename ${dir}`".tar
tarbz=$tar.bz2
mkdir $pdir 2>/dev/null || true
binsizes=big
rc=$dir/.binpackage
if [ -f $rc ]
then . $rc
fi
binsizes $binsizes
prunedirs="$srcdir dev tmp usr/bigports usr/src usr/tmp usr/log usr/adm usr/run home etc/utmp var/run var/log /var/spool"
for d in $prunedirs
do pruneexpr="$pruneexpr $n -path /$d -prune"
n="-o "
done
touch $packagestart
sleep 1
cd $dir
@@ -60,8 +66,13 @@ fi
echo " * Building package"
echo "Minix package $dir built `date`." >$INFO
( echo $INFO ; if [ -f $PI ]; then echo $PI; fi; find / -cnewer $packagestart | egrep -v "^($srcdir|/(dev|tmp)|/usr/(src|tmp|log|adm|run)|/home|/etc/utmp|/var/(run|log|spool))" | fgrep -v /.svn ) | pax -w -d | bzip2 >$tarbz
(
echo $INFO
if [ -f $PI ]
then echo $PI
fi
find / \( $pruneexpr \) -o -cnewer $packagestart -print | fgrep -v /.svn
) | pax -w -d | bzip2 >$tarbz
rm -f $packagestart $findlist $tarcmd
binsizes normal
mv $tarbz $pdir
exit 0

View File

@@ -1,4 +1,4 @@
SCRIPTS= binpackages.sh
MAN=
.include <minix.prog.mk>
.include <bsd.prog.mk>

View File

@@ -1,4 +1,4 @@
SCRIPTS= binsizes.sh
MAN=
.include <minix.prog.mk>
.include <bsd.prog.mk>

View File

@@ -1,4 +1,4 @@
.include <minix.own.mk>
.include <bsd.own.mk>
PROG= bzip2
DPADD+= ${LIBBZ2}
@@ -11,4 +11,4 @@ MLINKS+= bzip2.1 bunzip2.1\
LINKS+= ${BINDIR}/bzip2 ${BINDIR}/bunzip2
LINKS+= ${BINDIR}/bzip2 ${BINDIR}/bzcat
.include <minix.prog.mk>
.include <bsd.prog.mk>

View File

@@ -1,6 +1,6 @@
NOMAN=
.include <minix.own.mk>
.include <bsd.own.mk>
PROG= bzip2recover
CPPFLAGS+= -I ${BZ2DIR}
@@ -8,4 +8,4 @@ CPPFLAGS+= -I ${BZ2DIR}
BZ2DIR= ${MINIXSRCDIR}/commands/bzip2
.PATH: ${BZ2DIR}
.include <minix.prog.mk>
.include <bsd.prog.mk>

View File

@@ -1,4 +1,4 @@
PROG= cal
MAN=
.include <minix.prog.mk>
.include <bsd.prog.mk>

View File

@@ -1,4 +1,4 @@
PROG= calendar
MAN=
.include <minix.prog.mk>
.include <bsd.prog.mk>

View File

@@ -2,4 +2,4 @@ PROG= cat
BINDIR= /bin
MAN=
.include <minix.prog.mk>
.include <bsd.prog.mk>

View File

@@ -49,4 +49,4 @@ MAN.bsfilt=
FILESDIR= /usr/lib/cawf
FILES= common device.cf dumb.dev man.mac me.mac ms.mac mnx.mac
.include <minix.prog.mk>
.include <bsd.prog.mk>

View File

@@ -15,4 +15,4 @@ LINKS+= ${BINDIR}/cd ${BINDIR}/umask
LINKS+= ${BINDIR}/cd ${BINDIR}/wait
.include <minix.prog.mk>
.include <bsd.prog.mk>

View File

@@ -1,4 +0,0 @@
PROG= cdiff
MAN=
.include <minix.prog.mk>

View File

@@ -1,365 +0,0 @@
/* cdiff - context diff Author: Larry Wall */
/* Cdiff - turns a regular diff into a new-style context diff
*
* Usage: cdiff file1 file2
*/
#define PATCHLEVEL 2
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <ctype.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <limits.h>
#include <stdio.h>
char buff[512];
FILE *inputfp, *oldfp, *newfp;
int oldmin, oldmax, newmin, newmax;
int oldbeg, oldend, newbeg, newend;
int preoldmax, prenewmax;
int preoldbeg, preoldend, prenewbeg, prenewend;
int oldwanted, newwanted;
char *oldhunk, *newhunk;
char *progname;
size_t oldsize, oldalloc, newsize, newalloc;
_PROTOTYPE(int main, (int argc, char **argv));
_PROTOTYPE(void dumphunk, (void));
_PROTOTYPE(char *getold, (int targ));
_PROTOTYPE(char *getnew, (int targ));
_PROTOTYPE(void *xmalloc, (size_t size));
_PROTOTYPE(void *xrealloc, (void *ptr, size_t size));
#define Nullfp (FILE*)0
#define Nullch (char*)0
#define ENOUGH (NAME_MAX + PATH_MAX + 1)
#define CRC_END 12
int main(argc, argv)
int argc;
char **argv;
{
FILE *crcfp;
char *old, *new;
int context = 3;
struct stat statbuf;
register char *s;
char op;
char *newmark, *oldmark;
char sysbuf1[ENOUGH], sysbuf2[ENOUGH];
int len;
char *line;
int i;
int status;
progname = argv[0];
oldalloc = 512;
oldhunk = (char *) xmalloc(oldalloc);
newalloc = 512;
newhunk = (char *) xmalloc(newalloc);
for (argc--, argv++; argc; argc--, argv++) {
if (argv[0][0] != '-') break;
if (argv[0][1] == 'c') context = atoi(argv[0] + 2);
}
if (argc != 2) {
fprintf(stderr, "Usage: cdiff old new\n");
exit(2);
}
old = argv[0];
new = argv[1];
oldfp = fopen(old, "r");
if (!oldfp) {
fprintf(stderr, "Can't open %s\n", old);
exit(2);
}
newfp = fopen(new, "r");
if (!newfp) {
fprintf(stderr, "Can't open %s\n", new);
exit(2);
}
/* Compute crcs by popen()ing crc and reading the output. Do this before
* popen()ing diff to do the work. popen() attempts to support multiple
* clients, but the 1.3-1.6.24b versions don't succeed.
*/
sprintf(sysbuf1, "crc %s", old);
crcfp = popen(sysbuf1, "r");
if (!crcfp) {
/* The only advantage of cdiff over diff is that it prints crcs, so
* give up easily if crc fails.
*/
fprintf(stderr, "Can't execute crc %s\n", old);
exit(2);
}
fgets(sysbuf1, sizeof(sysbuf1), crcfp);
sysbuf1[CRC_END] = '\0';
status = pclose(crcfp);
if (status != 0) {
fprintf(stderr, "crc %s returned bad status %d\n", old, status);
exit(2);
}
sprintf(sysbuf2, "crc %s", new);
crcfp = popen(sysbuf2, "r");
if (!crcfp) {
fprintf(stderr, "Can't execute crc %s\n", new);
exit(2);
}
fgets(sysbuf2, sizeof(sysbuf2), crcfp);
sysbuf2[CRC_END] = '\0';
status = pclose(crcfp);
if (status != 0) {
fprintf(stderr, "crc %s returned bad status %d\n", new, status);
exit(2);
}
sprintf(buff, "diff %s %s 2>/dev/null", old, new);
inputfp = popen(buff, "r");
if (!inputfp) {
fprintf(stderr, "Can't execute diff %s %s\n", old, new);
exit(2);
}
fstat(fileno(oldfp), &statbuf);
printf("*** %s crc=%s\t%s", old, sysbuf1, ctime(&statbuf.st_mtime));
fstat(fileno(newfp), &statbuf);
printf("--- %s crc=%s\t%s", new, sysbuf2, ctime(&statbuf.st_mtime));
preoldend = -1000;
while (fgets(buff, sizeof buff, inputfp) != Nullch) {
if (isdigit(*buff)) {
oldmin = atoi(buff);
for (s = buff; isdigit(*s); s++);
if (*s == ',') {
s++;
oldmax = atoi(s);
for (; isdigit(*s); s++);
} else {
oldmax = oldmin;
}
if (*s != 'a' && *s != 'd' && *s != 'c') {
fprintf(stderr, "Unparseable input: %s\n", s);
exit(2);
}
op = *s;
s++;
newmin = atoi(s);
for (; isdigit(*s); s++);
if (*s == ',') {
s++;
newmax = atoi(s);
for (; isdigit(*s); s++);
} else {
newmax = newmin;
}
if (*s != '\n' && *s != ' ') {
fprintf(stderr, "Unparseable input: %s\n", s);
exit(2);
}
newmark = oldmark = "! ";
if (op == 'a') {
oldmin++;
newmark = "+ ";
}
if (op == 'd') {
newmin++;
oldmark = "- ";
}
oldbeg = oldmin - context;
oldend = oldmax + context;
if (oldbeg < 1) oldbeg = 1;
newbeg = newmin - context;
newend = newmax + context;
if (newbeg < 1) newbeg = 1;
if (preoldend < oldbeg - 1) {
if (preoldend >= 0) {
dumphunk();
}
preoldbeg = oldbeg;
prenewbeg = newbeg;
oldwanted = newwanted = 0;
oldsize = newsize = 0;
} else { /* we want to append to previous hunk */
oldbeg = preoldmax + 1;
newbeg = prenewmax + 1;
}
for (i = oldbeg; i <= oldmax; i++) {
line = getold(i);
if (!line) {
oldend = oldmax = i - 1;
break;
}
len = strlen(line) + 2;
if (oldsize + len + 1 >= oldalloc) {
oldalloc *= 2;
oldhunk = (char *) xrealloc(oldhunk, oldalloc);
}
if (i >= oldmin) {
strcpy(oldhunk + oldsize, oldmark);
oldwanted++;
} else {
strcpy(oldhunk + oldsize, " ");
}
strcpy(oldhunk + oldsize + 2, line);
oldsize += len;
}
preoldmax = oldmax;
preoldend = oldend;
for (i = newbeg; i <= newmax; i++) {
line = getnew(i);
if (!line) {
newend = newmax = i - 1;
break;
}
len = strlen(line) + 2;
if (newsize + len + 1 >= newalloc) {
newalloc *= 2;
newhunk = (char *) xrealloc(newhunk, newalloc);
}
if (i >= newmin) {
strcpy(newhunk + newsize, newmark);
newwanted++;
} else {
strcpy(newhunk + newsize, " ");
}
strcpy(newhunk + newsize + 2, line);
newsize += len;
}
prenewmax = newmax;
prenewend = newend;
}
}
if (preoldend >= 0) {
dumphunk();
}
status = pclose(inputfp);
if (!WIFEXITED(status)) exit(2);
status = WEXITSTATUS(status);
return(status == 0 || status == 1 ? status : 2);
}
void dumphunk()
{
int i;
char *line;
int len;
for (i = preoldmax + 1; i <= preoldend; i++) {
line = getold(i);
if (!line) {
preoldend = i - 1;
break;
}
len = strlen(line) + 2;
if (oldsize + len + 1 >= oldalloc) {
oldalloc *= 2;
oldhunk = (char *) xrealloc(oldhunk, oldalloc);
}
strcpy(oldhunk + oldsize, " ");
strcpy(oldhunk + oldsize + 2, line);
oldsize += len;
}
for (i = prenewmax + 1; i <= prenewend; i++) {
line = getnew(i);
if (!line) {
prenewend = i - 1;
break;
}
len = strlen(line) + 2;
if (newsize + len + 1 >= newalloc) {
newalloc *= 2;
newhunk = (char *) xrealloc(newhunk, newalloc);
}
strcpy(newhunk + newsize, " ");
strcpy(newhunk + newsize + 2, line);
newsize += len;
}
printf("***************\n");
if (preoldbeg >= preoldend) {
printf("*** %d ****\n", preoldend);
} else {
printf("*** %d,%d ****\n", preoldbeg, preoldend);
}
if (oldwanted) {
printf("%s", oldhunk);
}
oldsize = 0;
*oldhunk = '\0';
if (prenewbeg >= prenewend) {
printf("--- %d ----\n", prenewend);
} else {
printf("--- %d,%d ----\n", prenewbeg, prenewend);
}
if (newwanted) {
printf("%s", newhunk);
}
newsize = 0;
*newhunk = '\0';
}
char *getold(targ)
int targ;
{
static int oldline = 0;
while (fgets(buff, sizeof buff, oldfp) != Nullch) {
oldline++;
if (oldline == targ) return buff;
}
return Nullch;
}
char *getnew(targ)
int targ;
{
static int newline = 0;
while (fgets(buff, sizeof buff, newfp) != Nullch) {
newline++;
if (newline == targ) return buff;
}
return Nullch;
}
void *xmalloc(size)
size_t size;
{
void *ptr;
ptr = malloc(size);
if (ptr == NULL) {
fprintf(stderr, "%s: out of memory\n", progname);
exit(2);
}
return(ptr);
}
void *xrealloc(ptr, size)
void *ptr;
size_t size;
{
ptr = realloc(ptr, size);
if (ptr == NULL) {
fprintf(stderr, "%s: out of memory\n", progname);
exit(2);
}
return(ptr);
}

View File

@@ -2,4 +2,4 @@ PROG= cdprobe
CPPFLAGS+= -I${MINIXSRCDIR}/servers
MAN=
.include <minix.prog.mk>
.include <bsd.prog.mk>

View File

@@ -1,4 +0,0 @@
PROG= cgrep
MAN=
.include <minix.prog.mk>

View File

@@ -1,379 +0,0 @@
/* cgrep - grep and display context Author: Mark Mallet */
/*
Nov 19 1984 Mark Mallett (mem@zinn.MV.COM)
mem 860224 Modified to do r/e (regular expression) parsing on unix
mem 860324 Added -f, -n; added code to number lines correctly on output.
mem 870325 Added support for regcmp()/regex() style regular expression
library; redid some conditionals to provide better mix'n'match.
mem 870326 Don't try to print the filename if reading from stdin.
Add -w option. Fix a small problem which occasionally allowed
the separator to come out between adjacent lines of the file.
mem 871119 Fix semantics of call to regcmp(): the NULL terminating the
argument list was missing. It worked, but probably only
due to some bizarre coincidence.
dro 890109 Minor mods to compile under Minix
*/
#define OS_UNIX /* Define this for unix systems */
/* #define REGEX *//* Define this for re_comp/re_exec library */
#define REGCMP /* Define this to use regcmp/regex */
/* #define OS_CPM *//* Define this for CP/M-80 */
/* Don't touch these */
#define NOREGEXP /* Set this for no regular expression */
#ifdef REGEX
#undef NOREGEXP
#endif /* REGEX */
#ifdef REGCMP
#undef NOREGEXP
#endif /* REGCMP */
#ifdef OS_CPM
#include "stdio.h"
#include "ctype.h"
#endif /* OS_CPM */
#ifdef OS_UNIX
#include <sys/types.h>
#include <sys/dir.h> /* Either here or in sys directory - dro */
#include <ctype.h>
#include <limits.h> /* should have this - dro */
#include <regexp.h> /* should have this - dro */
#include <stdlib.h>
#include <stdio.h>
#endif /* OS_UNIX */
/* Local definitions */
#ifndef NULL
#define NULL ((char *)0)
#endif /* NULL */
#ifndef NUL
#define NUL '\000'
#endif
#ifndef TRUE
#define TRUE 1
#define FALSE 0
#endif
/* Internal data declared global */
/* Internal routines */
_PROTOTYPE(int main, (int argc, char **argv));
_PROTOTYPE(void dosrch, (char *ifnm));
_PROTOTYPE(void shwlin, (char *fnm, int linnum, char *line));
_PROTOTYPE(int matlin, (char *line));
_PROTOTYPE(void regerror, (const char *s));
/* External data */
/* Local data */
static int Debug = {FALSE}; /* Debug enabled flag */
static int Lcur = {0}; /* Current line (in Lines array) */
static char **Lines = {NULL}; /* Lines pointer array */
static int Linlen = {100}; /* Line length */
static int Lone = {0}; /* Line one (in Lines array) */
static int Nmr = {0}; /* Number of matched regions */
static char *Pat = {NULL}; /* Pattern */
static char Shwfile = {TRUE}; /* Show file name... */
static char Shwline = {TRUE}; /* Show line number */
static int Waft = {0}; /* Window after */
static int Wbef = {0}; /* Window before */
static int Wsiz = {0}; /* Window size */
regexp *Re; /* Result from reg compilation */
int main(argc, argv)
int argc; /* Argument count */
char **argv; /* Argument values */
{
int i; /* Scratch */
int n; /* Scratch again */
int c; /* A character */
char *aptr; /* Argument pointer */
int nf; /* number of files on command line */
nf = 0; /* No files on line */
for (i = 1; i < argc; i++) { /* Look at args */
if (argv[i][0] != '-') {/* If option */
if (Pat == NULL) { /* If no pattern yet given */
Pat = argv[i]; /* point here */
#ifdef REGEX
if ((Re = re_comp(Pat)) != NULL) {
fprintf(stderr, "cgrep: %s\n", re);
exit(1);
}
#endif /* REGEX */
#ifdef REGCMP
if ((Re = regcomp(Pat)) == NULL) {
fprintf(stderr, "cgrep: error in regular expression.\n");
exit(1);
}
#endif /* REGCMP */
} else { /* This must be a file to search */
nf++; /* Count it */
dosrch(argv[i]); /* Search */
}
} else { /* Option char */
c = argv[i][1]; /* Get option char */
if (isupper(c)) /* Trap idiot definition of tolower */
c = tolower(c); /* Don't care about case */
n = i;
aptr = NULL; /* Find arg, if any */
if (argv[i][2] != NUL) {
aptr = &argv[i][2];
n = i; /* Where to set i if we use this arg */
} else if (i < argc - 1) { /* use next.. */
n = i + 1;
aptr = argv[n];
}
switch (c) { /* Process the option */
case 'a': /* Lines after */
Waft = atoi(aptr);
Lines = NULL;
i = n;
break;
case 'b': /* Lines before */
Wbef = atoi(aptr);
Lines = NULL;
i = n;
break;
/* Disable debug output
case 'd': Debug = TRUE; break;
*/
case 'f': /* Suppress filename on output */
Shwfile = FALSE;
break;
case 'l': /* Line length */
Linlen = atoi(aptr);
Lines = NULL;
i = n;
break;
case 'n': /* Suppress line number on output */
Shwline = FALSE;
break;
case 'w': /* Window: lines before and after */
Waft = Wbef = atoi(aptr);
Lines = NULL;
i = n;
break;
default:
fprintf(stderr, "Invalid option %s\n", argv[i]);
exit(1);
}
}
}
if (Pat == NULL) { /* If no pattern given */
fprintf(stderr,
"Usage: cgrep [-a n] [-b n] [-f] [-l n] [-n] [-w n] pattern [filename... ]\n");
exit(1);
}
if (nf == 0) /* No files processed ? */
dosrch((char *)NULL); /* Do standard input */
return(0);
}
/* Dosrch (ifnm) Perform the search
* Accepts :
*
* ifn Input file name
*
*
* Returns :
*
*
*/
void dosrch(ifnm)
char *ifnm; /* Input filelname */
{
FILE *ifp; /* Input fp */
char *lptr; /* Line pointer */
int i; /* Scratch */
int prtaft; /* Print-after count */
int linnum; /* Line number */
int nlb; /* Number of lines buffered */
if (ifnm != NULL) { /* If file name given */
ifp = fopen(ifnm, "r"); /* Open it for read access */
if (ifp == NULL) {
fprintf(stderr, "Can not open file %s\n", ifnm);
return;
}
} else
ifp = stdin;
if (Lines == NULL) { /* If no line table allocated.. */
Wsiz = Wbef + 2; /* Determine total window size */
Lines = (char **) calloc((size_t)Wsiz, sizeof(char *));
/* Allocate pointer table */
for (i = 0; i < Wsiz; i++) /* Allocate line buffers */
Lines[i] = (char *) calloc((size_t)Linlen, sizeof(char));
}
Lcur = Lone = 0; /* Setup line pointers */
nlb = 0; /* No lines buffered */
linnum = 0; /* Line number is zero */
prtaft = -(Wbef + 1); /* Make sure separator given first time */
for (;;) { /* Loop through the file */
lptr = Lines[Lcur]; /* Get pointer to current line */
if (++Lcur == Wsiz) /* Bump curr pointer and wrap */
Lcur = 0; /* if hit end */
if (Lone == Lcur) /* If wrapped to beginning of window */
if (++Lone == Wsiz) /* Bump beginning */
Lone = 0; /* and wrap if hit end */
if (fgets(lptr, Linlen, ifp) != lptr) break; /* if end of file */
linnum++; /* Count line number */
if (matlin(lptr)) { /* If matching line */
if (prtaft < (-Wbef)) /* Check for separator needed */
if ((Nmr++ > 0) && ((Wbef > 0) || (Waft > 0)))
printf("----------------------------------------------------------------------------\n");
while (Lone != Lcur) { /* Until we close the window */
shwlin(ifnm, linnum - nlb, Lines[Lone]);
/* Show the line */
if (++Lone == Wsiz) Lone = 0;
nlb--;
}
nlb = 0; /* No lines buffered */
prtaft = Waft; /* Print n lines after */
} else { /* Didn't match */
if (prtaft-- > 0) { /* If must print lines after */
shwlin(ifnm, linnum, lptr);
/* Show the line */
Lone = Lcur; /* Match pointers */
} else if (nlb < Wbef) /* Count lines buffered */
nlb++;
}
}
if (ifnm != NULL) fclose(ifp);
}
/* Shwlin (fnm, linnum, line) Show a matching line
*
* Accepts :
*
* fnm File name
*
* linnum Line number
*
* line Line to show
*
*
* Returns :
*
*
*/
void shwlin(fnm, linnum, line)
char *fnm; /* File name */
int linnum; /* Line number */
char *line; /* Line (with newline at end) to print */
{
if (Shwfile && (fnm != NULL)) printf("%s%s", fnm, Shwline ? " " : ":");
if (Shwline) printf("@%05d:", linnum);
printf("%s", line);
}
/* Matlin (line) Perform match against pattern and line
*
* Accepts :
*
* line Address of line to match
*
*
* Returns :
*
* <value> TRUE if match FALSE if not
*
*
*/
int matlin(line)
char *line; /* Line to match */
{
int rtncode; /* Return value from this routine */
#ifdef NOREGEXP
char *pptr, *lptr, *tlptr;
int c1, c2;
#endif /* NOREGEXP */
if (Debug) printf("Matching %s against %s", Pat, line);
#ifdef REGEX
rtncode = re_exec(line); /* Hand off to r/e evaluator */
#endif /* REGEX */
#ifdef REGCMP
rtncode = (regexec(Re, line, TRUE) != 0);
#endif /* REGCMP */
#ifdef NOREGEX /* Have to do menial comparison.. */
lptr = line; /* Init line pointer */
for (rtncode = -1; rtncode < 0;) {
tlptr = lptr++; /* Get temp ptr to line */
pptr = Pat; /* Get ptr to pattern */
while (TRUE) {
if ((c1 = *pptr++) == NUL) {
rtncode = 1; /* GOOD return value */
break;
}
if ((c2 = *tlptr++) == NUL) {
rtncode = 0; /* BAD return value */
break;
}
if (isupper(c1)) c1 = tolower(c1);
if (isupper(c2)) c2 = tolower(c2);
if (c1 != c2) break;
}
}
#endif /* NOREGEX */
if (Debug) printf("matlin returned %s\n", rtncode ? "TRUE" : "FALSE");
return(rtncode);
}
void regerror(s)
const char *s;
{
printf("%s\n", (char *) s);
exit(1);
}

View File

@@ -1,4 +1,4 @@
SCRIPTS= checkhier.sh
MAN=
.include <minix.prog.mk>
.include <bsd.prog.mk>

View File

@@ -1,4 +1,4 @@
PROG= chmem
MAN=
.include <minix.prog.mk>
.include <bsd.prog.mk>

View File

@@ -1,4 +1,4 @@
PROG= chmod
MAN=
.include <minix.prog.mk>
.include <bsd.prog.mk>

View File

@@ -3,4 +3,4 @@ MAN=
LINKS+= ${BINDIR}/chown ${BINDIR}/chgrp
.include <minix.prog.mk>
.include <bsd.prog.mk>

View File

@@ -2,4 +2,4 @@ PROG= chroot
BINDIR= /bin
MAN=
.include <minix.prog.mk>
.include <bsd.prog.mk>

View File

@@ -1,4 +1,4 @@
PROG= ci
MAN=
.include <minix.prog.mk>
.include <bsd.prog.mk>

Some files were not shown because too many files have changed in this diff Show More