Commit graph

443 commits

Author SHA1 Message Date
Cristiano Giuffrida 64d15bd98e libvtreefs: allow highly dynamic directories
Change-Id: Ibf76262f943ef1a5f529384ebd4a06a2cc5897c1
2015-06-29 10:57:31 +00:00
Cristiano Giuffrida c21aa858e2 libvtreefs: dynamically allocate long inode names
Extended by David van Moolenbroek to continue using static buffers
for short inode names, so as to prevent important file system
services such as procfs from running out of memory at runtime.

Change-Id: I6f841741ee9944fc87dbdb78b5cdaa2abee9da76
2015-06-29 10:57:24 +00:00
Cristiano Giuffrida 5a7def9a94 libvtreefs: fix naming bug
Change-Id: Ib8767cfef4206ed491855bace6dd8bd58b45b8ce
2015-06-29 10:56:59 +00:00
Cristiano Giuffrida a8f606defa procfs: add service pid information
Change-Id: I163ca4c6c6db45cca41515644ac6c2acd0807ee8
2015-06-29 10:56:53 +00:00
David van Moolenbroek f5321d8d55 procfs: do not list inactive services
Each /proc/service entry must have a unique label.  With cloning,
multiple RS services may have the same label.  Since we are not
actually interested in inactive services (for now), eliminate those
entries, leaving only the active service which will then indeed have
a unique label in the list.  This resolves a procfs crash.

Change-Id: I0de7ef8fd186ab13f3e22e46416504fd981c09aa
2015-06-29 10:56:43 +00:00
David van Moolenbroek 0eabb93c0c procfs: retrieve both RS tables from RS at once
Previously, procfs would retrieve the rproc and rprocpub tables from
RS in two separate calls.  This allowed for a race condition where the
tables could change in between the calls, resulting in a panic in
procfs under certain circumstances.  RS now implements a new method
for getsysinfo that allows the retrieval of both tables at once.

Change-Id: I5ec22d25898361270c90e805a43fc6d76ad9e29d
2015-06-29 10:56:30 +00:00
David van Moolenbroek da21d85025 Add PTYFS, Unix98 pseudo terminal support
This patch adds support for Unix98 pseudo terminals, that is,
posix_openpt(3), grantpt(3), unlockpt(3), /dev/ptmx, and /dev/pts/.
The latter is implemented with a new pseudo file system, PTYFS.

In effect, this patch adds secure support for unprivileged pseudo
terminal allocation, allowing programs such as tmux(1) to be used by
non-root users as well.  Test77 has been extended with new tests, and
no longer needs to run as root.

The new functionality is optional.  To revert to the old behavior,
remove the "ptyfs" entry from /etc/fstab.

Technical nodes:

o The reason for not implementing the NetBSD /dev/ptm approach is that
  implementing the corresponding ioctl (TIOCPTMGET) would require
  adding a number of extremely hairy exceptions to VFS, including the
  PTY driver having to create new file descriptors for its own device
  nodes.

o PTYFS is required for Unix98 PTYs in order to avoid that the PTY
  driver has to be aware of old-style PTY naming schemes and even has
  to call chmod(2) on a disk-backed file system.  PTY cannot be its
  own PTYFS since a character driver may currently not also be a file
  system.  However, PTYFS may be subsumed into a DEVFS in the future.

o The Unix98 PTY behavior differs somewhat from NetBSD's, in that
  slave nodes are created on ptyfs only upon the first call to
  grantpt(3).  This approach obviates the need to revoke access as
  part of the grantpt(3) call.

o Shutting down PTY may leave slave nodes on PTYFS, but once PTY is
  restarted, these leftover slave nodes will be removed before they
  create a security risk.  Unmounting PTYFS will make existing PTY
  slaves permanently unavailable, and absence of PTYFS will block
  allocation of new Unix98 PTYs until PTYFS is (re)mounted.

Change-Id: I822b43ba32707c8815fd0f7d5bb7a438f51421c1
2015-06-23 17:43:46 +00:00
David van Moolenbroek 0a2a08739e libfsdriver: clear VM cache only if used
As part of its built-in mmap emulation support for "none" file system
services, libfsdriver clears the VM cache upon exit.  However, for
trivial file systems which do not even support reading from files, the
the VM cache need to be cleared either.  With this patch, the VM cache
is cleared only when modified, so that such trivial file systems need
not be given CLEARCACHE permission.

Change-Id: I518c092443455302b9b9728f10a3f894d2c8036b
2015-06-23 14:38:54 +00:00
David van Moolenbroek 3f30eb69f0 libfsdriver: default to noop for putnode
While putnode requests should always succeed, very simple file system
services may not care about reference counts and thus about putnode
requests at all.  For this reason, we now default to an OK response if
no fdr_putnode implementation is given.

Change-Id: I01f6421abf4546a1f69d8c21900a92d6acc45745
2015-06-23 14:38:28 +00:00
David van Moolenbroek 22840dea11 libfsdriver: preinitialize stat.st_ino
The stat.st_ino field must always be filled with the inode number
given as part of the fdr_stat request anyway, so libfsdriver can
simply fill in the number and allow the file system not to bother.

Change-Id: Ia7a849d0b23dfc83010df0d48fa26e4225427694
2015-06-23 14:38:04 +00:00
Leonardo Fogel 07cbc27cb0 Add a driver for the eMMC on the BeagleBone Black
Change-Id: I30ab36ac048c65538718e372db9502fb8f51d41f
2015-06-21 11:04:16 +00:00
David van Moolenbroek 5055c7ea51 VFS: fix pipe resumption delay bug
Commit 723e513 erroneously removed a yield() call from VFS which was
necessary to get resumed pipe read/write threads to run before VFS
blocks on receive().  The removal caused those threads to run only
once VFS received another message, effectively slowing down activity
on pipes to a crawl in some cases.

Instead of readding the yield() call, this patch restructures the
get_work() code to go back through the main message loop even when no
new work is received, thus ensuring that newly started threads are
always activated without requiring a special case.

This fixes #65.

Change-Id: I59b7fb9e403d87dba1a5deecb04539cc37517742
2015-06-19 22:13:34 +00:00
rlfnb e1e2bc96d2 handle lack of pckbd more gracefully
kb_init() panics, if no keyboard controller is found during self-test.
Instead of panic, the driver should quit the init process and tell it the SEF .

Change-Id: Icdfb7125f5d4062f46cfbbdbbb9e54ac4b273642
2015-06-15 17:11:29 +02:00
David van Moolenbroek af4345b097 isofs: do not link against libc
This change requires a small patch to libc, in order to avoid that
libminc has to pull in a large chunk of libc just for mktime(3).

Change-Id: I48e598b3716eff626cac461f78a41e32334e6b28
2015-06-07 17:01:45 +00:00
David van Moolenbroek 44707c1900 inet: do not link against libc
This should make its printed errors show up again.

Change-Id: I6839a584dc2a544bae7973ded3ab1dacf04e4ec0
2015-06-07 14:38:12 +00:00
David van Moolenbroek dfc3261535 PFS, inet: use static UID to drop privileges
Previously, services would obtain the user ID of "service" through
getpwnam(3).  While this approach is conceptually better, it also
imposes linking against libc which in turn causes problems with
printf(3), which already led to PFS no longer dropping privileges at
all.  For now, we hardcode SERVICE_UID and use that instead.

In the future, two changes should allow removal of SERVICE_UID again:
- "service edit" should cause RS to request that a service (such as
  PFS) drop privileges through SEF, using the user ID resolved by
  service(8), or something similar;
- a future devfs should make it possible for inet to start without
  root privileges altogether.

Change-Id: Ie02a1e888cde325806fc0ae76909943ac42c9b96
2015-06-06 21:42:48 +00:00
David van Moolenbroek 7eb698ea4a VFS: during initial mount, receive but block work
For VFS, initialization is a special case for processing work: PFS
and the ramdisk MFS must be fully mounted before VFS can process any
other requests, in particular from init(8). This case was handled by
receiving reply messages only from the FS service being mounted, but
this effectively disallowed PFS from calling setuid(2) at startup.

This patch lets VFS receive all messages during the mounting process,
but defer processing any new requests. As a result, the FS services
have a bit more freedom in what they can do during startup.

Change-Id: I18275f458952a8d790736a9c9559b27bbef97b7b
2015-06-06 18:45:23 +00:00
David van Moolenbroek 179bddcf5d VFS: fix error behavior for partial pipe writes
This patch fixes two related issues:

- If a large (>PIPE_BUF) pipe write is processed partially, only to be
  followed by a write error condition, then the process is left in an
  incorrect state, possibly causing VFS to crash on a subsequent call.

- If such a partially processed large pipe write ends up resulting in
  an EPIPE error, no corresponding SIGPIPE signal is generated.

The corrected behavior is tested in test68.

