7114 Commits

Author SHA1 Message Date
rlfnb
b67d2ae9e2 Fixed broken multiboot struct
Change-Id: Ib59fb04a45c4417588bf204a5a6e6306f5097e22
2017-07-12 07:40:10 +02:00
rlfnb
d4dd6511b9 replace tickdelay with micro_delay to be quantum-agnostic
Change-Id: Ie449d797389a178372035d797c84b02d636788cd
2017-06-01 19:48:56 +02:00
David van Moolenbroek
3e2c6c9674 isofs: support directories with many entries
In particular, remove the hardcoded limit of 4096 entries in a single
directory, as there are (at least) real DVDs out there with more
entries than that.  The implementation of this change requires a
second pass on large directories; performance optimizations are left
to future work.

Change-Id: Ia865ac95797fa2dd36b086779c3f1fef6b2f6a6f
2017-05-17 23:25:11 +00:00
David van Moolenbroek
502e7ff953 at_wini: bump hardcoded ATAPI limit to DVD size
at_wini was previously hardcoded to present ATAPI devices as having a
size of 800 MiB, which was enough for CDs but not for DVDs.  This
patch increases the device size to 8500 MiB, which should be large
enough to cover all DVDs.

Change-Id: I7d3192e4ecd0708a655663c1007ff517ed969580
2017-05-17 23:16:52 +00:00
Antoine Leca
d5e4fc0151 Fix Makefile.boot small issue sync'ing with NetBSD
Change-Id: I4f8cbfb9d4b6be8b31ce705cbecc4b12b7e1fe45
2017-05-08 12:15:09 +00:00
David van Moolenbroek
9f81acbc21 Fix lua
As reported by Jean-Baptiste Boric, lua would refuse to start,
throwing an error about incompatibility of numeric types.

This resolves #160.

Change-Id: I5cd6c3b2a35c7023946e4d14d4feedaaecb956fb
2017-05-08 11:53:38 +00:00
rlfnb
9624407e7a header cleanup
Change-Id: I4e169911591c56e91c301c5cb0bb3ea2d8140cf2
2017-05-07 14:02:00 +02:00
Jean-Baptiste Boric
c1d4abeb0c Fix pkgin_cd.sh
Change-Id: I513c16b0691897f3c665532d50ed398967f3e4d0
2017-05-07 00:54:46 +02:00
Jean-Baptiste Boric
66e071a40c Add releasetools/pkgsrc_cdimage.sh
This script uses the image generation framework to create a pkgsrc CD
image, useful for MINIX installations without Internet connectivity.

Change-Id: Ife037f6b6958e38986afad0632f37999ecbb2b55
2017-05-07 00:54:46 +02:00
Jean-Baptiste Boric
0884854a38 Rework package bundling mechanism
Setting PACKAGE_DIR without PACKAGES will default to bundling all
packages in PACKAGE_DIR. PKG_INFO is also mandatory now.

Change-Id: Iaf02221ec91e9c54dc8caec6e9a01bccfc65cc31
2017-05-07 00:54:45 +02:00
Ben Mezger
1915559884 Removed unused variable and cleaned whitespaces
Change-Id: Iaaf6b6f5f49f2d2599a3422250ad7e6e41838b82
2017-05-07 00:54:44 +02:00
Ben Mezger
afc65e92aa Removed unused variables and cleaned whitespaces.
Change-Id: Ib96d1c5bf7a1c65a99d77726fe54ccf37399f9eb
2017-05-07 00:54:43 +02:00
Ben Mezger
9f7f0ad073 Removed unused variables and cleaned whitespaces.
Change-Id: Ie5c1ad84ad162ab18443dd228686aba544ecb9ef
2017-05-07 00:54:43 +02:00
Ben Mezger
81ae2bc455 Prevent arg from being used any further
Patch edited by David van Moolenbroek.

Change-Id: Ie25faffea359e735145dbb4ae2bd2d213488952b
2017-05-07 00:54:19 +02:00
David van Moolenbroek
62cf0e1226 distrib: fix debug builds
Reported by Jean-Baptiste Boric.

