Add "modules" to symbol search path to get httpserver etc symbols

Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Calle Wilund <calle@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
module system: add httpserver module unless explicitly removed

Fixes #357.

This patch adds go config.json a "default" list, a list of modules that
are always added to every built image, unless explicitly subtracted with
the syntax "-name".

This patch puts "httpserver" in the new "default" list. So now, when
a user does "make image=memcached", he will get an image with both
memcached and httpserver, as if "make image=memcached,httpserver" was
used. To get only memcached, without httpserver, one can do

   make image=memcached,-httpserver

Reviewed-by: Tomasz Grabiec <tgrabiec@gmail.com>
Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
test/misc-malloc: fix data corruption in worker thread

We capture len and tf by reference, even though they are stack variables
that immediately go out of scope.

Change to capture by value. Fixes #370.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
rcu hashtable

This generic hash table does not follow STL conventions, since using an
iterator is difficult where things can change under your feet.

Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
tests: add test for rcu_hashtable

Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
net: use rcu_hashtable in net channel classifier

Reduce overhead in creating a tcp connection from O(existing connection count)
to O(1).

Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
vfs mount: change char * to const char*

There is no reason that the char* that are passed to mount will not be
const char*.

This is important when using c++ code which is not as forgiving when
using quoted text as string.

Reviewed-by: Glauber Costa <glommer@cloudius-systems.com>
Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
cli: Use a proper terminal definition

This patch takes vt100 terminal definition, changes it to fit qemu's handling
of ^J (taken from Nadav's rogue module) and updates the CLI code to use that
definiton.

This removes the weird warning message of "couldn't find dumb, using dumb".
If running outside OSv, there's no need for this and libedit will find the
proper terminal definition according to TERM environment variable.

Signed-off-by: Or Cohen <orc@fewbytes.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
httpserver: Fix /os/dmesg output format

Output should be json formatted, according to the schema.

Signed-off-by: Or Cohen <orc@fewbytes.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
x64: Document how boot16.S get loader size

Signed-off-by: Elazar Leibovich <elazarl@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
console: Fix bare linefeeds on early output on Xen

This patch fixes #371, which reported OSv's early output (first few lines
of verbose messages) is "scrambled" in the sense that each line starts
below the place where the previous line ended, instead of the beginning
of the line where it should.

Even modern terminals follow typewriters (does anyone even remember those?)
in that they have two separate concepts: A "line feed", which moves one line
down (in the same column), and a "carriage return", which returns to the
first column (on the same line). In ASCII, the line feed is '\n' (\012)
and the carriage return is '\r' (\015). You actually need to output *both*
of them to do what people normally expect from a "new line", i.e., go
to the first column of the next line.

Since UNIX adopted the convention that it only takes a "\n" to mark a new
line, the terminal driver needs to convert "\n" to a "\r\n" sequence.
This conversion can be turned on or off using the ONLCR flag in an ioctl
to the terminal driver (see termios(3)). Normally, in "cooked mode", this
conversion is enabled. In our implementation, this conversion is done
by LineDiscipline::write(), and is working fine, which is why we don't
see the linefeed problem after the early output.

But for the early console output, we had separate code for outputting it,
and in that case, forgot to do the \n->\r\n conversion. So this patch
adds it.

Why did this problem only effect Xen?

Xen doesn't use qemu. It turns out that qemu has a long-known bug which
hides this OSv bug :-) Qemu enables the ONLCR bit on the host's tty
(don't be confused - this is in the host and not the ONLCR code in OSv
described earlier). In other words, qemu translates every \n it gets over
the serial port to \r\n when printing it to the screen, so even if our
code just outputted \n, it would show it correctly. That may sound like
"not a bug, it's a feature", but it really *is* a bug in qemu - it also
means that the guest has no way to output a bare linefeed to go one
line down. This is why in apps/rogue I had to patch the terminal
definition to use the cursor-down escape sequence instead of the linefeed.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Increases maxsockets and TCP_SYNCACHE_HASHSIZE

Signed-off-by: Asias He <asias@cloudius-systems.com>
TCBHASHSIZE    16384

Signed-off-by: Asias He <asias@cloudius-systems.com>
#define TCBHASHSIZE    4096
tcp_twstart

Signed-off-by: Asias He <asias@cloudius-systems.com>
no print tcp_twstart

Signed-off-by: Asias He <asias@cloudius-systems.com>
tcptw_auto_size

Signed-off-by: Asias He <asias@cloudius-systems.com>
uma_zone_set_max

uma_zalloc_arg
uz_nitems_max
debug uma_zalloc_arg
fix uma_zalloc_arg uma_zfree_arg

Signed-off-by: Asias He <asias@cloudius-systems.com>
maxtcptw = 512
maxtcptw -> 0

Signed-off-by: Asias He <asias@cloudius-systems.com>