Commit graph

4049 commits

Author SHA1 Message Date
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
Tomas Hruby
b14a86ca5c 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
2010-02-09 15:13:07 +00:00
Tomas Hruby
8a03d497b8 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.
2010-02-09 15:12:20 +00:00
David van Moolenbroek
bdd4f5857f 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
2010-02-09 08:12:37 +00:00
David van Moolenbroek
f029b0e0b1 Kernel: fix sys_irqctl(IRQ_RMPOLICY) 2010-02-09 08:07:47 +00:00
David van Moolenbroek
448f4305e2 a.out.h typo (Bug#398, reported by 7shi) 2010-02-07 12:01:37 +00:00
Tomas Hruby
c5001b0a5f gas2ack fix
- fixed handling of segment overrides for instruction that may use two
  of them in the long format, e.g. movs
2010-02-05 13:53:10 +00:00