]> Zhao Yanbai Git Server - minix.git/log
minix.git
14 years agoanother warning regression fix
David van Moolenbroek [Tue, 22 Dec 2009 00:05:09 +0000 (00:05 +0000)]
another warning regression fix

14 years agono! no new warnings
David van Moolenbroek [Mon, 21 Dec 2009 23:39:08 +0000 (23:39 +0000)]
no! no new warnings

14 years agoFilter driver updates:
David van Moolenbroek [Mon, 21 Dec 2009 23:30:01 +0000 (23:30 +0000)]
Filter driver updates:
- optionally vectorize I/O requests to work around hardware bugs
- extend default buffer size to cover MFS's default maximum request size
- use mmap directly, rather than alloc_contig
- add 'nil' checksum type for comparison with layout
- minor style corrections

14 years agoTTY fixes:
David van Moolenbroek [Mon, 21 Dec 2009 23:19:01 +0000 (23:19 +0000)]
TTY fixes:
- reenable code to restore screen/cursor at shutdown
- add proper signal checking logic
- lock to first console during shutdown

14 years agoBasic System Event Framework (SEF) with ping and live update.
Cristiano Giuffrida [Mon, 21 Dec 2009 14:12:21 +0000 (14:12 +0000)]
Basic System Event Framework (SEF) with ping and live update.

SYSLIB CHANGES:
- SEF must be used by every system process and is thereby part of the system
library.
- The framework provides a receive() interface (sef_receive) for system
processes to automatically catch known system even messages and process them.
- SEF provides a default behavior for each type of system event, but allows
system processes to register callbacks to override the default behavior.
- Custom (local to the process) or predefined (provided by SEF) callback
implementations can be registered to SEF.
- SEF currently includes support for 2 types of system events:
  1. SEF Ping. The event occurs every time RS sends a ping to figure out
  whether a system process is still alive. The default callback implementation
  provided by SEF is to notify RS back to let it know the process is alive
  and kicking.
  2. SEF Live update. The event occurs every time RS sends a prepare to update
  message to let a system process know an update is available and to prepare
  for it. The live update support is very basic for now. SEF only deals with
  verifying if the prepare state can be supported by the process, dumping the
  state for debugging purposes, and providing an event-driven programming
  model to the process to react to state changes check-in when ready to update.
- SEF should be extended in the future to integrate support for more types of
system events. Ideally, all the cross-cutting concerns should be integrated into
SEF to avoid duplicating code and ease extensibility. Examples include:
  * PM notify messages primarily used at shutdown.
  * SYSTEM notify messages primarily used for signals.
  * CLOCK notify messages used for system alarms.
  * Debug messages. IS could still be in charge of fkey handling but would
  forward the debug message to the target process (e.g. PM, if the user
  requested debug information about PM). SEF would then catch the message and
  do nothing unless the process has registered an appropriate callback to
  deal with the event. This simplifies the programming model to print debug
  information, avoids duplicating code, and reduces the effort to print
  debug information.

SYSTEM PROCESSES CHANGES:
- Every system process registers SEF callbacks it needs to override the default
system behavior and calls sef_startup() right after being started.
- sef_startup() does almost nothing now, but will be extended in the future to
support callbacks of its own to let RS control and synchronize with every
system process at initialization time.
- Every system process calls sef_receive() now rather than receive() directly,
to let SEF handle predefined system events.

RS CHANGES:
- RS supports a basic single-component live update protocol now, as follows:
  * When an update command is issued (via "service update *"), RS notifies the
  target system process to prepare for a specific update state.
  * If the process doesn't respond back in time, the update is aborted.
  * When the process responds back, RS kills it and marks it for refreshing.
  * The process is then automatically restarted as for a buggy process and can
  start running again.
  * Live update is currently prototyped as a controlled failure.

14 years agoFix typo
Thomas Veerman [Mon, 21 Dec 2009 13:59:04 +0000 (13:59 +0000)]
Fix typo

14 years agoSupport for larger disks.
David van Moolenbroek [Mon, 21 Dec 2009 11:20:30 +0000 (11:20 +0000)]
Support for larger disks.
- MFS, df(1), fsck(1), badblocks(8), de(1x) now compute the
  superblock's s_firstdatazone value if the on-disk value is zero
- mkfs(1) sets s_firstdatazone in the superblock to zero if the
  on-disk field is too small to store the actual value
- more agressive mkfs(1) inode number heuristic, copied from r5261

14 years agoFix typo and a bug causing vnode references to become too low.
Thomas Veerman [Mon, 21 Dec 2009 09:36:34 +0000 (09:36 +0000)]
Fix typo and a bug causing vnode references to become too low.

