L4 ethernet driver and stack setup

Frank Mehnert fm3 at os.inf.tu-dresden.de
Mon Jun 20 15:49:09 CEST 2005

Hi Leon,

On Monday 20 June 2005 15:26, Leon Brits wrote:
> I've "extracted" the E1000 driver code from the TFTP server to get some
> packet data directly into L4. I've noticed that if I load this task with
> the loader then the TX part sends garbage. I then added (for fun) the
> attribute (section "STACK") to the buffer from which the packet is send
> and now it works.
> Can anybody explain this to me! Send a link to some use full doc?

TFTP is more or less a hack. Most drivers were derived from GRUB and
still GRUB is a hack. GRUB code "knows" that it runs one-by-one
mapped, that is physical and virtual addresses are equal. Therefore
in GRUB a network buffer can simply be allocated at the stack. In
L4env, the stack isn't necessary 1-by-1 mapped (especially, if the
task was started via the loader). Therefore, tftp starts a new thread
using a _known_ stack (see main.c, function real_main()). I assume
that specifiying the STACK attribute does the same in your application.

1-by-1 mapped memory is needed since the network card does not know
of any virtual memory layout.

## Dept. of Computer Science, Dresden University of Technology, Germany ##
## http://os.inf.tu-dresden.de/~fm3                                     ##
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://os.inf.tu-dresden.de/pipermail/l4-hackers/attachments/20050620/3e6efc47/attachment.sig>

More information about the l4-hackers mailing list