Change-Id: I1e9b156326385aa188c824557b6716c059e39fce
2017-05-06 14:43:03 +02:00
David van Moolenbroek
79a488aa87 Network stack feedback-based fixes
Thanks to Lionel Sambuc!

Change-Id: Iae6b2caf58e2b58093e60c5004cfa477e43da154
2017-04-30 17:37:10 +02:00
David van Moolenbroek
3ba6090f82 tests: add advanced TCP/IP tests (test91-94)
Change-Id: I052102f6122f82b3307595990bf91f64e97a45a8
2017-04-30 13:16:25 +00:00
David van Moolenbroek
1dee92ebe9 Import NetBSD networking rc scripts
IMPORTANT: this change has a docs/UPDATING entry!

Change-Id: I6f1e575166f5b47530a004c12aea9b45b571e13d
2017-04-30 13:16:22 +00:00
David van Moolenbroek
9a8b4f5601 netconf(8): rewrite
When possible, network drivers are now started automatically.  That
means that netconf(8)'s network driver selection has become obsolete.
This patch changes netconf(8) to allow the user to specify a network
configuration (currently one of DHCP IPv4+IPv6, DHCP IPv4-only,
manual IPv4-only) for any hardware network interfaces that are
currently present.

Selection of network drivers that require manual configuration first
(mainly old ISA cards) is still supported, but now as a special case.

Change-Id: I6208fc75192eb7f0b061862aaf7507f71a620da4
2017-04-30 13:16:19 +00:00
David van Moolenbroek
60299d873c etc/rc: start lwip service
Change-Id: I10cfdcde490987b93c79532a2c53dda2307b83ce
2017-04-30 13:16:16 +00:00
David van Moolenbroek
e4dbab1e53 etc/rc: auto-start PnP ethernet drivers
Change-Id: I0f6c955511cbb04d47093de28109b5084609856a
2017-04-30 13:16:13 +00:00
David van Moolenbroek
ad920fc485 tests: adapt existing tests to new LWIP service
Change-Id: Id744e9d3fbe19733557011f8803593cf3768c35d
2017-04-30 13:16:10 +00:00
David van Moolenbroek
bb9622b5ed ping(8), traceroute(8): adapt to new LWIP service
Change-Id: I0aae7199dfd9075201975e133cdaeab6bc2bd24f
2017-04-30 13:16:06 +00:00
David van Moolenbroek
ef8d499e2d Add lwip: a new lwIP-based TCP/IP service
This commit adds a new TCP/IP service to MINIX 3.  As its core, the
service uses the lwIP TCP/IP stack for maintenance reasons.  The
service aims to be compatible with NetBSD userland, including its
low-level network management utilities.  It also aims to support
modern features such as IPv6.  In summary, the new LWIP service has
support for the following main features:

- TCP, UDP, RAW sockets with mostly standard BSD API semantics;
- IPv6 support: host mode (complete) and router mode (partial);
- most of the standard BSD API socket options (SO_);
- all of the standard BSD API message flags (MSG_);
- the most used protocol-specific socket and control options;
- a default loopback interface and the ability to create one more;
- configuration-free ethernet interfaces and driver tracking;
- queuing and multiple concurrent requests to each ethernet driver;
- standard ioctl(2)-based BSD interface management;
- radix tree backed, destination-based routing;
- routing sockets for standard BSD route reporting and management;
- multicast traffic and multicast group membership tracking;
- Berkeley Packet Filter (BPF) devices;
- standard and custom sysctl(7) nodes for many internals;
- a slab allocation based, hybrid static/dynamic memory pool model.

Many of its modules come with fairly elaborate comments that cover
many aspects of what is going on.  The service is primarily a socket
driver built on top of the libsockdriver library, but for BPF devices
it is at the same time also a character driver.

