Giter VIP home page Giter VIP logo

embeded-linux-systems's Introduction

Embedded Linux Systems

image

Brief

This project involves configuring a bootloader and Linux kernel for an ARM Cortex-A9 processor to run on an embedded Linux system using an SD card. The following steps outline how to set up and run the system:

Prerequisites

Before proceeding, make sure you have the following packages installed on your system:

  • build-essential
  • git
  • autoconf
  • bison
  • flex
  • texinfo
  • help2man
  • gawk
  • libtool-bin
  • libncurses5-dev
  • unzip
  • libssl-dev
  • device-tree-compiler
  • swig
  • python3-distutils
  • python3-dev
  • tftpd-hpa
  • qemu-system-arm

You can install these packages by running the following command:

sudo apt install build-essential git autoconf bison flex texinfo help2man gawk libtool-bin libncurses5-dev unzip libssl-dev device-tree-compiler swig python3-distutils python3-dev tftpd-hpa qemu-system-arm

Linux Image Configuration

  1. Copy the two files from the Linux image directory to the TFTP file directory. The TFTP directory is typically located at /srv/tftp.

SD Card Setup

  1. Navigate to the bootloader directory.

  2. Execute the following commands:

    $ dd if=/dev/zero of=sd.img bs=1M count=1024
    $ cfdisk sd.img
    

    In the cfdisk interface, choose the 'dos' option. Create three primary partitions with the following properties:

    • Partition 1: 64MB size, FAT16 partition type. Mark this partition as bootable.
    • Partition 2: 8MB size, Linux type (root filesystem).
    • Partition 3: Use the remaining space, Linux type (data filesystem).

    Press 'Write' to save the partition table.

  3. Use the loop driver to emulate block devices from the SD card image and its partitions:

    $ sudo losetup -f --show --partscan sd.img
    $ sudo mkfs.vfat -F 16 -n boot /dev/loop<x>p1
    $ sudo losetup -d /dev/loop<x>
    

Booting

  1. Run the following command to boot the system using QEMU:

    sudo qemu-system-arm -M vexpress-a9 -m 128M -nographic -kernel u-boot -sd sd.img -net tap,script=./qemu-myifup -net nic -init /bin/sh
    

    Press any key when prompted.

Setting Environment Variables

  1. Within the QEMU environment, set the following environment variables:

    setenv ipaddr 192.168.0.100
    setenv serverip 192.168.0.1
    setenv bootcmd 'tftp 0x61000000 zImage; tftp 0x62000000 vexpress-v2p-ca9.dtb;bootz 0x61000000 - 0x62000000'
    setenv bootargs console=ttyAMA0 root=/dev/nfs ip=192.168.0.100 nfsroot=192.168.0.1:/home/<user>/<your path>/Embedded-Linux-Systems/nfsroot, nfsvers=3,tcp rw
    saveenv
    
  2. Reset the system to run QEMU:

    reset
    

The system will now boot successfully ✅.

Screenshots

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

Authors

👤 Michael Maher

Please ⭐️ this repository if this project helped you!

Buy Me A Coffee

License

Copyright © 2022 Michael Maher. This project is MIT licensed.

embeded-linux-systems's People

Contributors

michael-m-aher avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.