-
Notifications
You must be signed in to change notification settings - Fork 1
/
10-Hello_world_tutorial.txt
75 lines (46 loc) · 1.83 KB
/
10-Hello_world_tutorial.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
Guide How to compile and run a hello world driver in the MicroZedBoard
Adrian Remonda 2014
Prerequisites
-------------
Zedboard with a linux running, in this case xilinx 3.15
Linaro toolchain installed
Sources code: MicroZedKernel/src/hello_world
Settings for compiler:
---------------------
Assuming an already installed arm-linux-gnueabihf
~$ export CC=arm-linux-gnueabihf-
Check that is the linaro:
~$ ${CC}gcc --version
arm-linux-gnueabihf-gcc (crosstool-NG linaro-1.13.1-4.9-2014.09 - Linaro GCC 4.9-2014.09) 4.9.2 20140904 (prerelease)
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Connect the board
-----------------
Connect the MicroZed over SSH, in this case the ip address is 192.168.1.103
~$ cd src/hello_world
Be sure that you addapt the Makefile with:
TARGET = 192.168.1.103 -> The ip address of the board
TARGET_DIR = /root -> where the driver will be copied
KERNELDIR ?= ~/src/zynq/kernel/linux-xlnx -> path to the linux kernel sources
~$ make
A hello.ko file should be produced:
~$ ls
Makefile Module.symvers hello.c hello.ko hello.mod.c hello.mod.o hello.o modules.order
Install the module
~$ make install
Connect to the board through SSH
~$ ssh root@ip
Go to /root and check that the *.ko is there
root@arm:~# cd /root
root@arm:~# ls
hello.ko
Insert the module and check that the hello world is loaded:
root@arm:~# insmod hello.ko
root@arm:~# lsmod
Check the kernel logs, a "hello world" should be visible:
root@arm:~# dmesg
To unload the module:
root@arm:~# rmmod hello
root@arm:~# dmesg