]> Zhao Yanbai Git Server - minix.git/log
minix.git
14 years agoAlso remove awk.old from makefile.
Kees van Reeuwijk [Thu, 22 Apr 2010 14:18:35 +0000 (14:18 +0000)]
Also remove awk.old from makefile.

14 years agoFix some compilation errors with the gcc compiler, fix some recent warnings.
Kees van Reeuwijk [Thu, 22 Apr 2010 13:59:34 +0000 (13:59 +0000)]
Fix some compilation errors with the gcc compiler, fix some recent warnings.

14 years agoRemove obsolete implementation of awk.
Kees van Reeuwijk [Thu, 22 Apr 2010 13:41:35 +0000 (13:41 +0000)]
Remove obsolete implementation of awk.

14 years agoRemove useless symbol declarations from headers, make symbols local where possible...
Kees van Reeuwijk [Thu, 22 Apr 2010 07:49:40 +0000 (07:49 +0000)]
Remove useless symbol declarations from headers, make symbols local where possible, add some explicit initialization to global variables.

14 years agoMore accurate make rule.
Kees van Reeuwijk [Wed, 21 Apr 2010 14:41:20 +0000 (14:41 +0000)]
More accurate make rule.

14 years agoRemove U16_t and most other similar types. Rewrite functions to ansi-style
Kees van Reeuwijk [Wed, 21 Apr 2010 11:05:22 +0000 (11:05 +0000)]
Remove U16_t and most other similar types. Rewrite functions to ansi-style
declaration if necessary.

14 years agoForgot to add two new files to SVN.
Kees van Reeuwijk [Tue, 20 Apr 2010 07:17:03 +0000 (07:17 +0000)]
Forgot to add two new files to SVN.

14 years agoAdd some support for wchar_t.
Kees van Reeuwijk [Mon, 19 Apr 2010 15:20:24 +0000 (15:20 +0000)]
Add some support for wchar_t.

14 years agoCode cleanup: remove unused #include, variables and code,
Kees van Reeuwijk [Thu, 15 Apr 2010 18:49:36 +0000 (18:49 +0000)]
Code cleanup: remove unused #include, variables and code,

14 years agofix mfs/isofs signal handling
David van Moolenbroek [Thu, 15 Apr 2010 16:10:28 +0000 (16:10 +0000)]
fix mfs/isofs signal handling

14 years agoAdd scancode reading capability to TTY
Erik van der Kouwe [Thu, 15 Apr 2010 07:08:04 +0000 (07:08 +0000)]
Add scancode reading capability to TTY

14 years agoAdd scancode reading capability to TTY
Erik van der Kouwe [Thu, 15 Apr 2010 06:55:42 +0000 (06:55 +0000)]
Add scancode reading capability to TTY

14 years agoAdd scancode reading capability to TTY
Erik van der Kouwe [Thu, 15 Apr 2010 06:55:32 +0000 (06:55 +0000)]
Add scancode reading capability to TTY

14 years agoAdd timerisclear() macro.
Kees van Reeuwijk [Wed, 14 Apr 2010 17:51:39 +0000 (17:51 +0000)]
Add timerisclear() macro.

14 years agounbreak _open for gcc-compiled programs
David van Moolenbroek [Wed, 14 Apr 2010 11:07:49 +0000 (11:07 +0000)]
unbreak _open for gcc-compiled programs

14 years agoProvide information on lethal signals (stacktrace and signo)
Erik van der Kouwe [Wed, 14 Apr 2010 09:06:34 +0000 (09:06 +0000)]
Provide information on lethal signals (stacktrace and signo)

14 years agoRemove some duplicate declarations in headers.
Kees van Reeuwijk [Tue, 13 Apr 2010 15:22:38 +0000 (15:22 +0000)]
Remove some duplicate declarations in headers.
Explicitly declare some functions as returning void.

14 years agovm: util.S not used currently; leave it out.
Ben Gras [Tue, 13 Apr 2010 15:02:32 +0000 (15:02 +0000)]
vm: util.S not used currently; leave it out.

14 years agovm: include no-caching bits in PTF_ALLFLAGS for flags sanity check.
Ben Gras [Tue, 13 Apr 2010 11:08:08 +0000 (11:08 +0000)]
vm: include no-caching bits in PTF_ALLFLAGS for flags sanity check.