Change-Id: I5540e61ab6bcc60a31201485eda04bc49ece2ca8
2015-06-05 18:40:57 +00:00
Jacob Adams d9494baa34 cawf: Update K&R function declarations
Change-Id: Ib18171089c7b389f7f2643d7298f9659e882f65c
2015-05-18 15:20:39 +02:00
Jacob Adams c6748a4a93 cawf: Fix buffer scope
Change-Id: I03f9066c20da142034626b07d0b07c446075b8af
2015-05-18 15:20:36 +02:00
Jacob Adams c14bb31e67 sprofalyze: Fix minor typo
Change-Id: I0a419833fb2f438808613737680ace7246713ee9
2015-05-18 13:54:19 +02:00
Jacob Adams be4841096d Add manpage for sprofdiff
Change-Id: Ifa98ab133ef818d21921f05db650069448ea52ff
2015-05-18 13:52:13 +02:00
Jacob Adams 2a6b817353 Add manpage for sprofalyze
Change-Id: I206a5878e8f788ea4ff742453148462959263a6a
2015-05-18 13:41:29 +02:00
Jacob Adams c19d619d42 Importing bin/dd
Change-Id: Ibdfed821aa834419c9713dc80f698c8ed74ff269
2015-04-15 13:50:57 +02:00
Jacob Adams 3a1943c1c1 devmand: properly prevent overflow
closes #22

Change-Id: Ia10f352a7ff5b05b1095dbb65d36316f9165a6f0
2015-04-15 08:28:59 +02:00
Jacob Adams 1cd28eb8e4 libc: Fix incomplete fprintf
Closes #23

Change-Id: Ibe6362de0d2d1d94442401b92bc126e63bf9f9b0
2015-03-31 15:45:48 +02:00
Thomas Cort 79444d163d mined: increase the size of the tgetent() buffer.
From the termcap section of the GNU termutils manual:

"There is no way you can tell how much space is needed, so the convention
is to allocate a buffer 2048 characters long and assume that is enough.
(Formerly the convention was to allocate 1024 characters and assume that
was enough. But one day, for one kind of terminal, that was not
enough.)"

Change-Id: Ia5937366ae89e886dbaef7d180bee40669d0c488
2015-03-28 08:39:19 +01:00
Thomas Cort 93cdb3a735 mined: move to minix/usr.bin/mined
As suggested in issue #43.

Historic Locations:

Prior to this commit

  minix/commands/mined

Prior to commit 433d6423c3

  commands

Change-Id: I374ab3ff0e3b9e47779fc21e80b47fda87698242
2015-03-28 08:39:10 +01:00
Thomas Cort e6df9032b3 mined: remove !__STDC__ code blocks.
__STDC__ is used to mitigate the differences between K&R C and the
ANSI C standard. Nearly every compiler now supports ANSI C, so
there is no need to support non-standard compilers.

Change-Id: Ifc3381ecf1c43dfde9004bee48552d8b3ac4dcdc
2015-03-28 08:38:56 +01:00
Thomas Cort f3734d6b31 mined.h: use '\a' instead of ascii code for bell.
Makes the code slightly more portable and readable.

Change-Id: I45bbecb6dc1c320c9412eeeaf598116c2ce1aac5
2015-03-28 08:38:48 +01:00
Thomas Cort e978660932 mined: built without UNIX defined.
* Remove undef NULL, EOF, getchar, putchar
* Rename putchar, getchar, _putchar, _getchar to putch, getch, _putch,
  _getch to avoid conflict with libc functions.
* Rename UP() to UP1() (for UP 1 line) to avoid conflict with UP
  definition in termcap.h. Rename DN1 LF1 RT1 for consistency.
* Add termcap.h for prototypes for tputs and friends.
* Add libterminfo references to Makefile
* Add return value to _putch() to make it work as tputs expects.
* Make putch() call _putch()
* Remove UNIX ifdefs and all code in the !UNIX branches.

closes #43

Change-Id: I0a6f7298aa8b12a74225badc88d3c236a02669ea
2015-03-28 08:38:33 +01:00
Thomas Cort fc850d580c man: clean-out man1x category.
Removes the following man pages:

* awk.1x -- for a version of awk we no longer have
* kermit.1x -- seems gone altogether
* macros.1x -- not useful for anyone anymore

Moves the following man pages:

* mined.1x -- Moved to minix/commands/mined/mined.1
and reformatted to use the mdoc macros instead of the
Minix macros so that it displays properly.

Removes /usr/man/man1x from the directory tree.

closes #44

Change-Id: I59b8bd54cf5cba6d188e51e99a92b36e90c275c1
2015-03-25 06:53:44 +01:00
Thomas Cort d1a87c1f64 mined: clean-up trailing whitespace.
Change-Id: Ic27293d7e1d0f830d635b78e7e620dcf0ef3e03f
2015-03-24 14:03:03 +01:00
Thomas Cort d131b58784 mined1.c: remove i386 guard around escape sequences.
The escape sequences for the function keys used to be separated
out in older versions of Minix when they were different for m68k
and intel. Support for m68k was dropped and that code was
removed, leaving the ifdef i386. Since the sequences are the
same for i386 and arm, there is no need to keep the ifdef i386.

Change-Id: Id96a80bcb24da120efa63acc9b248d87fc347eac
2015-03-24 14:03:03 +01:00
Thomas Cort 6a0aa6fb5e mined.h: remove irrlevant comment.
It used to refer to several NIL_* definitions. Those were removed
in commit 6e25ad8b0a leaving the
comment with nothing to comment on.

Change-Id: I52221ae5d2c5216e82391b480cf2038ad723b8f0
2015-03-24 14:03:02 +01:00
Thomas Cort 0cf05b213d mined.h: remove unused definition, MEMORY_SIZE.
Change-Id: I1ae83c427cafb15f1382b7d8ab3871a36b0eec28
2015-03-24 14:03:02 +01:00
Thomas Cort 50d246bbba mined.h: remove minix/config.h include.
Nothing defined there is used by mined.

Change-Id: I38b692be1313aaed316eebd7caf8e879178d90dc
2015-03-24 14:02:41 +01:00
Jacob Adams d82c151c9e commands/fix: create manpage for fix(8)
Change-Id: I868f1338994d6cc2cba6789b9b4e8934610d0142
2015-03-24 08:21:14 +01:00
rlfnb 31ba042920 Fix boot if no pckd device is there
Trying to boot Minix3 master on an appliance/sbc like ALIX fails, as
the service command throws an error. Making the rc script more robust
solves it.

Change-Id: I659043cbbaa2d67b70d6d6e5ab14fff8e1bba769
2015-03-23 14:57:06 +01:00
Jacob Adams 80c94e3974 swifi: Fix incorrect memset
Change-Id: I6764aff558f51cdb90b91a3e71c982e8b3f47058
2015-03-23 14:56:59 +01:00
Jacob Adams f113a7238f Make rotate manpage more detailed
Change-Id: I028550c17b87655a6e39a7f8b3233cbe982883eb
2015-03-23 11:06:37 +01:00
Christian Koch 6f55e9f11d nonamed.8: Document the -L option.
Change-Id: I1aadb50cd416e0467a87c8d75db1c293333a7969
2015-03-19 10:00:56 +01:00
Jacob Adams 271999a2f3 Do not read past the end of the buffer
closes #22

Change-Id: I239c670915d98440c176ccf23e5270c40c4fbe81
2015-03-18 08:29:46 +01:00
Jacob Adams e3cf9c04f1 properly check if configuration file is opened
closes #21

Change-Id: I2f83b5385ac38bf07d30acb14f40c14bec476830
2015-03-18 08:25:19 +01:00
Jacob Adams 3bdcd28869 Get rid of K&R functions in recwave
Change-Id: I98cf0426aedf03ec0312f58ff77b816fd231eb84
2015-03-18 08:21:31 +01:00
Jacob Adams 25223c2ae2 Check argc is greater than 1 before using on argv
closes #19

Change-Id: I50ee3fa82bce274e710434628b6c178467fd3887
2015-03-18 08:20:08 +01:00
Emmanuel Blot 41b870c890 arm: Make sure __k_unpaged_MINIX is first
Do not rely on build order to set startup symbol (`__k_unpaged_MINIX`)
at kernel binary start

Change-Id: I1ed3f9309fe66ff97e24915938c114d5a159deaf
2015-03-18 07:50:31 +01:00
Emmanuel Blot 54841c0102 Fix incorrect sanity check
Remove invalid sanity check where an array is tested against NULL -
not a pointer

Change-Id: I3d5e33585e7f97a41124af4133e8a879ab21d972
2015-03-18 07:49:44 +01:00
Emmanuel Blot d91890d288 Fix format string for size_t types
Fix missing “%z[dux]” prefix printf formatter string for `size_t`
types.

Change-Id: If216a778b0b65e8ab2cdd1c7484cb8452d1f965d
2015-03-18 07:48:09 +01:00
Jacob Adams 61890c3b2e Change rotate.sh BZIP2 to the correct path
closes #8

Change-Id: I90cb30e3d8ee2c000aca36fb9f8cc22c6d49583e
2015-03-14 16:43:04 +01:00
Jacob Adams 1b6a97c9c0 commands/autopart: Fix dead code block
Fix dead code block, make surrounding code more readable, and remove
unused mode variable.

closes #20

Change-Id: I802e3d8680d7a7adc7acd580bfcec9dc28af0bc4
2015-03-13 18:53:05 +01:00
Jacob Adams dc0077241b Use or instead of and to determine if urb is valid
close #24

Change-Id: I12e2b20d69aa7b186a8e5cd0dc16f653a18b2ee2
2015-03-11 17:56:09 +01:00
rlfnb 7171c2321f Maybe a broken bios/device setting
Removing the panic leads to exactly one message on ALIX. Both commits
make minix out of the box booting on ALIX devices.