Change-Id: Ib0c02736234b21143915e5fcc0fda8fe408f046f
2017-04-30 13:16:03 +00:00
David van Moolenbroek
0f03189a6a RMIB: add indirection support for sparse subtrees
Normally, each RMIB subtree consists of an array of nodes, indexed
by node identifier.  In a sparsely filled subtree, most of the array
is empty and just wasting memory.  In that case, it may be beneficial
to have a level of indirection, with an intermediate array containing
pairs of node IDs and pointers to the actual nodes.  This patch adds
support for such indirection.

For the use cases that inspired this patch, net.inet and net.inet6,
the indirection shaves off a little under 16KB of memory from the
TCP/IP service.

Change-Id: Ic68ca3fee1a0f2032f77eef6df42728f9b9400e8
2017-04-30 13:16:00 +00:00
David van Moolenbroek
5edbea5063 libsys: allow for grant preallocation
Since the grant table is allocated dynamically, a system service always
runs the risk of running out of memory at run time when trying to
allocate a grant.  In order to allow services to mitigate that risk,
grants can now be preallocated, typically at system service startup,
using the new cpf_prealloc(3) libsys function.  The function takes a
'count' parameter that indicates the number of additional grants to
preallocate.  Thus, the function may be called from multiple submodules
within a service, each preallocating their own maximum of grants that
it may need at run time.

Change-Id: I6904726a722a8c27dfe2efa470e683718f310272
2017-04-30 13:15:57 +00:00
David van Moolenbroek
5d5fbe79c1 Import new lwIP version into liblwip
In order to match NetBSD-style imports of external code, the library
has been restructured.  The full lwIP source tree is imported, except
for a few .git* files in its root directory, into dist/.  The MINIX 3
Makefiles and other custom files are located in lib/.  Finally, since
we need to apply a number of small patches to lwIP, these patches are
stored in patches/, in addition to being applied to the lwIP tree.

The currently imported version of lwIP is taken from its master
branch sometime after the 2.0.1 release, specifically git-7ffe5bf.

Change-Id: Ie03c4fa36fa928870263c191205d6d93f652a3cc
2017-04-30 13:15:53 +00:00
David van Moolenbroek
47db417b1a lance: perform full reinitialization for restarts
When performing a restart (CSR0 STOP, STRT), the behavior regarding
the NIC's current RX/TX descriptor ring counters varies between cards:
older LANCE cards do not reset the counters; newer PCnet cards do
reset them; VirtualBox's emulation is once again broken in that it
claims to emulate newer cards but implements the older behavior.

Changing the card's receive mode requires such a restart, and now that
the system can actually change receive modes dynamically as part of
normal network operation, this results in the lance driver breaking
all the time on at least VirtualBox.

Instead of trying to figure out exactly what is going on with the
counters during a restart, we now simply perform a full-blown
reinitialization every time the NIC is restarted.  That leaves no
ambiguity regarding the counters, and appears to be what drivers on
other OSes do as well.  As a bonus, this approach actually saves code.

Change-Id: I60fad2df6de4616d5de2cec39c09b60c15d854fb
2017-04-30 13:15:50 +00:00
David van Moolenbroek
f7df02e747 libnetdriver: rewrite
This is a driver-breaking update to the netdriver library, which is
used by all network drivers.  The aim of this change is to make the
library more compatible with NetBSD, and in particular with various
features that are expected to be supported by the NetBSD userland.
The main changes made by this patch are the following:

- each network driver now has a NetBSD-style short device name;
- drivers are not expected to receive packets right after startup;
- extended support for receipt modes, including multicast lists;
- support for multiple parallel send, receive requests;
- embedding of I/O vectors in send and receive requests;
- support for capabilities, including checksum offloading;
- support for reporting link status updates to the TCP/IP stack;
- support for setting and retrieving media status;
- support for changing the hardware (MAC) address;
- support for NetBSD interface flags IFF_DEBUG, IFF_LINK[0-2];
- support for NetBSD error statistics;
- support for regular time-based ("tick") callbacks.

IMPORTANT: this patch applies a minimal update to the existing drivers
in order to make them work at all with the new netdriver library.  It
however does *not* change all drivers to make use of the new features.
In fact, strictly speaking, all drivers are now violating requirements
imposed by the new library in one way or another, most notably by
enabling packet receipt when starting the driver.  Changing all the
drivers to be compliant, and to support the newly added options, is
left to future patches.  The existing drivers should currently *not*
be taken as examples of how to implement a new network driver!

