Web 51 Firmware

FAQ  Obsah  Web 51 - Memory model
Web51 Software is the largest part of Web51 docs. Here we try to explain basic principles of our implementation of the necessary protocols. Mentioned sources are available for DOWNLOAD.

Development system - Detailed description of the directory structure

Detailed description of individual files and directories of the Web51 development system.
Since version 1.12, no proprietary development software is needed. All tasks are accomplished by free, open-source tools. In addition, native P-Code support is built into the mcs51-as assembler.


CGI Archive - List of CGI scripts in the basic distribution

The distribution contains a library of CGI scripts for use in HTML pages. Directory description explains what are the individual files intended for.


LIBK - List of kernel components

The libk library contains kernel modules. Source of these is available under our proprietary license only. The free version contains two pre-compiled binary-only versions of these libraries. See Contents of libraries.


LIBW - Support for arithmetic, logic, I/O, ... functions

The libw library includes all commonly used functions. Described sources are in the Web51 free development system package, available for DOWNLOAD.


html2db.pl - Conversion of html pages and other files

Before linking, all files need to be converted to .asm before they can be compiled and linked. For .HTML, .JPEG, or .GIF files, this is ensured by this Perl script. Resulting source code contains headers necessary for the Web51 filesystem.


ip2hex.pl, mac2hex.pl - Conversion of definition files

Scripts mac2hex.pl and ip2hex.pl convert MAC and IP addresses into a form suitable for the Web 51 development system. Scripts were inspired by similar GPL'ed scripts by Bruce Lightner.


RTL8019AS Packet Driver - Description of basic Ethernet controller operations


P-Code Interpreter

Web51 uses a P-Code interpreter for some portions. This reduces code and enables program execution from other than program memory, e.g. from an external serial EEPROM.


Serial line support - Memory management and serial line handler description

Since the RAM in the system is extremely limited, data from the serial line are handled in a special fashion.


Processing of Ethernet packets - Explanation ofthe main program loop

Main Web51 loop consists of several more or less mandatory parts that are in the web51.asm module, and user portions that are contained in the www8051.asm module. Description of individual main loop parts and their usage.


Simple http server

Basic characteristics of a simple WWW server, one of the examples.
Detailed description of embedding CGI scripts into html code.


Web 51 filesystem

Filesystem can span over 3 "medias": external I2C EEPROM, FlashROM of the CPU, EEPROM of the CPU (filesystem is searched in this order; therefore, files in external EEPROM 'overwrite' files in the CPU).


General properties of Web51 Software


Basic properties of Web 51 can be explained on the "serial" example. This example project demonstrates Web51 functioning as a simple converter that extends the serial line over a TCP/IP network.

Firmware of the "serial" project contains:
  1. Simple WWW server listening at port 80 that allows configuration changes
  2. Basic "Telnet" server listening at port 23 that moves data between an open TCP/IP connection and the serial line.
  3. Basic "Telnet" client that can automatically establish the above TCP/IP connection if it is not open.

After a passive connection is established, WWW server waits for the minimum necessary portion of a http request (it can even be sent by telnet, that is, char by char). Then, name of the requested page is processed, http headers are added to the page, the page is split into several packets if necessary, and transmitted to the client. The last transmitted packet carries a "terminate connection" flag, and the server immediately releases occupied resources. This means that the server does not support persistent (KeepAlive) connections. Since there is no memory to store dynamically generated pages, server does not support retransmission of unacknowledged pages. In case of an error, the entire request needs to be repeated.

Telnet server supports passive connections, and can also actively establish connection with another server, if this option is enabled. Unlike the WWW server, it supports retransmission of unacknowledged packets. However, if the memory that holds unacknowledged data runs out, communication slows down. Connection terminates about 50 seconds after the last acknowledge is received.

JavaScript  Some examples use client-side Javascript. For better orientation, the Javascript icon marks all examples and comments related to Javascript.

To compile examples without "telnet", it is recommended to use the appropriate version of libk.a, that is, libk80.a that supports only one TCP stack, can't actively establish connection and does not support serial port. Therefore, it leaves much more RAM unused. More details are in Link order, contents of libraries..





Sponzored by LPhard Ltd. Graphics by GIMP Created by EasyPad

(c)Copyright 2000 - 2002, HW server & Radek Benedikt
Web51@HW.cz, Web51.HW.cz
FAQ  Obsah  Web 51 - Memory model