akaros.git
8 years agoMajor reorganization in prep for appserver merge
Kevin Klues [Sun, 21 Mar 2010 19:32:01 +0000 (12:32 -0700)]
Major reorganization in prep for appserver merge

1) Now that our cross compiler is actually i686 instead of i386, I've moved
kern/arch/i386 to kern/arch/i686, changing the references in the top level
GNUmakefile as well as the Makefile for the cross compiler.

2) I reorganized all of the frontend syscall stuff from being sparc/ramp
specific to being platform independent.  This mostly required moving stuff out
of the sparc specific frontend.c/h files and putting them in
kern/src/frontend.c and kern/include/frontend.c files respectively.
Additionally, I moved stuff from the sparc specific syscall.c file directly
into kern/src/syscall.c, taking care to move all of the 'helper' functions that
were in this file into frontend.c.  That may not be the very best place for
them, as they don't really do anything frontend specific, but for now it seems
to make sense because the only syscalls that use them are those being forwarded
to the frontend appserver.

3) I started messing with Paul's ne2k driver to get it to forward system calls
the way the unified app server expects them.  I have things compiling (probably
not working), but I talked to Paul and he said this was really old code and I
should actually just rebase from the lwip branch and work off the code from
there.  So now I am committing so I can do just that...

8 years agoAdded -fpermissive to the gcc-glibc make process to allow it to compile with newer...
Kevin Klues [Fri, 19 Mar 2010 21:53:24 +0000 (14:53 -0700)]
Added -fpermissive to the gcc-glibc make process to allow it to compile with newer versions of gcc

8 years agoAdded support for kernel-aware stack pointers to glibc
Andrew Waterman [Sat, 13 Mar 2010 05:45:22 +0000 (21:45 -0800)]
Added support for kernel-aware stack pointers to glibc

8 years agoUser programs now tell kernel the stack pointers for new harts
Andrew Waterman [Sat, 13 Mar 2010 05:10:42 +0000 (21:10 -0800)]
User programs now tell kernel the stack pointers for new harts

...using procdata.  This change also eliminated the functions
proc_set_tfcoreid and proc_set_program_counter; instead, they
are args to proc_init_trapframe.

8 years agomade dynamically linked c++ programs work right
Andrew Waterman [Tue, 9 Mar 2010 08:56:51 +0000 (00:56 -0800)]
made dynamically linked c++ programs work right

8 years agoFixed gcc-glibc build on more up-to-date systems
Andrew Waterman [Sat, 6 Mar 2010 02:49:19 +0000 (18:49 -0800)]
Fixed gcc-glibc build on more up-to-date systems

gcc 4.3.2 only builds with autoconf older than 2.64, so we now distribute
the configure script rather than requiring autoconf.  (this is standard
practice in distributions, anyway.)

8 years agoFixed a trapframe-initialization bug in sys_exec
Andrew Waterman [Fri, 5 Mar 2010 22:20:41 +0000 (14:20 -0800)]
Fixed a trapframe-initialization bug in sys_exec

load_elf sets up the entry point in env_tf, but that change
must be propagated to current_tf

8 years agocleand up and sped up SPAARC kernel entry
Andrew Waterman [Wed, 3 Mar 2010 09:32:08 +0000 (01:32 -0800)]
cleand up and sped up SPAARC kernel entry

8 years agogcc-glibc compiles on both SPARC and i386
Andrew Waterman [Sun, 28 Feb 2010 01:07:58 +0000 (17:07 -0800)]
gcc-glibc compiles on both SPARC and i386

8 years agotake 2 at i386 sysdeps (glibc)
Andrew Waterman [Thu, 25 Feb 2010 08:11:22 +0000 (00:11 -0800)]
take 2 at i386 sysdeps (glibc)

8 years agocreated arch-specific glibc sysdep.h
Andrew Waterman [Thu, 25 Feb 2010 07:34:20 +0000 (23:34 -0800)]
created arch-specific glibc sysdep.h

8 years agoExposed SPARC iobus to userspace
Andrew Waterman [Wed, 24 Feb 2010 22:22:53 +0000 (14:22 -0800)]
Exposed SPARC iobus to userspace

users can now load_iobus and store_iobus.

8 years agoAdded 'sim' to .gitignore since older gits are stupid
Kevin Klues [Mon, 22 Feb 2010 15:34:00 +0000 (07:34 -0800)]
Added 'sim' to .gitignore since older gits are stupid