14 years agovm: don't force physical addresses to be nonzero.
Ben Gras [Tue, 13 Apr 2010 11:01:40 +0000 (11:01 +0000)]
vm: don't force physical addresses to be nonzero.

14 years agoRemove the types Dev_t, _mnx_Gui, _mnx_Uid, and similar.
Kees van Reeuwijk [Tue, 13 Apr 2010 10:58:41 +0000 (10:58 +0000)]
Remove the types Dev_t, _mnx_Gui, _mnx_Uid, and similar.
Use ANSI-style function declarations where necessary.

14 years agoPM remembers what it should schedule
Tomas Hruby [Tue, 13 Apr 2010 10:45:08 +0000 (10:45 +0000)]
PM remembers what it should schedule

- while PM implements fork also for RS it needs to remember what to
  schedule and what not. PM_SCHEDULED flag serves this purpose.

- PM only schedules processes that are descendaints of init, i.e. normal
  user processes

- after a process is forked PM schedules for the first time only
  processes that have PM_SCHEDULED set. The others are handled iether
  by kernel or some other scheduler

14 years agovm: remove assert, map in of phys addr 0 is legit sometimes.
Ben Gras [Tue, 13 Apr 2010 10:39:46 +0000 (10:39 +0000)]
vm: remove assert, map in of phys addr 0 is legit sometimes.

14 years agoFix date in UPDATING
Erik van der Kouwe [Mon, 12 Apr 2010 17:56:07 +0000 (17:56 +0000)]
Fix date in UPDATING

14 years agovm: use assert() instead of vm_assert(); remove vm_assert().
Ben Gras [Mon, 12 Apr 2010 12:37:28 +0000 (12:37 +0000)]
vm: use assert() instead of vm_assert(); remove vm_assert().

14 years agolet vm use physically fragmented memory for allocations.
Ben Gras [Mon, 12 Apr 2010 11:25:24 +0000 (11:25 +0000)]
let vm use physically fragmented memory for allocations.

map_copy_ph_block is replaced by map_clone_ph_block, which can
replace a single physical block by multiple physical blocks.

also,
 . merge map_mem.c with region.c, as they manipulate the same
   data structures
 . NOTRUNNABLE removed as sanity check
 . use direct functions for ALLOC_MEM and FREE_MEM again
 . add some checks to shared memory mapping code
 . fix for data structure integrity when using shared memory
 . fix sanity checks

14 years agoipc server: don't print as many errors, to make ipc test less noisy.
Ben Gras [Mon, 12 Apr 2010 11:06:15 +0000 (11:06 +0000)]
ipc server: don't print as many errors, to make ipc test less noisy.

14 years agoFixed escape warning.
Cristiano Giuffrida [Mon, 12 Apr 2010 08:39:59 +0000 (08:39 +0000)]
Fixed escape warning.

14 years agoQuantum in fork
Tomas Hruby [Sat, 10 Apr 2010 15:27:38 +0000 (15:27 +0000)]
Quantum in fork

- This patch removes the time slice split between parent and child in
  fork.

- The time slice of the parent remains unchanged and the child does
  not have any.

- If the process has a scheduler, the scheduler must assign the
  quantum and priority of the new process and let it run.

- If the child does not inherit a scheduler, it is scheduled by the
  dummy default kernel policy. (servers, drivers, etc.)

- In theory, the scheduler can change the quantum even of the parent
  process and implement any policy for splitting the quantum as
  neither the parent nor the child are runnable.  Sending the
  out-of_quantum message on behalf of the processes may look like the
  right solution, however, the scheduler would probably handle the
  message before the whole fork protocol is finished. This way the
  scheduler has absolute control when the process should become
  runnable.

14 years agoRestructure and simplyfycation of the scheduling code in PM a little bit.
Tomas Hruby [Sat, 10 Apr 2010 15:24:49 +0000 (15:24 +0000)]
Restructure and simplyfycation of the scheduling code in PM a little bit.

- It introduces schedule_process() which makes a kernel call to set
  the scheduling parameters of a process. It is used in the next patch.

14 years agoThis tiny cleanup makes the naming a variables in createpde() more clear.
Tomas Hruby [Sat, 10 Apr 2010 15:22:41 +0000 (15:22 +0000)]
This tiny cleanup makes the naming a variables in createpde() more clear.

