]> Zhao Yanbai Git Server - minix.git/log
minix.git
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.

14 years agoAdd a define for NSIG.
Kees van Reeuwijk [Wed, 17 Mar 2010 13:43:34 +0000 (13:43 +0000)]
Add a define for NSIG.

14 years agoNew RS and new signal handling for system processes.
Cristiano Giuffrida [Wed, 17 Mar 2010 01:15:29 +0000 (01:15 +0000)]
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.

14 years agotypo
David van Moolenbroek [Tue, 16 Mar 2010 16:21:28 +0000 (16:21 +0000)]
typo

14 years agoFixed a bug in interrupt handling code when removing a handler in case of
Cristiano Giuffrida [Tue, 16 Mar 2010 10:20:36 +0000 (10:20 +0000)]
Fixed a bug in interrupt handling code when removing a handler in case of
a shared IRQ.

14 years agoMinor correction in UPDATING
Erik van der Kouwe [Tue, 16 Mar 2010 08:16:13 +0000 (08:16 +0000)]
Minor correction in UPDATING

14 years agoConvert man/ over to new make
Arun Thomas [Tue, 16 Mar 2010 00:15:43 +0000 (00:15 +0000)]
Convert man/ over to new make

14 years agoSuppressed some warnings in the WIFSIGNALED macro.
Kees van Reeuwijk [Mon, 15 Mar 2010 18:33:29 +0000 (18:33 +0000)]
Suppressed some warnings in the WIFSIGNALED macro.

14 years agoFix bug item #405: missing # in front of comment
Thomas Veerman [Mon, 15 Mar 2010 10:42:51 +0000 (10:42 +0000)]
Fix bug item #405: missing # in front of comment