8 years agofixed hart_max_harts bug
Andrew Waterman [Sat, 20 Feb 2010 23:53:55 +0000 (15:53 -0800)]
fixed hart_max_harts bug

8 years agoAdded back harts support
Andrew Waterman [Sat, 20 Feb 2010 01:25:30 +0000 (17:25 -0800)]
Added back harts support

8 years agoglibc might compile for x86 now
Andrew Waterman [Fri, 19 Feb 2010 09:50:14 +0000 (01:50 -0800)]
glibc might compile for x86 now

removed sparc-specific dependencies from sysdeps/ros

8 years agoMassive glibc and directory structure change
Kevin Klues [Thu, 18 Feb 2010 23:22:27 +0000 (15:22 -0800)]
Massive glibc and directory structure change

Sincerely,
Chewbacca!

9 years agoCheckin of Andrews stuff needed to compile glibc
Kevin Klues [Thu, 18 Feb 2010 22:33:11 +0000 (14:33 -0800)]
Checkin of Andrews stuff needed to compile glibc

We may want to roll this back eventually or combine
it with another commit if Andrew ever gets his act together.

9 years agoHella ABI changes for ELF dynamic linking
Andrew Waterman [Wed, 10 Feb 2010 08:44:38 +0000 (00:44 -0800)]
Hella ABI changes for ELF dynamic linking

  1) sys_exec now takes a filename, not a binary blob

  2) load_elf does the grunt work of mmap()ing a program.
     it's hella fast!

  3) added some cruft to tell the dynamic linker about the
     program it's supposed to operate on (entry point,
     elf headers, etc.)

9 years agoBrief NE2K driver fix
Paul Pearce [Wed, 24 Feb 2010 00:59:18 +0000 (16:59 -0800)]
Brief NE2K driver fix

There there are some cases in which a new packet is signaled of zero length.
This was causing errors further up the stack, so I added a fix to deal with
this at the driver layer.

9 years agoFixed NE2K support. WIP Commit
Paul Pearce [Tue, 23 Feb 2010 03:18:14 +0000 (22:18 -0500)]
Fixed NE2K support. WIP Commit

This commit fixes the NE2K support.

9 years agoFunctonal webserver with supporting code changes. WIP COMMIT
Paul Pearce [Fri, 19 Feb 2010 19:19:44 +0000 (14:19 -0500)]
Functonal webserver with supporting code changes. WIP COMMIT

This commit includes a functional webserver (that serves 1 page)
along with all the required code changes to support it.

This commit BREAKS remote system calls on x86, as well as the
ne2k driver.

This is meant to be a checkpoint on the path before merging into
master.

9 years agoFinished glue logic to link LWIP to the OS. This is a WIP commit and contains evil...
Paul Pearce [Sat, 13 Feb 2010 00:49:43 +0000 (19:49 -0500)]
Finished glue logic to link LWIP to the OS. This is a WIP commit and contains evil hacks.

This commit contains a bunch of really ugly evil hacks whose sole job is to test
the underlying network logic. This has no way to receive packets, and the hart_entry()
code is not safe.

9 years agoFirst run at integrating LWIP into the tree (again)
Paul Pearce [Tue, 9 Feb 2010 04:13:14 +0000 (23:13 -0500)]
First run at integrating LWIP into the tree (again)

Things compile and turn on, but the functions in
user/lwip/core/sys_arch.c need to be filled in, and
user/lwip/netif/ethernetif.c needs to be verified.

9 years agoFixed issue with make not working right on Fedora, if ivycc wasn't installed
Paul Pearce [Thu, 18 Mar 2010 00:36:59 +0000 (17:36 -0700)]
Fixed issue with make not working right on Fedora, if ivycc wasn't installed

On some systems (Fedora confirmed) 'which non_existant_file' will generate
errors instead of simply not returning anything. The result of this is
attempting to do any of the make operations without ivycc installed would
generate a series of errors. This occured even if the system was configured
to use standard gcc.

9 years agoFixes race in x86 smp boot
Barret Rhoden [Wed, 10 Mar 2010 21:49:45 +0000 (13:49 -0800)]
Fixes race in x86 smp boot

Barriers before returning from smp_final_core_init().

9 years agoUserspace x86 mmap() calls portability
Barret Rhoden [Tue, 9 Feb 2010 22:47:27 +0000 (14:47 -0800)]
Userspace x86 mmap() calls portability

