Commit graph

644 commits

Author SHA1 Message Date
Arun Thomas aaaad89244 Use int64 functions consistently
Instead of manipulating the u64_t type directly, use the
ex64hi()/ex64lo()/make64() functions.
2010-11-07 23:35:29 +00:00
Arun Thomas 40fb96b838 Remove revision IDs from files 2010-11-04 01:13:59 +00:00
Tomas Hruby 40bfed28cd ACPI pci-to-pci bridges
- every pci device which implements _PRT acpi method is considered to
  be a pci-to-pci bridge

- acpi driver constructs a hierarchy of pci-to-pci bridges

- when pci driver identifies a pci-to-pci bridge it tells acpi driver
  what is the primary and the secondary bus for this device

- when pci requests IRQ routing information from acpi, it passes the
  bus number too to be able to identify the device accurately
2010-10-21 17:07:09 +00:00
Tomas Hruby 7fddd8358d PCI driver debug output fix
- bus number (busnr) must be used instead of internal busind
2010-10-19 10:30:15 +00:00
Tomas Hruby 613ff40936 acpi driver Makefile fix
- by Antoine Leca
2010-10-15 22:20:01 +00:00
Erik van der Kouwe 431a5a556d e1000: add 82574L ethernet adapter (thx Niek for your comments) 2010-10-15 08:53:22 +00:00
Tomas Hruby b0572bfd1e No need to scan devices in PIC mode 2010-09-22 08:01:43 +00:00
David van Moolenbroek 6b902492ae memory driver: propagate data copy error to caller 2010-09-09 16:13:02 +00:00
Tomas Hruby e6ebac015d APIC mode uses IO APICs
- kernel turns on IO APICs if no_apic is _not_ set or is equal 0

- pci driver must use the acpi driver to setup IRQ routing otherwise
  the system cannot work correctly except systems like KVM that use
  only legacy (E)ISA IRQs 0-15
2010-09-07 07:18:11 +00:00
Tomas Hruby 99d9144556 PCI driver uses ACPI if APIC is used.
-  PCI must query ACPI, if (IO)APIC is in use, for the routing
   information and change the ILR (interrupt line register) of each
   device accordingly so drivers use the right IRQ.
2010-09-02 15:44:38 +00:00
Tomas Hruby 7ae6f8740d ACPI driver loaded at boot time
- the acpi driver is part of the ramdisk and if present the rc script
  starts it before pci is started as pci needs if APIC mode is turned
  on.
2010-09-02 15:44:36 +00:00
Tomas Hruby 9560b6dea8 ACPI driver
- 99% of the code is Intel's ACPICA. The license is compliant with BSD
  and GNU and virtually all systems that use ACPI use this code, For
  instance it is part of the Linux kernel.

- The only minix specific files are

  acpi.c
  osminixxf.c
  platform/acminix.h

  and

  include/minix/acpi.h

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

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

- because of dependency on a native 64bit (long long, part of c99) it
  is compiled only with a gnu-like compilers which in case of Minix
  includes gcc llvm-gcc and clang
2010-09-02 15:44:04 +00:00
Tomas Hruby 43a4725423 pci_*.h headers moved from drivers/pci to include/machine 2010-09-02 15:43:59 +00:00
Erik van der Kouwe 1f2054c89c Shutdown changes for multiboot: CTRL-ALT-DEL resets, panic halts 2010-08-30 19:01:58 +00:00
David van Moolenbroek 4448836263 ramdisk: more inodes 2010-08-30 17:08:19 +00:00
Erik van der Kouwe a37514163b Touch generated files to avoid dependency generation warnings and missing dependencies 2010-08-29 17:50:51 +00:00
Arun Thomas a78608ec86 Fix dependency problems in the build 2010-08-26 19:54:49 +00:00
Ben Gras 0f4eda33eb new base libaudiodriver out of -lcommon in drivers/audio.
- this lets the drivers that used that library be compiled easily with
   different compilers.
