Sunteți pe pagina 1din 5

POSTER PAPER

International Journal of Recent Trends in Engineering, Vol. 1, No. 4, May 2009

Design and Development of ARM Processor


Based Web Server
V.Billy Rakesh Roy1, Sanket Dessai1, and S. G.Shiva Prasad Yadav 1
1
M S Ramaiah School of Advanced Studies in Collaboration with Coventry University (UK)/Embedded Design Centre,
Bangalore, India
Email: {rakesh.voola, sanketdessai0808, shivaspy}@gmail.com

Abstract—As the World-Wide Web (WWW) continues to


evolve, it is clear that its underlying technologies are useful
for much more than just browsing the web. Web browsers
have become the de facto standard user interface for a
variety of applications including embedded real time
applications such as Remote Data Acquisition System. This
brings in a need for web services being deployed on various
embedded processors such as Advanced RISC Machine
(ARM) in real time context.
The main aim of the project is to develop an embedded web
server using ARM9 processor and a Real Time Operating
System, µC/OS-II. µC/OS-II is used to monitor all the tasks
of the web server. Embedded C language has been used for
the software implementation of the embedded web server.
The web pages which are required for the web server were
developed using HTML. The µC/OS-II was successfully
ported on the ARM and the web server application is Fig 2. Embedded Web Server Architecture
configured with the operating system (µC/OS-II). Both, the
operating system and the web server application are ported Fig 1. shows a typical client-server architecture where,
on the ARM9. This embedded web server is tested for its the client accesses the server through the LAN router and
working, using a data acquisition web application hosted the Internet. Whenever, the client wants to access the
over a network of PC's.
sever, it sends the request to the server, this request is
This embedded web server which is developed by using
Embedded C language can be beneficial for mission critical
taken by the router, which is connected to the Internet.
applications, remote data acquisition systems, ATM The web processes the request made and finally connects
network and more. The developed web server accelerates to the desired web server, access the requested data and
business performance by automating and orchestrating sends the data to the client.
processes across total enterprises. Enterprise users can
collaborate more flexibly and cost-effectively with business Embedded Web Servers: General web servers, which
and trading partners. were developed for general-purpose computers such as
NT servers or Unix and Linux workstations, typically
require megabytes of memory, a fast processor, a
Index Terms— Embedded Web Server, µC/OS-II, ARM,
Web
preemptive multitasking operating system, and other
resources. A web server can be embedded in a device to
I. INTRODUCTION provide remote access to the device from a web browser.
The embedded system can be utilized to serve the
A web server is a system which hosts a web site and embedded web documents, including static and dynamic
provides services for any requesting clients. The general- information about embedded systems, to web browsers.
purpose web servers compose of an operating system, the This type of web server is called an Embedded Web
web pages or the application and a huge amount of Server.
memory and sometimes a special hardware. An embedded web server is a microcontroller that
contains an Internet software suite as well as application
code for monitoring and controlling systems. Embedded
web servers are integral part of an embedded network and
paves way for faster time to market products.
Fig 1. Shows the general-purpose web server where, it
requires a huge amount of memory, special hardware,
software and an operating system. An embedded web
server can replace the Fig 1., which is a single hardware
with an RTOS and the application. Fig 2. Shows typical
embedded web server architecture. The web server is the
Fig 1. Client - Server Architecture
board that has the application and the RTOS (µC/OS-II).
94

© 2009 ACADEMY PUBLISHER


POSTER PAPER
International Journal of Recent Trends in Engineering, Vol. 1, No. 4, May 2009