Change-Id: I9210fef79a8736e36b9c42c7925c9f3354c60e7c
2015-03-11 13:46:45 +01:00
rlfnb b56a9d4725 ALIX: No pci device at bus 0, dev 0, func 0
Seems like its a kind of convention introduced by Intel but not
mandatory from a PCI specification point of view, that the PCI host
controller resides on bus 0, device 0 function 0. At least tinybios
(the bios used by ALIX and WRAP) based appliances are not able to boot
with this change.

Change-Id: I0e45c68c482972be7276028525985de920cf64f7
2015-03-11 13:46:41 +01:00
Lionel Sambuc 3d0f2c86c4 Fix arm build for GCC, noassert, -Os
Change-Id: I706fdfc8fc9a5e0c9076e3657ac1a6ef0745bd14
2015-03-05 15:42:21 +01:00
David van Moolenbroek f912036bae libsffs, libvtreefs: fix getdents bug
Bad logic introduced as part of the fsdriver changes could cause
getdents to terminate early in these libraries.

Issue reported by r0ller.

Change-Id: If450d5ea85e830584878d8a4ec0f00519355a353
2015-02-10 13:47:29 +00:00
David van Moolenbroek 75e18fe498 Add 3c90x: 3Com 3C90xB/C network driver
Change-Id: Iba0bbcb3b1b69a7c204abdc81cf3afe59b6bfaae
2015-02-10 13:47:28 +00:00
David van Moolenbroek 2a3bc70264 ACPI: OS-dependent code tweaks
Change-Id: I533685f6716cb48ccf3d5ca5ef0fb681a5293549
2015-02-10 13:47:28 +00:00
David van Moolenbroek 29492bb71c ACPI: upgrade to acpica-unix2-20141107
Change-Id: I96151a2756fd9814bfba180548e8a96dca63ce51
2015-02-10 13:47:27 +00:00
David van Moolenbroek f202792edf VM: fix for handling one-shot page memory
The original one-shot page patch (git-e321f65) did not account for the
possibility of pagefaults happening while copying memory in the
kernel.  This allowed a simple cp(1) from vbfs to hang the system,
since VM was repeatedly requesting the same page from the file system.

With this fix, VM no longer tries to fetch the same memory-mapped page
from VFS more than once per memory handling request from the kernel.
In addition to fixing the original issue, this change should make
handling memory somewhat more robust and ever-so-slightly faster.

Test74 has been extended with a simple test for this case.

Change-Id: I6e565f3750141e51b52ec98c938f8e1aa40070d0
2015-02-10 13:47:27 +00:00
Thomas Goering e1131d9c96 recognize Intel 82540EP LP by e1000
Change-Id: I8868963ba09ce1dffa9416c9ece29c7315dee4cd
2014-12-12 21:28:06 +01:00
Ben Gras 5ae1a533c7 ARM: can build with llvm, switch to EABI
. bitcode fixes
	. switch to compiler-rt instead of netbsd libc functions
	  or libgcc for support functions for both x86 and arm
	. minor build fixes
	. allow  build with llvm without crossbuilding llvm itself
	. can now build minix/arm using llvm and eabi - without C++
	  support for now (hence crossbuilding llvm itself is turned off
	  for minix/arm)

Change-Id: If5c44ef766f5b4fc4394d4586ecc289927a0d6eb
2014-12-12 13:04:56 +01:00
Lionel Sambuc 41ba8c04cc Restart policies: Add testing and ProcFS DB
- Expose in procfs the service status and supported recovery policies.
 - This adds a test (testrelpol.sh) to exercise the restart policies of
   the system services and drivers.

NOTE:
  The policy support information is temporarily hardcoded in ProcFS, but
  this has to be replaced by properly retrieving this information from
  RS, which should in turn be setup on a per service basis, at
  initialization time.

Change-Id: I0cb1516a450355b38d0c46b1a8b3d9e841a2c029
2014-12-10 23:11:25 +01:00
David van Moolenbroek 5260f07c2c virtio_net: use new libnetdriver
Change-Id: Id06bdb67da12477984b42bbd46623bd8f25c0ab9
2014-12-04 12:10:52 +00:00
David van Moolenbroek d76bd1f07c rtl8169: use new libnetdriver
Change-Id: Ia26b6c440a1525f1d2bb9e7592e357dac0ba602c
2014-12-04 12:10:52 +00:00
David van Moolenbroek 4081bff625 rtl8139: use new libnetdriver
Change-Id: Iba941653b7c052375694bcec2561957c1979feb0
2014-12-04 12:10:51 +00:00
David van Moolenbroek bcc1b08c61 orinoco: use new libnetdriver
Change-Id: I003590539dd76f4be8e067f986bb1f17b151490d
2014-12-04 12:10:51 +00:00
David van Moolenbroek 6315775f16 lance: use new libnetdriver
Change-Id: If3414088e66407c688c4960f99a165b0ee1ebc83
2014-12-04 12:10:51 +00:00
David van Moolenbroek 5af3c2565f lan8710a: use new libnetdriver
Change-Id: Iaee4d75a5dfafc72d94f0b02681f9aea1c9da535
2014-12-04 12:10:50 +00:00
David van Moolenbroek 96e62d65b6 fxp: use new libnetdriver
Change-Id: I03268655a5daff3d109ae52e64673911ef096a3f
2014-12-04 12:10:49 +00:00
David van Moolenbroek 1ad10e3ae0 e1000: use new libnetdriver
Change-Id: I111750d2ca27f01039d0b427b1314aea861e2074
2014-12-04 12:10:49 +00:00
David van Moolenbroek 91c4db251e dpeth: use new libnetdriver
Change-Id: Ic389e54817c5b241dad851c89ef1cf16c015a79b
2014-12-04 12:10:49 +00:00
David van Moolenbroek 3913e49004 dp8390: use new libnetdriver
Change-Id: Ieaf6d605832d475f95fd9b06026b349dce7ee025
2014-12-04 12:10:49 +00:00
David van Moolenbroek 29018b4ecd dec21140A: use new libnetdriver
Change-Id: I54be3b770e4d1fd320200c30e9e9073a7c1b405b
2014-12-04 12:10:48 +00:00
David van Moolenbroek b80fc5be89 atl2: use new libnetdriver
Change-Id: I65de5d29a75d5f3101b2c5ab16a4b0d79bd77cc3
2014-12-04 12:10:48 +00:00
David van Moolenbroek dbcce9ddb0 libnetdriver: turn into network driver framework
The new implementation of this library provides abstractions for
network drivers, and should be used for all network drivers from now
on.  It provides the following functionality:

  - a function call table abstraction, hiding the details of the
    datalink protocol with simple parameters;
  - a state machine for sending and receiving packets, freeing the
    actual driver from keeping track of pending requests;
  - an abstraction for copying data from and to the network driver,
    freeing the actual driver from dealing with I/O vectors while at
    the same time providing a copy implementation which is more
    efficient than most current driver implementations;
  - a generalized implementation of zero-copy port-based I/O;
  - a clearer set of policies and defaults.

While the concept is very similar to lib{block,char,fs,input}driver,
one main difference is that libnetdriver now also takes care of SEF
initialization, mainly so that aspects such as recovery policies and
live-update aspects can be changed for all network drivers in a
single place.  As always, for the case that the provided message loop
is too restrictive, a set of more low-level message processing
functions is provided.

The netdriver API has been designed so as to allow alleviation of one
current protocol bottleneck: the fact that at most one send request
and one receive request may be pending at any time.  Changing this
aspect will however require a significant rewrite of libnetdriver,
and possibly debugging of drivers that are not able to cope with (in
particular) queuing multiple packets for transmission at once.

Beyond that, the design of the new API is based on the current
protocol, and may be changed/extended later to allow for non-ethernet
network drivers, exposure of link status, multicast address
configuration, suspend and resume, and any other features that are in
fact long overdue.

Change-Id: I47ec47e05852c42f92af04549d41524f928efec2
2014-12-04 12:10:48 +00:00
David van Moolenbroek 107df7c8fa e1000: convert to KNF
Change-Id: Ibd156c2e0a58fed70895080d4b230b26c500fa11
2014-12-04 12:10:48 +00:00
David van Moolenbroek 1539606d98 atl2: convert to KNF
Change-Id: Ie4b979aab3127a91a12b8086326da0eb1f9a860b
2014-12-04 12:10:47 +00:00
David van Moolenbroek d1db724f47 libvirtio: expose result size on packet dequeue
Change-Id: I49304678895779849abc2528a9f78730f968e712
2014-12-04 12:10:47 +00:00
David van Moolenbroek a810336026 orinoco: restore register memory mapping
Untested.

Change-Id: I439f0e711e16ba478dadf57ffc8ad74ec19ea1b9
2014-12-04 12:10:47 +00:00
David van Moolenbroek 2e5374621d fxp: enable bus mastering if needed
This is required for at least QEMU.  However, as of writing, QEMU also
requires fixes in its epro100 emulator before this driver can use it.

Change-Id: Ie5c5ffe4311b1a0e581bc687f1c15de3a85f4a30
2014-12-04 12:10:47 +00:00
David van Moolenbroek 92293fafd3 e1000: fix unaligned register access
This resolves a guru meditation in recent VirtualBox versions.