2010-08-25 11:03:53 +00:00
Ben Gras cb86231930 sb16: flatten mixer, common, dsp hierarchy into 2-PROGS dir 2010-08-25 09:57:10 +00:00
Ben Gras 36fa521a0e further ramdisk size increase for gcc+gcov binaries. 2010-08-25 07:26:00 +00:00
Ben Gras 6fb1789ba4 at_wini: fix warning, bogus PRIVATE in struct type declaration 2010-08-24 12:45:37 +00:00
Ben Gras 205855b8ee boot ramdisk slightly bigger for gcc-compiled binaries. 2010-08-20 12:59:55 +00:00
David van Moolenbroek 484b2f43d6 at_wini/ahci: write cache ioctls 2010-08-12 14:09:34 +00:00
David van Moolenbroek 5998a4b2af AHCI driver: miscellaneous changes
- check the DF status flag after each command
- increase I/O timeout from 15 to 30 seconds
- share some code between ATA and ATAPI after all
- produce more accurate errors on DIOCEJECT
- rename AHCI_ID_SIZE to the more appropriate ATA_ID_SIZE
- rearrange ahci.h in a now more sensible way
2010-08-12 14:08:23 +00:00
David van Moolenbroek a7ed430587 ramdisk: actually add ahci to the image, too 2010-08-11 11:30:08 +00:00
David van Moolenbroek 3f6f7672c2 ramdisk: add preliminary support for ahci 2010-08-11 11:16:44 +00:00
David van Moolenbroek 16f2eb25f4 AHCI driver 2010-08-05 16:37:58 +00:00
Thomas Veerman 5bf3967f26 Rename mkfs to mkfs.mfs and fsck to fsck.mfs. Add /sbin to root's PATH. 2010-08-05 12:35:00 +00:00
Erik van der Kouwe b43f3b6bfc This patch copies the ext2 server onto the initial ramdisk, the final
patch to allow MINIX to boot from ext2.

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

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

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

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

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

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

- Add the new MINIX installation to GRUB according to steps 7&8 in
  http://wiki.minix3.org/en/SummerOfCode2010/MultiBoot/HowTo