14 years agoA simpler test whether to use kernel's default scheduling
Tomas Hruby [Sat, 10 Apr 2010 15:19:25 +0000 (15:19 +0000)]
A simpler test whether to use kernel's default scheduling

- this is a small addition to the userspace scheduling.
  proc_kernel_scheduler() tests whether to use the default scheduling
  policy in kernel. It is true if the process' scheduler is NULL _or_
  self. Currently none of the tests was complete.

14 years agodo_schedule() cleanup
Tomas Hruby [Sat, 10 Apr 2010 15:17:09 +0000 (15:17 +0000)]
do_schedule() cleanup

- it is not neccessary to test whether the scheduler is a system
  process as the process already head permissions to make this call.

- it is better to test whether the scheduler has permission to make
  changes to this process before testing whether the values are valid.

14 years agoDriver mapping refactory.
Cristiano Giuffrida [Fri, 9 Apr 2010 21:56:44 +0000 (21:56 +0000)]
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

14 years agoport of netbsd's tr
Ben Gras [Thu, 8 Apr 2010 15:08:31 +0000 (15:08 +0000)]
port of netbsd's tr

14 years agonetbsd's original tr/extern.h as tr.h
Ben Gras [Thu, 8 Apr 2010 15:06:43 +0000 (15:06 +0000)]
netbsd's original tr/extern.h as tr.h

14 years agooriginal netbsd's tr(1)
Ben Gras [Thu, 8 Apr 2010 15:04:57 +0000 (15:04 +0000)]
original netbsd's tr(1)

14 years agono minix tr
Ben Gras [Thu, 8 Apr 2010 15:04:05 +0000 (15:04 +0000)]
no minix tr

14 years agoFixed gcc -Wall warnings.
Cristiano Giuffrida [Thu, 8 Apr 2010 15:02:32 +0000 (15:02 +0000)]
Fixed gcc -Wall warnings.

14 years agoisblank() implementation.
Ben Gras [Thu, 8 Apr 2010 15:00:25 +0000 (15:00 +0000)]
isblank() implementation.

14 years agoDriver refactory for live update and crash recovery.
Cristiano Giuffrida [Thu, 8 Apr 2010 13:41:35 +0000 (13:41 +0000)]
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.

14 years agoipc test improvements
Ben Gras [Thu, 8 Apr 2010 13:11:37 +0000 (13:11 +0000)]
ipc test improvements

 . rename testshm.sh to test.sh so all test scripts are called test.sh
 . delete msg* tests as msg* functionality isn't implemented
 . add ipc/test.sh that runs all test.sh scripts in the subdirs

14 years agomore stack for boot
Ben Gras [Thu, 8 Apr 2010 12:18:57 +0000 (12:18 +0000)]
more stack for boot

14 years agoRename all uses of U8_t to u8_t and remove U8_t, remove unused I8_t,
Kees van Reeuwijk [Wed, 7 Apr 2010 13:35:56 +0000 (13:35 +0000)]
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.

14 years agoFixed a panic message
Tomas Hruby [Wed, 7 Apr 2010 12:50:43 +0000 (12:50 +0000)]
Fixed a panic message

- exceptions cannot occur in kernel tasks as we don't have kernel
  tasks anymore

14 years agoRemoved unused variables, added const where possible.
Kees van Reeuwijk [Wed, 7 Apr 2010 11:25:51 +0000 (11:25 +0000)]
Removed unused variables, added const where possible.

14 years agoA fixed prototype in dec21140A.c
Tomas Hruby [Wed, 7 Apr 2010 07:50:44 +0000 (07:50 +0000)]
A fixed prototype in dec21140A.c

14 years agodo_nice.c
Tomas Hruby [Tue, 6 Apr 2010 13:44:03 +0000 (13:44 +0000)]
do_nice.c

- this file is not used and should have been remove in r6557

14 years agoSmall fixes
Tomas Hruby [Tue, 6 Apr 2010 11:29:31 +0000 (11:29 +0000)]
Small fixes

- do_sync_ipc() is private

- fixed typo in a comment

14 years agodo_ipc() rearrangements
Tomas Hruby [Tue, 6 Apr 2010 11:24:26 +0000 (11:24 +0000)]
do_ipc() rearrangements

