Commit graph

657 commits

Author SHA1 Message Date
David van Moolenbroek c5fae8a617 dec21140A: change debugging key to Shift+F7 2011-12-12 16:45:45 +01:00
Raja Appuswamy 8ab7667da4 ahci: NCQ support 2011-12-12 14:13:05 +01:00
David van Moolenbroek e7db2d3588 Add fbd -- Faulty Block Device driver
This driver can be loaded as an overlay on top of a real block
device, and can then be used to generate block-level failures for
certain transfer requests. Specifically, a rule-based system allows
the user to introduce (overt and silent) data corruption and errors.

It exposes itself through /dev/fbd, and a file system can be mounted
on top of it. The new fbdctl(8) tool can be used to control the
driver; see ``man fbdctl'' for details. It also comes with a test
set, located in test/fbdtest.
2011-12-11 22:45:46 +01:00
David van Moolenbroek 4005bba437 libblockdriver: clear IPC only on stateful restart
This removes a race condition when the block driver performs a
complete restart after a crash (the new default). If any user of
the driver finds out its new endpoint and sends a request to the
new driver instance before this instance has had the chance to
initialize, then its initialization would clear all IPC state and
thereby erroneously cancel the incoming request. Clearing IPC
state is only desired upon a stateful restart (where the driver's
endpoint is retained). This information is now passed to and used
by libblockdriver accordingly.
2011-12-11 22:36:19 +01:00
David van Moolenbroek c6459e8ec1 acpi: resolve warnings 2011-12-10 16:14:23 +01:00
David van Moolenbroek 67c012b3fc printer: perform probe on startup
This stops the printer driver from hanging the entire system when
/dev/lp is opened on systems that do not have a parallel port. With
this change, the printer driver shuts down immediately after loading
on such systems.
2011-12-05 16:28:10 +01:00
David van Moolenbroek e379e0936e Make block drivers restart with new endpoint 2011-12-05 16:28:08 +01:00
David van Moolenbroek e2758c6759 libblockdriver: allow for not handling partitions
Each block driver now gets to specify whether it is a disk block
driver, which implies it wants the library to handle getting and
setting partitions for it.
2011-11-28 16:42:35 +01:00
David van Moolenbroek 0aa01a2dce Add vbox -- VirtualBox time sync driver
Sets time forward to match the host time.

Started automatically if the corresponding device is present.
2011-11-23 18:15:43 +01:00
David van Moolenbroek 9874865a6f ahci: FUA (force-write) support 2011-11-23 15:40:38 +01:00
David van Moolenbroek b4d909d415 Split block/character protocols and libdriver
This patch separates the character and block driver communication
protocols. The old character protocol remains the same, but a new
block protocol is introduced. The libdriver library is replaced by
two new libraries: libchardriver and libblockdriver. Their exposed
API, and drivers that use them, have been updated accordingly.
Together, libbdev and libblockdriver now completely abstract away
the message format used by the block protocol. As the memory driver
is both a character and a block device driver, it now implements its
own message loop.

The most important semantic change made to the block protocol is that
it is no longer possible to return both partial results and an error
for a single transfer. This simplifies the interaction between the
caller and the driver, as the I/O vector no longer needs to be copied
back. Also, drivers are now no longer supposed to decide based on the
layout of the I/O vector when a transfer should be cut short. Put
simply, transfers are now supposed to either succeed completely, or
result in an error.

After this patch, the state of the various pieces is as follows:
- block protocol: stable
- libbdev API: stable for synchronous communication
- libblockdriver API: needs slight revision (the drvlib/partition API
  in particular; the threading API will also change shortly)
- character protocol: needs cleanup
- libchardriver API: needs cleanup accordingly
- driver restarts: largely unsupported until endpoint changes are
  reintroduced

As a side effect, this patch eliminates several bugs, hacks, and gcc
-Wall and -W warnings all over the place. It probably introduces a
few new ones, too.

Update warning: this patch changes the protocol between MFS and disk
drivers, so in order to use old/new images, the MFS from the ramdisk
must be used to mount all file systems.
2011-11-23 14:06:37 +01:00
Arun Thomas fa00de707c small ramdisk: install all password-related files 2011-11-23 10:28:00 +01:00
Arun Thomas ebdac755af ramdisk: install all password-related files 2011-11-22 19:58:45 +01:00
Arun Thomas 32aabfab40 ramdisk: build pwd_mkdb 2011-11-22 16:45:17 +01:00
Ben Gras cd107a5ac3 fxp: add device id in the right place 2011-11-22 11:17:49 +01:00
Ben Gras 81bdb22b0c fxp: add device id for LU82551IT
Contributed by Roman Ignatov
2011-11-22 11:09:42 +01:00
Ben Gras b1eba81b9d simplify build logic a bit
. always compile acpi, with clang, so never have
	  build/clean inconsistencies; can be enabled (i.e. run
	  at boot time) by setting acpi variable in the boot monitor
	. always strip binaries with the right strip cmd, so never
	  have ack/elf strip inconsistencies
