joel4: preparation for release mode builds

Modified the makefiles and tools.mk to allow for separate debug/release
build configurations.  The debug mode adds the -g flag to gcc compilations
which includes DWARF2 debugging information in the object. Also, the -O0
flag is specified, even though its the default.  In the release configuration,
-O2 should be specified, but currently cannot be set due to the 'ldr' bug
(possibly in gcc, possibly in my code).

Signed-off-by: jnider <joel@nider.org>
joel4: convert from \n to \r\n in serial printing

I often read the log files on Windows, which requires \r\n as a line
ending.  However, I am in the habit of writing only \n in my printf()
statements as is common on UNIX systems.  So this patch converts \n
to \r\n so my log files are readable under Windows.

I also did some code cleanup, which should have been a separate patch
but at this point probably won't matter too much since I'm the only one
looking at the code.

Signed-off-by: jnider <joel@nider.org>
boot: fixed the paths to the init modules

boot.txt contains a list of files to be loaded by the boot task. These
files are contained in a cpio archive which is sensitive to path names.
Currently the cpio archive is built from the source tree, which contains
certain paths, and these paths are then carried over to the cpio file.
It just means that the paths must be specified in order to find the files
correctly when parsing the cpio archive.

Signed-off-by: jnider <joel@nider.org>
joel4: fixed module loading page allocation

Fixed a bug that occured while copying the boot module from kernel-space
to user-space.  The source index was not being incremented, so the same
memory page was copied each time.  Needless to the say the file was not
readable like that.

Signed-off-by: jnider <joel@nider.org>
joel4: changed the name of the version macro

The define specifying the kernel build number was copied from KOS, and the
name was kept.  This patch changes the name to JOEL4 to reflect the new
kernel name.

Signed-off-by: jnider <joel@nider.org>