Passing -1 for the fd when making anonymous mappings.

9 years agoMade BusyBox work
Andrew Waterman [Tue, 9 Feb 2010 09:51:57 +0000 (01:51 -0800)]
Made BusyBox work

Minor tweaks to mmap, mostly.

We need a systematic way for the kernel to execute system
calls "anonymously"--for example, to launch the login shell
without having it stored in KFS, we need to be able to
open, read, and close a file.  I made special internal
versions of these, but it's a bit ugly...

9 years agoMerge branch 'master' of ssh://waterman@scm.millennium.berkeley.edu/project/cs/radlab...
Andrew Waterman [Mon, 8 Feb 2010 23:02:18 +0000 (15:02 -0800)]
Merge branch 'master' of ssh://waterman@scm.millennium.berkeley.edu/project/cs/radlab/src/parlab/ros

Conflicts:

kern/include/syscall.h

9 years agoadded tcgetattr/tcsetattr for bash
Andrew Waterman [Mon, 8 Feb 2010 23:00:35 +0000 (15:00 -0800)]
added tcgetattr/tcsetattr for bash

9 years agoMM touchups
Barret Rhoden [Mon, 8 Feb 2010 20:02:00 +0000 (12:02 -0800)]
MM touchups

Fixes mmap() for x86 - at least for what it's used for now.

Keeps the sys_ functions in syscall.c.  The general model I'd like is
for the sys_ to be a wrapper with basic checks and a callout to a more
complicated function that might get used elsewhere in system.  We don't
do it well yet, but that's the idea.

Also keeps the bits in mman.h in sync with Linux, which might make
things easier.  If we're going to change them back and forth, there
ought to be a reason at least.

Please keep the syscalls in order in syscall.h and syscall.c, and try to
group related calls together.

9 years agoProcinfo set to read-only
Barret Rhoden [Mon, 8 Feb 2010 19:23:13 +0000 (11:23 -0800)]
Procinfo set to read-only

If you have something you want RW to userspace, it belongs in PROCDATA,
not PROCINFO.

9 years agoMerge branch 'master' of ssh://waterman@scm.millennium.berkeley.edu/project/cs/radlab...
Andrew Waterman [Sat, 6 Feb 2010 23:38:14 +0000 (15:38 -0800)]
Merge branch 'master' of ssh://waterman@scm.millennium.berkeley.edu/project/cs/radlab/src/parlab/ros

9 years agoAdded mprotect; made mmap work (dumbly) for files
Andrew Waterman [Sat, 6 Feb 2010 23:38:06 +0000 (15:38 -0800)]
Added mprotect; made mmap work (dumbly) for files

Had to add sys_pread to accomplish this

9 years agomatrix now sets up default PATH
Andrew Waterman [Sat, 6 Feb 2010 23:35:54 +0000 (15:35 -0800)]
matrix now sets up default PATH

9 years agoFixes double-free when destroying a process
Barret Rhoden [Thu, 4 Feb 2010 03:07:33 +0000 (19:07 -0800)]
Fixes double-free when destroying a process

Just free up to UVPT.  memwalking through UVPT (or VPT) will lead to
headaches and usually something other than what you want.

9 years agomon_cpuinfo takes a decimal
Barret Rhoden [Thu, 4 Feb 2010 01:21:34 +0000 (17:21 -0800)]
mon_cpuinfo takes a decimal

Instead of hex.

9 years agox86 core id reordering
Barret Rhoden [Thu, 4 Feb 2010 01:07:27 +0000 (17:07 -0800)]
x86 core id reordering

Provides support for non-contiguous hardware core ids, since x86 encodes
topological information in their lapic ids.  If you use send_ipi, you
usually will want to convert to the hardware id using
get_hw_coreid(dest).

Also, if you want to send a group IPI (logical), there is a separate
function for that now.

9 years agoChanged env_user_mem_walk to use return codes
Andrew Waterman [Mon, 1 Feb 2010 06:42:35 +0000 (22:42 -0800)]
Changed env_user_mem_walk to use return codes

This way, a walk can be aborted in the middle--say, if
you found what you wanted or if you encountered an error.
Fork uses mem_walk to copy pages now.

9 years agoAdded env_user_mem_walk
Andrew Waterman [Mon, 1 Feb 2010 02:18:23 +0000 (18:18 -0800)]
Added env_user_mem_walk

