Click here to learn
about this Sponsor:
Home  |  News  |  Articles  |  Polls  |  Forum

Keywords: Match:
Hands on with LabVIEW and Embedded Linux (Part 5)
(continuation)

Six steps to Building an Embedded Linux System

The first phase of the installation process is to create a new virtual machine running under the VMware Workstation environment and start it up. Follow VMware's easy installation instructions and create a virtual machine with 32 MB of hard drive space. Then we'll show you how to turn it into a small Linux system running LabVIEW.

The CD-ROM that comes with this book is a bootable disk that contains the tools you will need to build your own embedded Linux system. Reboot the virtual machine off of the CD-ROM and follow these six steps . . .
  • Step 1. Partion the Virtual Hard Drive -- Inside the virtual machine at the Linux command prompt, type the command fdisk /dev/hda to format the virtual disk. You need to create a new primary partition that will take up the whole drive. Select n for a new partition, then p to make it a primary partition. It will be partition number 1 so enter a 1.Now that you have created the partition table you need to write it to disk so type w.

  • Step 2. Format the Virtual Hard Drive -- After making a partition on the virtual disk you need to format or make a filesystem on your new partition. To make Linux's native ext2 filesystem we'll use the command mke2fs -m 0 /dev/hda1. This command in brief says that we will make an ext2 filesystem on the new partition we just created, /dev/hda1. The mke2fs command automatically detects the space available on the partition. The -m 0 option (zero, not "oh") means that we are going to use all the space on the disk for ourselves and not reserve any space for the root user of a multi-user system

  • Step 3. Mount the target Partition -- To mount the hard drive we'll use the command mount followed by which device to mount and where to mount it.

      # mount /dev/hda1 /mnt

  • Step 4. Transfer the Operating System from the CD-ROM -- In the /usr directory of the CD-ROM there is a 11 MB file named embeddedlabview.tar.gz that contains everything you need for your first embedded Linux system. The CD-ROM contains some lightweight embedded system tools that do not have all the functionality of the GNU tools you may be used to with a typical Linux or UNIX system but they have more than enough functionality to get the job done.

    In order to decompress and extract your compressed archive you have to use a combination of two commands. The command zcat decompresses our archive and turns it from .tar.gz to a .tar file. To keep from making an intermediary .tar file we will use a UNIX pipe to send the output of the zcat command to the input for the tar command. The tar command extracts the files in the archive into our mounted directory:

      # zcat /usr/embeddedlabview.tar.gz | (cd /mnt; tar -xvf -)

    As the archive is extracted to the hard drive you should see a long list of files go by on your screen. When the tar command is finished you can poke around through the contents of the new hard drive. Use the command cd /dirname (e.g., cd /bin) to change directories and the command ls to list their contents. We'll explore the file structure later in the chapter. Right now let's finish up the installation and reboot into your new system.

  • Step 5. Install the bootloader -- Your virtual hard drive now has a Linux kernel and all the support files it needs to boot. Everything is in place except for the bootloader, a small section of code that is started by the BIOS and loads the operating system. The most popular bootloader for Linux is LILO (LInux LOader). LILO stores its information in the master boot record or MBR of the hard drive. When we issue the following command, LILO will read its configuration file (/etc/lilo.conf) in the /mnt directory and write its information to the MBR of /dev/hda.

      # lilo -v -C /etc/lilo.conf -r /mnt

  • Step 6. Boot up Your New Virtual Embedded System -- The system is now bootable. Hit crtl-alt-delete (Linux) or ctrl-alt-ins (Windows) to reboot and remove the CD-ROM from the drive. The (virtual) system should boot directly from the hard drive. After the VMware Workstation machine starts you will see Linux booting up. Once Linux has booted, the system will run a pre-compiled example LabVIEW application. Play with the buttons, explore the menus and you will see that LabVIEW for Linux is just like LabVIEW for any other platform.
Repeat and Modify for Your Target Hardware

So far we've created a virtual embedded system to make it easier to get started developing real embedded systems. As you have seen, developing software using virtual machines is a powerful and efficient way to work. However, because of the way that the virtual machine software works, it is not suitable for demanding real-time applications. For that you will have to move to actual embedded hardware.

--- Continued ---



Story navigation . . .

(Click here for further information)


FUEL Database on MontaVista Linux
Whether building a mobile handset, a car navigation system, a package tracking device, or a home entertainment console, developers need capable software systems, including an operating system, development tools, and supporting libraries, to gain maximum benefit from their hardware platform and to meet aggressive time-to-market goals.

Breaking New Ground: The Evolution of Linux Clustering
With a platform comprising a complete Linux distribution, enhanced for clustering, and tailored for HPC, Penguin Computing¿s Scyld Software provides the building blocks for organizations from enterprises to workgroups to deploy, manage, and maintain Linux clusters, regardless of their size.