With that said, a few drivers have already been changed to make use of
some of the new features: fxp, e1000, rtl8139, and rtl8169 now report
link and media status, and the last three of those now support setting
the hardware MAC address on the fly.  In addition, dp8390 has been
changed to default to PCI autoconfiguration if no configuration is
specified through environment variables.

Change-Id: I4b3ea9c0b9bc25d5b0609c6ff256fb0db71cdc42
2017-04-30 13:15:28 +00:00
David van Moolenbroek
686761dbbc syslogd(8): drop some MINIX-specific changes
Change-Id: Ic286b89975eeea1abf0d5086ee13dfb9ab57d8ba
2017-03-21 22:00:37 +00:00
David van Moolenbroek
5bded7c030 ftpd(8): drop some MINIX-specific changes
Also put in a crude way to clean up zombies when ftpd(8) is running
in daemon mode, because we do not yet support SA_NOCLDWAIT.

Change-Id: I8a7db1d665c432d736db833b0022d0340764db1f
2017-03-21 22:00:34 +00:00
David van Moolenbroek
340f5e5660 Import NetBSD httpd(8)
Also known as bozohttpd(8).

Change-Id: I40e955b5654674f2c708b10e5e403ca9cbc92534
2017-03-21 22:00:31 +00:00
David van Moolenbroek
8f957290eb Import NetBSD rtadvd(8)
Change-Id: I22626843d85c78f0fadefd58d61d7a85d285b2b8
2017-03-21 22:00:28 +00:00
David van Moolenbroek
5de448e315 Import NetBSD ndp(8)
Like arp(8), this utility already uses the NetBSD 8 protocol for
talking to the operating system through routing sockets.

Like arp(8), this utility is not fully functional, due to limitations
of lwIP.  While ndp(8) should provide a proper (read-only) view of the
contents of the Neighbor Discovery table, any attempts to modify the
table will fail.  In addition, various other ndp(8) features are not
supported.  On MINIX 3, the prefix and default router lists are not
managed by the operating system however, but rather by dhcpcd(8);
therefore, an implementation of the features related to those lists
would not provide any actual functionality.

Change-Id: I479bfc8141ba69fe50c1b2f7091933267ce6fa3e
2017-03-21 22:00:25 +00:00
David van Moolenbroek
b636d99d91 Import NetBSD tcpdump(8)
For now, printing of Sun RPC requests is disabled because we do not
yet have the RPC header files.  This should affect basically noone,
as we do not have any RPC-based programs yet, for the same reason.

Change-Id: Ie7818faaaacdc104d8b2c37a68866b4ce18247d6
2017-03-21 22:00:21 +00:00
David van Moolenbroek
d56f51ea7d Import NetBSD libpcap
As part of this, we import bpf_filter.c from NetBSD.  Even though that
file is part of the NetBSD kernel, it is also used by userland (as is
clear here).  Our LWIP service has its own bpf_filter.c implementation
but that implementation has certain limits (e.g. on program size) that
are fine for a system service but should not apply to userland.

The libpcap code has a number of blocks guarded by __NetBSD__, but
none of those blocks apply to MINIX 3.  In particular, some of the
alignment logic used for NetBSD may in fact not work in our case.

Change-Id: Ib187e22d627c929e111d5d4a991c3bee3c0154cb
2017-03-21 22:00:18 +00:00
David van Moolenbroek
83ee113ee0 Import NetBSD dhclient(8), dhcpd(8), dhcrelay(8)
dhcrelay(8) and omshell(1) have not been tested.

Change-Id: I0cad89f65666af4e366a86e130ce8df0894c3bb4
2017-03-21 22:00:14 +00:00
David van Moolenbroek
00b67f09dd Import NetBSD named(8)
Also known as ISC bind.  This import adds utilities such as host(1),
dig(1), and nslookup(1), as well as many other tools and libraries.