14 years ago- Add support for the ucontext system calls (getcontext, setcontext,
Thomas Veerman [Fri, 12 Mar 2010 15:58:41 +0000 (15:58 +0000)]
- Add support for the ucontext system calls (getcontext, setcontext,
  swapcontext, and makecontext).
- Fix VM to not erroneously think the stack segment and data segment have
  collided when a user-space thread invokes brk().
- Add test51 to test ucontext functionality.
- Add man pages for ucontext system calls.

14 years agoLet the commands/simple/tr.c understand about '\t', '\r', and '\n'.
Kees van Reeuwijk [Fri, 12 Mar 2010 09:58:44 +0000 (09:58 +0000)]
Let the commands/simple/tr.c understand about '\t', '\r', and '\n'.

14 years agoAdd an UNUSED annotation, and use it in libsys.
Kees van Reeuwijk [Thu, 11 Mar 2010 14:23:33 +0000 (14:23 +0000)]
Add an UNUSED annotation, and use it in libsys.

14 years agoWork around KVM unreal mode bug by avoiding unreal mode
Erik van der Kouwe [Wed, 10 Mar 2010 15:32:31 +0000 (15:32 +0000)]
Work around KVM unreal mode bug by avoiding unreal mode

14 years agoClean up code in preparation for using gcc warnings.
Kees van Reeuwijk [Wed, 10 Mar 2010 13:19:27 +0000 (13:19 +0000)]
Clean up code in preparation for using gcc warnings.

14 years agore-establish kernel assert()s.
Ben Gras [Wed, 10 Mar 2010 13:00:05 +0000 (13:00 +0000)]
re-establish kernel assert()s.

use the regular <assert.h> assert() instead of vmassert() in
kernel. throw out some #if 0 code. fix a few assert() conditions.
enable by default.

14 years agoAdd prototypes for a bunch of time-related functions. Surprisingly,
Kees van Reeuwijk [Tue, 9 Mar 2010 22:10:58 +0000 (22:10 +0000)]
Add prototypes for a bunch of time-related functions. Surprisingly,
they were in the implementation, but not in the header files.

14 years agoAdd a set of declarations to math.h. Since we don't actually have
Kees van Reeuwijk [Tue, 9 Mar 2010 22:05:20 +0000 (22:05 +0000)]
Add a set of declarations to math.h. Since we don't actually have
implementations for these functions, we lean on GNU builtin functions
for using them, so these declarations are also conditional on using
a GNU compiler.

14 years agofix newsigset/oldsigset references
Dirk Vogt [Tue, 9 Mar 2010 20:46:26 +0000 (20:46 +0000)]
fix newsigset/oldsigset references

14 years agoPrevent the use of an unitialized variable for block size in CRC calculation.
Kees van Reeuwijk [Tue, 9 Mar 2010 16:21:41 +0000 (16:21 +0000)]
Prevent the use of an unitialized variable for block size in CRC calculation.

14 years agoFlex: Fix install(1) invocation in build
Arun Thomas [Tue, 9 Mar 2010 09:43:53 +0000 (09:43 +0000)]
Flex: Fix install(1) invocation in build

14 years agoMove archtypes.h, fpu.h, and stackframe.h
Arun Thomas [Tue, 9 Mar 2010 09:41:14 +0000 (09:41 +0000)]
Move archtypes.h, fpu.h, and stackframe.h

Move archtypes.h to include/ dir, since several servers require it. Move
fpu.h and stackframe.h to arch-specific header directory. Make source
files and makefiles aware of the new header locations.

14 years agoVFS fixes:
David van Moolenbroek [Mon, 8 Mar 2010 22:05:27 +0000 (22:05 +0000)]
VFS fixes:
- do not use uninitialized req_breadwrite results upon failure
- improve ".." ELEAVEMOUNT correctness check

14 years agoAlso run fixincludes in gcc 4.4.3
Kees van Reeuwijk [Mon, 8 Mar 2010 14:51:00 +0000 (14:51 +0000)]
Also run fixincludes in gcc 4.4.3

14 years agofix for wrong arg to va_end() in panic() (thanks tveerman)
Ben Gras [Mon, 8 Mar 2010 14:36:55 +0000 (14:36 +0000)]
fix for wrong arg to va_end() in panic() (thanks tveerman)

14 years agoInclude directory reorg and makefile updates.
Arun Thomas [Mon, 8 Mar 2010 11:04:59 +0000 (11:04 +0000)]
Include directory reorg and makefile updates.

-Convert the include directory over to using bsdmake
 syntax
-Update/add mkfiles
-Modify install(1) so that it can create symlinks
-Update makefiles to use new install(1) options
-Rename /usr/include/ibm to /usr/include/i386
-Create /usr/include/machine symlink to arch header files
-Move vm_i386.h to its new home in the /usr/include/i386
-Update source files to #include the header files at their
 new homes.
-Add new gnu-includes target for building GCC headers

14 years agoFix for FPU broken by r6131
Tomas Hruby [Fri, 5 Mar 2010 22:23:03 +0000 (22:23 +0000)]
Fix for FPU broken by r6131

- cycles accounting must be called earlier, firstly not to clobber the %ebx
  register, secondly to be correctly called in both branches.

14 years agopanic() cleanup.
Ben Gras [Fri, 5 Mar 2010 15:05:11 +0000 (15:05 +0000)]
panic() cleanup.

this change
   - makes panic() variadic, doing full printf() formatting -
     no more NO_NUM, and no more separate printf() statements
     needed to print extra info (or something in hex) before panicing
   - unifies panic() - same panic() name and usage for everyone -
     vm, kernel and rest have different names/syntax currently
     in order to implement their own luxuries, but no longer
   - throws out the 1st argument, to make source less noisy.
     the panic() in syslib retrieves the server name from the kernel
     so it should be clear enough who is panicing; e.g.
         panic("sigaction failed: %d", errno);
     looks like:
         at_wini(73130): panic: sigaction failed: 0
         syslib:panic.c: stacktrace: 0x74dc 0x2025 0x100a
   - throws out report() - printf() is more convenient and powerful
   - harmonizes/fixes the use of panic() - there were a few places
     that used printf-style formatting (didn't work) and newlines
     (messes up the formatting) in panic()
   - throws out a few per-server panic() functions
   - cleans up a tie-in of tty with panic()

merging printf() and panic() statements to be done incrementally.

14 years agoMove cp_grant_id_t to a more central header file, and uses it more
Kees van Reeuwijk [Thu, 4 Mar 2010 16:15:26 +0000 (16:15 +0000)]
Move cp_grant_id_t to a more central header file, and uses it more
extensively.
Fix casts that cast the grand id field of some messages to the wrong
type.

14 years agoNo more E{SRC,DST}DIED errno's, replaced by EDEADSRCDST.
Ben Gras [Wed, 3 Mar 2010 15:47:16 +0000 (15:47 +0000)]
No more E{SRC,DST}DIED errno's, replaced by EDEADSRCDST.

The callers don't care about the difference and had to check 3 error
codes instead of one.

14 years agotop manpage update
Ben Gras [Wed, 3 Mar 2010 15:46:20 +0000 (15:46 +0000)]
top manpage update

14 years agonew feature for top - display chain of blocked processes for every
Ben Gras [Wed, 3 Mar 2010 15:45:43 +0000 (15:45 +0000)]
new feature for top - display chain of blocked processes for every
blocked process.

14 years agono more kprintf - kernel uses libsys printf now, only kputc is special
Ben Gras [Wed, 3 Mar 2010 15:45:01 +0000 (15:45 +0000)]
no more kprintf - kernel uses libsys printf now, only kputc is special
to the kernel.

14 years agoNew P_BLOCKEDON for kernel - a macro that encodes the "who is this
Ben Gras [Wed, 3 Mar 2010 15:32:26 +0000 (15:32 +0000)]
New P_BLOCKEDON for kernel - a macro that encodes the "who is this
process waiting for" logic, which is duplicated a few times in the
kernel. (For a new feature for top.)

Introducing it and throwing out ESRCDIED and EDSTDIED (replaced by
EDEADSRCDST - so we don't have to care which part of the blocking is
failing in system.c) simplifies some code in the kernel and callers that
check for E{DEADSRCDST,ESRCDIED,EDSTDIED}, but don't care about the
difference, a fair bit, and more significantly doesn't duplicate the
'blocked-on' logic.

14 years agoConvert library asm files to GAS syntax
Arun Thomas [Wed, 3 Mar 2010 14:27:30 +0000 (14:27 +0000)]
Convert library asm files to GAS syntax

14 years agoMore correctly use cp_grant_id_t.
Kees van Reeuwijk [Tue, 2 Mar 2010 23:12:13 +0000 (23:12 +0000)]
More correctly use cp_grant_id_t.
More correctly use vir_bytes.
More correctly use endpoint_t.

14 years agoFixed a number of cases where a bits in an integer were tested
Kees van Reeuwijk [Tue, 2 Mar 2010 12:55:39 +0000 (12:55 +0000)]
Fixed a number of cases where a bits in an integer were tested
incorrectly, resulting in real (and nasty) bugs.

14 years agoTypo in VM server
Tomas Hruby [Tue, 2 Mar 2010 10:53:17 +0000 (10:53 +0000)]
Typo in VM server

14 years agoslight tuning of /etc/mk situation when making release.
Ben Gras [Mon, 1 Mar 2010 15:53:57 +0000 (15:53 +0000)]
slight tuning of /etc/mk situation when making release.

  - Make the bootstrap /etc/mk be populated from the newly checked out source
  - Don't chmod 755 all of /etc
  - For the 'real' /etc/mk installing, let the /etc/mk ownership and permission
    come from the mtree file, delete the contents of /etc/mk, then copy the .mk
    files over and set reasonable permissions and ownership. (So that the .mk
    get updated from the real usr/src/ copies, and no other junk if anything,
    after the bootstrap phase, whatever happened there.)

14 years ago#include <minix/ipc.h> in <minix/sef.h>
Erik van der Kouwe [Fri, 26 Feb 2010 10:13:50 +0000 (10:13 +0000)]
#include <minix/ipc.h> in <minix/sef.h>

14 years ago#include <minix/ipc.h> in <minix/sef.h>
Erik van der Kouwe [Fri, 26 Feb 2010 10:12:54 +0000 (10:12 +0000)]
#include <minix/ipc.h> in <minix/sef.h>

14 years agoCopy mkfiles when building world
Arun Thomas [Thu, 25 Feb 2010 22:10:48 +0000 (22:10 +0000)]
Copy mkfiles when building world

14 years ago - new pread(), fnmatch() calls
Ben Gras [Thu, 25 Feb 2010 17:08:08 +0000 (17:08 +0000)]
 - new pread(), fnmatch() calls
 - split sprintf() and snprintf() to solve a linking problem when
   compiling an application

14 years agoReplace Minix tar with pax's tar
Arun Thomas [Wed, 24 Feb 2010 11:58:10 +0000 (11:58 +0000)]
Replace Minix tar with pax's tar

14 years agoImprove makefile logic for building programs/libs
Arun Thomas [Wed, 24 Feb 2010 11:58:05 +0000 (11:58 +0000)]
Improve makefile logic for building programs/libs

14 years agoFixed an array bounds violation.
Kees van Reeuwijk [Wed, 24 Feb 2010 10:39:58 +0000 (10:39 +0000)]
Fixed an array bounds violation.
Let include guards comform to the Minix standard.

14 years agoFix an array-bound violation, add some include guards.
Kees van Reeuwijk [Mon, 22 Feb 2010 17:44:08 +0000 (17:44 +0000)]
Fix an array-bound violation, add some include guards.

14 years agoremove subdirs that aren't built.
Ben Gras [Fri, 19 Feb 2010 16:31:43 +0000 (16:31 +0000)]
remove subdirs that aren't built.

ftp is superseded by other dirs, i86 is not used, httpd* is superseded
by packages, sed is superseded by simple/sed.c.

14 years agoadd swifi to the build/install.
Ben Gras [Fri, 19 Feb 2010 16:16:28 +0000 (16:16 +0000)]
add swifi to the build/install.

14 years agofix some warning in swifi, make it installable
Ben Gras [Fri, 19 Feb 2010 16:15:25 +0000 (16:15 +0000)]
fix some warning in swifi, make it installable

14 years agoFlag to load kernel high (not yet used by default), improved debug output
Erik van der Kouwe [Fri, 19 Feb 2010 12:38:38 +0000 (12:38 +0000)]
Flag to load kernel high (not yet used by default), improved debug output

14 years agoRemove executable bit on mkdep.1
Erik van der Kouwe [Fri, 19 Feb 2010 12:32:01 +0000 (12:32 +0000)]
Remove executable bit on mkdep.1

14 years agoFix some uses of uninitialized variables.
Kees van Reeuwijk [Fri, 19 Feb 2010 10:41:02 +0000 (10:41 +0000)]
Fix some uses of uninitialized variables.

14 years agoRemove useless variables and the computations on them.
Kees van Reeuwijk [Fri, 19 Feb 2010 10:00:32 +0000 (10:00 +0000)]
Remove useless variables and the computations on them.

14 years agoLots of cleanup of boot code.
Kees van Reeuwijk [Wed, 17 Feb 2010 20:30:29 +0000 (20:30 +0000)]
Lots of cleanup of boot code.

14 years agoRemove some unused #include.
Kees van Reeuwijk [Wed, 17 Feb 2010 20:24:42 +0000 (20:24 +0000)]
Remove some unused #include.
Remove some unused variables and computations on them.

14 years agoBump version number to 3.1.7
Arun Thomas [Wed, 17 Feb 2010 12:51:26 +0000 (12:51 +0000)]
Bump version number to 3.1.7

14 years agoGet gcc tests building again
Arun Thomas [Wed, 17 Feb 2010 08:45:56 +0000 (08:45 +0000)]
Get gcc tests building again

14 years agoThrow out obsolete Atari, Macintosh and Sun code to un-break packages;
Erik van der Kouwe [Tue, 16 Feb 2010 19:19:42 +0000 (19:19 +0000)]
Throw out obsolete Atari, Macintosh and Sun code to un-break packages;
credits to Sernin van de Krol's zip-2.31 patch for showing this problem

14 years agoIncorporate bsdmake into buildsystem and reorganize libs
Arun Thomas [Tue, 16 Feb 2010 14:41:33 +0000 (14:41 +0000)]
Incorporate bsdmake into buildsystem and reorganize libs

14 years agoThe function fabsf should return a float, not a double.
Kees van Reeuwijk [Mon, 15 Feb 2010 14:25:33 +0000 (14:25 +0000)]
The function fabsf should return a float, not a double.

14 years agofix the somehow newly introduced warnings
David van Moolenbroek [Sun, 14 Feb 2010 18:39:47 +0000 (18:39 +0000)]
fix the somehow newly introduced warnings

14 years agouse the verbose=2 boot monitor setting to get extensive output for debugging
Erik van der Kouwe [Sat, 13 Feb 2010 22:11:16 +0000 (22:11 +0000)]
use the verbose=2 boot monitor setting to get extensive output for debugging

14 years agoUndo the use of #include <...> because it caused some errors.
Kees van Reeuwijk [Fri, 12 Feb 2010 14:43:18 +0000 (14:43 +0000)]
Undo the use of #include <...> because it caused some errors.

14 years agotop update
Tomas Hruby [Wed, 10 Feb 2010 15:38:27 +0000 (15:38 +0000)]
top update

- it works with the new TSC based time accounting

14 years agoTime accounting based on TSC
Tomas Hruby [Wed, 10 Feb 2010 15:36:54 +0000 (15:36 +0000)]
Time accounting based on TSC

- as thre are still KERNEL and IDLE entries, time accounting for
  kernel and idle time works the same as for any other process

- everytime we stop accounting for the currently running process,
  kernel or idle, we read the TSC counter and increment the p_cycles
  entry.

- the process cycles inherently include some of the kernel cycles as
  we can stop accounting for the process only after we save its
  context and we start accounting just before we restore its context

- this assumes that the system does not scale the CPU frequency which
  will be true for ... long time ;-)

14 years agonew free_contig() and changes to make drivers use it; so now we
Ben Gras [Wed, 10 Feb 2010 13:56:26 +0000 (13:56 +0000)]
new free_contig() and changes to make drivers use it; so now we
have malloc/free, alloc_contig/free_contig and mmap/munmap nicely
paired up.

memory uses malloc/free instead of mmap/munmap as it doesn't have
to be contiguous for the ramdisks (and it might help if it doesn't!).

14 years agoFixes broken orinoco compilation in r6119
Tomas Hruby [Tue, 9 Feb 2010 16:43:34 +0000 (16:43 +0000)]
Fixes broken orinoco compilation in r6119

14 years agoAnd of course, as much as I've tried to be careful I forgot to add this file in
Tomas Hruby [Tue, 9 Feb 2010 15:36:29 +0000 (15:36 +0000)]
And of course, as much as I've tried to be careful I forgot to add this file in
r6116 :(

14 years agointr_disabled() tests removed
Tomas Hruby [Tue, 9 Feb 2010 15:29:58 +0000 (15:29 +0000)]
intr_disabled() tests removed

- we don't need to test this in kernel as we always have interrupts
  disabled

- if interrupts are enabled in kernel, it is only at very carefully
  chosen places. There are no such places now.

14 years agoNo locking in kernel code
Tomas Hruby [Tue, 9 Feb 2010 15:26:58 +0000 (15:26 +0000)]
No locking in kernel code

- No locking in RTS_(UN)SET macros

- No lock_notify()

- Removed unused lock_send()

- No lock/unlock macros anymore

14 years agoLots of small code cleanup: make symbols local, remove unused symbols,
Kees van Reeuwijk [Tue, 9 Feb 2010 15:23:38 +0000 (15:23 +0000)]
Lots of small code cleanup: make symbols local, remove unused symbols,
fixed a typo, removed a now unused header file.
Use #include <..> for header files that represent libraries.

14 years agoTASK_PRIVILEGE and level0() removed
Tomas Hruby [Tue, 9 Feb 2010 15:23:31 +0000 (15:23 +0000)]
TASK_PRIVILEGE and level0() removed

- there are no tasks running, we don't need TASK_PRIVILEGE priviledge anymore

- as there is no ring 1 anymore, there is no need for level0() to call sensitive
  code from ring 1 in ring 0

- 286 related macros removed as clean up

14 years agoNo CLOCK task
Tomas Hruby [Tue, 9 Feb 2010 15:22:43 +0000 (15:22 +0000)]
No CLOCK task

- no kernel tasks are runnable

- clock initialization moved to the end of main()

- the rest of the body of clock_task() is moved to bsp_timer_int_handler() as
  for now we are going to handle this on the bootstrap cpu. A change later is
  possible.

14 years agoRemoval of the system task
Tomas Hruby [Tue, 9 Feb 2010 15:20:09 +0000 (15:20 +0000)]
Removal of the system task

* Userspace change to use the new kernel calls

- _taskcall(SYSTASK...) changed to _kernel_call(...)

- int 32 reused for the kernel calls

- _do_kernel_call() to make the trap to kernel

- kernel_call() to make the actuall kernel call from C using
  _do_kernel_call()

- unlike ipc call the kernel call always succeeds as kernel is
  always available, however, kernel may return an error

* Kernel side implementation of kernel calls

- the SYSTEm task does not run, only the proc table entry is
  preserved

- every data_copy(SYSTEM is no data_copy(KERNEL

- "locking" is an empty operation now as everything runs in
  kernel

- sys_task() is replaced by kernel_call() which copies the
  message into kernel, dispatches the call to its handler and
  finishes by either copying the results back to userspace (if
  need be) or by suspending the process because of VM

- suspended processes are later made runnable once the memory
  issue is resolved, picked up by the scheduler and only at
  this time the call is resumed (in fact restarted) which does
  not need to copy the message from userspace as the message
  is already saved in the process structure.

- no ned for the vmrestart queue, the scheduler will restart
  the system calls

- no special case in do_vmctl(), all requests remove the
  RTS_VMREQUEST flag

14 years agocopy_msg_from_user() and copy_msg_to_user()
Tomas Hruby [Tue, 9 Feb 2010 15:15:45 +0000 (15:15 +0000)]
copy_msg_from_user() and copy_msg_to_user()

- copies a mesage from/to userspace without need of translating
  addresses

- the assumption is that the address space is installed, i.e. ldt and
  cr3 are loaded correctly

- if a pagefault or a general protection occurs while copying from
  userland to kernel (or vice versa) and error is returned which gives
  the caller a chance to respond in a proper way

- error happens _only_ because of a wrong user pointer if the function
  is used correctly

- if the prerequisites of the function do no hold, the function will
  most likely fail as the user address becomes random

14 years agoEarly address space switch
Tomas Hruby [Tue, 9 Feb 2010 15:13:52 +0000 (15:13 +0000)]
Early address space switch

- switch_address_space() implements a switch of the user address space
  for the destination process

- this makes memory of this process easily accessible, e.g. a pointer
  valid in the userspace can be used with a little complexity to
  access the process's memory

- the switch does not happed only just before we return to userspace,
  however, it happens right after we know which process we are going
  to schedule. This happens before we start processing the misc flags
  of this process so its memory is available

- if the process becomes not runnable while processing the mics flags
  we pick a new process and we switch the address space again which
  introduces possibly a little bit more overhead, however, it is
  hopefully hidden by reducing the overheads when we actually access
  the memory

14 years agoSys calls are called ipc calls now
Tomas Hruby [Tue, 9 Feb 2010 15:13:07 +0000 (15:13 +0000)]
Sys calls are called ipc calls now

- the syscalls are pretty much just ipc calls, however, sendrec() is
  used to implement system task (sys) calls

- sendrec() won't be used anymore for this, therefore ipc calls will
  become pure ipc calls

14 years agoSystem task initialization moved to main()
Tomas Hruby [Tue, 9 Feb 2010 15:12:20 +0000 (15:12 +0000)]
System task initialization moved to main()

- the system task initialization code does not really need to be part
  of the system task process. An earlier initialization in kernel is
  cleaner as it does not only initialize the syscalls but also irq
  hooks etc.

14 years agoFixes for truncate system calls:
David van Moolenbroek [Tue, 9 Feb 2010 08:12:37 +0000 (08:12 +0000)]
Fixes for truncate system calls:
- VFS: check for negative sizes in all truncate calls
- VFS: update file size after truncating with fcntl(F_FREESP)
- VFS: move pos/len checks for F_FREESP with l_len!=0 from FS to VFS
- MFS: do not zero data block for small files when fully truncating
- MFS: do not write out freed indirect blocks after freeing space
- MFS: make truncate work correctly with differing zone/block sizes
- tests: add new test50 for truncate call family

14 years agoKernel: fix sys_irqctl(IRQ_RMPOLICY)
David van Moolenbroek [Tue, 9 Feb 2010 08:07:47 +0000 (08:07 +0000)]
Kernel: fix sys_irqctl(IRQ_RMPOLICY)

14 years agoa.out.h typo (Bug#398, reported by 7shi)
David van Moolenbroek [Sun, 7 Feb 2010 12:01:37 +0000 (12:01 +0000)]
a.out.h typo (Bug#398, reported by 7shi)

14 years agogas2ack fix
Tomas Hruby [Fri, 5 Feb 2010 13:53:10 +0000 (13:53 +0000)]
gas2ack fix

- fixed handling of segment overrides for instruction that may use two
  of them in the long format, e.g. movs

14 years agoFixes in mkdep.1, suggested by Greg King
Erik van der Kouwe [Fri, 5 Feb 2010 13:07:08 +0000 (13:07 +0000)]
Fixes in mkdep.1, suggested by Greg King

14 years agophilip's inet tcp fix.
Ben Gras [Thu, 4 Feb 2010 22:06:10 +0000 (22:06 +0000)]
philip's inet tcp fix.

14 years agoonly check local benchmark dir if it exists
Ben Gras [Thu, 4 Feb 2010 18:15:10 +0000 (18:15 +0000)]
only check local benchmark dir if it exists

14 years agoalso be able to run benchmarks from packages.
Ben Gras [Thu, 4 Feb 2010 17:52:38 +0000 (17:52 +0000)]
also be able to run benchmarks from packages.

14 years agoImport NetBSD's make
Arun Thomas [Thu, 4 Feb 2010 16:52:54 +0000 (16:52 +0000)]
Import NetBSD's make

14 years agoRemoved useless global variable sys_call_code
Tomas Hruby [Wed, 3 Feb 2010 18:17:01 +0000 (18:17 +0000)]
Removed useless global variable sys_call_code

- we have to same information in the message (m_ptr) where needed

14 years agomakefile for benchmarks.
Ben Gras [Wed, 3 Feb 2010 16:49:15 +0000 (16:49 +0000)]
makefile for benchmarks.

14 years agofix for asmconv - stop translating after .sect .end.
Ben Gras [Wed, 3 Feb 2010 16:03:00 +0000 (16:03 +0000)]
fix for asmconv - stop translating after .sect .end.

14 years agoremove traces of benchmarks from test/.
Ben Gras [Wed, 3 Feb 2010 14:32:36 +0000 (14:32 +0000)]
remove traces of benchmarks from test/.