2011-11-18 17:11:17 +01:00
Ben Gras 349a158056 base system hooks for pkgsrc drivers
. rc script and service know to look in /usr/pkg/.. for
	  extra binaries and conf files
	. service split into parsing config and doing RS request
	  so that a new utility (printconfig) can just print the
	  config in machine-parseable format for netconf integration
	. converted all base system eth drivers/netconf
2011-11-16 16:18:21 +01:00
Ben Gras 5c00743626 Switch to NetBSD passwd format
Based on work by Vivek Prakash and Gianluca Guida.

See UPDATING about caveats on currently existing accounts.

	. restores netbsd libc pwcache functions
2011-11-14 14:47:42 +00:00
David van Moolenbroek 2602861f23 Move optset.c into libsys; remove redundant copies 2011-11-07 16:16:08 +01:00
David van Moolenbroek ff542f0b27 atl2: prevent compiler memory access misordering
While no problems have been observed in practice yet, modern compilers
may reorder memory access operations, and that could lead to problems
with memory-mapped I/O typically done by drivers. This patch prevents
any potentially problematic reordering by the compiler in the ATL2
driver.

In addition, this patch removes a number of gcc/clang warnings.
2011-11-07 14:25:09 +01:00
David van Moolenbroek 47aad344c3 Drivers: fix issues introduced by commit b198207 2011-11-04 23:54:04 +01:00
David van Moolenbroek 5320333614 ahci: prevent compiler memory access misordering
While no problems have been observed in practice yet, modern compilers
may reorder memory access operations, and that could lead to problems
with memory-mapped I/O typically done by drivers. This patch prevents
any potentially problematic reordering by the compiler in the AHCI
driver.
2011-11-04 14:13:24 +01:00
David van Moolenbroek e1d867b686 ahci/libdriver: multithreading support
This patch adds support for executing multiple concurrent requests on
different devices on the same AHCI controller. The libdriver library
has been extended to include a generic multithreading interface, and
the AHCI driver has been extended to make use of this interface.

The original version of this code has been written by Arne Welzel.
2011-11-04 09:37:53 +00:00
Antoine LECA 230dd159df dec21140A driver warnings fix 2011-09-29 17:37:47 +00:00
Arun Thomas cb54d96eec Remove legacy boot monitor vars 2011-09-16 20:10:47 +02:00
Ben Gras 3a44cd477b tty: handle REVIVE case on console device
. can happen on e.g. ^S
	. reported by Stephen Hatton
2011-08-09 16:59:01 +00:00
Ben Gras 989934b37c rename -lutil to -lminixutil
. in preparation for netbsd -lutil
2011-08-01 14:32:14 +02:00
Arun Thomas f985ecba0d MKEMBED is now MKSMALL 2011-08-01 11:05:17 +02:00
Arun Thomas ae561b8f12 Add MKAPIC and MKACPI options 2011-07-31 16:22:43 +02:00
Arun Thomas fcc2c77af2 ramdisk: For MKEMBED, skip ext2, achi, and acpi 2011-07-30 13:16:16 +02:00
Arun Thomas 159b8f71b7 Use 'strip -s' for ELF image 2011-07-22 07:52:34 +02:00
Arun Thomas 70712c015e release.sh: add missing bootstrap util 2011-07-20 16:03:06 +02:00
Arun Thomas 0d9095d116 Fix ISO building
-Update release.sh to use new stat syntax
-Add missing utils to release bootstrap dirs
-Remove needless dependency in ramdisk Makefile
2011-07-20 10:36:37 +02:00
Arun Thomas 3eb22ca4d1 MK option to build only system image programs 2011-07-20 09:57:46 +02:00
Arun Thomas 5df8be8e7a buildsystem: use dependall target
Improves cache locality by grouping together dependency generation
with building for each program instead of doing a whole-tree dep
generation phase followed by a whole-tree build phase
2011-07-19 15:28:20 +02:00
Ben Gras 02081e4b62 rename mmap() and munmap()
. it's a good extra interface to have but doesn't
	  meet standardised functionality
	. applications (in pkgsrc) find it and expect
	  full functionality the minix mmap doesn't offter
	. on the whole probably better to hide these functions
	  (mmap and friends) until they are grown up; the base system
	  can use the new minix_* names
