My name is Sven Andersson and I
work as a consultant in embedded
system design, implemented in ASIC
In my spare time I write this blog
and I hope it will inspire others to
learn more about this fantastic field.
I live in Stockholm Sweden and have
my own company
You are welcome to contact me
and ask questions or make comments
about my blog.
By default, system images built with PetaLinux SDK include a web application demo built using the uWeb (MicroWeb) framework from WorkWare Systems. If we prefer to create our own Embedded Web interfaces, PetaLinux also includes the BusyBox httpd server. This tutorial describes how to configure the BusyBox web server and create/install our own custom web content into a PetaLinux system image.
Create a new application
We will create a dummy application to hold the web content. We call it TourSkating, you will soon see why.
Once we have created the new application, the next step is to compile and build it. The required steps are shown below.
2. Select your new application to be included in the build process. The application is not enabled by default. Launch the rootfs configuration menu:
->petalinux-config -c rootfs
3. We will include the TourSkating app and exclude the uWeb app.
4. We need to include the built-in web server (httpd). It can be found in base->busybox->busybox-httpd
5. Exit and save the configuration.
Build a new PetaLinux kernel
6. Execute the command:
Create the index.html file
The web page will display two pictures.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Tour skating in Sweden and around the world</title> </head> <body> <h3> The ice is like a mirror</h3> <img src="MirrorLike.png"> <br><br> <h3> On the ice</h3> <img src="TourStart.png"> <br><br> <a href="http://www.wildskating.com">For more information see my blog</a> <br> </body> </html>
Follow the instructions in part 28 to boot PetaLinux.
Copying files to the PetaLinux installation
We will use the cURLcommand to transfer the files from our host to the guest. cURLis a command line tool for doing all sorts of interesting and essential URL manipulations and data transfers. The original goal of the program was to transfer files programmatically via protocols such as http, ftp, gopher, sftp, ftps, scp, tftp, and many others, via a command line interface. The main benefit of using the command line interface is that you can use the program in your Windows batch file or Linux shell scripts to automate many URL related processes. Here are the command to transfer the three files used to display our web page.