this patch does not add or change any functionality of do_ipc(), it
only makes things a little cleaner (hopefully).

Until now do_ipc() was responsible for handling all ipc calls. The
catch is that SENDA is fairly different which results in some ugly
code like this typecasting and variables naming which does not make
much sense for SENDA and makes the code hard to read.

result = mini_senda(caller_ptr, (asynmsg_t *)m_ptr, (size_t)src_dst_e);

As it is called directly from assembly, the new do_ipc() takes as
input values of 3 registers in reg_t variables (it used to be 4,
however, bit_map wasn't used so I removed it), does the checks common
to all ipc calls and call the appropriate handler either for
do_sync_ipc() (all except SENDA) or mini_senda() (for SENDA) while
typecasting the reg_t values correctly. As a result, handling SENDA
differences in do_sync_ipc() is no more needed. Also the code that
uses msg_size variable is improved a little bit.

arch_do_syscall() is simplified too.

14 years agoRTS_SYS_LOCK and do_runctl()
Tomas Hruby [Tue, 6 Apr 2010 11:18:04 +0000 (11:18 +0000)]
RTS_SYS_LOCK and do_runctl()

- No need for RTS_SYS_LOCK as there are no tasks anymore.

14 years agodo_vtimer()
Tomas Hruby [Tue, 6 Apr 2010 11:16:14 +0000 (11:16 +0000)]
do_vtimer()

- removed comment which is not true anymore as we don't have any
  tasks. No need to take any special measures.

14 years agoConvert kernel over to bsdmake
Arun Thomas [Thu, 1 Apr 2010 22:22:33 +0000 (22:22 +0000)]
Convert kernel over to bsdmake

14 years agoFixed some incorrect uses of printf-like functions.
Kees van Reeuwijk [Thu, 1 Apr 2010 14:30:36 +0000 (14:30 +0000)]
Fixed some incorrect uses of printf-like functions.

14 years agoFix printfs with too few or too many parms, remove unused vars, fix incorrect flag...
Kees van Reeuwijk [Thu, 1 Apr 2010 13:25:05 +0000 (13:25 +0000)]
Fix printfs with too few or too many parms, remove unused vars, fix incorrect flag tests, other code cleanup.

14 years agoLots of const correctness, other cleanup.
Kees van Reeuwijk [Thu, 1 Apr 2010 12:51:31 +0000 (12:51 +0000)]
Lots of const correctness, other cleanup.

14 years agointroduce the fsckopts sysenv, options passed to fsck by /etc/rc.
Ben Gras [Wed, 31 Mar 2010 15:06:53 +0000 (15:06 +0000)]
introduce the fsckopts sysenv, options passed to fsck by /etc/rc.

setting 'fsckopts=-a' makes it much easier to work on a minix machine
remotely and reboot after a crash.

14 years agoonly print 'PCI: ignoring bad value ...' once per boot.
Ben Gras [Wed, 31 Mar 2010 12:29:30 +0000 (12:29 +0000)]
only print 'PCI: ignoring bad value ...' once per boot.

14 years agoMove kernel signal SIGKNDELAY to system signal SIGSNDELAY and fix broken ptrace.
Cristiano Giuffrida [Wed, 31 Mar 2010 08:55:12 +0000 (08:55 +0000)]
Move kernel signal SIGKNDELAY to system signal SIGSNDELAY and fix broken ptrace.

14 years agoMove allocation of temporary inodes for cloned character special devices from
Thomas Veerman [Tue, 30 Mar 2010 15:00:09 +0000 (15:00 +0000)]
Move allocation of temporary inodes for cloned character special devices from
MFS to PFS.

14 years agoMore use of endpoint_t. Other code cleanup.
Kees van Reeuwijk [Tue, 30 Mar 2010 14:07:15 +0000 (14:07 +0000)]
More use of endpoint_t. Other code cleanup.

14 years agoFixed missing __UNCONST macro definition in previous patch.
Lorenzo Cavallaro [Tue, 30 Mar 2010 13:08:14 +0000 (13:08 +0000)]
Fixed missing __UNCONST macro definition in previous patch.

14 years agocdecl calling convention requires to push arguments on the stack in a
Lorenzo Cavallaro [Tue, 30 Mar 2010 09:36:46 +0000 (09:36 +0000)]
cdecl calling convention requires to push arguments on the stack in a
reverse order to easily support variadic arguments. Thus, instead of
using the proper stdarg.h macros (that nowadays are
compiler-dependent), it may be tempting to directly take the address of
the last argument and considering it as the start of an array. This is
a shortcut that avoid looping to get all the arguments as the CPU
already pushed them on the stack before the call to the function.

Unfortunately, such an assumption is strictly compiler-dependent and
compilers are free to move the last argument on the stack, as a local
variable, and return the address of the location where the argument was
stored, if asked for. This will break things as the rest of the array's
argument are stored elsewhere (typically, a couple of words above the
location where the argument was stored).

This patch fixes the issue by allowing ACK to take the shortcut and
enabling gcc/llvm-gcc to follow the right way.

14 years agoFixed brackets in bitmap macros
Tomas Hruby [Tue, 30 Mar 2010 08:34:33 +0000 (08:34 +0000)]
Fixed brackets in bitmap macros

14 years agodon't print SYSTEM stacktrace on exceptions as it's not scheduled any more.
Ben Gras [Mon, 29 Mar 2010 15:32:19 +0000 (15:32 +0000)]
don't print SYSTEM stacktrace on exceptions as it's not scheduled any more.

14 years agoNOREC_ENTER and NOREC_RETURN checks removed
Tomas Hruby [Mon, 29 Mar 2010 11:43:10 +0000 (11:43 +0000)]
NOREC_ENTER and NOREC_RETURN checks removed

- the reasons for these checks no longer exist

- these check are problematic on SMP

14 years agofix null deref; vmnt->mounted_on is NULL legitimately for root.
Ben Gras [Mon, 29 Mar 2010 11:39:54 +0000 (11:39 +0000)]
fix null deref; vmnt->mounted_on is NULL legitimately for root.

changed check+panic to assert().

added assert().

14 years agoA reliable way for userspace to check if a msg is from kernel
Tomas Hruby [Mon, 29 Mar 2010 11:25:01 +0000 (11:25 +0000)]
A reliable way for userspace to check if a msg is from kernel

- IPC_FLG_MSG_FROM_KERNEL status flag is returned to userspace if the
  receive was satisfied by s message which was sent by the kernel on
  behalf of a process. This perfectly reliale information.

- MF_SENDING_FROM_KERNEL flag added to processes to be able to set
  IPC_FLG_MSG_FROM_KERNEL when finishing receive if the receiver
  wasn't ready to receive immediately.

- PM is changed to use this information to confirm that the scheduling
  messages are indeed from the kernel and not faked by a process.

  PM uses sef_receive_status()

- get_work() is removed from PM to make the changes simpler

14 years agoSlightly faster IPC
Tomas Hruby [Mon, 29 Mar 2010 11:16:37 +0000 (11:16 +0000)]
Slightly faster IPC

- there are cycles wasted in the IPC call due to a fairly compliacted
  way of copying messages from userland to kernel. Sometimes this
  complicated way (generic though) is used even for copying within the
  kernel address space, sometimes it is used for copying in case _no_
  copying is necessary. The goal of this patch is to improve this a
  little bit.

- the places where a copy is from user to kernel use the
  copy_msg_from_user() kernel-kernel copies are turned into
  assignments and BuildNotifyMessage uses the delivery buffers to
  avoid copying.

- copy_msg_from_user() was introduced when removing the system task
  and is about 2/3 faster then using the current mechanism
  (phys_copy). It also avoids the PHYS_COPY_CATCH macro. Assignment is
  also faster and no copy is the fastest ;-) so perhaps there will be
  some hardly noticable performance gain besides the clean up.