14 years agoFix compilation errors caused by more files not added in previous commit
Thomas Veerman [Sun, 20 Dec 2009 21:31:03 +0000 (21:31 +0000)]
Fix compilation errors caused by more files not added in previous commit

14 years agoAdd PFS (missing in previous commit)
Thomas Veerman [Sun, 20 Dec 2009 20:41:50 +0000 (20:41 +0000)]
Add PFS (missing in previous commit)

14 years ago- Introduce support for sticky bit.
Thomas Veerman [Sun, 20 Dec 2009 20:27:14 +0000 (20:27 +0000)]
- Introduce support for sticky bit.
- Revise VFS-FS protocol and update VFS/MFS/ISOFS accordingly.
- Clean up MFS by removing old, dead code (backwards compatibility is broken by
  the new VFS-FS protocol, anyway) and rewrite other parts. Also, make sure all
  functions have proper banners and prototypes.
- VFS should always provide a (syntactically) valid path to the FS; no need for
  the FS to do sanity checks when leaving/entering mount points.
- Fix several bugs in MFS:
  - Several path lookup bugs in MFS.
  - A link can be too big for the path buffer.
  - A mountpoint can become inaccessible when the creation of a new inode
    fails, because the inode already exists and is a mountpoint.
- Introduce support for supplemental groups.
- Add test 46 to test supplemental group functionality (and removed obsolete
  suppl. tests from test 2).
- Clean up VFS (not everything is done yet).
- ISOFS now opens device read-only. This makes the -r flag in the mount command
  unnecessary (but will still report to be mounted read-write).
- Introduce PipeFS. PipeFS is a new FS that handles all anonymous and
  named pipes. However, named pipes still reside on the (M)FS, as they are part
  of the file system on disk. To make this work VFS now has a concept of
  'mapped' inodes, which causes read, write, truncate and stat requests to be
  redirected to the mapped FS, and all other requests to the original FS.

14 years agoRemove some GCC library warnings
Erik van der Kouwe [Thu, 17 Dec 2009 08:43:31 +0000 (08:43 +0000)]
Remove some GCC library warnings

14 years agoDrivers and servers are simply known as services.
Cristiano Giuffrida [Thu, 17 Dec 2009 01:53:26 +0000 (01:53 +0000)]
Drivers and servers are simply known as services.

/etc CHANGES:
- /etc/drivers.conf has been renamed to /etc/system.conf. Every entry in
the file is now marked as "service" rather than driver.
- user "service" has been added to password file /etc/passwd.
- docs/UPDATING updated accordingly, as well as every other mention to the old
drivers.conf in the system.

RS CHANGES:
- No more distinction between servers and drivers.
- RS_START has been renamed to RS_UP and the old legacy RS_UP and RS_UP_COPY
dropped.
- RS asks PCI to set / remove ACL entries only for services whose ACL properties
have been set. This change eliminates unnecessary warnings.
- Temporarily minimize the risk of potential races at boot time or when starting
a new service. Upcoming changes will eliminate races completely.
- General cleanup.

14 years agoFix bug in IPC deadlock detection code.
Cristiano Giuffrida [Wed, 16 Dec 2009 23:32:08 +0000 (23:32 +0000)]
Fix bug in IPC deadlock detection code.

The old deadlock code was misplaced and unable to deal with asynchronous
IPC primitives (notify and senda) effectively. As an example, the following
sequence of messages allowed the deadlock detection code to
trigger a false positive:
1. A.notify(B)
2. A.receive(B)
3. B.receive(A)
1. B.notify(A)
The solution is to run the deadlock detection routine only when a process is
about to block in mini_send() or mini_receive().

14 years agotypo
David van Moolenbroek [Wed, 16 Dec 2009 12:17:02 +0000 (12:17 +0000)]
typo

14 years agofix remaining warnings in 'make world'
David van Moolenbroek [Mon, 14 Dec 2009 20:25:52 +0000 (20:25 +0000)]
fix remaining warnings in 'make world'

14 years agoawk: check presence of parameters
David van Moolenbroek [Mon, 14 Dec 2009 20:24:33 +0000 (20:24 +0000)]
awk: check presence of parameters

14 years agotest42: disable attach-to-PM test
David van Moolenbroek [Sun, 13 Dec 2009 21:45:23 +0000 (21:45 +0000)]
test42: disable attach-to-PM test

14 years agoRewrite of boot process
Cristiano Giuffrida [Fri, 11 Dec 2009 00:08:19 +0000 (00:08 +0000)]
Rewrite of boot process