2010-08-04 05:18:03 +00:00
Dirk Vogt 4523163411 Some PCI config space registers have to be accessed in with there actual
width. Without this patch DDELinux is not able to read the PCI BARs
correctly.
2010-08-03 10:03:40 +00:00
Erik van der Kouwe 0f92964a2f Oops 2010-08-02 14:49:35 +00:00
Erik van der Kouwe c7859a538c Replace newroot with a call to mount, will make type autodetect easier 2010-08-02 14:15:48 +00:00
David van Moolenbroek da597227ac put env_arg[cv] declaration in minix/sysutil.h 2010-07-29 21:16:23 +00:00
Arun Thomas dbde088d98 Replace NULL macro defs with null.h include 2010-07-22 10:03:31 +00:00
David van Moolenbroek 1ecdac623a libsys: add standard condition spinning primitives 2010-07-12 23:14:40 +00:00
Ben Gras ae9fa7fdf6 rtl8169 driver: let it recognize an extra card that works too 2010-07-10 17:04:17 +00:00
David van Moolenbroek 895850b8cf move timers code to libsys 2010-07-09 12:58:18 +00:00
Kees van Reeuwijk 0cfdb11450 Repair errors and warnings flagged by llvm. 2010-07-06 11:29:23 +00:00
Arun Thomas 368f77ceea Fix building of image target 2010-07-06 09:19:04 +00:00
Cristiano Giuffrida 3de6a807ce Configure settings for system services dynamically with the new service edit command. 2010-07-05 19:37:08 +00:00
David van Moolenbroek 4d3c887d6b at_wini: rename 'ata_instance' to 'instance' 2010-07-03 17:51:12 +00:00
Kees van Reeuwijk 630f566d3f Convert a few main() functions to a form that the clang compiler likes. 2010-07-01 22:23:25 +00:00
David van Moolenbroek 71dbe2d023 ramdisk rc: start disk drivers synchronously.
This eliminates a race condition between the disk driver calling
sys_statectl(SYS_STATE_CLEAR_IPC_REFS) as part of driver_announce(),
and the root MFS calling sendrec(DEV_OPEN) on the disk driver.
2010-07-01 14:35:47 +00:00
David van Moolenbroek 06a0260c3c PCI: add AHCI T3 and subclass values 2010-07-01 09:20:36 +00:00
David van Moolenbroek 2488cc6442 PCI: expose BAR sizes 2010-07-01 09:10:16 +00:00
Tomas Hruby b17e3adb60 drivers/ builds in parallel (make -j N) 2010-07-01 07:39:36 +00:00
Erik van der Kouwe 5e602d3dab Put rs.single on initial ramdisk to prevent potential race when readclock terminates early 2010-07-01 06:14:06 +00:00
David van Moolenbroek 9313bc9a6f fix dec21140A driver (reported by zvolkov) 2010-06-29 11:45:32 +00:00
Ben Gras 635a8f772c memory driver: use mmap to pre-allocate ramdisks to avoid overcommit. 2010-06-28 18:12:32 +00:00
Ben Gras dbfb70134c sep. ${.OBJDIR} fixes, contributed by Antoine Leica. 2010-06-27 23:45:30 +00:00
Arun Thomas c0c8d25799 Rename mkfiles from minix.*.mk to bsd.*.mk
Makes things easier for pkgsrc
2010-06-25 18:29:09 +00:00
Tomas Hruby 21725c107d cd subdir && $(MAKE) targets -> $(MAKE) -C subdir targets
- first step towards parallel building
2010-06-22 12:03:09 +00:00
Erik van der Kouwe e2730c3e2f Recognize Intel 82558B, contributed by Sergei Antonov 2010-06-21 17:08:37 +00:00
David van Moolenbroek eeab8e0680 libdriver: make partition code use a contiguous buffer 2010-06-13 10:40:22 +00:00
Arun Thomas 1b2c01db1b Makefile updates:
Turn on optimization
Remove some redundancy in FLAGS
2010-06-11 16:05:36 +00:00
Arun Thomas f0a158d8c1 More cleanup to remove MM and FS references 2010-06-10 14:04:46 +00:00
Arun Thomas 4c10a31440 Remove legacy MM, FS, and FS_PROC_NR macros 2010-06-08 13:58:01 +00:00
Ben Gras 49165ef796 support for ukranian (charse koi8-u) contributed by Roman Ignatov. 2010-06-08 01:04:52 +00:00
Ben Gras 277ff6f2ce e1000: map in 0x1000 of flash if 0x10000 fails. 2010-06-07 16:30:10 +00:00
Ben Gras 035c5a369c move drivers/random SHA implementation to libutil and header to <minix/sha2.h> 2010-06-02 22:58:29 +00:00
Kees van Reeuwijk ed0b81c25c Removed some unused variables and functions. 2010-06-02 19:41:38 +00:00
Arun Thomas ec27911a7f Ramdisk makefile update 2010-06-01 15:11:43 +00:00
Erik van der Kouwe 8bca982581 Remove those annoying $Id and $Revision tags 2010-05-31 20:00:08 +00:00
Erik van der Kouwe 43b589c1cc Avoid use of C++ reserved word class in headers (reported by Aki Goto, tracker item 375) 2010-05-27 08:48:53 +00:00
Arun Thomas b48b037fbe Reorganize some directories
servers/hgfs/hgfs_server => servers/hgfs
servers/hgfs/libhgfs => lib/libhgfs
servers/rs/service => commands/service
drivers/memory/memory_driver => drivers/memory
drivers/memory/ramdisk => drivers/ramdisk
2010-05-26 22:49:57 +00:00
Arun Thomas 007104d60e GCC build fixes/updates
-Set stack sizes for boot image processes
-Increase RS stack size
-Reduce ramdisk size
-HARDWARE task should use kernel stack
-Minor asm tweaks for leading underscores
2010-05-26 18:45:55 +00:00
David van Moolenbroek b16fc7e7bf different rtl8169 shutdown code 2010-05-26 11:22:06 +00:00
Arun Thomas b0159ad168 Buildsystem changes for GCC
-Makefile updates
-Update mkdep
-Build fixes/warning cleanups for some programs
-Restore leading underscores on global syms in kernel asm files
-Increase ramdisk size
2010-05-19 13:24:15 +00:00
Ben Gras 38ece51b25 charset cp1251 contributed by Roman Ignatov. 2010-05-19 11:34:47 +00:00
David van Moolenbroek 9ba65d2ea8 This patch switches the MINIX3 ethernet driver stack from a port-based
model to an instance-based model. Each ethernet driver instance is now
responsible for exactly one network interface card. The port field in
/etc/inet.conf now acts as an instance field instead.

