Commit graph

3005 commits

Author SHA1 Message Date
Ben Gras
35a108b911 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.
2010-03-05 15:05:11 +00:00
Kees van Reeuwijk
851dc95566 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.
2010-03-04 16:15:26 +00:00
Ben Gras
adf0b6fb26 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.
2010-03-03 15:47:16 +00:00
Ben Gras
eedff09bfd top manpage update 2010-03-03 15:46:20 +00:00
Ben Gras
72fc754948 new feature for top - display chain of blocked processes for every
blocked process.
2010-03-03 15:45:43 +00:00
Ben Gras
e6cb76a2e2 no more kprintf - kernel uses libsys printf now, only kputc is special
to the kernel.
2010-03-03 15:45:01 +00:00
Ben Gras
18924ea563 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.
2010-03-03 15:32:26 +00:00
Arun Thomas
cbd276e4ce Convert library asm files to GAS syntax 2010-03-03 14:27:30 +00:00
Kees van Reeuwijk
bf7397b64e More correctly use cp_grant_id_t.
More correctly use vir_bytes.
More correctly use endpoint_t.
2010-03-02 23:12:13 +00:00
Kees van Reeuwijk
f3c98fdca2 Fixed a number of cases where a bits in an integer were tested
incorrectly, resulting in real (and nasty) bugs.
2010-03-02 12:55:39 +00:00
Tomas Hruby
975efeac31 Typo in VM server 2010-03-02 10:53:17 +00:00
Ben Gras
5af8c345be 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.)
2010-03-01 15:53:57 +00:00
Erik van der Kouwe
6b867ec05c #include <minix/ipc.h> in <minix/sef.h> 2010-02-26 10:13:50 +00:00
Erik van der Kouwe
2a67e38d88 #include <minix/ipc.h> in <minix/sef.h> 2010-02-26 10:12:54 +00:00
Arun Thomas
dd6569d342 Copy mkfiles when building world 2010-02-25 22:10:48 +00:00
Ben Gras
7c4cd0e6b0 - new pread(), fnmatch() calls
- split sprintf() and snprintf() to solve a linking problem when
   compiling an application
2010-02-25 17:08:08 +00:00
Arun Thomas
4cb358d999 Replace Minix tar with pax's tar 2010-02-24 11:58:10 +00:00
Arun Thomas
a4af231978 Improve makefile logic for building programs/libs 2010-02-24 11:58:05 +00:00
Kees van Reeuwijk
1ce69592d2 Fixed an array bounds violation.
Let include guards comform to the Minix standard.
2010-02-24 10:39:58 +00:00
Kees van Reeuwijk
3922d45719 Fix an array-bound violation, add some include guards. 2010-02-22 17:44:08 +00:00
Ben Gras
c460974814 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.
2010-02-19 16:31:43 +00:00
Ben Gras
8c88a0219b add swifi to the build/install. 2010-02-19 16:16:28 +00:00
Ben Gras
d3b3c9d36d fix some warning in swifi, make it installable 2010-02-19 16:15:25 +00:00
Erik van der Kouwe
1a326acada Flag to load kernel high (not yet used by default), improved debug output 2010-02-19 12:38:38 +00:00
Erik van der Kouwe
e3bfaaa2d0 Remove executable bit on mkdep.1 2010-02-19 12:32:01 +00:00
Kees van Reeuwijk
1ba0936619 Fix some uses of uninitialized variables. 2010-02-19 10:41:02 +00:00
Kees van Reeuwijk
1597e701a0 Remove useless variables and the computations on them. 2010-02-19 10:00:32 +00:00
Kees van Reeuwijk
cf4f92dc21 Lots of cleanup of boot code. 2010-02-17 20:30:29 +00:00
Kees van Reeuwijk
97c169b93a Remove some unused #include.
Remove some unused variables and computations on them.
2010-02-17 20:24:42 +00:00
Arun Thomas
1e9a3c1423 Bump version number to 3.1.7 2010-02-17 12:51:26 +00:00
Arun Thomas
56b99ca816 Get gcc tests building again 2010-02-17 08:45:56 +00:00
Erik van der Kouwe
5af2471a9a 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
2010-02-16 19:19:42 +00:00
Arun Thomas
b706112487 Incorporate bsdmake into buildsystem and reorganize libs 2010-02-16 14:41:33 +00:00
Kees van Reeuwijk
6686e9ae9f The function fabsf should return a float, not a double. 2010-02-15 14:25:33 +00:00
David van Moolenbroek
e306663455 fix the somehow newly introduced warnings 2010-02-14 18:39:47 +00:00
Erik van der Kouwe
ff835e0e35 use the verbose=2 boot monitor setting to get extensive output for debugging 2010-02-13 22:11:16 +00:00
Kees van Reeuwijk
df60646f98 Undo the use of #include <...> because it caused some errors. 2010-02-12 14:43:18 +00:00
Tomas Hruby
b5e7af96c9 top update
- it works with the new TSC based time accounting
2010-02-10 15:38:27 +00:00
Tomas Hruby
1b56fdb33c 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 ;-)
2010-02-10 15:36:54 +00:00
Ben Gras
f08f2bd88c 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!).
2010-02-10 13:56:26 +00:00
Tomas Hruby
49284caf2a Fixes broken orinoco compilation in r6119 2010-02-09 16:43:34 +00:00
Tomas Hruby
d845891a50 And of course, as much as I've tried to be careful I forgot to add this file in
r6116 :(
2010-02-09 15:36:29 +00:00
Tomas Hruby
c9da61022b 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.
2010-02-09 15:29:58 +00:00
Tomas Hruby
c6fec6866f No locking in kernel code
- No locking in RTS_(UN)SET macros

- No lock_notify()

- Removed unused lock_send()

- No lock/unlock macros anymore
2010-02-09 15:26:58 +00:00
Kees van Reeuwijk
064cb7583a 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.
2010-02-09 15:23:38 +00:00
Tomas Hruby
391fd926ff 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
2010-02-09 15:23:31 +00:00
Tomas Hruby
ebba20a65d 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.
2010-02-09 15:22:43 +00:00
Tomas Hruby
728f0f0c49 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
2010-02-09 15:20:09 +00:00
Tomas Hruby
5e57818431 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
2010-02-09 15:15:45 +00:00
Tomas Hruby
ad9ba944d1 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
2010-02-09 15:13:52 +00:00