KERNEL CHANGES:
- The kernel only knows about privileges of kernel tasks and the root system
process (now RS).
- Kernel tasks and the root system process are the only processes that are made
schedulable by the kernel at startup. All the other processes in the boot image
don't get their privileges set at startup and are inhibited from running by the
RTS_NO_PRIV flag.
- Removed the assumption on the ordering of processes in the boot image table.
System processes can now appear in any order in the boot image table.
- Privilege ids can now be assigned both statically or dynamically. The kernel
assigns static privilege ids to kernel tasks and the root system process. Each
id is directly derived from the process number.
- User processes now all share the static privilege id of the root user
process (now INIT).
- sys_privctl split: we have more calls now to let RS set privileges for system
processes. SYS_PRIV_ALLOW / SYS_PRIV_DISALLOW are only used to flip the
RTS_NO_PRIV flag and allow / disallow a process from running. SYS_PRIV_SET_SYS /
SYS_PRIV_SET_USER are used to set privileges for a system / user process.
- boot image table flags split: PROC_FULLVM is the only flag that has been
moved out of the privilege flags and is still maintained in the boot image
table. All the other privilege flags are out of the kernel now.

RS CHANGES:
- RS is the only user-space process who gets to run right after in-kernel
startup.
- RS uses the boot image table from the kernel and three additional boot image
info table (priv table, sys table, dev table) to complete the initialization
of the system.
- RS checks that the entries in the priv table match the entries in the boot
image table to make sure that every process in the boot image gets schedulable.
- RS only uses static privilege ids to set privileges for system services in
the boot image.
- RS includes basic memory management support to allocate the boot image buffer
dynamically during initialization. The buffer shall contain the executable
image of all the system services we would like to restart after a crash.
- First step towards decoupling between resource provisioning and resource
requirements in RS: RS must know what resources it needs to restart a process
and what resources it has currently available. This is useful to tradeoff
reliability and resource consumption. When required resources are missing, the
process cannot be restarted. In that case, in the future, a system flag will
tell RS what to do. For example, if CORE_PROC is set, RS should trigger a
system-wide panic because the system can no longer function correctly without
a core system process.

PM CHANGES:
- The process tree built at initialization time is changed to have INIT as root
with pid 0, RS child of INIT and all the system services children of RS. This
is required to make RS in control of all the system services.
- PM no longer registers labels for system services in the boot image. This is
now part of RS's initialization process.

14 years agoAdjust number of tests
Erik van der Kouwe [Wed, 9 Dec 2009 19:30:39 +0000 (19:30 +0000)]
Adjust number of tests

14 years agoImplementation of strto(u)ll, documentation and tests for strto(u)l(l)
Erik van der Kouwe [Wed, 9 Dec 2009 19:01:38 +0000 (19:01 +0000)]
Implementation of strto(u)ll, documentation and tests for strto(u)l(l)

14 years agoAdd Ben's test 44
Erik van der Kouwe [Wed, 9 Dec 2009 13:42:33 +0000 (13:42 +0000)]
Add Ben's test 44

14 years agoUse subdirectory t43 for tests
Erik van der Kouwe [Wed, 9 Dec 2009 07:59:08 +0000 (07:59 +0000)]
Use subdirectory t43 for tests

14 years agoRemoved non-existant test 44 from Makefile
Erik van der Kouwe [Wed, 9 Dec 2009 07:52:17 +0000 (07:52 +0000)]
Removed non-existant test 44 from Makefile

14 years agoMake VM fix up memory for kernel that crosses region boundaries
Ben Gras [Tue, 8 Dec 2009 13:35:52 +0000 (13:35 +0000)]
Make VM fix up memory for kernel that crosses region boundaries
too.

Add a test to make this happen (triggers a vm panic before this commit).

14 years agoImplementation of getrlimit and getdtablesize
Erik van der Kouwe [Mon, 7 Dec 2009 19:56:40 +0000 (19:56 +0000)]
Implementation of getrlimit and getdtablesize

14 years agoIntel Pro/1000 driver written by Niek Linnenbank.
Ben Gras [Mon, 7 Dec 2009 18:33:41 +0000 (18:33 +0000)]
Intel Pro/1000 driver written by Niek Linnenbank.

14 years ago - map in as much memory as is necessary in 4MB chunks to
Ben Gras [Mon, 7 Dec 2009 12:10:44 +0000 (12:10 +0000)]
 - map in as much memory as is necessary in 4MB chunks to
   let boot processes run with segments
 - allow segment-only processes to fork() by copying them
   and giving them an identity page table