The operating system manages all the tasks such as B. System Design
sending the HTML pages, connecting to new users etc. The Fig 4 gives the overall system design. The main
The RTOS manages all the required tasks in parallel, and components of the system are Hardware, RTOS, HTML
in small amounts of time. Web-based management user Pages, Transfer of Data.
interfaces using embedded web servers have many Hardware: The hardware used for embedded web
advantages: ubiquity, user-friendliness, low development server is ARM9 based board. The board has the html
cost and high maintainability. Embedded web servers pages saved on it.
have different requirements, such as low resource usage, RTOS: The application runs in the form of tasks. Each
high reliability, security and portability, for which general user connecting to the server is treated as a task. To
web server technologies are unsuitable. There are also manage the users, connections, an operating system is
design issues such as HTTP and embedded API. required, that performs the operations in real time. The
embedded web server is implemented using µC/OS-II a
II. DESIGN powerful but small RTOS kernel. It is highly CPU
independent and has been ported to numerous
A. Design of the System Flow microprocessor platforms.
Fig 3. Shows the basic block diagram of the embedded HTML Pages: To interact with the clients, the client
web server. The necessary requirement analysis is done has to send the data to them. In the embedded web server,
on the RTOS, web server, TCP/IP and the target board. web pages are selected as the media of interaction. The
Based on the requirement analysis, the µC/OS-II is web pages are designed using HTML. The designed web
configured, as per the target board. After configuring pages look as in the Figure 5.
µC/OS-II, the port for STR9 is generated and targeted to
STR9 using Keil uVision3 tool using hyper terminal. The
target along with the RTOS is tested, by booting the
target with the RTOS. The application is written and is
made specific to the RTOS and both the web server and
the RTOS are ported on the target. The web server
application is tested for it’s functioning.

Fig 5. Designed Web Pages

C. Porting µC/OS-II
INCLUDES.H:‘INCLUDES.H’ is a MASTER include
file and is found at the top of all ‘.C’ files.
‘INCLUDES.H’ allows every .C file in the project to be
written without concerns about which header file will
Fig 3. Basic Design of the System
actually be needed. The ‘INCLUDES.H’ includes header
files that are not pertinent to the actual ‘.C’ file being
compiled.
OS_CPU.H:‘OS_CPU.H’ contains processor and
implementation specific #defines constants, macros, and
typedefs
OS_CPU_A.ASM: A µC/OS-II port requires that need
to write four assembly language functions:
OSStartHighRdy (), OSCtxSw (), OSIntCtxSw (),
OSTickISR (),
OSStartHighRdy () function is called by OSStart () to
start the highest priority task ready-to-run.
OSStartHighRdy() assumes that OSTCBHighRdy points
to the task control block of the task with the highest
priority
Fig 4: Overall System Design ¾ OSCtxSw() is executed when an interrupt is
encountered. OSCtxSw() is a interrupt
service routine. The sequence of events that
leads µC/OS-II to vector to OSCtxSw() is as
95

© 2009 ACADEMY PUBLISHER


POSTER PAPER
International Journal of Recent Trends in Engineering, Vol. 1, No. 4, May 2009

