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
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.
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
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
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.
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
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.
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
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
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.
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 :
- 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
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
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).
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
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
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
Ben Gras [Mon, 19 Oct 2009 14:23:04 +0000 (14:23 +0000)]
- reverse order of transfer command and DMA initiation - fixes DMA problem
that some hardware had
- clear DMA_ST_INT after DMA - fixes infinite number of interrupts
that some hardware had
- initial ATAPI DMA implementation, doesn't actually increase performance
on my test hardware so possibly not right yet, disabled by default
Add more identifiers to drivers.conf for orinoco and rtl8137.
Increase RSS_NR_PCI_ID and remove dumplicate reference
to /etc/drivers.conf; each such reference uses _PATH_DRIVERS_CONF
from <minix/paths.h> now.