run.py: Add '--graphics' option

This adds a '--graphics' option to run.py that enables QEMU's graphics
mode using SDL.  This is needed for testing OSv's VGA support.

Requested-by: Takuya ASADA <syuu@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
trace: add 'extract' command

Add a 'trace extract' command that hides the gdb magic and is
future-proof when we change the trace transport protocol.

Reviewed-by: Tomasz Grabiec <tgrabiec@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Fix regression in early output to stdout

Output to stdout normally goes to file descriptor 1. However, during
early boot, before the console is opened on file descriptor 1, we also
want printf() to work. So this case is specially treated in
libc/stdio/__stdout_write.cc, where in this early case, we used debug_write
directly, instead of write to the file descriptor.

However, recent patches changed debug_write to write to a memory buffer,
instead of to screen (unless "--verbose" option is given to the loader).
This made early printf() break too.

This patch changes __stdout_write to use console::write(), not
debug_write(). To use console::write(), I had to convert that source
file to C++.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
loader.cc: make error messages visible

Since recently, debug() messages are by default not visible. This means
they are not a good way to print error messages :-)

This patch fixes two error messages from loader.cc, that were no longer
visible. For example, "scripts/run.py -e xyz" completed without any message
instead of telling the user that "xyz" doesn't exist.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
loader: Bring back OSv version at boot

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Revert "conf: make release build use -O3"

This reverts commit 4af010f18bd9656cf021303ab2c4f86a155e3212.

This change causes OSv to abort when JVM is started with
the following options:

 -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005

Result:

ERROR: transport error 202: setsockopt TCPNODELAY failed: Protocol not available
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [../../../src/share/back/debugInit.c:750]
FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
Aborted

I think it's best to revert it until the root cause is solved.

See issue #167

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
mgmt.git: boot message cleanups

Take the latest mgmt.git which has fixes to make OSv boot less verbose.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
README: Replace debugging sections with links to Wiki

OSv debugging and trace analysis are much better covered in the Wiki
pages.  Replace the text in README with links to the more up-to-date
Wiki.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
devfs: Remove "device not found" printout

OpenJDK looks up "/dev/urandom" at startup but works just fine without
it.  There's no need to display an error message in OSv if that happens.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
loader: Remove copyright statement from boot log

Remove the copyright statement from boot log but keep the OSv version
banner there to tidy up boot.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>