2011-07-16 13:01:19 +02:00
Erik van der Kouwe 66bc7580c7 Fix e1000 bug introduced in 123cf7 2011-07-13 11:36:10 +02:00
Arun Thomas 8a5484202c Support for 82801CAM PRO/100 VE
Contributed by Jan Wieck
2011-07-11 21:10:28 +02:00
Arun Thomas b956c8735e Fix GCC image building 2011-07-09 15:04:42 +02:00
Tomas Hruby a97a80178e E1000 - Intel 82571EB Gigabit Ethernet Controller 2011-07-08 20:31:21 +02:00
Tomas Hruby 6dea092dec E1000 - pci probing
- once we know it is not an Intel device, it is not a match
2011-07-08 20:31:21 +02:00
Tomas Hruby 123cf7fe37 E1000 - reading EEPROM
- once the DONE bit is set, we already have the data
2011-07-08 20:31:21 +02:00
Tomas Hruby 48a4ff2307 E1000 - fixed reading MAC from EEPROM
- makes case which is correct according to Intel docs the default
2011-07-08 20:31:21 +02:00
Tomas Hruby d75138be00 E1000 - fixed reading/writing device registers
- the pointers must be flagged as volatile because otherwise they
  might be "optimized" by a compiler. It is a common good
  practice to access the registers this way, the keyword is in C
  for a reason.

- for instance, in eeprom_eerd() when polling a register the
  compiler, under certain conditions, may decide upon the first
  read and if it does not break the loop it assumes that the
  value is not going to change and thus stays in an infinite
  loop.
2011-07-08 20:31:21 +02:00
Arun Thomas cf04da3ebe Restore stripping of elf binaries in ramdisk 2011-06-28 17:49:45 +02:00
Arun Thomas 93ae43f577 boot: Add multiboot support
Not yet fully spec-compliant; work in progress
2011-06-24 17:21:51 +02:00
Gianluca Guida cc17b27a2b Build NetBSD libc library in world in ELF mode.
3 sets of libraries are built now:
  . ack: all libraries that ack can compile (/usr/lib/i386/)
  . clang+elf: all libraries with minix headers (/usr/lib/)
  . clang+elf: all libraries with netbsd headers (/usr/netbsd/)

Once everything can be compiled with netbsd libraries and headers, the
/usr/netbsd hierarchy will be obsolete and its libraries compiled with
netbsd headers will be installed in /usr/lib, and its headers
in /usr/include. (i.e. minix libc and current minix headers set
will be gone.)

To use the NetBSD libc system (libraries + headers) before
it is the default libc, see:
   http://wiki.minix3.org/en/DevelopersGuide/UsingNetBSDCode
This wiki page also documents the maintenance of the patch
files of minix-specific changes to imported NetBSD code.

Changes in this commit:
  . libsys: Add NBSD compilation and create a safe NBSD-based libc.
  . Port rest of libraries (except libddekit) to new header system.
  . Enable compilation of libddekit with new headers.
  . Enable kernel compilation with new headers.
  . Enable drivers compilation with new headers.
  . Port legacy commands to new headers and libc.
  . Port servers to new headers.
  . Add <sys/sigcontext.h> in compat library.
  . Remove dependency file in tree.
  . Enable compilation of common/lib/libc/atomic in libsys
  . Do not generate RCSID strings in libc.
  . Temporarily disable zoneinfo as they are incompatible with NetBSD format
  . obj-nbsd for .gitignore
  . Procfs: use only integer arithmetic. (Antoine Leca)
  . Increase ramdisk size to create NBSD-based images.
  . Remove INCSYMLINKS handling hack.
  . Add nbsd_include/sys/exec_elf.h
  . Enable ELF compilation with NBSD libc.
  . Add 'make nbsdsrc' in tools to download reference NetBSD sources.
  . Automate minix-port.patch creation.
  . Avoid using fstavfs() as it is *extremely* slow and unneeded.
  . Set err() as PRIVATE to avoid name clash with libc.
  . [NBSD] servers/vm: remove compilation warnings.
  . u32 is not a long in NBSD headers.
  . UPDATING info on netbsd hierarchy
  . commands fixes for netbsd libc
2011-06-24 11:46:30 +02:00
Erik van der Kouwe 6e0f3b3bda Split off sys_umap_remote from sys_umap
sys_umap now supports only:
- looking up the physical address of a virtual address in the address space
  of the caller;
- looking up the physical address of a grant for which the caller is the
  grantee.

This is enough for nearly all umap users. The new sys_umap_remote supports
lookups in arbitrary address spaces and grants for arbitrary grantees.
2011-06-10 14:28:20 +00:00
Ben Gras b19820774e fixed clang warnings in drivers/
. changed debug statements system for audio/ to do so
2011-06-09 16:57:51 +02:00