Data Monitoring with NightStar LX
Unlike ordinary debuggers, NightStar LX doesn¿t leave you stranded in the dark. It¿s more than just a debugger, it¿s a whole suite of integrated diagnostic tools designed for time-critical Linux applications to reduce test time, increase productivity and lower costs. You can debug, monitor, analyze and tune with minimal intrusion, so you see real execution behavior. And that¿s positively illuminating.

Virtualizing Service Provider Networks with Vyatta
This paper highlights Vyatta's unique ability to virtualize networking functions using Vyatta's secure routing software in service provider environments.

High Availability Messaging Solution Using AXIGEN, Heartbeat and DRBD
This white paper discusses a high-availability messaging solution relying on the AXIGEN Mail Server, Heartbeat and DRBD. Solution architecture and implementation, as well as benefits of using AXIGEN for this setup are all presented in detail.

Understanding the Financial Benefits of Open Source
Will open source pay off? Open source is becoming standard within enterprises, often because of cost savings. Find out how much of a financial impact it can have on your organization. Get this methodology and calculator now, compliments of JBoss.

Embedded Hardware and OS Technology Empower PC-Based Platforms
The modern embedded computer is the jack of all trades appearing in many forms.

Data Management for Real-Time Distributed Systems
This paper provides an overview of the network-centric computing model, data distribution services, and distributed data management. It then describes how the SkyBoard integration and synchronization service, coupled with an implementation of the OMG¿s Data Distribution Service (DDS) standard, can be used to create an efficient data distribution, storage, and retrieval system.

7 Advantages of D2D Backup
For decades, tape has been the backup medium of choice. But, now, disk-to-disk (D2D) backup is gaining in favor. Learn why you should make the move in this whitepaper.

 


Got a HOT tip?   please tell us!
Free weekly newsletter
Enter your email...
Click here for a profile of each sponsor:
PLATINUM SPONSORS
(Become a sponsor)

ADVERTISEMENT
(Advertise here)

Check out the latest Linux powered...

Mobile phones!

MIDs, UMPCs
& tablets

Mobile devices

Other cool
gadgets



BREAKING NEWS

• LiMo to gain FOMA pack
• Quad-core PICMG board runs Linux
• DIY Linux service gains ultralight GUI
• Asus nettop gets discrete graphics
• Mapping the mobile open source ecosystem
• WiMAX deal "clears" Linux for takeoff
• HMI panels run Linux
• Nokia alludes to Linux phone plans
• Linux music phone boasts stereo mini-jack
• Nokia spins open Linux home automation gateway
• Qseven module sports Atom
• Open source phone gains "fat" distro
• Android phone launches in China
• Microsoft to bake own phone?
• Tux cashes in on paint


Most popular stories -- past 90 days:
• Open source phone goes mass-market
• Tinest Linux system, yet?
• Garmin Nav devices run Gnome Linux
• ARM9 board boots Debian in 0.69 seconds
• Low-cost laptop runs Linpus Linux
• Linux-friendly Beagle fetches $150
• Mini Linux PC breaks $100 barrier
• Open source camera records geotagged video to SATA HDD
• Open set-top box ships
• First $100 laptop runs Linux


DesktopLinux headlines:
• Linux gains FPS
• Ubuntu tops on desktop, but not servers
• Browser swallows OS
• Tutorial reveals desktop Linux security tips
• Fedora 10 first impressions
• 8,000 TuxTop models and counting
• "Moonlight" ready to shine
• Adobe unleashes 64-bit Flash
• Debian Lenny installer arrives
• Ubuntu announces ARM port


Also visit our sister site:


Sign up for LinuxDevices.com's...

news feed

Home  |  News  |  Articles  |  Polls  |  Forum  |  About  |  Contact
 

Ziff Davis Enterprise Home | Contact Us | Advertise | Link to Us | Reprints | Magazine Subscriptions | Newsletters
Tech RSS Feeds | White Papers | ROI Calculators | Tech Podcasts | Tech Video | VARs | Channel News

Baseline | Careers | Channel Insider | CIO Insight | DesktopLinux | DeviceForge | DevSource | eSeminars |
eWEEK | Enterprise Network Security | LinuxDevices | Linux Watch | Microsoft Watch | Mid-market | Networking | PDF Zone |
Publish | Security IT Hub | Strategic Partner | Web Buyer's Guide | Windows for Devices

Developer Shed | Dev Shed | ASP Free | Dev Articles | Dev Hardware | SEO Chat | Tutorialized | Scripts |
Code Walkers | Web Hosters | Dev Mechanic | Dev Archives | igrep

Use of this site is governed by our Terms of Service and Privacy Policy. Except where otherwise specified, the contents of this site are copyright © 1999-2008 Ziff Davis Enterprise Holdings Inc. All Rights Reserved. Reproduction in whole or in part in any form or medium without express written permission of Ziff Davis Enterprise is prohibited. Linux is a registered trademark of Linus Torvalds. All other marks are the property of their respective owners.