14 years agoUserspace scheduling
Tomas Hruby [Mon, 29 Mar 2010 11:07:20 +0000 (11:07 +0000)]
Userspace scheduling

- cotributed by Bjorn Swift

- In this first phase, scheduling is moved from the kernel to the PM
  server. The next steps are to a) moving scheduling to its own server
  and b) include useful information in the "out of quantum" message,
  so that the scheduler can make use of this information.

- The kernel process table now keeps record of who is responsible for
  scheduling each process (p_scheduler). When this pointer is NULL,
  the process will be scheduled by the kernel. If such a process runs
  out of quantum, the kernel will simply renew its quantum an requeue
  it.

- When PM loads, it will take over scheduling of all running
  processes, except system processes, using sys_schedctl().
  Essentially, this only results in taking over init. As children
  inherit a scheduler from their parent, user space programs forked by
  init will inherit PM (for now) as their scheduler.

 - Once a process has been assigned a scheduler, and runs out of
   quantum, its RTS_NO_QUANTUM flag will be set and the process
   dequeued. The kernel will send a message to the scheduler, on the
   process' behalf, informing the scheduler that it has run out of
   quantum. The scheduler can take what ever action it pleases, based
   on its policy, and then reschedule the process using the
   sys_schedule() system call.

- Balance queues does not work as before. While the old in-kernel
  function used to renew the quantum of processes in the highest
  priority run queue, the user-space implementation only acts on
  processes that have been bumped down to a lower priority queue.
  This approach reacts slower to changes than the old one, but saves
  us sending a sys_schedule message for each process every time we
  balance the queues. Currently, when processes are moved up a
  priority queue, their quantum is also renewed, but this can be
  fiddled with.