Change-Id: I5034d8af1fe885adda3c027cb23563bffaccf97e
2014-12-04 12:10:46 +00:00
David van Moolenbroek 4bf270019a dp8390: update, allow default port and IRQ
Bochs has switched from port base 0x240 to 0x300 for its default
NE2000 ISA configuration, and QEMU is using the same settings.

Change-Id: Ide6cdb14321eb4324d0bf6d6314c5970b3493e95
2014-12-04 12:10:46 +00:00
David van Moolenbroek cc5b198875 UDS: move from drivers/net/ to net/
Change-Id: I53992b205e767a77c7b3c868a38c7f3d772a4ed3
2014-12-04 12:10:46 +00:00
Ben Gras 3c8950cce9 minix/ changes for arm llvm build
. fixes needed to build Minix/ARM with LLVM without errors,
	  mostly size_t cleanness

Change-Id: If4dd0a23bc5cb399296073920a8940c34b4caef4
2014-12-03 23:40:56 +01:00
Lionel Sambuc 0805ab8cfd Import a few manpages
The following manpages where contributed by
Jacob Adams <tookmund@gmail.com>:
 - atnormalize.8
 - autopart.8
 - decomp16.1
 - devsize.8
 - rawspeed.8
 - rotate.8
 - update_bootcfg.8
 - updateboot.8

Change-Id: Ide3abf0962083b83e37426e2d47f3a9391d6315e
2014-11-25 11:04:20 +01:00
Ben Gras 3a9e392b3a remove unused PSW restore code
. now done in-kernel so IOPL gets restored

Change-Id: I9905d2844a4715004054a788613ff7efd02a227d
2014-11-25 10:51:01 +01:00
Ben Gras c9278f9170 restore PSW like 9393439a20 for AMD syscall
Change-Id: Ide0a8727af8d0d81361382dbd2460c7a6c5743fc
2014-11-24 12:05:45 +01:00
David van Moolenbroek 65eccd1f74 inet: detect short TCP option lengths
Previously, a TCP option length of zero would cause inet to end up
in an infinite loop.

This resolves #7, reported by Alejandro Hernandez.

Change-Id: I45ad4c789d10d8e202cf6e140a7b9db7a6543c75
2014-11-18 12:53:18 +00:00
David van Moolenbroek aa4ee93d43 dhcpd: don't crash so easily
The jump-to-start hack is not resetting global variables, resulting in
a crash after several such restarts cause an overflow in the network
table.  This patch fixes that particular issue, but more similar
issues (in particular memory leaks) are bound to come up.  As such this
is a stopgap measure until we can get rid of the old dhcpd altogether.

This resolves the additional issue reported in #2.

Change-Id: Ic4cd80eae520cf2b97e893bac63b3ab1ecfea6d8
2014-11-17 20:17:43 +00:00
David van Moolenbroek b49f4cacde rtl8139: enable bus mastering if needed
This resolves #2.

Change-Id: Ie6736f0d5a713025f09c18de7042ba44fbb1b2f8
2014-11-17 19:23:00 +00:00
David van Moolenbroek e321f65582 libfsdriver: support mmap on FSes with no device
This patch adds (very limited) support for memory-mapping pages on
file systems that are mounted on the special "none" device and that
do not implement PEEK support by themselves.  This includes hgfs,
vbfs, and procfs.

The solution is implemented in libvtreefs, and consists of allocating
pages, filling them with content by calling the file system's READ
functionality, passing the pages to VM, and freeing them again.  A new
VM flag is used to indicate that these pages should be mapped in only
once, and thus not cached beyond their single use.  This prevents
stale data from getting mapped in without the involvement of the file
system, which would be problematic on file systems where file contents
may become outdated at any time.  No VM caching means no sharing and
poor performance, but mmap no longer fails on these file systems.

Compared to a libc-based approach, this patch retains the on-demand
nature of mmap.  Especially tail(1) is known to map in a large file
area only to use a small portion of it.

All file systems now need to be given permission for the SETCACHEPAGE
and CLEARCACHE calls to VM.

A very basic regression test is added to test74.

Change-Id: I17afc4cb97315b515cad1542521b98f293b6b559
2014-11-15 11:19:52 +00:00
David van Moolenbroek 289b04677a libfsdriver: prefill st_dev for stat requests
This obviates the need for several file system implementations to
remember the device on which they are mounted.

Change-Id: Ida8325cf4bcf072e61761cfee34e3f7ed2d750b9
2014-11-14 15:54:16 +00:00
David van Moolenbroek 31b6611abf procfs: add /proc/service directory
This directory is filled dynamically with regular files, one for each
service that RS knows about, named after its label.  Its contents are
still subject to (heavy) change, but currently expose the service's
endpoint and number of restarts so far.

Change-Id: Ie58c824bcb6382c8da7a714e59fee87329970b4b
2014-11-12 12:13:53 +00:00
David van Moolenbroek f1abbce725 procfs: convert to KNF
Change-Id: Ib4252f199af0f9597745dcd2c11a7f761738671f
2014-11-12 12:13:47 +00:00
David van Moolenbroek 52be5c0afb libvtreefs: API changes/extensions, part 2
- rename start_vtreefs to run_vtreefs, since the function returns upon
  termination these days;
- add get_inode_slots function to retrieve the number of indexed slots;
- add support for extra per-inode data for arbitrary storage.

Change-Id: If2d365d7b478a1cecc9e20fb2b3e70c1a1cf7243
2014-11-12 12:13:43 +00:00
David van Moolenbroek 5eefd0fec2 libvtreefs: API changes/extensions, part 1
- move primary I/O buffer into vtreefs; change read hook API;
- add hooks for write, truncate, symlink, mknod, unlink, chmod/chown;
- modernize message_hook;
- change procfs, devman, gpio accordingly;

Change-Id: I9f0669e41195efa3253032e95d93f0a78e9d68d6
2014-11-12 12:13:38 +00:00
David van Moolenbroek 693ad767e8 libvtreefs: convert to KNF
Change-Id: I81bdf05c9b630a0cbb0ac573d36d4f59f8137199
2014-11-12 12:13:33 +00:00
Emmanuel Blot f92baba71c Fix bad cast from u16_t to ssize_t 2014-11-12 12:13:28 +00:00
David van Moolenbroek 7ee000e54a procfs: compile in x86 support only for x86 target
Issue reported by Emmanuel Blot.

Change-Id: I7f5b1b65273e6ac841d5451e0be7b0e1c92d537c
2014-11-12 12:13:23 +00:00
David van Moolenbroek a8a812ef6a test76: increase alarm times
The test would sometimes fail because an alarm triggered before the
system call to be interrupted by the alarm could be started.

Change-Id: Ia507720a1f2d259afde1f97b7edd03f22cbd4810
2014-11-12 12:12:40 +00:00
David van Moolenbroek 8b18d03deb trace(1): document how to add an IOCTL handler
Also fix two small IOCTL-related bugs:
- do not print an argument pointer for argument-less IOCTLs;
- print IOCTL contents with -V given once, just like structures.

Change-Id: Iec7373003d71937fd34ee4b9db6c6cec0c916411
2014-11-12 12:02:29 +00:00
David van Moolenbroek 92601f58cb ext2: perform super I/O with contiguous memory
Issue reported by Antoine Leca.

Change-Id: Ie6f3ab6c1943b0b7ea9d5a68d4c24b92bab17233
2014-11-11 21:43:55 +00:00
Ben Gras f53651de01 VM,MFS: better handling of some exceptional cases
Fix for problems reported by Alejandro Hernández:
	. VM unmap: handle case where there is no nextvr

Fixes for problems found by running Melkor ELF fuzzing tool:
	. VM: better handle case where region prealloc fails by
	  freeing memory that was allocated so far
	. MFS fs_readwrite: EOF check should happen for read and
	  peek requests, not just read

This fixes #4.

Change-Id: I2adf4eebdfb4c48a297beff0478eed5c917a53a4
2014-11-10 17:51:57 +01:00
Lionel Sambuc 9e77ef5013 Enhancing /proc/pci
- Adding missing fields for PCI device lookup
 - Adding the domain (for now set to zero) as part of the slot name

Change-Id: Iebaf3b21f6ab5024738cbc1dea66d5ad3ada175d
2014-11-10 14:43:27 +01:00
Lionel Sambuc 5d8311761a Turn PCI into a character driver
Change-Id: Ia9c83af4d52e82e845b6a847c3e82e33d1920ae0
2014-11-10 14:43:27 +01:00
Lionel Sambuc 3641562f44 Use NetBSD PCI ID DB
Change-Id: I3fcbce5983b4e0b45e6cc8fac076947c6a84928d
2014-11-07 16:20:39 +01:00
Lionel Sambuc 6e7bb62853 PCI driver cleanup
- Moved to KNF
 - Whitespace cleanup
 - Removed useless static functions prototypes
 - Renamed some file private functions by prepending '__'
 - Renamed some server-specific function by prepending '_'
 - Fixed compilation warning for WARNS= 3

