Add some RTEMS notes
[yaffs2.git] / rtems / RTEMS_NOTES
1
2
3 Building with Makeifle
4
5 Assuming the BSP is the sparc erc32 BSP in:
6 /home/charles/quick-start/rtems/5/sparc-rtems5/erc32/
7
8
9
10 Set up environment variuables
11
12 export RTEMS_MAKEFILE_PATH=/home/charles/quick-start/rtems/5/sparc-rtems5/erc32/
13 export PATH=/home/charles/quick-start/rtems/5/bin/:$PATH
14
15 Now we can build and install the Yaffs library:
16
17 $cd /opt/y/git/yaffs2/rtems
18
19 $make -f Makefile.rtems clean
20 $make -f Makefile.rtems all
21    output is build-erc32/libyaffs2.a
22 $make -f Makefile.rtems install
23    mkdir -p /home/charles/quick-start/rtems/5/sparc-rtems5/erc32/lib/include/yaffs
24    install -m 644 build-erc32/libyaffs2.a /home/charles/quick-start/rtems/5/sparc-rtems5/erc32/lib
25    install -m 644 rtems_yaffs.h yportenv.h ydirectenv.h yaffs_osglue.h yaffs_hweight.h yaffscfg.h yaffs_list.h yaffsfs.h yaffs_guts.h yaffs_packedtags2.h yaffs_ecc.h /home/charles/quick-start/rtems/5/sparc-rtems5/erc32/lib/include/yaffs
26
27
28 Building test application
29
30
31 $ cd rtems-y-test/
32
33
34
35 Running 
36
37 $  sparc-rtems5-sis hello_world_c/o-optimize/hello.exe
38
39  SIS - SPARC/RISCV instruction simulator 2.20,  copyright Jiri Gaisler 2019
40  Bug-reports to jiri@gaisler.se
41
42  ERC32 emulation enabled
43
44  Loaded hello_world_c/o-optimize/hello.exe, entry 0x02000000
45 sis> go
46 resuming at 0x02000000
47
48
49 *** HELLO WORLD TEST ***
50 Hello World 123
51 *** END OF HELLO WORLD TEST ***
52
53 *** FATAL ***
54 fatal source: 5 (RTEMS_FATAL_SOURCE_EXIT)
55 fatal code: 0 (0x00000000)
56 RTEMS version: 5.0.0.e22554535796fc29a7ed7c5e2338128e324a621d-modified
57 RTEMS tools: 7.5.0 20191114 (RTEMS 5, RSB 5 (599c4d7c87fa), Newlib d14714c69)
58 executing thread ID: 0x08a010001
59 executing thread name: UI1 
60 cpu 0 in error mode (tt = 0x101)
61    125619  0200c0e0:  91d02000   ta  0x0
62 sis> 
63
64
65 Running with GDB
66
67 Open a second terminal to run sis in gdb mode
68
69 $ sparc-rtems5-sis -gdb
70
71  SIS - SPARC/RISCV instruction simulator 2.20,  copyright Jiri Gaisler 2019
72  Bug-reports to jiri@gaisler.se
73
74  ERC32 emulation enabled
75
76 gdb: listening on port 1234 connected
77 X2000000,0:#40
78
79
80 *** HELLO WORLD TEST ***
81 Hello World 123
82 *** END OF HELLO WORLD TEST ***
83
84 *** FATAL ***
85 fatal source: 5 (RTEMS_FATAL_SOURCE_EXIT)
86 fatal code: 0 (0x00000000)
87 RTEMS version: 5.0.0.e22554535796fc29a7ed7c5e2338128e324a621d-modified
88 RTEMS tools: 7.5.0 20191114 (RTEMS 5, RSB 5 (599c4d7c87fa), Newlib d14714c69)
89 executing thread ID: 0x08a010001
90 executing thread name: UI1 
91
92
93
94
95
96
97 From other window use gdb
98
99
100
101 $ sparc-rtems5-gdb hello.exe
102 GNU gdb (GDB) 8.3
103 Copyright (C) 2019 Free Software Foundation, Inc.
104 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
105 This is free software: you are free to change and redistribute it.
106 There is NO WARRANTY, to the extent permitted by law.
107 Type "show copying" and "show warranty" for details.
108 This GDB was configured as "--host=x86_64-linux-gnu --target=sparc-rtems5".
109 Type "show configuration" for configuration details.
110 For bug reporting instructions, please see:
111 <http://www.gnu.org/software/gdb/bugs/>.
112 Find the GDB manual and other documentation resources online at:
113     <http://www.gnu.org/software/gdb/documentation/>.
114
115 For help, type "help".
116 Type "apropos word" to search for commands related to "word"...
117 Reading symbols from hello.exe...
118 (gdb) target remote :1234
119 :1234: Connection timed out.
120 (gdb) target remote :1234
121 Remote debugging using :1234
122 0x00000000 in ?? ()
123 (gdb) load
124 Loading section .text, size 0x12880 lma 0x2000000
125 Loading section .rtemsroset, size 0x40 lma 0x2012880
126 Loading section .data, size 0x530 lma 0x20138c0
127 Start address 0x2000000, load size 77296
128 Transfer rate: 2434 KB/sec, 270 bytes/write.
129 (gdb) c
130 Continuing.
131
132 Program received signal SIGTERM, Terminated.
133 syscall () at /home/charles/quick-start/src/rtems/c/src/../../cpukit/score/cpu/sparc/syscall.S:44
134 44              ta      0                       ! syscall 1, halt with %g1,%g2,%g3 info
135 (gdb) 
136