14 years agoCooments to warn not to use certains instructions
Tomas Hruby [Mon, 7 Dec 2009 12:01:05 +0000 (12:01 +0000)]
Cooments to warn not to use certains instructions

- gas2ack cannot handle all variants of some instructions. Until this issues is
  addressed, this patch places a big warning where appropriate. This code is not
  supposed to change frequently.

14 years agoGive test 43 root privileges to prevent errors when run as non-root
Erik van der Kouwe [Fri, 4 Dec 2009 18:58:57 +0000 (18:58 +0000)]
Give test 43 root privileges to prevent errors when run as non-root

14 years agoFixed tests to use the right path when run as root
Erik van der Kouwe [Fri, 4 Dec 2009 17:51:06 +0000 (17:51 +0000)]
Fixed tests to use the right path when run as root

14 years agoFix line which was too long
Erik van der Kouwe [Fri, 4 Dec 2009 17:49:20 +0000 (17:49 +0000)]
Fix line which was too long

14 years agoAdd realpath function
Erik van der Kouwe [Fri, 4 Dec 2009 07:52:22 +0000 (07:52 +0000)]
Add realpath function

14 years agoCleanup getsockopt and add SO_TYPE
Erik van der Kouwe [Fri, 4 Dec 2009 07:26:56 +0000 (07:26 +0000)]
Cleanup getsockopt and add SO_TYPE

14 years agoA debug print with no meaning removed from VM.
Tomas Hruby [Thu, 3 Dec 2009 10:53:56 +0000 (10:53 +0000)]
A debug print with no meaning removed from VM.

14 years agoFPU: fix field names, compiler warning, long lines
David van Moolenbroek [Wed, 2 Dec 2009 23:12:46 +0000 (23:12 +0000)]
FPU: fix field names, compiler warning, long lines

14 years agoPart of the FPU changes; forgot to add these files in FPU commit.
Ben Gras [Wed, 2 Dec 2009 16:35:05 +0000 (16:35 +0000)]
Part of the FPU changes; forgot to add these files in FPU commit.

14 years agortl8169 driver contributed by Jaswinder Singh Rajput.
Ben Gras [Wed, 2 Dec 2009 15:59:42 +0000 (15:59 +0000)]
rtl8169 driver contributed by Jaswinder Singh Rajput.

14 years agoprevious commit premature and not part of FPU changes.
Ben Gras [Wed, 2 Dec 2009 15:53:20 +0000 (15:53 +0000)]
previous commit premature and not part of FPU changes.

14 years agoSpecify types for integer MAX constants
Erik van der Kouwe [Wed, 2 Dec 2009 15:35:09 +0000 (15:35 +0000)]
Specify types for integer MAX constants

14 years agoany blocksize.
Ben Gras [Wed, 2 Dec 2009 15:33:14 +0000 (15:33 +0000)]
any blocksize.

14 years agoFPU context switching support by Evgeniy Ivanov.
Ben Gras [Wed, 2 Dec 2009 13:01:48 +0000 (13:01 +0000)]
FPU context switching support by Evgeniy Ivanov.

14 years agoAdd 'getidle' CPU utilization measurement infrastructure
David van Moolenbroek [Wed, 2 Dec 2009 11:52:26 +0000 (11:52 +0000)]
Add 'getidle' CPU utilization measurement infrastructure

14 years agoFilter driver by Wu Bingzheng et al
David van Moolenbroek [Wed, 2 Dec 2009 10:08:58 +0000 (10:08 +0000)]
Filter driver by Wu Bingzheng et al

14 years agoAllow servers to run with fewer privileges:
David van Moolenbroek [Wed, 2 Dec 2009 10:06:58 +0000 (10:06 +0000)]
Allow servers to run with fewer privileges:
- allow non-root processes to get their own endpoint
- make alloc_contig() call sys_umap() only when requested

14 years agolibdriver changes:
David van Moolenbroek [Wed, 2 Dec 2009 09:57:48 +0000 (09:57 +0000)]
libdriver changes:
- remove obsolete non-safecopy support
- merge libdriver and libdriver_asyn
- change standard reply model from sendnb to senda

14 years agoRS changes:
David van Moolenbroek [Wed, 2 Dec 2009 09:54:50 +0000 (09:54 +0000)]
RS changes:
- add new "control" config directive, to let drivers restart drivers
  (by Jorrit Herder)
- fix bug causing system processes to be started twice sometimes

14 years agofix for race condition - IRQ can happen between clearing the endpoint
Ben Gras [Tue, 1 Dec 2009 16:46:27 +0000 (16:46 +0000)]
fix for race condition - IRQ can happen between clearing the endpoint
of the handling process and before removing the hook. The handler function
will panic then.