Change-Id: Ie44d35839177d5ee0630cdf576660c852452ab80
2014-11-07 16:20:39 +01:00
Lionel Sambuc 3d3105466a PCKDB: Fix PS/2 Mouse support.
Change-Id: I2240b47ca47a3db7268b47e9e5881d8200c68531
2014-11-07 16:20:39 +01:00
Lionel Sambuc 9393439a20 Fix iopl flag when sysenter/exit are used
Change-Id: If8c12f987c3adb8f329ae163da6b2f1cb8cc772f
2014-11-07 16:20:39 +01:00
David van Moolenbroek 521fa314e2 Add trace(1): the MINIX3 system call tracer
Change-Id: Ib970c8647409196902ed53d6e9631a1673a4ab2e
2014-11-04 21:46:31 +00:00
David van Moolenbroek cb3a6387c8 VM: fix returning VFS error code for mmap
Change-Id: Ifcaa15fb8277be53515eb18c4f86a306c52d91d6
2014-11-03 11:19:08 +00:00
David van Moolenbroek 1f945e8080 Fix fcntl(F_[GS]ETNOSIGPIPE) semantics
The new semantics should match those of NetBSD and other systems.

Change-Id: Ic9ca9d6b8c3e42d2a2953d9feea5f6bacaceb43c
2014-11-01 12:57:31 +00:00
David van Moolenbroek 10b1b4ee12 devman: allow multiple event read calls up to EOF
Read calls may be repeated by VFS if the user destination memory is
not mapped in.  Devman currently assumes that all reads are
successful, and uses this to track whether EOF has been reached for
a particular event, discarding it as soon as this happens.  Upon
repetition, this may result in lost events for devmand.

With this patch, devman discards events only once devmand reads the
EOF marker, which itself can never generate a user page fault.  The
result is that read calls for data can be repeated safely, without
the risk of losing events in the process.

Change-Id: I9dfdf7f8c8992a20a10302d79c3506e61f8564b0
2014-10-28 14:43:33 +00:00
David van Moolenbroek 65f76edb8f minix libraries: resolve clang warnings
Change-Id: I0f3425fb8838708c9848a006f1eee5ab1bad71d2
2014-09-30 21:04:09 +00:00
David van Moolenbroek 5dd8da10c5 libc: resolve minix clang warnings
Change-Id: If6c42f7346cc1b00b387ae8d3b4f0df3ffb0244f
2014-09-30 20:35:56 +00:00
David van Moolenbroek 685aa79304 libsys: resolve clang warnings
Change-Id: Ic954ba8667b4d039172b8e0d2ec57674a479b8aa
2014-09-30 20:08:54 +00:00
David van Moolenbroek d794ecc9ef Replace NetBSD grep with OpenBSD grep
The NetBSD version is seriously broken--it is unable to match lines
against an empty pattern--and appears to be unmaintained.

The new version is the latest OpenBSD grep, with a number of MINIX-
specific changes marked as such, and an additional number of
(signed/unsigned, const) fixes to pass compilation.

Since this is not NetBSD code, move back the entire thing into
minix/usr.bin.

Change-Id: Icd40794a2d0cff9e7fb452db7d28c16dbd25e51d
2014-09-30 18:09:56 +00:00
David van Moolenbroek 94e65446c4 libsffs: make path names constant
And a few other related warning fixes.

Change-Id: I1a49b9ee04c2b1bf80bc943272f72ffd6de77ef6
2014-09-30 12:48:10 +00:00
David van Moolenbroek 1dcfbcd173 Remove support for call profiling
The entire infrastructure relied on an ACK feature, and as such, it
has been broken for years now, with no easy way to repair it.

Change-Id: I783c2a21276967af115a642199f31fef0f14a572
2014-09-30 12:39:03 +00:00
David van Moolenbroek e5808135dd test56: fix race condition
Change-Id: I42bfe2b150e92f760794b4a03e62859c8bd7a992
2014-09-29 16:16:36 +00:00
David van Moolenbroek cbc8a0df90 tests: fix clang warnings
Change-Id: I5dddc85169d7ef515c99dd1ab824573cbc1b5f2b
2014-09-29 16:16:32 +00:00
David van Moolenbroek e296281ce2 VFS: do not make cloned devices setuid/setgid
Change-Id: Ifd97444dd54334ccbc8780df9473450998ab7489
2014-09-29 16:16:27 +00:00
David van Moolenbroek 6990e61341 Remove obsolete MIOC(UN)MAP requests
Change-Id: I915ac759bc80a50aad21c12f088ad6c345a42986
2014-09-29 16:16:22 +00:00
David van Moolenbroek f737eea636 svrctl(2) update
- synchronize request type with ioctl by making it unsigned long;
- unbreak VFS requests, as they were being sent to PM;
- use proper ioctl direction flags (and new numbers) for requests;
- remove some needless header inclusions;
- svrctl is in libc, make its message name reflect this;
- keep backward compatibility: svrctl is part of the userland ABI.

Change-Id: I44902e8d0d11b8ebc1ef3bda94d2202481743c9b
2014-09-29 16:15:21 +00:00
David van Moolenbroek 347cc10a91 VFS/FS: putnode count need not be 64-bit
Change-Id: I49e67438d3f316e0321ac711494e988bb6510679
2014-09-29 15:14:02 +00:00
David van Moolenbroek 63ce03db66 IOCTL requests are unsigned longs now
Issue reported by JD Begin.

Change-Id: I0306d9dc43c36107897c8b73ed340d86a8dcef27
2014-09-29 15:11:01 +00:00
AndrewEdwards e3fd605f72 Create new colemak minix keymap.
Change-Id: I3464e723bd6bb578f415dfe78540e60b2eefb8b7
2014-09-29 00:39:25 +02:00
Sky Liu ca78167b44 Porting grep from NetBSD
Change-Id: I6fa9e3c0a4edc4d3ff292dc5c96ac16b34d7c792
2014-09-24 15:33:57 +02:00
David van Moolenbroek 3a40bab785 tests: reenable testisofs
Change-Id: Ic0883f8b487390e34f1a27e324b033a8cbe2cfff
2014-09-18 13:01:13 +00:00
David van Moolenbroek ef9dc93f44 Clean up obsolete FS support routines
Change-Id: I56d0ab51f32064bb964051732de7e2465dc22b75
2014-09-18 13:01:02 +00:00
David van Moolenbroek c2f99d7c3a isofs: rename source directory to "isofs"
Change-Id: Ibe630f720b4399e7ebbbd850650036fbaa9cec7b
2014-09-18 13:00:57 +00:00
David van Moolenbroek edfcb02885 isofs: basic improvements
- fix for "out of extents" panic;
- return ENOENT when a file name does not exist;
- inode count sanity check upon unmount.

Change-Id: Icb97dbaf7c8aec463438f06b341defca357094b2
2014-09-18 13:00:52 +00:00
David van Moolenbroek e2dc2c8954 isofs: use libdriver
Change-Id: I5ced800eec92f651f31d9c77c3129fe837ca4614
2014-09-18 13:00:47 +00:00
Jean-Baptiste Boric 3e08d38e8e iso9660fs: rewrite ISO 9660 file system server
iso9660fs has been cleaned up and debugged. It now supports:
 * ISO 9660 Level 3,
 * System Use Sharing Protocol (SUSP),
 * Rock Ridge Interchange Protocol (RRIP).

The following Rock Ridge features are supported:
 * POSIX file attributes (PX),
 * POSIX device number (PN),
 * Symbolic links (SL),
 * Alternate file name (NM),
 * Timestamps in 7-byte format (TF).

Change-Id: Ib227411bdda5bc10a957b27ad05fafdc95eca35f
2014-09-18 13:00:42 +00:00
David van Moolenbroek 1858c65d72 Revert "Temporarily disable the is9600 FS server"
This reverts commit ab5c98ee5a.
2014-09-18 12:59:18 +00:00
David van Moolenbroek 8ca6466a71 writeisofs: set file struct version field to one
Dictated by the spec and correctly flagged by the new isofs code.

Change-Id: Ie155c30b6a53e40ec42066af0adbcdbf457e5620
2014-09-18 12:46:29 +00:00
David van Moolenbroek 30d9b70391 PFS: rewrite, restyle
- remove the buffer pool, inode bitmap, and inode hash table, and
  simplify the code accordingly;
- use theoretically slightly more optimal buffer management;
- put the entire source in one file, instead of having many files
  with one or two functions each;
- convert the code to KNF style.

Change-Id: Ib8f6f0bd99fbc6eb9098fba718e71b8e560783d9
2014-09-18 12:46:28 +00:00
David van Moolenbroek f859061eaf PFS: use libfsdriver
In order to avoid creating libfsdriver exceptions, two changes to VFS
are necessary:

- the returned position field for reads/writes is no longer abused to
  return the new pipe size; VFS is perfectly capable of updating the
  size itself;
- during system startup, PFS is now sent a mount request, just like all
  other file systems.

In proper "two steps forward, one step back" fashion, the latter point
has the consequence that PFS can no longer drop its privileges at
startup.  This is probably best resolved with a more general solution
for all boot image system services.  The upside is that PFS no longer
needs to be linked with libc.

Change-Id: I92e2410cdb0d93d0e6107bae10bc08efc2dbb8b3
2014-09-18 12:46:28 +00:00
David van Moolenbroek 2e89653e65 libc: make socketpair(3) use the right device
UDS expects the device number of the actual socket, not the device on
which the socket happens to reside.  The code worked only because PFS
returned the same value in the st_dev stat field, which it will have
to continue doing for a while now.

