Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
OyinkuroBenafa committed May 24, 2021
0 parents commit 4feae88
Show file tree
Hide file tree
Showing 354 changed files with 26,268 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.DS_Store
55 changes: 55 additions & 0 deletions License/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# ARM UNIVERSITY PROGRAMME EDUCATION KIT TEACHING MATERIALS END USER LICENSE AGREEMENT

## ARM EDUCATION

## EDUCATION KIT END USER LICENCE AGREEMENT

1. These terms are displayed for you to read prior to use of the particular education kit and any related documentation and materials (“Materials”) made available to you by Arm Limited (“Arm”). If you choose not to agree with these terms, do not use or access the Materials.

1. THESE TERMS AND CONDITIONS CONSTITUTE A LEGALLY BINDING AGREEMENT BETWEEN YOU AND ARM (“AGREEMENT”). The Materials may include third party elements, and/or hardware distributed on behalf of a third party, which may be subject to separate terms of use. You acknowledge that any hardware provided to you is a third party product and Arm is solely distributing such hardware on behalf of the third party. To the fullest extent permitted by law, Arm shall have no responsibility or liability in respect of any such hardware.

1. You acknowledge that the Materials are specifically designed and licensed only for non-commercial, educational purposes.

1. INTELLECTUAL PROPERTY. The Materials are protected by copyright laws, international copyright treaties, and trade secret laws, and other intellectual property laws and treaties around the world. The Materials are licensed, not sold, to you, and can only be used in accordance with the terms of this Agreement. Arm and its licensors retain title and ownership of the Materials, including all intellectual property rights in the Materials (other than in respect of any third party elements). Arm reserves all rights not specifically granted under this Agreement.

1. LICENCE. Subject to your compliance with this Agreement and unless otherwise specified in Clause 13, Arm hereby grants to you a limited, non-exclusive, non-transferable, royalty-free, licence under its copyright subsisting in the Materials to use, copy and modify the Materials (and if and only if you are a current member of an educational institution, make the Materials available to others within your academic institution) upon the terms of this Agreement, solely for non-commercial educational purposes. For the purposes of these terms, “educational purposes” means internal use in taught classes and related projects at educational institutions delivering accredited degrees and diplomas, but “educational purposes” excludes research that is intended to be published or otherwise made available to third parties or the public (including, without limitation, PhD research).

Unless otherwise specified in Clause 13: (a) you may refer to and cite the Materials in publications provided that you give a full citation referencing Arm as the author and owner of the Materials; (b) you may not use the Materials for any commercial purpose; (c) you may not remove any proprietary notice(s) contained in the Materials; and (d) you may not use the Materials to design to manufacture Arm-based processors. You may not use the Materials for any unlawful purpose, you may not (except as far as permitted by applicable law) reverse engineer or decompile the Materials, and you may not use the Materials in any way that may damage Arm’s reputation or bring Arm into disrepute. The licence granted by Arm pursuant to this Clause 5 is effective until terminated. Without prejudice to any other rights, Arm may terminate this Agreement and your right to use the Materials if you are in material breach of any of these terms or if you do anything that infringes Arm’s intellectual property rights. Termination will be effective immediately on the service of Arm’s notice of termination to you. In the event of termination, you shall destroy all copies of the Materials, including all portions and derivatives of them, and cease all use of the Materials immediately. Clauses impliedly or expressly intended to survive termination shall continue in full force and effect.

1. WARRANTIES AND LIMITATIONS.

a. THE MATERIALS ARE PROVIDED “AS IS”. ALL WARRANTIES AND CONDITIONS, EXPRESS, IMPLIED OR STATUTORY, ARE HEREBY EXCLUDED, INCLUDING, WITHOUT LIMITATION, THOSE RELATING TO MERCHANTABILITY, SATISFACTORY QUALITY, FREEDOM FROM DEFECTS, RELIABILITY, AVAILABILITY, ACCURACY, NON-INFRINGEMENT OR FITNESS FOR A PARTICULAR PURPOSE.

b. IN NO EVENT SHALL ARM BE LIABLE UNDER THIS AGREEMENT OR OTHERWISE IN CONNECTION WITH THE MATERIALS FOR ANY INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES WHETHER SUCH DAMAGES ARE ALLEGED AS A RESULT OF TORTIOUS CONDUCT OR BREACH OF CONTRACT OR OTHERWISE EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

c. THE MAXIMUM LIABILITY OF ARM TO YOU IN AGGREGATE FOR ALL CLAIMS MADE AGAINST ARM IN CONTRACT, TORT OR OTHERWISE UNDER OR IN CONNECTION WITH THIS AGREEMENT, OR OTHERWISE IN CONNECTION WITH THE MATERIALS SHALL NOT EXCEED THE GREATER OF ONE HUNDRED U.S. DOLLARS ($100 USD) OR THE TOTAL OF SUMS PAID, IF ANY, BY YOU TO ARM UNDER THIS AGREEMENT.