This patch also updates the data link protocol. This update:
- eliminates the concept of ports entirely;
- eliminates DL_GETNAME entirely;
- standardizes on using m_source for IPC and DL_ENDPT for safecopies;
- removes error codes from TASK/STAT replies, as they were unused;
- removes a number of other old or unused fields;
- names and renames a few other fields.

All ethernet drivers have been changed to:
- conform to the new protocol, and exactly that;
- take on an instance number based on a given "instance" argument;
- skip that number of PCI devices in probe iterations;
- use config tables and environment variables based on that number;
- no longer be limited to a predefined maximum of cards in any way;
- get rid of any leftover non-safecopy support and other ancient junk;
- have a correct banner protocol figure, or none at all.

Other changes:
* Inet.conf is now taken to be line-based, and supports #-comments.
  No existing installations are expected to be affected by this.
* A new, select-based asynchio library replaces the old one.
  Kindly contributed by Kees J. Bot.
* Inet now supports use of select() on IP devices.
  Combined, the last two changes together speed up dhcpd
  considerably in the presence of multiple interfaces.
* A small bug has been fixed in nonamed.
2010-05-17 22:22:53 +00:00
Arun Thomas 5706670029 Convert boot/ and commands/ over to bsdmake 2010-05-12 16:28:54 +00:00
David van Moolenbroek 713454aca7 fix multiport support in ethernet drivers 2010-05-10 20:19:55 +00:00
Tomas Hruby 6e25ad8b0a Use of all NIL_* defines converted to NULL 2010-05-10 13:26:00 +00:00
Tomas Hruby ae9222a72b pci synchronous start up
- fixes a race between rs and pci
2010-05-07 16:23:07 +00:00
Ben Gras 09958abda8 tty: don't use custom kputc; this fixes tty printf()s. 2010-05-04 09:26:01 +00:00
Ben Gras 603ed23ebd at_wini: remove unnecessary quirks debug message 2010-04-28 14:19:40 +00:00
Ben Gras b65ebdffac at_wini: more general system to allow devices that behave like ata controllers.
(let silicon image sata controller that is pci class 1, subclass 0x80,
but works as a sata controller, work as such.)
2010-04-28 11:52:28 +00:00
Ben Gras 72e866db48 pci: don't do sanity check for missing pci bus, the check can misfire. 2010-04-28 11:51:13 +00:00
Ben Gras 5d870f020d tty: try more often to get the config byte. 2010-04-28 11:50:54 +00:00
Tomas Hruby 1718924b10 Fixed printf warning in the filter driver 2010-04-26 14:44:20 +00:00
Kees van Reeuwijk e24ed988d6 Fix some compilation errors with the gcc compiler, fix some recent warnings. 2010-04-22 13:59:34 +00:00
Kees van Reeuwijk 86a23c1fbd Remove U16_t and most other similar types. Rewrite functions to ansi-style
declaration if necessary.
2010-04-21 11:05:22 +00:00
Kees van Reeuwijk b412fb7ad5 Code cleanup: remove unused #include, variables and code, 2010-04-15 18:49:36 +00:00
Erik van der Kouwe 7de730afe4 Add scancode reading capability to TTY 2010-04-15 06:55:42 +00:00
Cristiano Giuffrida 65ef539739 Driver mapping refactory.
VFS CHANGES:
- dmap table no longer statically initialized in VFS
- Dropped FSSIGNON svrctl call no longer used by INET