Change-Id: I426d38a86a96307ff6e6ed8099d37dae02d6bf2b
2014-09-18 12:46:28 +00:00
David van Moolenbroek 970d95ecd5 ext2: use libfsdriver
- fix panic on truncating files with holes;
- remove block-based readahead, to match MFS.

Change-Id: I385552f8019e9c013a6cb937bcc8e4e7181a4a50
2014-09-18 12:46:27 +00:00
David van Moolenbroek ccaeedb267 MFS: use libfsdriver
Change-Id: Ib658c7dea47b81a417755b0554a75288117b431a
2014-09-18 12:46:27 +00:00
David van Moolenbroek ad80a203db Move clock_time into libsys
Change-Id: Ibc5034617e6f6581de7c4a166ca075b3c357fa82
2014-09-18 12:46:26 +00:00
David van Moolenbroek 0dc5c83ec2 libvtreefs: use libfsdriver
Change-Id: I0e6446bd0ccc3b89edc237be441ebfd92585f352
2014-09-18 12:46:26 +00:00
David van Moolenbroek a99c939dee libsffs: use libfsdriver
Change-Id: Id8377873455771c614371e115643cd906d05f12c
2014-09-18 12:46:25 +00:00
David van Moolenbroek ebd3c0673d libminixfs: add block I/O routines
The new functionality aims to save each file system server from having
to implement its own block I/O routines just so that it can serve as a
root file system.  The new source file (bio.c) lists the requirements
that file system servers have to fulfill in order to use the routines.

Change-Id: Ia0190fd5c30e8c2097ed8f4b0e3ccde1827e0b92
2014-09-18 12:46:25 +00:00
David van Moolenbroek c5beebb68d libminixfs: do not make fs_sync upcalls
The file system may not be expecting these upcalls at arbitrary
moments, while they serve only as a performance optimization anyway.

Change-Id: I0748fd1f6c2645ddbb64466093ee36025aac45e0
2014-09-18 12:46:24 +00:00
David van Moolenbroek 35118b0a91 test72: fix mock bdev functions
The minixfs library only ever submits vector elements (and reads) of
the system page size. The test implementation was expecting vector
elements (and reads) of the file system block size. The resulting
mismatch caused I/O to fail in various ways, even though this did not
have an effect on the actual test.

Change-Id: I02f4a3efcd4a32916435d82c7d5798e6b78f0a27
2014-09-18 12:46:24 +00:00
David van Moolenbroek f018897664 test72: fix premature block size update
Updating the current block size before flushing the cache, which still
contained blocks with the old block size, resulted in triggering an
assert on position alignment.

Change-Id: I7a83f3d3bc57bafc08aa6c8df64fbf978273bbfd
2014-09-18 12:46:23 +00:00
David van Moolenbroek 89c9de7d09 Add libfsdriver: a library to drive file systems
This library provides new abstractions for the upper (VFS) side of
file system services, and should be used for all file system service
implementations from now on.  It provides the following functionality:

  - a function call table abstraction, hiding the details of the
    VFS-FS protocol with simple parameters;
  - a (currently limited) number of per-function steps required for
    all file system implementations, such as copying in and out path
    names and result buffers;
  - a default implementation for multicomponent path lookups, such
    that the file system merely has to implement resolution of single
    components at a time;
  - an abstraction for copying data from and to the file system, which
    allows transparent intraprocess copying as required for the lookup
    implementation;
  - a set of functions to simplify getdents implementations.

The message loop provided by the library is currently for use by
single-threaded file system implementations only.  Multithreaded file
system services may use the more low-level message processing
functionality.

Protocol-level optimizations such as including names in protocol
messages may be hidden entirely in this library.  In addition, in the
future, the lookup implementation may be replaced by a single-
component lookup VFS/FS protocol request as part of a VFS name cache
implementation; this, too, can be hidden entirely in this library.

Change-Id: Ib34f0d0e021dfa3426ce8826efcf3eaa94d3ef3e
2014-09-18 12:46:23 +00:00
David van Moolenbroek e7b4aa7d99 VFS: provide correct root directory for lookups
This fixes a VFS panic and a chroot(2) security hole.

Change-Id: Ifd1923f886501cf3a73277aab89db974798c47dc
2014-09-18 12:46:23 +00:00
David van Moolenbroek 71cd1dd4b9 VFS: do not call REQ_FLUSH on the root file system
Change-Id: I15d29a6f3d198e604ea7f7a9db600d6d18b6994b
2014-09-18 12:46:22 +00:00
Ben Gras 43eceae54c restore pkgin_cd
. make release.sh put packages on the cd
	. make setup script produce a better rc.package file

Change-Id: Ia4b7588975c2ddf630fa1c510715d82755f67f1e
2014-09-13 17:05:52 +02:00
Ben Gras a875715bb4 restore single user mode
. the minix init started rc with the 'bootargs' variable.
	  this can now be cleanly passed to rc by executing sysenv
	  from the ramdisk rc script.

Change-Id: I68d0d2ab0be326b2ae30438a62dd7649b600c2d2
2014-09-12 23:16:13 +02:00
Lionel Sambuc ab5c98ee5a Temporarily disable the is9600 FS server
It is currently too broken to be of any use anyway. Fixes are pending,
which is why this patch is intended to be reverted before those are
merged.

For the time being, the following tools can be used to access cdroms:
 - isodir
 - isoinfo
 - isoread
 - writeisofs

Change-Id: I681e8f1224bb464ba978f893dc18d46fa06a8208
2014-09-12 13:39:49 +02:00
Lionel Sambuc 6631803105 usb/hcd: asserts should not have side effects
They can be deactivated with -DNDEBUG, which is why they can't contain
code which should always be run.

It seems the local implementation of USB_ASSERT doesn't honor the
CPP flags NDEBUG, this will be corrected in a later patch.

Change-Id: Iac56b09fd563f1b8c4c7be15a468a05b9cc86a18
2014-09-12 13:20:43 +02:00
Lionel Sambuc d5b158e992 pkgin_sets: Fix python package name
Change-Id: I09658a10f750b3d15867d6bd69d749c61831a00d
2014-09-12 11:10:30 +02:00
David van Moolenbroek bb9431cb88 Kernel: update copyright year
Change-Id: I1776f1bc6402f264c7095c17a9ace087036cf010
2014-09-10 13:01:45 +00:00
David van Moolenbroek 16b6870659 blocktest: update test.sh for new shell
Change-Id: I9c08139db972013a16f5794bd213b69bba0b5350
2014-09-09 10:04:09 -04:00
Sky Liu 2fde3a4846 Porting uuencode/uudecode from NetBSD
Lionel: I fixed small mistakes in the mi file, typos, missing keywords,
        and whitespace fixes.

Change-Id: If0c04b923af328838f2d0950e189bf28995bc0f0
2014-09-08 19:51:28 +02:00
Lionel Sambuc 31b808b8fa Drop minix-malloc & friends
Known limitations:
 - comment for now testisofs, as iso9660fs is known to be broken.

Benefits:
 - near 3x speed improvement on C++ code compilation, bringing down
   make build to from 44min down to 21min.

 - Allows for X applications to work properly, which should be available
   in near-term future through pkgsrc for 3.3.0.

Change-Id: I8f4179a7ea925ed381642add32cfd8c5822217e4
2014-09-08 17:30:18 +02:00
Lionel Sambuc 6f7ac603f2 Allow elf_unpack to withstand invalid ELF headers
Change-Id: I10a0f3111176b9614b8531d6736e2e860eb95ce4
2014-09-08 11:48:57 +02:00
Lionel Sambuc ea36b58e62 Set uts.machine to i386 on intel 32bit platforms.
Change-Id: Ic0833843f0d3e3df50fcbde11b453b846f0d4f33
2014-09-05 15:35:23 +02:00
Lionel Sambuc 3f072cf30f commands/setup: fixes for new sh & renamed fsck
- adapt an arithmetic expression for the new sh
 - update the fsck call to use the main fsck wrapper instead of a
   specific fsck version.

Change-Id: I7e25bf6e54b5c9f564082459e78b9ce5c39254cf
2014-09-05 10:26:19 +02:00
Ben Gras 85ebb0e0c3 tps65950: allow 0 as id for qemu beaglexm
makes booting on qemu beaglexm a lot prettier.

Change-Id: I45d0383abbf0d21227a95f538ed78ca6c1ed7871
2014-09-04 13:46:02 +02:00
Ben Gras 683d394d66 devmand: skip unconfigured script invocations
. if a up/down script isn't specified, devmand
	  would try to execute a command line with (null)
	  in it, causing messy messages on startup
	. skip script at a higher level when missing,
	  and add asserts for expected strings at the lower level

Change-Id: Ia0d772076f3781caa5879ea4e64b53fa6c6e8478
2014-09-04 13:33:11 +02:00
Ben Gras a4d4ce4adb retire unstack & datasizes in favour of addr2line
Change-Id: Ibf5db75f3358c3c0bf81ca211a6602b333af0473
2014-09-03 19:14:13 +02:00
Ben Gras fcba33f524 increase root FS size to 128MB
Change-Id: Ibccc32d672b138fd267641e5e5a6e06bfa8502e9
2014-09-03 18:36:11 +02:00
Ben Gras 4f9ef4d3b0 VM: mem_shared: allow re-pagefault
Change-Id: Iffd0e265c03f064545c9689ac204c58335d32c9a
2014-09-03 14:32:54 +02:00
David van Moolenbroek 921b550693 AHCI: remove obsolete free_contig calls
The memory used to be in its own memory region, but is now a part of
a larger memory region which is already being freed anyway.