14 years agoAlternative VirtualBox/Lance driver workaround
David van Moolenbroek [Sat, 28 Nov 2009 13:28:55 +0000 (13:28 +0000)]
Alternative VirtualBox/Lance driver workaround

14 years agoRS fixes:
David van Moolenbroek [Sat, 28 Nov 2009 13:23:45 +0000 (13:23 +0000)]
RS fixes:
- fix resource leak (PCI ACLs) when child fails right after exec
- fix resource leak (memory) when child exec fails at all
- fix race condition setting VM call privileges for new child
- make dev_execve() return a proper result, and check this result
- remove RS_EXECFAILED, as it should behave exactly like RS_EXITING
- add more clarifying comments about starting servers

14 years agoPM: remove 'boottime' global variable
David van Moolenbroek [Sat, 28 Nov 2009 13:22:01 +0000 (13:22 +0000)]
PM: remove 'boottime' global variable

14 years agofix _NSIG usage
David van Moolenbroek [Sat, 28 Nov 2009 13:20:50 +0000 (13:20 +0000)]
fix _NSIG usage

14 years agoPortability: POSIXize some of inet's error codes
David van Moolenbroek [Sat, 28 Nov 2009 13:18:33 +0000 (13:18 +0000)]
Portability: POSIXize some of inet's error codes

14 years agoKernel: unbreak load averages
David van Moolenbroek [Sat, 28 Nov 2009 13:16:03 +0000 (13:16 +0000)]
Kernel: unbreak load averages

14 years agoKernel: fix faulty trap check
David van Moolenbroek [Sat, 28 Nov 2009 13:15:07 +0000 (13:15 +0000)]
Kernel: fix faulty trap check

14 years agoPortability: include sys/select.h from sys/time.h
David van Moolenbroek [Sun, 22 Nov 2009 20:11:06 +0000 (20:11 +0000)]
Portability: include sys/select.h from sys/time.h

14 years agoVM: don't send arbitrary status values to kernel
David van Moolenbroek [Sun, 22 Nov 2009 13:06:18 +0000 (13:06 +0000)]
VM: don't send arbitrary status values to kernel

14 years agoSupport for read/write on connected UDP sockets
David van Moolenbroek [Thu, 19 Nov 2009 23:45:46 +0000 (23:45 +0000)]
Support for read/write on connected UDP sockets

14 years agoRemove dead mini_ds_retrieve_u32 code
David van Moolenbroek [Tue, 17 Nov 2009 14:10:09 +0000 (14:10 +0000)]
Remove dead mini_ds_retrieve_u32 code

14 years agoPatch by Jaswinder Singh Rajput to fix FTP progress display
Erik van der Kouwe [Tue, 17 Nov 2009 08:41:43 +0000 (08:41 +0000)]
Patch by Jaswinder Singh Rajput to fix FTP progress display

14 years agoLocal APIC
Tomas Hruby [Mon, 16 Nov 2009 21:41:44 +0000 (21:41 +0000)]
Local APIC

- local APIC timer used as the source of time

- PIC is still used as the hw interrupt controller as we don't have
  enough info without ACPI or MPS to set up IO APICs

- remapping of APIC when switching paging on, uses the new mechanism
  to tell VM what phys areas to map in kernel's virtual space

- one more step to SMP

based on code by Arun C.

14 years agoNew instructions in gas2ack
Tomas Hruby [Mon, 16 Nov 2009 21:32:48 +0000 (21:32 +0000)]
New instructions in gas2ack

pause
mfence
rdtsc
rdpmc

14 years agougly double blank line, my fault
David van Moolenbroek [Mon, 16 Nov 2009 18:22:28 +0000 (18:22 +0000)]
ugly double blank line, my fault

14 years ago.align replaced by .balign in mpx386.S
Tomas Hruby [Fri, 13 Nov 2009 09:30:45 +0000 (09:30 +0000)]
.align replaced by .balign in mpx386.S

14 years agogas2ack does not understand .align
Tomas Hruby [Fri, 13 Nov 2009 09:29:37 +0000 (09:29 +0000)]
gas2ack does not understand .align

- as .align is target dependent we for usage of .balign for byte alignment

14 years agogas2ack support for rdmsr and wrmsr
Tomas Hruby [Thu, 12 Nov 2009 16:19:01 +0000 (16:19 +0000)]
gas2ack support for rdmsr and wrmsr

14 years agoNo need for a special idle queue
Tomas Hruby [Thu, 12 Nov 2009 08:47:25 +0000 (08:47 +0000)]
No need for a special idle queue