follows. The current task calls a service target hardware, enter the following
provided by µC/OS-II which causes a higher command:
priority task to be ready-to-run. ¾ ARMcore> Bootm 40000
¾ OSIntCtxSw() function is called by ¾ Successful kernel start-up will return a boot-
OSIntExit() to perform a context switch from up message in the hyper terminal window
an Interrupt Service Routine. OSIntCtxSw() is showing the complete system configuration
called from an ISR, it is assumed that all the information. At the end of these initialization
processor registers are already properly saved messages the login prompt can be seen
onto the interrupted task’s stack ¾ The configuration file and the kernel image
OSTimeTickHook(). which is to be ported on the target processor
¾ The only function that is actually necessary is has to be copied from the host pc on to the
OSTaskStkInit(). The other five functions board using the using a tftp Ethernet
must be declared but there’s no need to connection into RAM
contain any code inside them. ¾ ARMcore@root> tftp get ip:filename
¾ OSTaskStkInit() function is called by destination:filename
OSTaskCreate() and OSTaskCreateExt() to ¾ The application which is copied from the host
initialize the stack frame of a task pc is a kernel image which is compiled in
such an environment that it supports the
D. Compilation and Porting Procedure for µC/OS-II on
target. The kernel image which is the
STR9:
developed application supports the board, can
All the required files of µC/OS-II are copied on a be run on the board my giving the below
single folder and the code is compiled using the ARM command
specific cross compiler. The output of this is the hex file ARMcore@root>./webserver-arm
that is to be ported on to the board. The generated hex file ¾ All the steps above are to be performed and
is loaded onto the target using the hyper terminal. The the target will be loaded with the required OS
following steps are to be performed to load the code on and the application.
the target.
¾ Open hyper terminal. F. Embedded Web Server Process Structure:
¾ The connection settings of the hyper terminal The Embedded web server is a finite state machine
are as below. (FSM), which processes an HTTP request as a sequence
¾ Bits per second – 57600 Data bits – 8 of discrete steps. Figure 6 shows the finite state machine
¾ Parity – None Stop bits - 1 for the embedded web server.
¾ Flow Control – Hardware
¾ The null modem cable from the serial port on
the host-PC is connected to the target
development board
¾ The RJ-45 socket on the development board is
connected to the host-PC using a cross-over
Ethernet cable
¾ The power cable is connected to the power
socket of the target development board and
the other end is connected to the USB socket
of the PC. Now, in the terminal window, it
can be seen the U-Boot startup messages
attempting to tftpboot over the network once
power is applied to the target hardware
¾ Hit any key to stop tftpboot autoboot, as the
environment settings for the target hardware
must first be configured
Fig 6: Embedded Web Server Process Structure
E. Booting from on-board Flash and Running the
Developed Application on Board: In order to support multiple connections in a single
¾ Start the hyper terminal thread environment, multiple finite state machines are run
¾ Set the BootOs variable to boot the kernel by a scheduling system that uses a lightweight task
image from Flash memory 0x40000. Upon a structure, which consists of a pointer to the function
reset the kernel will boot from Flash. being run, a variable holding the state in the finite state
¾ ARMcore> BootOs 40000 machine, and a flag indicating whether the finite state
¾ ARMcore > saveenv machine can be run or blocked. The scheduling system
¾ To boot the kernel from Flash through the allocates an available finite state machine for an accepted
hyper terminal program without resetting the connection, checks each finite state machine to see if it is
blocked or runable and moves the finite state machine

96

© 2009 ACADEMY PUBLISHER


POSTER PAPER
International Journal of Recent Trends in Engineering, Vol. 1, No. 4, May 2009

one step if it is runable. Each state in a finite state


machine can check for the presence of data that is ready
to be processed at the entry point; if none is ready, the
finite state machine can block itself until data arrives.
When data becomes available at the entry point, the finite
state machine can then be unblocked so its handler can
perform the task of state, and turn over the result to the
next state by changing the state flag and pointer to the
handler.

II. EXPERIMENTAL SETUP

A. Experimental Setup of the Embedded Web Server:


The experimental setup of the embedded web server is
shown in Fig 7. The target is connected to the ethernet
controller of the network, the power to the target is given
through USB and the debugger is connected to the USB Fig 9: Booting the target using µC/OS-II
of the system and the other end to the board.
µC/OS-II. And the web server application is executed for
B. Integrating RTOS and Embedded Web Server that user’s application, running in a task.
The main part of the embedded web server is the When a new connection is established, a new task is
RTOS handling the web server application. Whenever, created and the user’s application is executed in a
a connection is established, a new task is created using separate task as a separate application. This process is
continued for all the users connecting to the server. Fig 8
shows the flowchart of the embedded web server and the
RTOS, managing the incoming connections.
C. Porting the Web Server
The Embedded web server application and the RTOS
are ready and are to be ported on the target. The porting is
done using Keil uVision3 compiler. Now, the code is
loaded on the target and the target is configured over the
network, to work as an embedded web server.
D. Testing the Embedded Web Server
Testing: Initially, the target is tested for the working of
operating system. This is done by booting the target using
the hyper terminal. Fig 9 shows the target booting using
Fig 7: Experimental Setup RTOS.
After the target is successfully booted with µC/OS-II,
it is tested over the network using ping command. Fig 10
shows the embedded web server, responding to the ping
command made by the client. Now the embedded web
server is responding to the clients, request is made to the
server, embedded web server, by typing the IP address of
the server in the client’s browser.
The user has to enter ‘10.1.1.26’ IP to access the
server. This request is taken by the operating system of
the client and given to the LAN controller of the client
system. The LAN controller sends the request to the
router that processes and checks for the system connected
to the network with the particular IP address. If the IP
address entered is correct and matches to that of the
server, a request is sent to the LAN controller of the
server and a session is established and a TCP/IP
connection is establishes and the server starts sending the
web pages to the client.
Fig 11 shows the client entering the IP address of the
server and the server send the html page to the requested
clients. Fig 12 shows various clients connecting to the
Fig 8: µC/OS-II and Embedded Web Server Tasks server and getting the html page.