Change-Id: Ice3174cec76e07112a1997b969dc3f47f573514c
2014-09-02 15:51:16 +00:00
Lionel Sambuc 9d3fcac4cd Some more NDEBUG fixes
- replace a stray assert(0) with abort()
 - remove unrequired copy-pasted #undef NDEBUG
 - replace some #if NDEBUG by #if DEBUG as they protect debug printf()s.

Change-Id: Iff4c0331b06e860d32d91ce6b1d6c765ed065c8b
2014-09-02 16:57:50 +02:00
Lionel Sambuc 20a91f7755 Fix -DNEDUG builds
- assert() is macro which is defined as empty, while panic is always
   present. I added an explicit abort() after the macro to make sure the
   function never returns in case of wrong flags.

 - Fixed gcc build with -NDEBUG, -Os for ARM.
   * A few 'may be used uninitialized' messages
   * A few new missing support library functions where added in libminc.

Change-Id: I69fcda2cd3888390b7ddeff4c0cd849105ce86ff
2014-09-02 15:22:15 +02:00
Lionel Sambuc da9af514b5 Make the kernel less chatty
Change some messages from always printed to varying level of the "verbose"
argument.

Change-Id: I6899268aa895c66e72806ca4d02bb53a0e4ea785
2014-09-01 16:36:26 +02:00
Ben Gras 48e74378c7 vm: allow split of mem_anon_contig region
. so that memory of such regions can be deallocated in any order

Change-Id: I34013d6085cf19a482412cf9bed6b7f96e60e1e6
2014-09-01 15:31:19 +02:00
David van Moolenbroek d3434cb55b VFS: convert EINTR to EAGAIN for nonblocking I/O
The conversion was never properly implemented for asynchronous
character drivers, and got lost during the removal of the
synchronous character protocol.

Change-Id: Ib858806859aa7a52d6b391d4c6c521a2be361fdd
2014-08-31 17:29:47 +00:00
David van Moolenbroek 502b6bda83 Kernel: fix sys_trace
Change-Id: I44bdd3b1d79bf751923581b75c3d44f011d2a5e0
2014-08-30 19:10:12 +00:00
Lionel Sambuc 5f5dcc545f Fix bitcode support for kernel 2014-08-29 12:57:03 -04:00
Lionel Sambuc 5f8eb6fb0c minix/llvm/passes/Makefile.inc: Fix
This fixes and documents a mistake made during the sources move.
2014-08-29 12:56:57 -04:00
Erik van der Kouwe a7db4b5d19 Skip modules that don't work on x86
Skip the following modules in relink.llvm/build.llvm:
 - i2c
 - gpio
 - cat24c256
 - tsl2550
2014-08-29 12:56:40 -04:00
Erik van der Kouwe 08423ba51f Adjust LLVM MINIX scripts for new source layout
Adjust to the fact that drivers and servers have moved into the minix
subdir.
2014-08-29 12:56:28 -04:00
Erik van der Kouwe 52c6ad72ab build.llvm fix to allow pass arguments
This allows pass arguments to be specified (written by Cristiano)
2014-08-29 12:56:23 -04:00
Lionel Sambuc d90bee9749 Importing bin/sh
/etc/profile enables by default tabcompletion, as well as emacs mode,
in order to keep the old MINIX ash behavior.

Note: The shell now refuses to source a script without a relative or
      absolute path.
      This means:
        - '. myscript.sh' fails, while
        - '. ./myscript.sh' succeeds

Change-Id: I0be89b0747bd005e4c05cadb937af86883627dc6
2014-08-29 12:56:04 -04:00
Wojciech Zajac 2d64210c1d Much USB code for ARM USB support
Written by JP Embedded.

Host controller (HCD), mass storage, and hub drivers.

Change-Id: I4237cf7aeb4a1c0205a1876593a9cc67ef3d577e
2014-08-29 18:52:49 +02:00
Ben Gras bad58c9c51 merge libminlib with libc
Change-Id: I79cc4ea90c378a1da3dac16487b53034953827a7
2014-08-28 18:49:19 +02:00
Ben Gras c2808d8b07 remove libcompat_minix as library
. get rid of includes in libcompat_minix:
	  . move configfile.h to minix/include/
	  . all others are unneeded as they point to other files
	. merge the .c files with libc

Change-Id: I5e840c66fb9bc484f377926aa9d66473bbd16259
2014-08-28 18:49:13 +02:00
Ben Gras d1abad940a some small changes
. add /sbin to tests $PATH for ping
	. take disable file mmap item from default boot menu
	. ask for feedback in motd
	. fix ext2fs on arm (the memory alloced with STATICINIT is flaky on arm)

Change-Id: I7525207074d62abc47ed3891139f6ef7ef6025be
2014-08-28 18:49:03 +02:00
David van Moolenbroek 27d0ecdb62 VFS: unbreak select on /dev/tty
The remapping from /dev/tty to the real controlling terminal in the
device code was confusing the select code.  The latter is now aware
of this case and should handle it properly, at the cost of one extra
field in the filp structure.

There is a nasty, hopefully sufficiently rare case of /dev/tty being
kept open while controlling terminals are changing, that we are still
not handling.  Doing so would require more than just a few changes,
but the code should at least detect and cleanly fail on this case.

Test77 now has a basic test set for selecting on /dev/tty.

Change-Id: Iaedea449cdb728d0e66a9de8faacdfd9638dfe92
2014-08-28 16:30:48 +00:00
David van Moolenbroek 673c4e01a5 PTY: let closed master cause EOF on slave
This puts PTY on par with e.g. rs232 as well as behavior documented
for other OSes.  It is not a fix for an issue in userland, though.

- add a (minimal) test case to test77;
- fix a few other minor issues in test77.

Change-Id: I89c000921ee69dd9f5713665349c1ab1ad1dc2cc
2014-08-28 16:30:25 +00:00
David van Moolenbroek 3b4688844f VFS: complete the devmajor_t/devminor_t switch
Change-Id: I9f809283f19d577cf7e02705fdbb2310ae2b6cba
2014-08-28 16:29:56 +00:00
David van Moolenbroek 391516dd77 tty/pty: unbreak stty(1)
Change-Id: I3f857dcbb89e18c7db3a72f4bd6809beb7904bc0
2014-08-28 16:29:27 +00:00
David van Moolenbroek 7e94554b62 uptime(1): also report uptime
It might be more useful this way.  *cough*

Change-Id: I318169fef8bf7737dc46eebf5c5332ce42a9076a
2014-08-28 12:06:50 +00:00
Ben Gras cd34841de5 INIT died problem / build system robustness
Changes provoked by debugging / making 'PM: INIT died' error debuggable.

This was caused (in one instance) by a missing /dev/console (and everything
else) on the boot time ramdisk.

	. sanity-check against this case by checking for console
	. PM: print init stacktrace and exit status when init dies
	. eliminate some explicitly invoked ${MAKE}s and a rm -rf in
	  Makefiles, causing race conditions; use explicit ordering (.WAIT)
	  instead, moving some of the burden of dependencies of partial builds
	  to the user. On the plus side, generate ramdisk just once.
	. make mkfs.mfs fail as soon as it sees an error missing file in
	  the proto file. - except for EACCES on minix native for the mfs
	  test. also fix some fmt warnings.
	. init: include debug info in executable

Change-Id: I8eea4986a4f64ecaf223aff5da321d8b4f4a3fa4
2014-08-28 08:52:50 +02:00
David van Moolenbroek 11eaad3501 Import NetBSD w(1) and uptime(1)
Change-Id: Id6cc36f4befbce4be3a471ae920d75972a44bef1
2014-08-27 10:13:37 +00:00
David van Moolenbroek 7773367959 ps: fix reported run time 2014-08-24 09:22:36 +00:00
David van Moolenbroek d26b52b7cf test59: fix status type for mthread_join call
Integer and pointer sizes may not be the same.
2014-08-24 09:22:35 +00:00
Lionel Sambuc 3260d16f34 Fix -DNDEBUG support
Change-Id: Ib64cef83a646bce2b0afa72b607fb9e5c306e859
2014-08-22 19:12:17 +02:00
Ben Gras 222afb38ac arm am335x: disable watchdog timer on bootup
. for new uboot (specifically beaglebone black rev c) compliance