- as the idle task is never placed on any run queue, we don't need any special
  idle queue.

- one more queue available for user processes

14 years agoIdle task never runs
Tomas Hruby [Thu, 12 Nov 2009 08:42:18 +0000 (08:42 +0000)]
Idle task never runs

- idle task becomes a pseudo task which is never scheduled. It is never put on
  any run queue and never enters userspace. An entry for this task still remains
  in the process table for time accounting

- Instead of panicing if there is not process to schedule, pick_proc() returns
  NULL which is a signal to put the cpu in an idle state and set everything in
  such a way that after receiving and interrupt it looks like idle task was
  preempted

- idle task is set non-preemptible to avoid handling in the timer interrupt code
  which make userspace scheduling simpler as idle task does not need to be
  handled as a special case.

14 years agoUse of isemptyp() macro instead of testing RTS_SLOT_FREE flag
Tomas Hruby [Thu, 12 Nov 2009 08:35:26 +0000 (08:35 +0000)]
Use of isemptyp() macro instead of testing RTS_SLOT_FREE flag

- some code used to test if only this flag is set, some if also this flag is
  set. This change unifies the test

14 years agoThe rest of the r5641 commit
Tomas Hruby [Wed, 11 Nov 2009 17:02:45 +0000 (17:02 +0000)]
The rest of the r5641 commit

14 years agoenable printing of 64-bit ints with gcc.
Tomas Hruby [Wed, 11 Nov 2009 12:15:08 +0000 (12:15 +0000)]
enable printing of 64-bit ints with gcc.

14 years agoallow kernel to tell VM extra physical addresses it wants mapped in.
Tomas Hruby [Wed, 11 Nov 2009 12:07:06 +0000 (12:07 +0000)]
allow kernel to tell VM extra physical addresses it wants mapped in.
used in the future for mapping in local APIC memory.

14 years agokernel/proc.h can be included in kernel assembky files
Tomas Hruby [Tue, 10 Nov 2009 09:14:50 +0000 (09:14 +0000)]
kernel/proc.h can be included in kernel assembky files

- the gnu .S are compiled with __ASSEMBLY__ macro set which allows us to
  conditionaly remove C stuff from the proc.h file when included in assembly
  files

14 years agoAll macros defining rts flags are prefixed with RTS_
Tomas Hruby [Tue, 10 Nov 2009 09:11:13 +0000 (09:11 +0000)]
All macros defining rts flags are prefixed with RTS_

- macros used with RTS_SET group of macros to define struct proc p_rts_flags are
  now prefixed with RTS_ to make things clear

14 years agopick_proc() called only just before returning to userspace
Tomas Hruby [Mon, 9 Nov 2009 17:48:31 +0000 (17:48 +0000)]
pick_proc() called only just before returning to userspace

- new proc_is_runnable() macro to test whether process is runnable. All tests
  whether p_rts_flags == 0 converted to use this macro

- pick_proc() calls removed from enqueue() and dequeue()

- removed the test for recursive calls from pick_proc() as it certainly cannot
  be called recursively now

- PREEMPTED flag to mark processes that were preempted by enqueueuing a higher
  priority process in enqueue()

- enqueue_head() to enqueue PREEMPTED processes again at the head of their
  current priority queue

- NO_QUANTUM flag to block and dequeue processes preempted by timer tick with
  exceeded quantum. They need to be enqueued again in schedcheck()

- next_ptr global variable removed

14 years agopci: extend NR_DRIVERS to cover all system processes
David van Moolenbroek [Mon, 9 Nov 2009 10:43:46 +0000 (10:43 +0000)]
pci: extend NR_DRIVERS to cover all system processes

14 years agoRemoval of the executable flag from files that cannot be executed
Tomas Hruby [Mon, 9 Nov 2009 10:26:00 +0000 (10:26 +0000)]
Removal of the executable flag from files that cannot be executed

- 755 -> 644

14 years agoactivate new ptrace test, too
David van Moolenbroek [Mon, 9 Nov 2009 09:26:09 +0000 (09:26 +0000)]
activate new ptrace test, too

14 years agoFix ptrace bug when reattaching to a detached process
David van Moolenbroek [Mon, 9 Nov 2009 08:12:25 +0000 (08:12 +0000)]
Fix ptrace bug when reattaching to a detached process

14 years agoComplete ovehaul of mode switching code
Tomas Hruby [Fri, 6 Nov 2009 09:08:26 +0000 (09:08 +0000)]
Complete ovehaul of mode switching code