Change-Id: I035ca46e64f1965d57019e773f4ff0ef035e4aa3
2017-03-21 22:00:06 +00:00
David van Moolenbroek
9f20bfa6c4 Import NetBSD dhcpcd(8)
The port could be improved by adding support for pselect(2).

Other than that, this port has a few MINIX-specific changes:

- we undefine IN_IFF_ flags to stop dhcpcd from thinking that we have
  operating system support for link-local IPv4 address management;
- we work around one crash bug that seems triggered by using dhcpcd
  on some but not all interfaces;
- we add "noalias" to the default dhcpcd.conf(5) configuration file.

Change-Id: I8a81c2c2af353c5ce08335673b1ab2d4b39178da
2017-03-21 21:59:13 +00:00
David van Moolenbroek
d642636d2d Import NetBSD resolvconf(8)
Also known as "openresolv".  Needed for dhcpcd(8).

Change-Id: Ibcb616837e9a5293377e451c6f6218a37260ed80
2017-03-09 23:40:18 +00:00
David van Moolenbroek
c3b6f8f269 Import NetBSD inetd(8)
Do not start it by default just yet.

Change-Id: Id8d2dd33eb67ae74b3ef3060638e20c781e8e37d
2017-03-09 23:40:18 +00:00
David van Moolenbroek
e044bafaad Import NetBSD telnetd(8)
Change-Id: Ie1ae80e8a4945f6f4ccce8f468c1b04a8d89cf43
2017-03-09 23:40:17 +00:00
David van Moolenbroek
7348b5c52b Import NetBSD telnet(1)
Change-Id: Ib58b43cc9baabe183a59410212827f65ec117277
2017-03-09 23:40:16 +00:00
David van Moolenbroek
72e899eafc Import NetBSD traceroute6(8)
Change-Id: I040651cf29a9efd6b85afafe6813e48c2f1a4f2d
2017-03-09 23:40:16 +00:00
David van Moolenbroek
903ca1e525 Import NetBSD ping6(8)
Change-Id: Ife49f5fac0e50852c74a0f85b6129c204d172c68
2017-03-09 23:40:15 +00:00
David van Moolenbroek
04e82b7dc9 Import NetBSD arp(8)
Behaviorally this port should already be largely on par with the
NetBSD 8 version, in that it sets the RTF_LLDATA flag on routing
socket requests to indicate that they target link-local data.

Many parts of the arp(8) functionality are currently not yet supported
by the operating system, largely due to lwIP not exposing appropriate
means of implementing them.

Change-Id: Icfac054b4deddda03eee4acf0e261aa48cd031ba
2017-03-09 23:40:14 +00:00
David van Moolenbroek
66dfcc8533 Import NetBSD netstat(1)
The port forces the use of sysctl(7), as obtaining information through
KVM is not and will never be viable.  The sysctl mode of netstat(1) is
currently somewhat limited and buggy, though.  We fix a few minimal
issues, but more improvements will have to come from NetBSD reimports.

Some of netstat(1)'s views are currently not supported by the
operating system.  Later improvements on this point will not require
changes to the imported code, though.

Change-Id: If74a6811f0fc81bd1ecc31010a28379b14b2a0eb
2017-03-09 23:40:14 +00:00
David van Moolenbroek
483e595557 Import NetBSD route(8)
Change-Id: I724a2a56157ea72afdd3f6a82239687894c8e3e8
2017-03-09 23:40:13 +00:00
David van Moolenbroek
90b801219a Import NetBSD ifconfig(8)
Not all of its functionality is actually implemented in the operating
system.  In addition, a few modules (agr, vlan) have been disabled
because we have not imported the necessary headers yet.

Change-Id: I4c9271065d640bd9112b4bd27e2652e1d51b18b4
2017-03-09 23:40:12 +00:00
David van Moolenbroek
f1fab66e7d Import NetBSD libwrap
Change-Id: Ib8b979fb9a96c2048b8ea93038944c743048bff4
2017-03-09 23:40:12 +00:00