Change-Id: I28fd0ca15f5365e14bf2bb9407f266e3e570b6d9
2014-08-22 14:30:49 +02:00
Ben Gras 2909efcb88 fix test48 - minix3.org.xyz resolves now
Change-Id: I40b86b7c8cbfcbac0c976c2477200081c2cfc8f7
2014-08-22 12:38:09 +02:00
Lionel Sambuc 7b5343bff9 Removal of commands fix: Keep builtin man pages.
Change-Id: I5cff0f987ed637677406e90faeecb8104f6551bc
2014-08-22 12:34:48 +02:00
Lionel Sambuc ae8b65444d commands/test: removed
Change-Id: I5557eb2116d23c466ce82f1c8c9d18590316a0d0
2014-08-21 18:33:23 +02:00
Lionel Sambuc d4c5f15a03 commands/expr: removed
Change-Id: I374f162959c6e0d708c7b1bd66f2c7a4346c097a
2014-08-21 18:33:23 +02:00
Lionel Sambuc 5b03ef0598 commands/command: removed
Change-Id: I90d57681e7bcabebff323f27af57bab108fa6d4d
2014-08-21 18:33:23 +02:00
Lionel Sambuc 4f88696945 commands/wait: removed
Change-Id: Ie712ec86ef9bbdeffb2fafb51b64600bd118d1e2
2014-08-21 18:33:22 +02:00
Lionel Sambuc 09012edc2b commands/read: removed
Change-Id: Iaa24bb634b31932f793f02c4df10b48030ab70a0
2014-08-21 18:33:22 +02:00
Lionel Sambuc c6284ef73d commands/umask: removed
Change-Id: I0e09cd3e311dad61e72989262fef037759ae9d5d
2014-08-21 18:33:22 +02:00
Lionel Sambuc 3aa3cee7d5 commands/cd: removed
Change-Id: I438c1dfc778e23131fbd0ee1246abfb7df9437f3
2014-08-21 18:33:22 +02:00
Lionel Sambuc 594136a126 commands/getopts: removed
Change-Id: Idc9ec425749a76e2664906f2483be6071273507f
2014-08-21 18:33:21 +02:00
Ben Gras 7f5f010bbd netbsd ping & traceroute
. remove minix ping
	. add support for socket(AF_INET, SOCK_RAW, {IPPROTO_ICMP,IPPROTO_UDP})
	. gives test48 a better chance of detecting network connectivity

Change-Id: Ia678546d27ac378642f1160a141e1fc33458cce2
2014-08-21 08:07:39 -04:00
Lionel Sambuc d13085797b minix/driver/storage/ramdisk: Makefile rework
This is an attempt at simplifying the Makefile, by specifying the home
directory of every utility, instead of trying to guess depending on some
variable.

While this is a bit more verbose, this simplifies the logic. This also makes
it simpler to add / remove programs from the ramdisk.

Change-Id: Id789a6cc6e5a9be11decec0f30c5327f19819aa1
2014-08-20 10:24:35 -04:00
Wojciech Zajac 187bd3cde6 DDEKit interrupt fix
- With this patch, DDEKit no longer uses IRQ number as interrupt ID
      and more IRQ numbers can be used with it

    - DDEKit IRQ code, will now check return values and panic on error

Change-Id: I9ef5ab1ee2262242204bdd8c0a60459a19ddcc1b
2014-08-19 18:24:29 +02:00
Lionel Sambuc d7e5edb2c7 /usr/tests/minix-posix/check-install
This script runs a subset of all the available test. This is aimed at
first time users which might be surprised by the warnings and time the
full test suite takes.

This runs all the tests which in case of success only print "ok" and
don't take too much time to run, independently of the network
connectivity.

Change-Id: Id54b7656a98f9ec81880f91cb63ca888a175f20f
2014-08-13 16:42:57 +02:00
Lionel Sambuc aea6d8c922 Introduce pkgin_sets
This tool allow you to install one or more predefined package sets.

Change-Id: Id21c9e9fbd43f44f2d3b040961411428e1ae0af9
2014-08-13 16:42:57 +02:00
Lionel Sambuc b8d147203f Removing /home/bin
The bin user doesn't need an actual home folder to run the tests. As
such this account should not be used in 'su - bin'. To be noted that
'su bin' still works as expected, and allow to run the minix test set
as usual.

Change-Id: I21fd178bf3b7b28849f05ef24930b553094cc851
2014-08-07 14:01:30 +02:00
Lionel Sambuc 957a365668 Removing the ast account
We used to have an account "ast" as a token to Andrew S. Tannebaum,
the creator of MINIX. The account was disable by default, with no
possible way to login.

It seems it generates more confusion than it is worth, so this removes it.

The default skeleton user profile is still stored into /etc/ast instead
of the usual /etc/skel.

Change-Id: I71818c0bb9580cdecfa9621f8693586fc48d17cb
2014-08-07 13:19:17 +02:00
Lionel Sambuc 7785012b88 setup.sh: Improved user messages.
Change-Id: I5b260b5893ec5ec5a905c48ea8f04aeb2f764bd9
2014-08-07 13:08:12 +02:00
Lionel Sambuc 37f29f557a servers/rs: Add sanity check on executable size
RS used to do a stat, and check that the stat was successful, but it
didn't check that the executable was not actually empty.

This patch adds a check to detect file which are smaller than the minimum
ELF size possible.

Change-Id: I22b004084f17e7d395e2c1377add7bc8b51c3d5e
2014-07-31 16:00:32 +02:00
Lionel Sambuc 50a1aef12b Move all services to /service
This concerns all services, a.k.a drivers, filesystem drivers, network
(inet, lwip, uds) servers, and the system servers.

Change-Id: I626fd15c795e15af42df2d10d47fb4a703665d63
2014-07-31 16:00:31 +02:00
Lionel Sambuc 84bb300f88 Remove /multiboot
This is just a duplicate of /boot/.temp, and it is not used anymore.

Change-Id: I8a4d6e68829de3ff3628ff0fe15f6d1d0a6b128f
2014-07-31 16:00:31 +02:00
Lionel Sambuc 433d6423c3 New sources layout
Change-Id: Ic716f336b7071063997cf5b4dae6d50e0b4631e9
2014-07-31 16:00:30 +02:00
Ben Gras edb410ffe2 empty Makefile
. needed to avoid a build problem on native minix under some
	  circumstances
2014-07-28 17:06:16 +02:00
Cristiano Giuffrida 592c9e1223 llvm: Use mfs images for clientctl buildisk. 2014-07-28 17:06:14 +02:00
Cristiano Giuffrida dea274570b llvm: Add SERIALOUT option to clientctl script. 2014-07-28 17:06:13 +02:00
Koustubha Bhat 98141c6587 build.llvm: including configure.llvm.inc must be optional 2014-07-28 17:06:13 +02:00
Cristiano Giuffrida bf1ab51c95 llvm: Use a separate common.overrides file for MINIX. 2014-07-28 17:06:12 +02:00
Cristiano Giuffrida 646a6b144b llvm: Fix rc script. 2014-07-28 17:06:12 +02:00
Cristiano Giuffrida 5c95bc4d9f llvm: Add clientctl actions for external disk support. 2014-07-28 17:06:11 +02:00
Cristiano Giuffrida 0810704c3d llvm: Preserve default OPTFLAGS when adding instrumentation. 2014-07-28 17:06:10 +02:00
Cristiano Giuffrida 5119c2fe3a llvm: Use default LLVMPREFIX when building passes. 2014-07-28 17:06:10 +02:00
Erik van der Kouwe ca39637dcc LLVM clientctl: activate the KVM module only if available 2014-07-28 17:06:10 +02:00
Erik van der Kouwe d7b27ed4f9 Fix LLVM clientctl: if the kvm command is not available, just use QEMU directly 2014-07-28 17:06:09 +02:00
Erik van der Kouwe 193bd04207 configure.llvm: add INTERACTIVE environment variable which can be set to no to prevent questions from being asked 2014-07-28 17:06:09 +02:00
Cristiano Giuffrida d27de61ef2 llvm: Fix llvm-apps bridging. 2014-07-28 17:06:08 +02:00
Cristiano Giuffrida 07ae148a06 llvm: serverctl is now clientctl. 2014-07-28 17:06:08 +02:00
Cristiano Giuffrida 635e44315c llvm: Always build memory last. 2014-07-28 17:06:08 +02:00
Cristiano Giuffrida 8eb30202e6 llvm: Add the serverctl script. 2014-07-28 17:06:07 +02:00
Cristiano Giuffrida 4ddc42d97a llvm: Use common.overrides* files the llvm-apps way. 2014-07-28 17:06:07 +02:00
Cristiano Giuffrida 9f6977d22d llvm: Split BITCODE_LD_FLAGS
Split across the two linking steps for instrumentation purposes.
2014-07-28 17:06:06 +02:00
Cristiano Giuffrida 79f9fd0612 llvm: Readd mistakenly deleted minix.inc. 2014-07-28 17:06:06 +02:00
Cristiano Giuffrida c2a6ec6824 llvm: A few bitcode-related fixes. 2014-07-28 17:06:05 +02:00
Cristiano Giuffrida 76c4605bfe llvm: Remove no longer needed SLOPPY_FLIST option. 2014-07-28 17:06:05 +02:00
Cristiano Giuffrida 0e560ca0c8 llvm: Avoid versioning configuration files directly. 2014-07-28 17:06:04 +02:00
Koustubha Bhat dd85959391 LLVM Hello pass: inserts printf statement in main() method. 2014-07-28 17:06:04 +02:00
Koustubha Bhat 5ba302fdea Bridging Minix & llvm-apps repos for instrumentating Minix
Allows instrumentation of Minix components using LLVM passes from
"llvm-apps" repository

In addition, the change does the following:
 1. Move releasetools/generate_gold_plugin.sh to minix/llvm
 2. Move external/bsd/llvm/passes to minix/llvm/passes
 3. libLTO.so, LLVMgold.so and WeakAliasModuleOverride.so files
    now get installed in minix/llvm/bin
2014-07-28 17:06:03 +02:00