97

© 2009 ACADEMY PUBLISHER


POSTER PAPER
International Journal of Recent Trends in Engineering, Vol. 1, No. 4, May 2009

web server replaces the PC, which is required for remote


labs with special hard- and software.

REFERENCES
[1] David Brash, “The ARM Architecture Version”, ARM
White Paper, January 2002
[2] Brian W. Kernigan and Dennis M.Ritchie, “The C
Programming Language (ANSI)”, Prentice Hall,
second edition, 2001
[3] Tao Lin ,Hai Zhao ,Jiyong Wang ,Guangjie Han and
Jindong Wang ,”An Embedded Web Server for
Equipment ”,School of Information Science &
Engineering, Northeastern University, Shenyang,
Liaoning, China
[4] Yanzheng LI, Shuicai WU, Jia LI and Yanping BAI
Fig 10: Pinging the Embedded Web Server over the network ,”The ECG Tele-monitor Based on Embedded Web
Server”, Biomedical Engineering Center, Beijing
University of Technology Beijing, China
[5] Hong-Taek Ju, Mi-Joung Choi and James W. Hong,
“An efficient and lightweight embedded Web server
for Web-based network element management”,
International Journal of Network Management, pp.
261 – 275, Oct 2000
[6] Nick Witchey, ”Designing an embedded web server”,
Applied Computing Technologies, Applied
Computing Technologies, April 2000
[7] Kyle Norman, “Integrating Web Servers in Embedded
Applications”, Luminary Micro Applications
Engineer, Luminary MicroWild Basin, Suite 350
Fig 11: User Entering The IP Address
Austin
[8] CACH Petr and FIEDLER Petr, “Ethernet interface in
application”, Department of Control and
Instrumentation, Brno University of Technology,
Božetěchova, Czech Republic
[9] Ian S. Schofield, David A. Naylor, “Instrumentation
Control Using the Rabbit 2000 Embedded
Microcontroller”, Astronomical Instrumentation
Group, Department of Physics, University of
Lethbridge, 4401 University Drive West, Lethbridge,
Alberta, T1K 3M4, Canada
[10] Andrew S. Tanenbum, “Computer Networks”,
Aderson Winsley Publications, Vol.3, 2004
[11] ST Electronics, “STR91xF ARM9®-based
microcontroller family – Reference Manual”,
September, 2006
[12] Jean J. Labrosse, “MicroC/OS-II The real time
kernel”, R & D Publications, second edition, 1992
[13] Deitel, Harvey M. and Michael S. Kogan, “The
Design Of OS/2”, Addison-Wesley, second edition,
Fig 12: Application Running on Different Systems on Network 1992
[14] Mi-Joung Choi, Hong-Taek Ju, Hyun-Jun Cha, Sook-
CONCLUSIONS Hyang Kim and J. Won-Ki Hong, “An Efficient
Embedded Web Server for Web-based
The embedded web server that has been designed can be [15] Network Element Management”, Dept. of Computer
used in educational institutions, offices and many other Science and Engineering, Pohang Korea
places. For web-based network element management [16] Krithi Ramamritham, John A. Stankovic,“
provide an administrator with a simple but enhanced and Scheduling Algorithms and Operating Systems
more powerful user interface without additional Support for Real-Time Systems”, Proceedings of
hardware. Software contention and architectures can IEEE, vol. 82, No. 1, pp. 55-67, Jan. 1994
[17] http://www.st.com,(August 2007)
significantly affect web server performance. Poorly
[18] http://www.arm.com, (December 2007)
designed and configured software architectures might
even generate high response times while the physical
resources display low utilization.
A remote user only requires a common Internet browser
to carry out experiments on real hardware. The embedded

98

© 2009 ACADEMY PUBLISHER

S-ar putea să vă placă și