..which calls a user-specified function on each resident
page in a specified range.  can be used to free memory
(env_user_mem_free was rewritten to use it), or other
neat things.

9 years agofixed a bug in kpage_alloc
Andrew Waterman [Mon, 1 Feb 2010 01:49:55 +0000 (17:49 -0800)]
fixed a bug in kpage_alloc

9 years agoSplit headers up to reduce namespace pollution
Andrew Waterman [Wed, 27 Jan 2010 21:49:55 +0000 (13:49 -0800)]
Split headers up to reduce namespace pollution

9 years agoAdded distinct user mmap and brk segments
Andrew Waterman [Wed, 27 Jan 2010 21:49:26 +0000 (13:49 -0800)]
Added distinct user mmap and brk segments

brk only works below UMMAP_START and mmap only works above it.
This is a bit of a ghetto hack but will get us out of trouble for now.

9 years agobacktrace on user fault in SPARC port
Andrew Waterman [Wed, 27 Jan 2010 21:48:07 +0000 (13:48 -0800)]
backtrace on user fault in SPARC port

9 years agoadded sparc syscalls to makefile
Andrew Waterman [Wed, 27 Jan 2010 21:47:06 +0000 (13:47 -0800)]
added sparc syscalls to makefile

9 years agoUse stdbool.h to define bool
Andrew Waterman [Wed, 27 Jan 2010 21:46:50 +0000 (13:46 -0800)]
Use stdbool.h to define bool

9 years agoSplit procinfo.h from procdata.h to reduce namespace pollution
Andrew Waterman [Wed, 27 Jan 2010 21:46:24 +0000 (13:46 -0800)]
Split procinfo.h from procdata.h to reduce namespace pollution

9 years agoMinor SPARC header file changes to make glibc compile
Andrew Waterman [Wed, 27 Jan 2010 21:45:54 +0000 (13:45 -0800)]
Minor SPARC header file changes to make glibc compile

9 years agoAdded forwarded POSIX syscalls to SPARC port
Andrew Waterman [Wed, 27 Jan 2010 21:44:54 +0000 (13:44 -0800)]
Added forwarded POSIX syscalls to SPARC port

9 years agoMoved memory-barrier macros out of arch/atomic.h
Andrew Waterman [Wed, 27 Jan 2010 21:44:15 +0000 (13:44 -0800)]
Moved memory-barrier macros out of arch/atomic.h