- after a trap to kernel, the code automatically switches to kernel
  stack, in the future local to the CPU

- k_reenter variable replaced by a test whether the CS is kernel cs or
  not. The information is passed further if needed. Removes a global
  variable which would need to be cpu local

- no need for global variables describing the exception or trap
  context. This information is kept on stack and a pointer to this
  structure is passed to the C code as a single structure

- removed loadedcr3 variable and its use replaced by reading the %cr3
  register

- no need to redisable interrupts in restart() as they are already
  disabled.

- unified handling of traps that push and don't push errorcode

- removed save() function as the process context is not saved directly
  to process table but saved as required by the trap code. Essentially
  it means that save() code is inlined everywhere not only in the
  exception handling routine

- returning from syscall is more arch independent - it sets the retger
  in C

- top of the x86 stack contains the current CPU id and pointer to the
  currently scheduled process (the one right interrupted) so the mode
  switch code can find where to save the context without need to use
  proc_ptr which will be cpu local in the future and therefore
  difficult to access in assembler and expensive to access in general

- some more clean up of level0 code. No need to read-back the argument
  passed in
  %eax from the proc structure. The mode switch code does not clobber
  %the general registers and hence we can just call what is in %eax

- many assebly macros in sconst.h as they will be reused by the apic
  assembly

14 years agoClock task split
Tomas Hruby [Fri, 6 Nov 2009 09:04:15 +0000 (09:04 +0000)]
Clock task split

- preemption handled in the clock timer interrupt handler, not in the clock task

- more achitecture independent clock timer handling code

- smp ready as each CPU can have its own timer

14 years agoFix for broken parsing of memory environment string in pci driver
Tomas Hruby [Fri, 6 Nov 2009 08:58:05 +0000 (08:58 +0000)]
Fix for broken parsing of memory environment string in pci driver

- unfixed parsing could run away from the the string and fail on a correct
  string in complete_bars()

- it reanables the body of complete_bars()

14 years agoinodes - using types with known size
Tomas Hruby [Fri, 6 Nov 2009 08:55:07 +0000 (08:55 +0000)]
inodes - using types with known size

- fixes a problem in inodes truct definitions. The original definitions use
  posix types. These types don't have well defined size. Therefore when
  compiling mkfs on a different system natively the inodes sizes do not match.
  This patch replaces the posix types with interger types of the same size and
  signedness as the original types in use.

14 years agoChanges to the include files in order to make cross-compilation possible.
Tomas Hruby [Fri, 6 Nov 2009 08:46:22 +0000 (08:46 +0000)]
Changes to the include files in order to make cross-compilation possible.

- The primary reason is that mkfs and installboot need to run natively during
  the cross compilation (host and target versions are compiled). There is a
  collision of include files though. E.g. a.out.h is very minix-specific.
  Therefore some files we moved and replaced by stubs that include the original
  file if compiling on or for Minix :

  include/a.out.h -> include/minix/a.out.h
  include/sys/dir.h -> include/minix/dir.h
  include/dirent.h -> include/minix/dirent.h
  include/sys/types.h -> include/minix/types.h

- This does not break any native compilation on Minix. Other headers that were
  including the original files are changed according to include directly the
  new, minix specific location not to pick up the host system includes while
  cross-compiling.

- role of this patch is to make rebasing of the build branch simpler until the
  new build system is merged

14 years agovmassert reports also the source file in which it was triggered
Tomas Hruby [Wed, 4 Nov 2009 15:30:08 +0000 (15:30 +0000)]
vmassert reports also the source file in which it was triggered

14 years agoHardware interrupts code path cleanup
Tomas Hruby [Wed, 4 Nov 2009 13:24:56 +0000 (13:24 +0000)]
Hardware interrupts code path cleanup

- the PIC master and slave irq handlers don't pass the irq hook pointer but just
  the irq number. It gives a little bit more information to the C handler as the
  irq number is not lost

- the irq code path is more achitecture independent. i386 hw interrupts are
  called irq and whereever the code is arch independent enough hw_intr_
  functions are called to mask/unmask interrupts

- the legacy PIC is not the only possible interrupt controller in the x86 world,
  therefore the intr_(un)mask functions were renamed to signal their
  functionality explicitly. APIC will add their own.

- masking and unmasking PIC interrupt lines is removed from assembler and all
  the functionality is rewriten in C and moved to i8259.c

- interrupt handlers have to unmask the interrupt line if all irq handlers are
  done. Assembler does not do it anymore

