Hello Tobias,

first, I appreciate that you follow your claim, and started your weekly
reports.

On 25.05.2012 19:23, Tobias Börtitz wrote:
> Hey everyone,
> 
> so this is my first report after beeing one week into the coding phase
> of the GSoC.
> In the last weeks I have been reading documentation and source code of
> HelenOS, trying to understand the build process and structure of the
> source tree while acquiring deeper knowledge about Makefiles, Linker
> Scripts, the ELF binary format, etc.
> Afterwards I have been playing around with the user land, writing a
> simple program loaded as module from grub which is printing "Hello
> Word!" onto the kernel console. First I tried linking in all the needed
> object files for getting the printf directive to work. When
> I realized that this would not be that easy because it would require
> almost the complete kernel to link into it, I simply used the libc from
> the HelenOS userspace for linking. The code can be found in my
> repository (https://github.com/kurbel/genode) in the base-spartan branch
> in ./base-spartan/src/tests/userspace_printf.
> But despite all efforts I was not able to successfully achieve the first
> step of my schedule, which was creating a simple roottask replacement
> which should be run directly on the kernel. The idea behind this was to
> replace all via grub loaded modules with just one module which should
> print something to the serial port. For compiling the genode linker
> script should be used. The problem is that all attempts of printing
> something to the serial port (using qemu with the "-serial mon:stdio"
> option which should redirect all output from the serial port to the
> console where qemu is started from) failed (the code can be found in
> .base-spartan/src/simple_serial_print). So the question is what went
> wrong. Is the linking that something that can't be processed by the
> kernel (in my opinion unlikely because there where no complaints that
> the module could not be loaded)? Or am I not able to access the serial
> port the way I am trying to (e.g. because of enabled port protection)?

I don't know, whether I/O port protection is enabled for the roottask of
the SPARTAN kernel or not, but when looking at your code example it
seems to me that it relies on the fact that the uart-device is already
initialized. It looks like you copied the simple hello_raw example from
the "how to port Genode to the OKL4 kernel" report which is fine, but on
OKL4 the corresponding uart-port was already initialized by the kernel,
on SPARTAN this is probably not the case, following your observations of
missing driver support for x86 in the kernel.

You can have a look, e.g. at the NOVA-kernel
'base-nova/contrib/src/console_serial.cpp' (I only took that example,
because it's very easy to read).

Maybe your printf will work after correct initialization? But of course
the question remains, whether you can directly access the corresponding
I/O ports, or what you have to do as the first process in the system to
gain control over it.

Regards
Stefan

_______________________________________________
HelenOS-devel mailing list
[email protected]
http://lists.modry.cz/cgi-bin/listinfo/helenos-devel

Reply via email to