- do_nice has been removed from kernel. PM answers to get- and
  setpriority calls, updates it's own nice variable as well as the
  max_run_queue. This will be refactored once scheduling is moved to a
  separate server. We will probably have PM update it's local nice
  value and then send a message to whoever is scheduling the process.

- changes to fix an issue in do_fork() where processes could run out
  of quantum but bypassing the code path that handles it correctly.
  The future plan is to remove the policy from do_fork() and implement
  it in userspace too.

14 years agoRemoved NIL_SYS_PROC and NIL_PROC
Tomas Hruby [Sun, 28 Mar 2010 09:54:32 +0000 (09:54 +0000)]
Removed NIL_SYS_PROC and NIL_PROC

- NIL_PROC replaced by simple NULLs

14 years agoLots of const correctness.
Kees van Reeuwijk [Sat, 27 Mar 2010 14:31:00 +0000 (14:31 +0000)]
Lots of const correctness.

14 years agoPreserve the order of IPC messages between two parties.
Cristiano Giuffrida [Sat, 27 Mar 2010 00:09:22 +0000 (00:09 +0000)]
Preserve the order of IPC messages between two parties.

Currently a sequence of messages between a sender A and a receiver B of the
form: A.asynsend(M1, B); A.send(M2, B) may result in the receiver receiving
M1 first and then M2 or viceversa. This patch makes sure that the original
order M1, M2 is always preserved.

Note that the order of a hypotetical sequence A.asynsend(M1, B);
A.asynsend(M2, B) is already guaranteed by the implementation of
asynsend by design. Other senda-based wrappers can define their own
semantics.

14 years agoComment in proc.h
Tomas Hruby [Fri, 26 Mar 2010 13:19:04 +0000 (13:19 +0000)]
Comment in proc.h

- This comment is not correct as the pproc_addr array does not exist.

14 years agoDirection flag
Tomas Hruby [Fri, 26 Mar 2010 12:29:52 +0000 (12:29 +0000)]
Direction flag

- ack assumes that the direction flag in eflags is clear when
  assigning two structures. It is implemented by a call to a built-in
  function which is like memcpy but needs the flag to be clear
  otherwise rubish is copied. This patch fixes the kernel entries.

14 years agocdecl calling convention expects the callee to pop the hidden pointer on
Lorenzo Cavallaro [Wed, 24 Mar 2010 17:25:17 +0000 (17:25 +0000)]
cdecl calling convention expects the callee to pop the hidden pointer on
struct return. For example, GCC and LLVM comply with this (tested on IA32).

ACK doesn't seem to follow this convention and expects the caller to clean up
the stack. Compiling hand-written ACK-compliant assembly code (returning a
struct) with GCC or LLVM used to break things (4-bytes misaligned stack).

The patch fixes this problem.

14 years agoMinor docs/UPDATING fix
Arun Thomas [Wed, 24 Mar 2010 13:41:38 +0000 (13:41 +0000)]
Minor docs/UPDATING fix