d. Nothing in this section shall operate to exclude or limit liability for: (i) death or personal injury resulting from either party's negligence; or (ii) fraud; or (iii) any other matters in respect of which by law liability cannot be excluded or limited.

1. EXPORT CONTROL. You hereby acknowledge and agree that the Materials are subject to U.S. export control laws, including the U.S. Export Administration Act and its associated regulations, and may be subject to export or import regulations in other countries. You agree to comply fully with all laws and regulations of the United States and other countries (“**Export Laws**”) to assure that neither the Materials, nor any direct products of them are;

( i ) exported, directly or indirectly, in violation of Export Laws, either to any countries that are subject to U.S export restrictions or to any end user who has been prohibited from participating in the U.S. export transactions by any federal agency of the U.S. government; or

(ii) intended to be used for any purpose prohibited by Export Laws, including, without limitation, nuclear, chemical, or biological weapons proliferation. The Materials consist solely of commercial items. If applicable, your institution shall be responsible for ensuring that any Materials provided to the US Government in accordance with the terms of this Agreement are provided with the rights and subject to restrictions described elsewhere in this Agreement.

1. FEEDBACK AND MODIFICATIONS. You hereby grant to Arm a non-exclusive, royalty-free, fully paid-up, worldwide licence to use, copy, modify, distribute, and create derivative works of any suggestions, comments or feedback that you provide to Arm in relation to the Materials, and any modifications you make to the Materials, under all your intellectual property rights subsisting therein, for any purpose. To the extent that any claim in any patent application filed by you would not have been conceived by you but for having had access to the Materials, such claim shall be deemed to be feedback and is hereby licensed to Arm in accordance with the provisions of this Clause 8.

1. GOVERNING LAW. This Agreement and any disputes or claims arising out of or in connection with it or its subject matter or formation (including non-contractual disputes or claims) are governed by and construed in accordance with the laws of England and Wales.

1. PERSONAL DATA. Arm will process any personal data in accordance with its privacy policy: www.arm.com/company/policies/privacy.

1. UPDATES. Arm may update this Agreement from time to time. Updates will be posted on this page and, where appropriate, notified to you by email. If you do not agree with an update, you should cease use of the Materials.

1. CONTACTING US. If you have any queries in relation to this Agreement or the Materials, please email university@arm.com.

1. SPECIAL CONDITIONS. The provisions of this Clause 13 shall take precedence in the event of any conflict with the remainder of this Agreement.

(i) Use of the pedagogical processor model provided with the Introduction to Computer Architecture Education Kit (the "Arm Education Core") is subject to the following special conditions:

(a) you may only refer to or publish the Arm Education Core, or any modifications you make to the Arm Education Core or any results you obtain from its use, in whole or in part if you have first obtained Arm's specific prior written consent by emailing us at the address specified in Clause 12 above;

(b) you may use the Arm Education Core to synthesize and implement an SoC on FPGA or for an ASIC implementation of the SoC for non-commercial educational purposes (as defined in Clause 5 above);

(c) you may not make any claims about the Arm Education Core's functionality or otherwise other than those published by Arm. The Arm Education Core is not representative of any commercially available Arm processors and you may not make any statements that indicate or imply the contrary.


38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Disclaimer
Arm is committed to making the language we use inclusive, meaningful, and respectful. Our goal is to remove and replace non-inclusive language from our vocabulary to reflect our values and represent our global ecosystem.

Arm is working actively with our partners, standards bodies, and the wider ecosystem to adopt a consistent approach to the use of inclusive language and to eradicate and replace offensive terms. We recognise that this will take time. This course may contain references to non-inclusive language; it will be updated with newer terms as those terms are agreed and ratified with the wider community.

Contact us at education@arm.com with questions or comments about this course. You can also report non-inclusive and offensive terminology usage in Arm content at terms@arm.com.

# Embedded-Linux-Education-Kit

Welcome to our Embedded Linux Education Kit!

Our flagship offering to universities worldwide is the Arm University Program Education Kit series.

These self-contained educational materials offered exclusively and at no cost to academics and teaching staff worldwide. They’re designed to support your day-to-day teaching on core electronic engineering and computer science subjects. You have the freedom to choose which modules to teach – you can use all the modules in the Education Kit or only those that are most appropriate to your teaching outcomes.