...just so the Xen ring buffer header doesn't have to suck in
the entire arch/atomic.h.  (The real reason is that glibc chokes
on atomic_add, so don't want it polluting the namespace...)

9 years agoI hate failed merges
Andrew Waterman [Wed, 27 Jan 2010 21:37:57 +0000 (13:37 -0800)]
I hate failed merges

9 years agoMade fork/exec slow but correct.
Andrew Waterman [Wed, 27 Jan 2010 21:32:45 +0000 (13:32 -0800)]
Made fork/exec slow but correct.

Since mmap is actually used now, we need to scan the whole
virtual address range to determine what to copy or unmap.
But this is really slow, so need to walk the pagetable for
efficiency (using env_user_mem_walk or the like)

9 years agoAdded dumb implementation of get_free_va_range.
Andrew Waterman [Wed, 27 Jan 2010 21:27:55 +0000 (13:27 -0800)]
Added dumb implementation of get_free_va_range.

Right now it just linearly scans the user's address space,
which is obviously a low-performance implementation.  But
it works...

9 years agoFixes some syscall issues, esp getpid
Barret Rhoden [Mon, 25 Jan 2010 20:17:24 +0000 (12:17 -0800)]
Fixes some syscall issues, esp getpid

Adds sys_getpid to the syscall table, provides return values for calls
like proc_yield, keeps the table entries in the order in ros/syscall.h,
and reorganizes the syscalls into groups.

9 years agoFixes multiboot memory detection for weird types
Barret Rhoden [Fri, 22 Jan 2010 19:25:51 +0000 (11:25 -0800)]
Fixes multiboot memory detection for weird types

IAW the spec, type 1 is free, all others are reserved.  Some machines
(the new nehalem) had types greater than our array of strings.

9 years agoFixes trapframes on x86
Barret Rhoden [Fri, 22 Jan 2010 19:10:07 +0000 (11:10 -0800)]
Fixes trapframes on x86

Missed the extra segmentation registers in the specialized irq handler
when implementing TLS.

9 years agoFree user memory only up to UVPT on x86
Barret Rhoden [Fri, 22 Jan 2010 06:24:57 +0000 (22:24 -0800)]
Free user memory only up to UVPT on x86

Not sure about sparc, but we don't want to free the page tables via the
UVPT or VPT mappings during user_mem_free() on x86.

9 years agoFixes set_timer() for x86
Barret Rhoden [Fri, 22 Jan 2010 01:41:24 +0000 (17:41 -0800)]
Fixes set_timer() for x86

9 years agoPrototype of env_user_mem_walk
Andrew Waterman [Fri, 22 Jan 2010 00:33:17 +0000 (16:33 -0800)]
Prototype of env_user_mem_walk

This is a general mechanism to apply some operator to
all pages mapped into a process's address space.  for
example, env_user_mem_free can be implemented using
this plus a callback that does page_decref.  it will
be useful for implementing fork/exec "right".

9 years agoImplemented syscall dispatch table
Andrew Waterman [Fri, 22 Jan 2010 00:30:28 +0000 (16:30 -0800)]
Implemented syscall dispatch table

...rather than the huge switch statement.  Also fixed a bug
in sys_brk (it's supposed to return the new break; an error
is indicated by retval != newbrk).

9 years agoadded memchr function to string.c
Andrew Waterman [Fri, 22 Jan 2010 00:28:05 +0000 (16:28 -0800)]
added memchr function to string.c

9 years agoadded memchr function to string.c
Andrew Waterman [Fri, 22 Jan 2010 00:26:28 +0000 (16:26 -0800)]
added memchr function to string.c

9 years agoenv_user_mem_free now frees procinfo/procdata pages
Andrew Waterman [Thu, 21 Jan 2010 01:18:20 +0000 (17:18 -0800)]
env_user_mem_free now frees procinfo/procdata pages

The trick is to free up to KERNBASE, not UTOP,
because the procinfo/procdata pages lie above UTOP.

9 years agoMerge branch 'master' of ssh://waterman@scm.millennium.berkeley.edu/project/cs/radlab...
Andrew Waterman [Tue, 19 Jan 2010 23:23:01 +0000 (15:23 -0800)]
Merge branch 'master' of ssh://waterman@scm.millennium.berkeley.edu/project/cs/radlab/src/parlab/ros

9 years agoSped up SPARC kernel crossings
Andrew Waterman [Tue, 19 Jan 2010 23:22:56 +0000 (15:22 -0800)]
Sped up SPARC kernel crossings

Trash the register windows on kernel->user transition,
rather than flushing them.

9 years agoAdded set_timer(usec) function
Andrew Waterman [Tue, 19 Jan 2010 23:22:24 +0000 (15:22 -0800)]
Added set_timer(usec) function

On i386, it uses lapic_set_timer; on SPARC it uses
the hacked-up RAMP interrupt timer.

9 years agoFixes procdata's ring buffers
Barret Rhoden [Mon, 11 Jan 2010 21:15:43 +0000 (13:15 -0800)]
Fixes procdata's ring buffers

Ring buffers need their space to be allocated directly after the sring
struct.

9 years agoProcdata and procinfo can be more than a page long
Barret Rhoden [Sat, 9 Jan 2010 02:47:29 +0000 (18:47 -0800)]
Procdata and procinfo can be more than a page long

These regions need to be contiguous so that the kernel can access them
via kernel addresses.

9 years agoMerge branch 'master' of ssh://waterman@scm.millennium.berkeley.edu/project/cs/radlab...
Andrew Waterman [Thu, 14 Jan 2010 20:07:20 +0000 (12:07 -0800)]
Merge branch 'master' of ssh://waterman@scm.millennium.berkeley.edu/project/cs/radlab/src/parlab/ros

9 years agoSped up fork/exec significantly
Andrew Waterman [Thu, 14 Jan 2010 20:05:51 +0000 (12:05 -0800)]
Sped up fork/exec significantly

It's still not copy on write, but it's much faster now.
Two main changes: don't have env_segment_free operate
on the entire address space, but rather just the text,
heap, data, and stack.  Also, I implemented pagecopy,
which is like memcpy but assumes a large size/alignment

9 years agoFixed issues with the RealTek network driver and the slab allocator
Paul Pearce [Tue, 12 Jan 2010 01:14:13 +0000 (20:14 -0500)]
Fixed issues with the RealTek network driver and the slab allocator

Previously the RealTek network driver would use kmalloc for allocating
the RX and TX descriptor rings. A requirement of the rings was that
they be 256 byte alligned. We had previously discussed this, and
determined that by default kmalloc would, if asked for X bytes, return
X byte aligned memory. This is no longer the case with the new
slab allocator, so the driver no longer functioned correctly

We now directly request pages, to ensure proper alignment.

9 years agoStartcore message uses printd instead of printk
Andrew Waterman [Mon, 11 Jan 2010 07:15:53 +0000 (23:15 -0800)]
Startcore message uses printd instead of printk

9 years agoMerge branch 'master' of ssh://waterman@scm.millennium.berkeley.edu/project/cs/radlab...
Andrew Waterman [Mon, 11 Jan 2010 05:59:53 +0000 (21:59 -0800)]
Merge branch 'master' of ssh://waterman@scm.millennium.berkeley.edu/project/cs/radlab/src/parlab/ros

9 years agoMade resource allocation use printd instead of printk
Andrew Waterman [Mon, 11 Jan 2010 05:59:40 +0000 (21:59 -0800)]
Made resource allocation use printd instead of printk

9 years agoMade SPARC SMP boot messages use printd instead of printk
Andrew Waterman [Mon, 11 Jan 2010 05:59:12 +0000 (21:59 -0800)]
Made SPARC SMP boot messages use printd instead of printk

9 years agoSped up memset
Andrew Waterman [Mon, 11 Jan 2010 05:58:24 +0000 (21:58 -0800)]
Sped up memset

Even if initial pointer isn't aligned, fast-forward to
use word or dword stores.  This speeds up BSS zeroing a lot.

9 years agoMatrix's behavior is less stupid
Andrew Waterman [Mon, 11 Jan 2010 05:53:12 +0000 (21:53 -0800)]
Matrix's behavior is less stupid

If you hit enter, it doesn't try to execute the current directory :-)

9 years agoMerge branch 'master' of ssh://waterman@scm.millennium.berkeley.edu/project/cs/radlab...
Andrew Waterman [Mon, 11 Jan 2010 05:52:18 +0000 (21:52 -0800)]
Merge branch 'master' of ssh://waterman@scm.millennium.berkeley.edu/project/cs/radlab/src/parlab/ros

9 years agoMade SPARC read()/write() more compliant
Andrew Waterman [Mon, 11 Jan 2010 05:52:07 +0000 (21:52 -0800)]
Made SPARC read()/write() more compliant

Attempt to do as many front-end calls as needed to
write or read an entire buffer, rather than stopping
at the end of a page.

9 years agoFixed proc state initialization
Andrew Waterman [Sun, 10 Jan 2010 02:18:41 +0000 (18:18 -0800)]
Fixed proc state initialization

9 years agoMerge branch 'master' of ssh://waterman@scm.millennium.berkeley.edu/project/cs/radlab...
Andrew Waterman [Sun, 10 Jan 2010 02:08:01 +0000 (18:08 -0800)]
Merge branch 'master' of ssh://waterman@scm.millennium.berkeley.edu/project/cs/radlab/src/parlab/ros

9 years agomade test_interrupts sparc compatible
Andrew Waterman [Sun, 10 Jan 2010 02:07:45 +0000 (18:07 -0800)]
made test_interrupts sparc compatible

9 years agoGave half of colors to global color map
Andrew Waterman [Sun, 10 Jan 2010 02:05:24 +0000 (18:05 -0800)]
Gave half of colors to global color map

9 years agoMade c99 compatibility changes
Andrew Waterman [Sun, 10 Jan 2010 02:04:06 +0000 (18:04 -0800)]
Made c99 compatibility changes

9 years agox86 thread local storage tweaks
Barret Rhoden [Sat, 9 Jan 2010 01:25:22 +0000 (17:25 -0800)]
x86 thread local storage tweaks

Pulls the actual LDT out of procdata, since the kernel doesn't need to
read/write the LDT, and allows userspace to mmap() only what it needs
based on the number of potential vcores.

9 years agoMonitor exit
Barret Rhoden [Sat, 9 Jan 2010 00:58:25 +0000 (16:58 -0800)]
Monitor exit

Can leave the monitor, which is useful when dealing with breakpoints for
debugging.  Also cleans up the x86 trap return path.

9 years agoThread local storage for x86
Barret Rhoden [Thu, 7 Jan 2010 21:53:47 +0000 (13:53 -0800)]
Thread local storage for x86

On parlib, using the TLS array.  There is no protection from
segmentation: userspace can write its own LDT (exposed via procdata),
which could also be a decent way to select different TLSs for a core
(for user threading).

This also fixes a bug where the stack_ptr_array pointer was too small
and was clobbering things next to it.

Note that procdata and procinfo are not currently contiguous, which
means if the kernel accesses them and they are more than one page long,
it is accessing random memory.

9 years agoRestored x86 compliation. Still unable to run under x86 due to no TLS
Paul Pearce [Wed, 6 Jan 2010 04:38:52 +0000 (23:38 -0500)]
Restored x86 compliation. Still unable to run under x86 due to no TLS

This commit provides various fixes, including several stubs, needed to allow
ROS to build for x86. Most of these stubs are syscalls that newlib_backend
needs to handle. I haven't decided how we should support these syscalls. Our
options are to either ship them off over the serial/network link to the
syscall server, or handle them locally.

There is an additional stub in trap.h to handle the setting of errno's
with respect to syscalls. We need to figure out how we wish to handle
this.

NOTE: Although this compiles, attempting to run this under x86 will
result in a page fault durin proc_run. This is a result of the lack
of any thread local store support on the x86 side. Paul plans to
take a look at adding x86 tls support, next.

9 years agoonly link in roslib for i386
Andrew Waterman [Sun, 3 Jan 2010 20:41:06 +0000 (12:41 -0800)]
only link in roslib for i386

9 years agoAdded fork, exec, wait
Andrew Waterman [Sun, 3 Jan 2010 01:10:34 +0000 (17:10 -0800)]
Added fork, exec, wait

This probably deserves more explanation than I'll give here,
but here's the skinny: fork is a naive implementation that
doesn't work with mmap'd pages and doesn't use copy-on-write.

exec still takes a binary blob as an argument, like run_binary,
but unlike run_binary, it overwrites the calling process.

wait relies on a new process field called exitcode, which is
set by sys_proc_destroy() (therefore on exit()).

also added ppid to procinfo.

9 years agoinlined get_page_color
Andrew Waterman [Sun, 3 Jan 2010 01:08:17 +0000 (17:08 -0800)]
inlined get_page_color

9 years agoChanged argc/argv/envp ABI
Andrew Waterman [Sun, 3 Jan 2010 01:07:51 +0000 (17:07 -0800)]
Changed argc/argv/envp ABI

9 years agoAdded process list (ps) to monitor
Andrew Waterman [Sun, 3 Jan 2010 01:07:11 +0000 (17:07 -0800)]
Added process list (ps) to monitor

9 years agoReduced boot time
Andrew Waterman [Sun, 3 Jan 2010 01:05:23 +0000 (17:05 -0800)]
Reduced boot time

Most boot time is spent adding pages to the free list.
I inlined the function to determine the page color, and
added the assumption that there is a power of two number
of colors (true for all commercial processor caches).

9 years agoEnabled reading performance counters in user space
Andrew Waterman [Sun, 3 Jan 2010 01:03:03 +0000 (17:03 -0800)]
Enabled reading performance counters in user space

I used a fast-trap (user trap 0x89) rather than a full syscall

9 years agoAdded errno support
Andrew Waterman [Sun, 3 Jan 2010 01:02:07 +0000 (17:02 -0800)]
Added errno support

9 years agoMerged proc_init_trapframe and proc_init_trapframe_vcoreid
Andrew Waterman [Sun, 3 Jan 2010 00:49:54 +0000 (16:49 -0800)]
Merged proc_init_trapframe and proc_init_trapframe_vcoreid

9 years agoReduced SPARC kernel binary size
Andrew Waterman [Sun, 3 Jan 2010 00:48:05 +0000 (16:48 -0800)]
Reduced SPARC kernel binary size

Moved page tables out of .data into .bss

9 years agoAdded compile option to link in fewer binaries
Andrew Waterman [Sun, 3 Jan 2010 00:44:40 +0000 (16:44 -0800)]
Added compile option to link in fewer binaries

-DMINIMAL_KFS will only link in matrix (the shell)

9 years agomade augment-gcc less stupid
Andrew Waterman [Sun, 3 Jan 2010 00:43:22 +0000 (16:43 -0800)]
made augment-gcc less stupid