14 years agoSort docs/UPDATING entries reverse chronologically
Arun Thomas [Wed, 24 Mar 2010 10:13:19 +0000 (10:13 +0000)]
Sort docs/UPDATING entries reverse chronologically

14 years agoFix crtso building with GCC
Arun Thomas [Wed, 24 Mar 2010 10:11:17 +0000 (10:11 +0000)]
Fix crtso building with GCC

14 years agoMore const correctness.
Kees van Reeuwijk [Tue, 23 Mar 2010 14:25:09 +0000 (14:25 +0000)]
More const correctness.
Removed prototype for unimplemented getpgid() function.
Removed a value return from a void function.

14 years agoFixed prototype in cat
Tomas Hruby [Tue, 23 Mar 2010 13:36:16 +0000 (13:36 +0000)]
Fixed prototype in cat

14 years agoInterrupts hadling while idle
Tomas Hruby [Tue, 23 Mar 2010 13:35:01 +0000 (13:35 +0000)]
Interrupts hadling while idle

- When the cpu halts, the interrupts are enable so the cpu may be
  woken up. When the interrupt handler returns but another interrupt
  is available it is also serviced immediately. This is not a problem
  per-se. It only slightly breaks time accounting as idle accounted is
  for the kernel time in the interrupt handler.

-  As the big kernel lock is lock/unlocked in the smp branch in the
   time acounting functions as they are called exactly at the places
   we need to take the lock) this leads to a deadlock.

- we make sure that once the interrupt handler returns from the nested
  trap, the interrupts are disabled. This means that only one
  interrupt is serviced after idle is interrupted.

- this requires the loop in apic timer calibration to keep reenabling
  the interrupts. I admit it is a little bit hackish (one line),
  however, this code is a stupid corner case at the boot time.
  Hopefully it does not matter too much.

14 years agoIPC status code for receive().
Cristiano Giuffrida [Tue, 23 Mar 2010 00:09:11 +0000 (00:09 +0000)]
IPC status code for receive().

IPC changes:
- receive() is changed to take an additional parameter, which is a pointer to
a status code.
- The status code is filled in by the kernel to provide additional information
to the caller. For now, the kernel only fills in the IPC call used by the
sender.

Syslib changes:
- sef_receive() has been split into sef_receive() (with the original semantics)
and sef_receive_status() which exposes the status code to userland.
- Ideally, every sys process should gradually switch to sef_receive_status()
and use is_ipc_notify() as a dependable way to check for notify.
- SEF has been modified to use is_ipc_notify() and demonstrate how to use the
new status code.

14 years agoPrioritized NOTIFY messages for reliable asynchonrous delivery of system events.
Cristiano Giuffrida [Mon, 22 Mar 2010 23:44:55 +0000 (23:44 +0000)]
Prioritized NOTIFY messages for reliable asynchonrous delivery of system events.

14 years agoPrint stacktrace when a system service fails or when a core dump has to be generated...
Cristiano Giuffrida [Mon, 22 Mar 2010 22:46:29 +0000 (22:46 +0000)]
Print stacktrace when a system service fails or when a core dump has to be generated for a user process.

14 years agoConvert drivers/ and servers/ over to bsdmake
Arun Thomas [Mon, 22 Mar 2010 21:25:22 +0000 (21:25 +0000)]
Convert drivers/ and servers/ over to bsdmake

-Move libdriver to lib/
-Install all boot image services on filesystem to aid restartability

14 years agoMiscellaneous code cleanup.
Kees van Reeuwijk [Mon, 22 Mar 2010 20:43:06 +0000 (20:43 +0000)]
Miscellaneous code cleanup.

14 years agoonly print 1 every 1000 spurious interrupts (per interrupt).
Ben Gras [Mon, 22 Mar 2010 13:55:51 +0000 (13:55 +0000)]
only print 1 every 1000 spurious interrupts (per interrupt).

14 years agoatomicity fix when enabling paging
Tomas Hruby [Mon, 22 Mar 2010 07:42:52 +0000 (07:42 +0000)]
atomicity fix when enabling paging

- before enabling paging VM asks kernel to resize its segments. This
  may cause kernel to segfault if APIC is used and an interrupt
  happens between this and paging enabled. As these are 2 separate
  vmctl calls it is not atomic. This patch fixes this problem. VM does
  not ask kernel to resize the segments in a separate call anymore.
  The new segments limit is part of the "enable paging" call. It
  generalizes this call in such a way that more information can be
  passed as need be or the information may be completely different if
  another architecture requires this.

