Skip to content
Snippets Groups Projects
  1. Mar 25, 2018
    • Arne Welzel's avatar
      minix/tests/arm: naive tests to cause data aborts · 35b65c5a
      Arne Welzel authored
      Some assembly code to cause unaligned access as well as
      segmentation faults to exercise the data abort path.
      
      Change-Id: Ie419114b76a8db849537a94fda781019cf14d50d
      35b65c5a
    • Arne Welzel's avatar
      kernel/arm: send SIGSEGV to processes · 0dd719f1
      Arne Welzel authored
      On second thought, handle unknown faults caused by processes by sending
      SIGSEGV to them instead of bringing the whole system to a grind.
      
      arm/archconst: use values defined in armreg.h
      
      Change-Id: Ieed5bb06910ab0c8eef1e68b0b4eec680867acd3
      0dd719f1
    • Arne Welzel's avatar
      bsd.own.mk: use -mno-unaligned-access on ARM · 5e9e5b98
      Arne Welzel authored
      Without this option, gcc may emit code accessing unaligned memory. This,
      and the fact that SCTRL.A (System Control Register - Alignment Check) is
      set to 1 in Minix causes data aborts when such code is encountered.
      
      This was the cause of #104. The `minix-service' executable caused
      unaligned memory accesses calling into getpwnam(). These then trigger
      data abort exceptions. On ARM, these were previously forwarded to `vm'
      as pagefaults. However, `vm' did not properly handle them, but instead
      allocated one page for the faulting address (over and over again) and
      then resumed the process at the faulting instruction (over and over
      again). This behavior masked the whole story as an OOM.
      
      Below the assembly version getpwent.c in which unaligned memory
      accesses are even highlighted...
      
       ...
       341         ldr     lr, [sp, #48]
       342         cmp     lr, #0
       343         bne     .L46
       344         ldr     r0, [r4]        @ unaligned
       345         add     r1, r7, #5
       346         str     r0, [sp, #4]    @ unaligned
       347         ldr     r4, [sp, #4]
       348         mov     r5, r4, asr #31
       349         strd    r4, [r8, #40]
       ...
      
      This should fix #104. It was tested on an actual Beaglebone Black.
      
      An alternative fix would be to disable alignment checking by setting
      SCTRL.A to 0 and allowing unaligned memory accesses.
      
      Change-Id: I4d366eb0af1b2936bca369fd28014fb829228ad5
      5e9e5b98
    • Arne Welzel's avatar
      kernel/arm: do not treat all data aborts as pagefaults · 7c3424c2
      Arne Welzel authored
      For now, distinguish alignment, translation and permission faults.
      The first kind of faults cause the kernel to send SIGBUS to the
      process causing the fault, the latter two are forwarded to `vm' as
      pagefaults. Previously, any data abort was forwarded to `vm' as
      a pagefault, resulting in hard to debug issue #104.
      
      Any unhandled fault status results in a disaster. This seems
      better than naively hoping `vm' can do something about it.
      
      Change-Id: I526f575bb2681e087e20fd49c5c0846cdd450c31
      7c3424c2
  2. Mar 23, 2018
  3. Nov 16, 2017
    • Krystian Lewandowski's avatar
      pci server crashes during boot on Qubes OS · b2ee0702
      Krystian Lewandowski authored
      I tried to launch Minix3 in Qubes OS. While there is no problem to boot
      minix as a qube (in Qubes OS terminology) before 3641562f, it fails with
      the commit (and after). I didn't digg into PCI handling but this change
      fixes the problem. Minix handles NULL case from pci_subclass_name.
      
      Change-Id: I162424d92b613598e6eb845a71f90a02e31041db
      b2ee0702
  4. Jul 12, 2017
  5. Jun 01, 2017
  6. May 17, 2017
    • David van Moolenbroek's avatar
      isofs: support directories with many entries · 3e2c6c96
      David van Moolenbroek authored
      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
      3e2c6c96
    • David van Moolenbroek's avatar
      at_wini: bump hardcoded ATAPI limit to DVD size · 502e7ff9
      David van Moolenbroek authored
      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
      502e7ff9
  7. May 08, 2017
  8. May 07, 2017
    • rlfnb's avatar
      header cleanup · 9624407e
      rlfnb authored
      Change-Id: I4e169911591c56e91c301c5cb0bb3ea2d8140cf2
      9624407e
  9. May 06, 2017
  10. Apr 30, 2017
    • David van Moolenbroek's avatar
      Network stack feedback-based fixes · 79a488aa
      David van Moolenbroek authored
      Thanks to Lionel Sambuc!
      
      Change-Id: Iae6b2caf58e2b58093e60c5004cfa477e43da154
      79a488aa
    • David van Moolenbroek's avatar
      tests: add advanced TCP/IP tests (test91-94) · 3ba6090f
      David van Moolenbroek authored
      Change-Id: I052102f6122f82b3307595990bf91f64e97a45a8
      3ba6090f
    • David van Moolenbroek's avatar
      Import NetBSD networking rc scripts · 1dee92eb
      David van Moolenbroek authored
      IMPORTANT: this change has a docs/UPDATING entry!
      
      Change-Id: I6f1e575166f5b47530a004c12aea9b45b571e13d
      1dee92eb
    • David van Moolenbroek's avatar
      netconf(8): rewrite · 9a8b4f56
      David van Moolenbroek authored
      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
      9a8b4f56
    • David van Moolenbroek's avatar
      etc/rc: start lwip service · 60299d87
      David van Moolenbroek authored
      Change-Id: I10cfdcde490987b93c79532a2c53dda2307b83ce
      60299d87
    • David van Moolenbroek's avatar
      etc/rc: auto-start PnP ethernet drivers · e4dbab1e
      David van Moolenbroek authored
      Change-Id: I0f6c955511cbb04d47093de28109b5084609856a
      e4dbab1e
    • David van Moolenbroek's avatar
      tests: adapt existing tests to new LWIP service · ad920fc4
      David van Moolenbroek authored
      Change-Id: Id744e9d3fbe19733557011f8803593cf3768c35d
      ad920fc4
    • David van Moolenbroek's avatar
      ping(8), traceroute(8): adapt to new LWIP service · bb9622b5
      David van Moolenbroek authored
      Change-Id: I0aae7199dfd9075201975e133cdaeab6bc2bd24f
      bb9622b5
    • David van Moolenbroek's avatar
      Add lwip: a new lwIP-based TCP/IP service · ef8d499e
      David van Moolenbroek authored
      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
      ef8d499e
    • David van Moolenbroek's avatar
      RMIB: add indirection support for sparse subtrees · 0f03189a
      David van Moolenbroek authored
      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
      0f03189a
    • David van Moolenbroek's avatar
      libsys: allow for grant preallocation · 5edbea50
      David van Moolenbroek authored
      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
      5edbea50
    • David van Moolenbroek's avatar
      Import new lwIP version into liblwip · 5d5fbe79
      David van Moolenbroek authored
      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
      5d5fbe79
    • David van Moolenbroek's avatar
      lance: perform full reinitialization for restarts · 47db417b
      David van Moolenbroek authored
      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
      47db417b
    • David van Moolenbroek's avatar
      libnetdriver: rewrite · f7df02e7
      David van Moolenbroek authored
      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
      f7df02e7
Loading