INET CHANGES:
- INET announces its presence to VFS just like any other driver

RS CHANGES:
- The boot image dev table contains all the data to initialize VFS' dmap table
- RS interface supports asynchronous up and update operations now
- RS interface extended to support driver style and flags
2010-04-09 21:56:44 +00:00
Cristiano Giuffrida 48c6bb79f4 Driver refactory for live update and crash recovery.
SYSLIB CHANGES:
- DS calls to publish / retrieve labels consider endpoints instead of u32_t.

VFS CHANGES:
- mapdriver() only adds an entry in the dmap table in VFS.
- dev_up() is only executed upon reception of a driver up event.

INET CHANGES:
- INET no longer searches for existing drivers instances at startup.
- A newtwork driver is (re)initialized upon reception of a driver up event.
- Networking startup is now race-free by design. No need to waste 5 seconds
at startup any more.

DRIVER CHANGES:
- Every driver publishes driver up events when starting for the first time or
in case of restart when recovery actions must be taken in the upper layers.
- Driver up events are published by drivers through DS. 
- For regular drivers, VFS is normally the only subscriber, but not necessarily.
For instance, when the filter driver is in use, it must subscribe to driver
up events to initiate recovery.
- For network drivers, inet is the only subscriber for now.
- Every VFS driver is statically linked with libdriver, every network driver
is statically linked with libnetdriver.

DRIVER LIBRARIES CHANGES:
- Libdriver is extended to provide generic receive() and ds_publish() interfaces
for VFS drivers.
- driver_receive() is a wrapper for sef_receive() also used in driver_task()
to discard spurious messages that were meant to be delivered to a previous
version of the driver.
- driver_receive_mq() is the same as driver_receive() but integrates support
for queued messages.
- driver_announce() publishes a driver up event for VFS drivers and marks
the driver as initialized and expecting a DEV_OPEN message.
- Libnetdriver is introduced to provide similar receive() and ds_publish()
interfaces for network drivers (netdriver_announce() and netdriver_receive()).
- Network drivers all support live update with no state transfer now.

KERNEL CHANGES:
- Added kernel call statectl for state management. Used by driver_announce() to
unblock eventual callers sendrecing to the driver.
2010-04-08 13:41:35 +00:00
Kees van Reeuwijk c114df82ec Rename all uses of U8_t to u8_t and remove U8_t, remove unused I8_t,
Remove all uses of U16_t and U32_t in pci-related code.
If necessary to avoid problems, change functions to ansi-style declaration.
2010-04-07 13:35:56 +00:00
Kees van Reeuwijk 94a81c840a Removed unused variables, added const where possible. 2010-04-07 11:25:51 +00:00
Tomas Hruby c39eb33b74 A fixed prototype in dec21140A.c 2010-04-07 07:50:44 +00:00
Arun Thomas 4ed3a0cf3a Convert kernel over to bsdmake 2010-04-01 22:22:33 +00:00
Kees van Reeuwijk 0a04f49d2b Fixed some incorrect uses of printf-like functions. 2010-04-01 14:30:36 +00:00
Kees van Reeuwijk fc7dced1fa Fix printfs with too few or too many parms, remove unused vars, fix incorrect flag tests, other code cleanup. 2010-04-01 13:25:05 +00:00
Kees van Reeuwijk c3f649557e Lots of const correctness, other cleanup. 2010-04-01 12:51:31 +00:00
Ben Gras de93803ab0 only print 'PCI: ignoring bad value ...' once per boot. 2010-03-31 12:29:30 +00:00
Kees van Reeuwijk 4865e3f4f9 More use of endpoint_t. Other code cleanup. 2010-03-30 14:07:15 +00:00
Kees van Reeuwijk 407316e451 More const correctness.
Removed prototype for unimplemented getpgid() function.
Removed a value return from a void function.
2010-03-23 14:25:09 +00:00
Arun Thomas 436d6012a3 Convert drivers/ and servers/ over to bsdmake
-Move libdriver to lib/
-Install all boot image services on filesystem to aid restartability
2010-03-22 21:25:22 +00:00
Kees van Reeuwijk c33102ea6b Miscellaneous code cleanup. 2010-03-22 20:43:06 +00:00
Cristiano Giuffrida cb176df60f New RS and new signal handling for system processes.
UPDATING INFO:
20100317:
        /usr/src/etc/system.conf updated to ignore default kernel calls: copy
        it (or merge it) to /etc/system.conf.
        The hello driver (/dev/hello) added to the distribution:
        # cd /usr/src/commands/scripts && make clean install
        # cd /dev && MAKEDEV hello