Our Embedded Linux Education Kit covers the fundamental knowledge of the Linux architecture, and practical skills involved in configuring and building a full Linux operating system stack. A full description of the education kit can be found [here](https://www.arm.com/resources/education/education-kits/embedded-linux).

## Kit specification:

* A full set of lecture slides, ready for use in a typical 10-12-week undergraduate course (full syllabus below)
* Lab manual with solutions for faculty. Labs are based on low-cost yet powerful Arm-based single board computers donated by partners (subject to availability)
* **Prerequisites:** Basics of operating systems, basics of software programming in C

## Course Aim
To produce students who can develop an embedded Linux system on low-cost yet powerful Arm based platforms, including customer peripheral development for various applications using standard software tools.

## Syllabus
1. Introduction to Linux and Embedded Systems
1. Linux-based Embedded System Component Stack
1. Anatomy of a Linux-based System
1. Configuration and Build Process
1. Linux Kernel Modules
1. Communication Between Kernel and User Space
1. Application Demo: Building a Ranging Sensor Kernel Module
1. System Debugging and Profiling

## License
You are free to fork or clone this material. See [LICENSE.md](https://github.com/arm-university/Embedded-Linux-Education-Kit/blob/main/License/LICENSE.md) for the complete license.
Binary file not shown.
Binary file added Raspberry_Pi/contents/Module_2/Lab Manual.docx
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added Raspberry_Pi/contents/Module_2/~$b Manual.docx
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
11 changes: 11 additions & 0 deletions Raspberry_Pi/contents/Module_5/Lab Files/hello-mod/files/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
obj-m := hello.o
SRC := $(shell pwd)
all:
$(MAKE) -C $(KERNEL_SRC) M=$(SRC)
modules_install:
$(MAKE) INSTALL_MOD_DIR=kernel/drivers/aup -C $(KERNEL_SRC) M=$(SRC) modules_install

clean:
rm -f *.o *~core.depend .*.cmd *.ko *.mod.c
rm -f Module.markers Module.symvers modules.order
rm -rf .tmp_versions Modules.symvers
43 changes: 43 additions & 0 deletions Raspberry_Pi/contents/Module_5/Lab Files/hello-mod/files/hello.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/cdev.h>


static dev_t hello_dev;
struct cdev hello_cdev;
static char buffer[64];

struct file_operations hello_fops = {
.owner = THIS_MODULE,

};

static int __init hello_module_init(void)
{
printk(KERN_INFO "Loading HelloWorld_module.\n");

alloc_chrdev_region(&hello_dev, 0, 1, "hello_dev");
printk(KERN_INFO "%s\n", format_dev_t(buffer, hello_dev));

cdev_init(&hello_cdev, &hello_fops);
hello_cdev.owner = THIS_MODULE;
cdev_add(&hello_cdev, hello_dev, 1);

return 0;
}

static void __exit hello_module_cleanup(void)
{
printk(KERN_INFO "Cleaning-up hello_dev.\n");
cdev_del(&hello_cdev);
unregister_chrdev_region(hello_dev, 1);
}

module_init(hello_module_init);
module_exit(hello_module_cleanup);

MODULE_AUTHOR("Your Name");
MODULE_LICENSE("GPL");

10 changes: 10 additions & 0 deletions Raspberry_Pi/contents/Module_5/Lab Files/hello-mod/hello_1.0.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
DESCRIPTION = "hello driver"
LICENSE = "GPLv2+"
LIC_FILES_CHKSUM = "file://${BPN}.c;endline=19;md5=4866f9824d27c1cd5324fd5e84caeb6e"

inherit module

PR = "r0"

SRC_URI = "file://Makefile file://${BPN}.c"
S = "${WORKDIR}"
Binary file added Raspberry_Pi/contents/Module_5/Lab Manual.docx
Binary file not shown.
Binary file not shown.
Binary file not shown.
20 changes: 20 additions & 0 deletions Raspberry_Pi/contents/Module_6/Lab Files/gpio-mod/files/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
obj-m := gpio.o

SRC := $(shell pwd)

all:

$(MAKE) -C $(KERNEL_SRC) M=$(SRC)

modules_install:

$(MAKE) INSTALL_MOD_DIR=kernel/drivers/aup -C $(KERNEL_SRC) M=$(SRC) modules_install


clean:

rm -f *.o *~core.depend .*.cmd *.ko *.mod.c

rm -f Module.markers Module.symvers modules.order

rm -rf .tmp_versions Modules.symvers
184 changes: 184 additions & 0 deletions Raspberry_Pi/contents/Module_6/Lab Files/gpio-mod/files/gpio.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>

#include <linux/types.h>
#include <linux/kdev_t.h>
#include <linux/fs.h>
#include <linux/cdev.h>
#include <asm/uaccess.h>

#include <linux/gpio.h>

#include <linux/interrupt.h>

#define GPIO_OUT 20 // GPIO_105
#define GPIO_IN 21 // GPIO_148

static dev_t gpio_dev;

struct cdev gpio_cdev;

static int gpio_lock = 0;

volatile char gpio_in_value = 0;

static irq_handler_t InterruptHandler( unsigned int irq, struct pt_regs *regs )
{
gpio_in_value = gpio_get_value( GPIO_IN );

printk( KERN_INFO "gpio_dev: %s got GPIO_IN with value %c\n",
__func__, gpio_in_value+'0' );

return (irq_handler_t) IRQ_HANDLED;
}


int gpio_open(struct inode *inode, struct file *file)
{
int ret = 0;

printk( KERN_INFO "gpio_dev: %s\n", __func__ );
if( gpio_lock > 0 )
{
ret = -EBUSY;
}
else
gpio_lock++;

return( ret );
}

int gpio_close(struct inode *inode, struct file *file)
{
printk( KERN_INFO "gpio_dev: %s\n", __func__ );

gpio_lock = 0;

return( 0 );
}


ssize_t gpio_read(struct file *filp, char __user *buf, size_t count, loff_t *f_pos)
{
char buffer[2];

printk(KERN_INFO "gpio read (count=%d, offset=%d)\n", (int)count, (int)*f_pos );

buffer[0] = gpio_in_value;
buffer[1] = 0;

copy_to_user( buf, buffer, 1 );

return 1;
}

ssize_t gpio_write(struct file *filp, const char *buffer, size_t length, loff_t * offset)
{
int n = 0;

while( length )
{
if( *buffer == '0' )
{
gpio_set_value( GPIO_OUT, 0 );
printk( KERN_INFO "gpio_dev: %s wrote %c to GPIO_OUT\n", __func__, *buffer );
}
if( *buffer == '1' )
{
gpio_set_value( GPIO_OUT, 1 );
printk( KERN_INFO "gpio_dev: %s wrote %c to GPIO_OUT\n", __func__, *buffer );
}
buffer++;
length--;
n++;
}

return( n );
}


struct file_operations gpio_fops = {
.owner = THIS_MODULE,
.read = gpio_read,
.write = gpio_write,
.open = gpio_open,
.release = gpio_close,
};

static int __init gpio_module_init(void)
{
char buffer[64];
int ret = 0;

printk(KERN_INFO "Loading gpio_module\n");

alloc_chrdev_region(&gpio_dev, 0, 1, "gpio_dev");
printk(KERN_INFO "%s\n", format_dev_t(buffer, gpio_dev));

cdev_init(&gpio_cdev, &gpio_fops);
gpio_cdev.owner = THIS_MODULE;
cdev_add(&gpio_cdev, gpio_dev, 1);

if( gpio_request( GPIO_OUT, "gpio_dev" ) )
{
printk( KERN_INFO "gpio_dev: %s unable to get GPIO_OUT\n", __func__ );
ret = -EBUSY;
goto Done;
}

if( gpio_request( GPIO_IN, "gpio_dev" ) )
{
printk( KERN_INFO "gpio_dev: %s unable to get GPIO_IN\n", __func__ );
ret = -EBUSY;
goto Done;
}

if( gpio_direction_output( GPIO_OUT, 0 ) < 0 )
{
printk( KERN_INFO "gpio_dev: %s unable to set GPIO_OUT as output\n", __func__ );
ret = -EBUSY;
goto Done;
}

if( gpio_direction_input( GPIO_IN ) < 0 )
{
printk( KERN_INFO "gpio_dev: %s unable to set GPIO_IN as input\n", __func__ );
ret = -EBUSY;
goto Done;
}

if( request_irq( gpio_to_irq( GPIO_IN ), (irq_handler_t) InterruptHandler,
IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, "gpio_dev", NULL ) < 0 )
{
printk( KERN_INFO "gpio_dev: %s unable to register gpio irq for GPIO_IN\n",
__func__ );

ret = -EBUSY;
goto Done;
}

Done:
return ret;
}

static void __exit gpio_module_cleanup(void)
{
printk(KERN_INFO "Cleaning-up gpio_dev.\n");

gpio_free( GPIO_OUT );
gpio_free( GPIO_IN );

free_irq( gpio_to_irq( GPIO_IN ), NULL );

gpio_lock = 0;

cdev_del(&gpio_cdev);
unregister_chrdev_region(gpio_dev, 1);
}

module_init(gpio_module_init);
module_exit(gpio_module_cleanup);

MODULE_AUTHOR("Your Name");
MODULE_LICENSE("GPL");

0 comments on commit 4feae88

Please sign in to comment.