14 years ago - enable remembering of device memory ranges set by PCI and
Ben Gras [Tue, 3 Nov 2009 11:12:23 +0000 (11:12 +0000)]
  - enable remembering of device memory ranges set by PCI and
    told to kernel
  - makes VM ask the kernel if a certain process is allowed
    to map in a range of physical memory (VM rounds it to page
    boundaries afterwards - but it's impossible to map anything
    smaller otherwise so I assume this is safe, i.e. there won't
    be anything else in that page; certainly no regular memory)
  - VM permission check cleanup (no more hardcoded calls, less
    hardcoded logic, more readable main loop), a loose end left
    by GQ
  - remove do_copy warning, as the ipc server triggers this but
    it's no more harmful than the special cases already excluded
    explicitly (VFS, PM, etc).

14 years agoVarious small IS, TTY, isofs fixes
David van Moolenbroek [Mon, 2 Nov 2009 23:04:52 +0000 (23:04 +0000)]
Various small IS, TTY, isofs fixes

IS:
- do not use p_getfrom_e for a process that is sending
- register with TTY only function keys that are used
- various header and formatting fixes
- proper shutdown code

TTY:
- restore proper Ctrl+F1 dump contents

isofs:
- don't even try to call sys_exit()

14 years agoKernel: add support for indirect grants
David van Moolenbroek [Mon, 2 Nov 2009 22:30:37 +0000 (22:30 +0000)]
Kernel: add support for indirect grants

14 years agoash: only execute regular files
David van Moolenbroek [Sun, 1 Nov 2009 22:25:54 +0000 (22:25 +0000)]
ash: only execute regular files

14 years agoKernel, servers: remove unused proto.h definitions
David van Moolenbroek [Sat, 31 Oct 2009 14:11:50 +0000 (14:11 +0000)]
Kernel, servers: remove unused proto.h definitions

14 years agoPM: clean up endpoint info API/ABI
David van Moolenbroek [Sat, 31 Oct 2009 14:09:28 +0000 (14:09 +0000)]
PM: clean up endpoint info API/ABI

14 years agoConversion of kernel assembly from ACK to GNU
Tomas Hruby [Fri, 30 Oct 2009 16:00:44 +0000 (16:00 +0000)]
Conversion of kernel assembly from ACK to GNU

- .s files removed and replaced by .S as the .S is a standard extension for assembly that needs preprocessing

14 years ago gas2ack
Tomas Hruby [Fri, 30 Oct 2009 15:57:35 +0000 (15:57 +0000)]
gas2ack

    - an asmconv based tool for conversion from GNU ia32 assembly to ACK assembly

    - in contrast to asmconv it is a one way tool only

    - as the GNU assembly in Minix does not prefix global C symbols with _ gas2ack
      detects such symbols and prefixes them to be compliant with the ACK convention

    - gas2ack preserves comments and unexpanded macros

    - bunch of fixes to the asmconv GNU->ACK direction

    - support of more instructions that ACK does not know but are in use in Minix

    - it is meant as a temporary solution as long as ACK will be a supported
      compiler for the core system

14 years agoPM, VFS: remove unused param.h definitions
David van Moolenbroek [Thu, 29 Oct 2009 13:29:04 +0000 (13:29 +0000)]
PM, VFS: remove unused param.h definitions

14 years agoPM: remove unused core_name variable
David van Moolenbroek [Thu, 29 Oct 2009 12:07:53 +0000 (12:07 +0000)]
PM: remove unused core_name variable

14 years agoDS: do not panic when sending reply fails
David van Moolenbroek [Tue, 27 Oct 2009 17:06:45 +0000 (17:06 +0000)]
DS: do not panic when sending reply fails

14 years agoCreate man pages for bigsh and dev2name
Erik van der Kouwe [Tue, 27 Oct 2009 15:34:22 +0000 (15:34 +0000)]
Create man pages for bigsh and dev2name

14 years agoGround work for larger file systems, and miscellaneous fixes:
David van Moolenbroek [Mon, 26 Oct 2009 13:35:39 +0000 (13:35 +0000)]
Ground work for larger file systems, and miscellaneous fixes:
- MFS and mkfs(1) now perform extra sanity checks
- fsck(1) can now deal with inode tables extending beyond the file
  system's first 4GB
- badblocks(8) no longer writes out the superblock for no reason
- mkfs(1) no longer crashes when given no parameters
- more(1) no longer crashes when standard output is redirected

14 years agoDon't check DMA_ST_ERROR before DMA_ST_INT is set (which is done too)
Ben Gras [Thu, 22 Oct 2009 14:31:29 +0000 (14:31 +0000)]
Don't check DMA_ST_ERROR before DMA_ST_INT is set (which is done too)