14 years agoKernel dumps its registers when exception
Tomas Hruby [Sat, 20 Mar 2010 14:59:18 +0000 (14:59 +0000)]
Kernel dumps its registers when exception

- if an exception occurs in kernel and this exception is not handled
  in an sane way and the kernel crashes, it also dumps what was loaded
  in the general purpose registers exactly at the time of the
  exception to help to debug the problem

14 years agothis patch adds access to the debug breakpoints to
Erik van der Kouwe [Fri, 19 Mar 2010 19:15:20 +0000 (19:15 +0000)]
this patch adds access to the debug breakpoints to
the kernel. They are not used atm, but having them in trunk allows them
to be easily used when needed. To set a breakpoint that triggers when
the variable foo is written to (the most common use case), one calls:

breakpoint_set(vir2phys((vir_bytes) &foo), 0,
  BREAKPOINT_FLAG_MODE_GLOBAL |
  BREAKPOINT_FLAG_RW_WRITE |
  BREAKPOINT_FLAG_LEN_4);

It can later be disabled using:

breakpoint_set(vir2phys((vir_bytes) &foo), 0,
  BREAKPOINT_FLAG_MODE_OFF);

There are some limitations:

- There are at most four breakpoints (hardware limit); the index of the
  breakpoint (0-3) is specified as the second parameter of
  breakpoint_set.

- The breakpoint exception in the kernel is not handled and causes a
  panic; it would be reasonably easy to change this by inspecing DR6,
  printing a message, disabling the breakpoint and continuing. However,
  in my experience even just a panic can be very useful.

- Breakpoints can be set only in the part of the address space that is
  in every page table. It is useful for the kernel, but to use this for
  user processes would require saving and restoring the debug registers
  as part of the context switch. Although the CPU provides support for
  local breakpoints (I implemened this as BREAKPOINT_FLAG_LOCAL) they
  only work if task switching is used.

14 years agoSpecify missing return type
Erik van der Kouwe [Fri, 19 Mar 2010 19:07:00 +0000 (19:07 +0000)]
Specify missing return type

14 years agoVM: fix kernel mappings for children of non-paged parents.
Ben Gras [Thu, 18 Mar 2010 17:17:31 +0000 (17:17 +0000)]
VM: fix kernel mappings for children of non-paged parents.

14 years agodocs/UPDATING correction
Tomas Hruby [Thu, 18 Mar 2010 17:00:32 +0000 (17:00 +0000)]
docs/UPDATING correction

14 years agoFixed kernel stack comment
Tomas Hruby [Thu, 18 Mar 2010 16:18:22 +0000 (16:18 +0000)]
Fixed kernel stack comment

14 years agoremove 3 awk files - don't have generated files in svn.
Ben Gras [Thu, 18 Mar 2010 14:15:48 +0000 (14:15 +0000)]
remove 3 awk files - don't have generated files in svn.

14 years agochange messy CREATEPDE macro to clean little function.
Ben Gras [Thu, 18 Mar 2010 13:35:41 +0000 (13:35 +0000)]
change messy CREATEPDE macro to clean little function.

forget about the dirtypde bitmap and WIPEPDE/DONEPDE macros too.

check if mapping happens to already be in place, and if so, don't
reload cr3 (on the account of that mapping, that is).

don't reload cr3 unconditionally.

14 years agoProvide a warning is a kernel call has been denied, to ease system.conf debugging
Erik van der Kouwe [Wed, 17 Mar 2010 18:23:51 +0000 (18:23 +0000)]
Provide a warning is a kernel call has been denied, to ease system.conf debugging

14 years agoLet awk.old install its awk as /usr/bin/awk.old.
Kees van Reeuwijk [Wed, 17 Mar 2010 16:16:52 +0000 (16:16 +0000)]
Let awk.old install its awk as /usr/bin/awk.old.
Add one-true-awk as the new awk that installs to /usr/bin/awk.

14 years agoMoved current awk sources to awk.old.
Kees van Reeuwijk [Wed, 17 Mar 2010 16:11:48 +0000 (16:11 +0000)]
Moved current awk sources to awk.old.