KERNEL CHANGES:
- Generic signal handling support. The kernel no longer assumes PM as a signal
manager for every process. The signal manager of a given process can now be
specified in its privilege slot. When a signal has to be delivered, the kernel
performs the lookup and forwards the signal to the appropriate signal manager.
PM is the default signal manager for user processes, RS is the default signal
manager for system processes. To enable ptrace()ing for system processes, it
is sufficient to change the default signal manager to PM. This will temporarily
disable crash recovery, though.
- sys_exit() is now split into sys_exit() (i.e. exit() for system processes,
which generates a self-termination signal), and sys_clear() (i.e. used by PM
to ask the kernel to clear a process slot when a process exits).
- Added a new kernel call (i.e. sys_update()) to swap two process slots and
implement live update.

PM CHANGES:
- Posix signal handling is no longer allowed for system processes. System
signals are split into two fixed categories: termination and non-termination
signals. When a non-termination signaled is processed, PM transforms the signal
into an IPC message and delivers the message to the system process. When a
termination signal is processed, PM terminates the process.
- PM no longer assumes itself as the signal manager for system processes. It now
makes sure that every system signal goes through the kernel before being
actually processes. The kernel will then dispatch the signal to the appropriate
signal manager which may or may not be PM.

SYSLIB CHANGES:
- Simplified SEF init and LU callbacks.
- Added additional predefined SEF callbacks to debug crash recovery and
live update.
- Fixed a temporary ack in the SEF init protocol. SEF init reply is now
completely synchronous.
- Added SEF signal event type to provide a uniform interface for system
processes to deal with signals. A sef_cb_signal_handler() callback is
available for system processes to handle every received signal. A
sef_cb_signal_manager() callback is used by signal managers to process
system signals on behalf of the kernel.
- Fixed a few bugs with memory mapping and DS.

VM CHANGES:
- Page faults and memory requests coming from the kernel are now implemented
using signals.
- Added a new VM call to swap two process slots and implement live update.
- The call is used by RS at update time and in turn invokes the kernel call
sys_update().

RS CHANGES:
- RS has been reworked with a better functional decomposition.
- Better kernel call masks. com.h now defines the set of very basic kernel calls
every system service is allowed to use. This makes system.conf simpler and
easier to maintain. In addition, this guarantees a higher level of isolation
for system libraries that use one or more kernel calls internally (e.g. printf).
- RS is the default signal manager for system processes. By default, RS
intercepts every signal delivered to every system process. This makes crash
recovery possible before bringing PM and friends in the loop.
- RS now supports fast rollback when something goes wrong while initializing
the new version during a live update.
- Live update is now implemented by keeping the two versions side-by-side and
swapping the process slots when the old version is ready to update.
- Crash recovery is now implemented by keeping the two versions side-by-side
and cleaning up the old version only when the recovery process is complete.

DS CHANGES:
- Fixed a bug when the process doing ds_publish() or ds_delete() is not known
by DS.
- Fixed the completely broken support for strings. String publishing is now
implemented in the system library and simply wraps publishing of memory ranges.
Ideally, we should adopt a similar approach for other data types as well.
- Test suite fixed.

DRIVER CHANGES:
- The hello driver has been added to the Minix distribution to demonstrate basic
live update and crash recovery functionalities.
- Other drivers have been adapted to conform the new SEF interface.
2010-03-17 01:15:29 +00:00
David van Moolenbroek 7685e98304 typo 2010-03-16 16:21:28 +00:00