summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2002-03-27 11:21:50 +0000
committerBjörn Stenberg <bjorn@haxx.se>2002-03-27 11:21:50 +0000
commitd6023a7adee17628e0ec4bad02e10199c1165bdb (patch)
treeff133f4507b5c388094401093c224fff22215395
parente8c6b2052b11d85b8836a0c07e493b9562dd11eb (diff)
downloadrockbox-d6023a7adee17628e0ec4bad02e10199c1165bdb.tar.gz
rockbox-d6023a7adee17628e0ec4bad02e10199c1165bdb.zip
Initial version
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@34 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--www/codes_new.pngbin0 -> 2300 bytes
-rw-r--r--www/codes_old.pngbin0 -> 2460 bytes
-rw-r--r--www/docs/Makefile9
-rw-r--r--www/docs/index.t36
-rw-r--r--www/example/Makefile40
-rw-r--r--www/example/README7
-rw-r--r--www/example/app.lds23
-rw-r--r--www/example/main.c102
-rw-r--r--www/example/start.s23
-rwxr-xr-xwww/index.cgi41
-rw-r--r--www/rockbox100.pngbin0 -> 4908 bytes
-rw-r--r--www/rockbox400.pngbin0 -> 12261 bytes
-rw-r--r--www/schematics/6k_schematic.pdfbin0 -> 42784 bytes
-rw-r--r--www/schematics/Makefile9
-rw-r--r--www/schematics/PCB_composite_print.pdfbin0 -> 45180 bytes
-rw-r--r--www/schematics/PCB_final_print.pdfbin0 -> 48622 bytes
-rw-r--r--www/schematics/index.t13
-rw-r--r--www/schematics/rec_interface.pdfbin0 -> 30626 bytes
-rw-r--r--www/schematics/rec_main.pdfbin0 -> 91899 bytes
-rw-r--r--www/schematics/remoclone_schem.pdfbin0 -> 9712 bytes
-rw-r--r--www/sh-win/LCDv2Win.zipbin0 -> 64119 bytes
-rw-r--r--www/sh-win/Makefile9
-rw-r--r--www/sh-win/empty.zipbin0 -> 62684 bytes
-rw-r--r--www/sh-win/enviro.jpgbin0 -> 37913 bytes
-rw-r--r--www/sh-win/enviro2.jpgbin0 -> 36174 bytes
-rw-r--r--www/sh-win/enviro3.jpgbin0 -> 10242 bytes
-rw-r--r--www/sh-win/index.t280
27 files changed, 592 insertions, 0 deletions
diff --git a/www/codes_new.png b/www/codes_new.png
new file mode 100644
index 0000000000..03cb1deadb
--- /dev/null
+++ b/www/codes_new.png
Binary files differ
diff --git a/www/codes_old.png b/www/codes_old.png
new file mode 100644
index 0000000000..b30a155a32
--- /dev/null
+++ b/www/codes_old.png
Binary files differ
diff --git a/www/docs/Makefile b/www/docs/Makefile
new file mode 100644
index 0000000000..5ec9d50aa5
--- /dev/null
+++ b/www/docs/Makefile
@@ -0,0 +1,9 @@
1ACTION=@echo preprocessing $@; rm -f $@; fcpp -WWW -I.. -Uunix -H -C -V -LL >$@
2
3SRC := $(wildcard *.t)
4OBJS := $(SRC:%.t=%.html)
5
6all: $(OBJS)
7
8%.html : %.t
9 $(ACTION) $<
diff --git a/www/docs/index.t b/www/docs/index.t
new file mode 100644
index 0000000000..21ad679121
--- /dev/null
+++ b/www/docs/index.t
@@ -0,0 +1,36 @@
1#define _PAGE_ Useful data sheets
2#include "head.t"
3
4<p>All in PDF format.
5
6<h2>General docs</h2>
7
8<ul>
9<li><a href="cpu_sh1_pb.pdf">Hitachi SH-1 Product Brief</a> 120 kB
10<li><a href="sh1_2p.pdf">Hitachi SH-1 Programming Manual r4.0</a> 1600 kB
11<li><a href="sh7032h.pdf">Hitachi SH-1 Hardware Manual r5.0</a> 2300 kB
12<li><a href="flash_SST37VF512.pdf">SST SST37VF020 256kB Flash ROM</a> 172 kB
13</ul>
14
15<h2>Player specific</h2>
16<ul>
17<li><a href="SSD1801R0_4.pdf">Solomon SSD 1801 LCD controller</a> 584 kB (unconfirmed)
18<li><a href="dsp_mas3507d_3pd.pdf">Micronas MAS 3507D MPEG Audio Decoder</a> 872 kB
19<li><a href="dac_dac3550a_1ds.pdf">Micronas DAC 3550A Stereo Audio DAC</a> 592 kB
20<li><a href="dram_41c16105.pdf">ISSI IS41LV16105 Fast Page DRAM</a> 148 kB
21</ul>
22
23<h2>Recorder specific</h2>
24<ul>
25<li><a href="ssd1815r1_5.pdf">Solomon SSD 1815 LCD controller</a> 864 kB
26<li><a href="mas3587f_2pd.pdf">Micronas MAS 3587F MPEG Audio Encoder/Decoder</a> 1300 kB
27<li><a href="dram_k4e151612d.pdf">Samsung K4E151612D EDO DRAM</a> 400 kB
28</ul>
29<ul>
30<li><a href="dc2dc_LM2651.pdf">National LM2651 DC/DC converter</a> 200 kB
31<li><a href="dc2dc_MC34063A.pdf">Fairchild MC34064A DC/DC converter</a> 45 kB
32<li><a href="fet_FZT849.pdf">FZT824 High Current Transistor</a> 60 kB
33<li><a href="rtc_tm41st84w.pdf">ST M41ST84W Real Time Clock</a> 180 kB
34</ul>
35
36#include "foot.t"
diff --git a/www/example/Makefile b/www/example/Makefile
new file mode 100644
index 0000000000..7d8f2fdefd
--- /dev/null
+++ b/www/example/Makefile
@@ -0,0 +1,40 @@
1HPATH = /usr/local/sh-gcc/bin
2CC = $(HPATH)/sh-elf-gcc
3LD = $(HPATH)/sh-elf-ld
4AR = $(HPATH)/sh-elf-ar
5AS = $(HPATH)/sh-elf-as
6OC = $(HPATH)/sh-elf-objcopy
7
8INCLUDES=-I.
9
10CFLAGS = -Os -Wall -m1 -nostdlib -Wstrict-prototypes -fomit-frame-pointer -fschedule-insns $(INCLUDES)
11AFLAGS += -small -relax
12
13OBJS= start.o main.o
14
15%.o: %.s
16 $(CC) -o $@ $(CFLAGS) $(INCLUDES) $(DEFS) -c $<
17
18
19all : archos.mod # archos.asm
20
21main.o: main.c
22
23archos.elf : $(OBJS) app.lds
24 $(CC) -nostdlib -o archos.elf $(OBJS) -lgcc -Tapp.lds -Wl,-Map,archos.map
25
26archos.bin : archos.elf
27 $(OC) -O binary archos.elf archos.bin
28
29archos.asm: archos.bin
30 sh2d -sh1 archos.bin > archos.asm
31
32archos.mod : archos.bin
33 scramble archos.bin archos.mod
34
35dist:
36 tar czvf dist.tar.gz Makefile main.c start.s app.lds
37
38clean:
39 -rm -f *.x *.i *.o *.elf *.bin *.map *.mod *.bak *~
40
diff --git a/www/example/README b/www/example/README
new file mode 100644
index 0000000000..ca8ea36c37
--- /dev/null
+++ b/www/example/README
@@ -0,0 +1,7 @@
1Rockbox example build
2---------------------
3
4These files are meant to show how to build a simple program for the Archos.
5
6Note that the display code only works on older machines (<4.50) so don't
7look too hard on that.
diff --git a/www/example/app.lds b/www/example/app.lds
new file mode 100644
index 0000000000..03bd1b2b54
--- /dev/null
+++ b/www/example/app.lds
@@ -0,0 +1,23 @@
1ENTRY(_start)
2OUTPUT_FORMAT(elf32-sh)
3SECTIONS
4{
5 .vectors 0x09000000 :
6 {
7 *(.vectors);
8 . = ALIGN(0x200);
9 *(.text.start)
10 *(.text)
11 *(.rodata)
12 }
13
14 .bss :
15 {
16 _stack = . + 0x1000;
17 }
18
19 .pad 0x0900C800 :
20 {
21 LONG(0);
22 }
23 }
diff --git a/www/example/main.c b/www/example/main.c
new file mode 100644
index 0000000000..9188aaf640
--- /dev/null
+++ b/www/example/main.c
@@ -0,0 +1,102 @@
1#define PBDR (*((volatile unsigned short *)0x05FFFFC2))
2
3#define DC 1
4#define CS1 2
5#define SDA 4
6#define SCK 8
7
8static const unsigned char ascii2lcd[] = {
9 0x00,0x01,0x02,0x03,0x00,0x84,0x85,0x89,
10 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
11 0xec,0xe3,0xe2,0xe1,0xe0,0xdf,0x15,0x00,
12 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
13 0x24,0x25,0x26,0x37,0x06,0x29,0x2a,0x2b,
14 0x2c,0x2d,0x2e,0x2f,0x30,0x31,0x32,0x33,
15 0x34,0x35,0x36,0x37,0x38,0x39,0x3a,0x3b,
16 0x3c,0x3d,0x3e,0x3f,0x40,0x41,0x42,0x43,
17 0x44,0x45,0x46,0x47,0x48,0x49,0x4a,0x4b,
18 0x4c,0x4d,0x4e,0x4f,0x50,0x51,0x52,0x53,
19 0x54,0x55,0x56,0x57,0x58,0x59,0x5a,0x5b,
20 0x5c,0x5d,0x5e,0xa9,0x33,0xce,0x00,0x15,
21 0x00,0x65,0x66,0x67,0x68,0x69,0x6a,0x6b,
22 0x6c,0x6d,0x6e,0x6f,0x70,0x71,0x72,0x73,
23 0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0x7b,
24 0x7c,0x7d,0x7e,0x24,0x24,0x24,0x24,0x24,
25 0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24,
26 0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24,
27 0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24,
28 0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24,
29 0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24,
30 0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24,
31 0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24,
32 0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24,
33 0x45,0x45,0x45,0x45,0x45,0x45,0x24,0x47,
34 0x49,0x49,0x49,0x49,0x4d,0x4d,0x4d,0x4d,
35 0x48,0x52,0x53,0x53,0x53,0x53,0x53,0x24,
36 0x24,0x59,0x59,0x59,0x59,0x5d,0x24,0x24,
37 0x65,0x65,0x65,0x65,0x65,0x65,0x24,0x67,
38 0x69,0x69,0x69,0x69,0x6d,0x6d,0x6d,0x6d,
39 0x73,0x72,0x73,0x73,0x73,0x73,0x73,0x24,
40 0x24,0x79,0x79,0x79,0x79,0x7d,0x24,0x7d
41};
42
43void lcd_write(int byte, int data)
44{
45 int i;
46 char on,off;
47
48 PBDR &= ~CS1; /* enable lcd chip select */
49
50 if ( data ) {
51 on=~(SDA|SCK);
52 off=SCK|DC;
53 }
54 else {
55 on=~(SDA|SCK|DC);
56 off=SCK;
57 }
58 /* clock out each bit, MSB first */
59 for (i=0x80;i;i>>=1)
60 {
61 PBDR &= on;
62 if (i & byte)
63 PBDR |= SDA;
64 PBDR |= off;
65 }
66
67 PBDR |= CS1; /* disable lcd chip select */
68}
69
70void lcd_printxy( char x, char y, unsigned char* string, int len )
71{
72 int i;
73 lcd_write(0xb0+y*16+x,0);
74 for (i=0; string[i] && i<len; i++)
75 lcd_write(ascii2lcd[string[i]],1);
76}
77
78int main(void)
79{
80 lcd_printxy(0,0,"Open Source",11);
81
82 /* simple scroll */
83 while (1) {
84 int i,j;
85 char* string = " Jukebox Jukebox ";
86 for ( i=0; i<11; i++ ) {
87 lcd_printxy(0,1,string+i,11);
88 for (j=0; j<600000; j++);
89 PBDR ^= 0x40; /* toggle LED (PB6) */
90 }
91 }
92}
93
94extern const void stack(void);
95
96const void* vectors[] __attribute__ ((section (".vectors"))) =
97{
98 main, /* Power-on reset */
99 stack, /* Power-on reset (stack pointer) */
100 main, /* Manual reset */
101 stack /* Manual reset (stack pointer) */
102};
diff --git a/www/example/start.s b/www/example/start.s
new file mode 100644
index 0000000000..fd4669db56
--- /dev/null
+++ b/www/example/start.s
@@ -0,0 +1,23 @@
1! note: sh-1 has a "delay cycle" after every branch where you can
2! execute another instruction "for free".
3
4 .file "start.s"
5 .section .text.start
6 .extern _main
7 .extern _vectors
8 .extern _stack
9 .global _start
10 .align 2
11
12_start:
13 mov.l 1f, r1
14 mov.l 3f, r3
15 mov.l 2f, r15
16 jmp @r3
17 ldc r1, vbr
18 nop
19
201: .long _vectors
212: .long _stack
223: .long _main
23 .type _start,@function
diff --git a/www/index.cgi b/www/index.cgi
new file mode 100755
index 0000000000..a340a2e5ac
--- /dev/null
+++ b/www/index.cgi
@@ -0,0 +1,41 @@
1#!/usr/bin/perl
2
3# A very simple load balancing script:
4# If more than $nlim hits in under $tlim seconds, redirect to $mirror.
5#
6# 2002-01-24 Björn Stenberg <bjorn@haxx.se>
7
8# redirect is triggered by more than:
9$nlim = 10; # accesses in...
10$tlim = 10; # seconds
11$mirror = "http://rockbox.sourceforge.net/bjorn.haxx.se/rockbox/";
12
13open FILE, "+<.load" or die "Can't open .load: $!";
14flock FILE, LOCK_EX;
15@a = <FILE>;
16if ( scalar @a > $nlim ) {
17 $first = shift @a;
18}
19else {
20 $first = $a[0];
21}
22$now = time();
23@a = ( @a, "$now\n" );
24truncate FILE, 0;
25seek FILE, 0, 0;
26for ( @a ) {
27 print FILE $_;
28}
29flock FILE, LOCK_UN;
30close FILE;
31
32$diff = $now - $first;
33if ( $diff < $tlim ) {
34 print "Location: $mirror\n\n";
35}
36else {
37 print "Content-Type: text/html\n\n";
38 open FILE, "<main.html" or die "Can't open main.html: $!\n";
39 print <FILE>;
40 close FILE;
41}
diff --git a/www/rockbox100.png b/www/rockbox100.png
new file mode 100644
index 0000000000..4c7cdcb426
--- /dev/null
+++ b/www/rockbox100.png
Binary files differ
diff --git a/www/rockbox400.png b/www/rockbox400.png
new file mode 100644
index 0000000000..84d940abe9
--- /dev/null
+++ b/www/rockbox400.png
Binary files differ
diff --git a/www/schematics/6k_schematic.pdf b/www/schematics/6k_schematic.pdf
new file mode 100644
index 0000000000..611e501faf
--- /dev/null
+++ b/www/schematics/6k_schematic.pdf
Binary files differ
diff --git a/www/schematics/Makefile b/www/schematics/Makefile
new file mode 100644
index 0000000000..5ec9d50aa5
--- /dev/null
+++ b/www/schematics/Makefile
@@ -0,0 +1,9 @@
1ACTION=@echo preprocessing $@; rm -f $@; fcpp -WWW -I.. -Uunix -H -C -V -LL >$@
2
3SRC := $(wildcard *.t)
4OBJS := $(SRC:%.t=%.html)
5
6all: $(OBJS)
7
8%.html : %.t
9 $(ACTION) $<
diff --git a/www/schematics/PCB_composite_print.pdf b/www/schematics/PCB_composite_print.pdf
new file mode 100644
index 0000000000..a3deddf6f2
--- /dev/null
+++ b/www/schematics/PCB_composite_print.pdf
Binary files differ
diff --git a/www/schematics/PCB_final_print.pdf b/www/schematics/PCB_final_print.pdf
new file mode 100644
index 0000000000..69cfd88c47
--- /dev/null
+++ b/www/schematics/PCB_final_print.pdf
Binary files differ
diff --git a/www/schematics/index.t b/www/schematics/index.t
new file mode 100644
index 0000000000..68e7a2e72f
--- /dev/null
+++ b/www/schematics/index.t
@@ -0,0 +1,13 @@
1#define _PAGE_ Schematics
2#include "head.t"
3
4<p><a href="6k_schematic.pdf">Jukebox 6000</a> R3
5
6<p><a href="rec_main.pdf">Jukebox Recorder</a> main board, rev2
7<br><a href="rec_interface.pdf">Jukebox Recorder</a> interface board, rev2.1
8
9<p><a href="remoclone_schem.pdf">Remoclone schematics</a>
10<br><a href="PCB_composite_print.pdf">Remoclone PCB composite print</a>
11<br><a href="PCB_final_print.pdf">Remoclone PCB final print</a>
12
13#include "foot.t"
diff --git a/www/schematics/rec_interface.pdf b/www/schematics/rec_interface.pdf
new file mode 100644
index 0000000000..803e3521b2
--- /dev/null
+++ b/www/schematics/rec_interface.pdf
Binary files differ
diff --git a/www/schematics/rec_main.pdf b/www/schematics/rec_main.pdf
new file mode 100644
index 0000000000..5c3fb290a6
--- /dev/null
+++ b/www/schematics/rec_main.pdf
Binary files differ
diff --git a/www/schematics/remoclone_schem.pdf b/www/schematics/remoclone_schem.pdf
new file mode 100644
index 0000000000..b2620ce476
--- /dev/null
+++ b/www/schematics/remoclone_schem.pdf
Binary files differ
diff --git a/www/sh-win/LCDv2Win.zip b/www/sh-win/LCDv2Win.zip
new file mode 100644
index 0000000000..33e7872be9
--- /dev/null
+++ b/www/sh-win/LCDv2Win.zip
Binary files differ
diff --git a/www/sh-win/Makefile b/www/sh-win/Makefile
new file mode 100644
index 0000000000..5ec9d50aa5
--- /dev/null
+++ b/www/sh-win/Makefile
@@ -0,0 +1,9 @@
1ACTION=@echo preprocessing $@; rm -f $@; fcpp -WWW -I.. -Uunix -H -C -V -LL >$@
2
3SRC := $(wildcard *.t)
4OBJS := $(SRC:%.t=%.html)
5
6all: $(OBJS)
7
8%.html : %.t
9 $(ACTION) $<
diff --git a/www/sh-win/empty.zip b/www/sh-win/empty.zip
new file mode 100644
index 0000000000..a1b354fbf7
--- /dev/null
+++ b/www/sh-win/empty.zip
Binary files differ
diff --git a/www/sh-win/enviro.jpg b/www/sh-win/enviro.jpg
new file mode 100644
index 0000000000..eb90f6d47e
--- /dev/null
+++ b/www/sh-win/enviro.jpg
Binary files differ
diff --git a/www/sh-win/enviro2.jpg b/www/sh-win/enviro2.jpg
new file mode 100644
index 0000000000..706adaff4f
--- /dev/null
+++ b/www/sh-win/enviro2.jpg
Binary files differ
diff --git a/www/sh-win/enviro3.jpg b/www/sh-win/enviro3.jpg
new file mode 100644
index 0000000000..1eb15f8b8b
--- /dev/null
+++ b/www/sh-win/enviro3.jpg
Binary files differ
diff --git a/www/sh-win/index.t b/www/sh-win/index.t
new file mode 100644
index 0000000000..e3923c498a
--- /dev/null
+++ b/www/sh-win/index.t
@@ -0,0 +1,280 @@
1#define _PAGE_ Setting up an SH-1 compiler for Windows
2#include "head.t"
3<P>
4by <A href="mailto:edx@codeforce.d2g.com">Felix Arends</A>, 1/8/2002
5<BR>
6
7<P>
8NOTE: THIS COMPILER DOES NOT YET WORK WITH WINDOWS XP!!!
9
10<P>
11I have spent a long time figuring out how to compile SH1 code in windows (using
12the sh-elf-gcc compiler) and when I finally compiled the first OS for my
13Jukebox I decided to write a little tutorial explaining the setup process.
14
15<H2>
16The GNU-SH Tool Chain for Windows
17</H2>
18<P>
19This is actually all you need to download. It includes the binutils, gcc and
20newlib. The complete GNUSH Tool Chain (currently v0101) is 117MB but for you it
21is enough to download the GNUSH Tool Chain for ELF format (45 MB).
22
23<P>
24The GNUSH website can be found at <a href="http://www.kpit.com/download/downloadgnu.htm">
25http://www.kpit.com/download/downloadgnu.htm</a> (source code is also
26available there) and the direct link to the file you need is <a href="http://www.kpit.com/download/elf.zip">
27http://www.kpit.com/download/elf.zip</a>. It uses the cygwin dll to emulate
28a linux layer but you do not have to care about that.
29
30<H2>
31Setting up&nbsp;the Compiler
32</H2>
33<P>
34Install the GNUSH Tool Chain (nothing you really have to care about during the
35installation process). After that you should add some paths to your PATH system
36environment variable. If you have Windows 95/98/Me you can do that by modifying
37your autoexec.bat:
38
39<P>
40Add the following line to your autoexec.bat:
41
42<P>
43<TABLE cellSpacing="1" cellPadding="1" width="100%" border="1">
44<TBODY>
45<TR>
46<TD bgcolor="#a0d6e8">
47<code>SET PATH=%PATH%;C:\Programs\kpit\GNU-SH v0101
48[ELF]\Sh-elf\bin\;C:\Programs\kpit\GNU-SH v0101
49[ELF]\Sh-elf\lib\gcc-lib\sh-elf\2.9-GNU-SH-v0101\;C:\Programs\kpit\GNU-SH v0101
50[ELF]\Other Utilities</code>
51</TD>
52</TR>
53</TBODY>
54</TABLE>
55
56<P>
57</CODE>(Note: This is just one single line)
58
59<P>
60Replace the beginning of the paths with the path-name you chose to installt the
61tools in. Reboot.
62
63<P>
64In Windows 2000 it is a bit different. You can find the PATH-environment
65variable if you right-click the "My Computer" icon on your desktop and choose
66"Properties" in the popup-menu. Go to the "Advanced" tab and click
67"Environment-Variables":
68
69<P align="center">
70<IMG src="enviro.jpg"> <IMG src="enviro2.jpg"> <IMG src="enviro3.jpg">
71
72<P>
73(Note: There is also a PATH-variable in the "System variables" list, it does
74not matter which one you edit)
75
76<P>
77To the value the PATH-variable already has, add:
78
79<P>
80<TABLE cellSpacing="1" cellPadding="1" width="100%" border="1">
81<TR>
82<TD bgcolor="#a0d6e8">
83<code>;C:\Programs\kpit\GNU-SH v0101 [ELF]\Sh-elf\bin\;C:\Programs\kpit\GNU-SH
84v0101 [ELF]\Sh-elf\lib\gcc-lib\sh-elf\2.9-GNU-SH-v0101\;C:\Programs\kpit\GNU-SH
85v0101 [ELF]\Other Utilities</code>
86</TD>
87</TR>
88</TABLE>
89
90<P>
91Replace the program path with the path you chose for the program. You do not
92have to reboot.
93
94<H2>
95An "empty" System
96</H2>
97<P>
98First of all, I'll explain what to do to compile an "empty" system. It just
99initializes and calls the <EM>main</EM> function, but does not do anything
100else. You can add some code to the <EM>main</EM> function and simply recompile.
101It is actually like this: You don't have to care about any of those files,
102because you won't have to change much of them (except the main.cpp of
103course!!).
104
105<P>
106<STRONG>main.cpp:
107<BR>
108</STRONG>
109<TABLE cellSpacing="1" cellPadding="1" width="550" border="1">
110<TR>
111<TD bgcolor="#a0d6e8">
112<P>
113<code><font color="#0000ff">int</font> __main(<font color="#0000ff">void</font>){}
114<BR>
115<BR>
116<font color="#0000ff">int</font> main(<font color="#0000ff">void</font>)
117<BR>
118{
119<BR>
120<font color="#009000">&nbsp;&nbsp;&nbsp; // add code here</font>
121<BR>
122}
123<BR>
124<BR>
125<FONT color="#0000ff">extern</FONT> <FONT color="#0000ff">const</FONT> <FONT color="#0000ff">
126void</FONT> stack(<FONT color="#0000ff">void</FONT>);
127<br>
128<br>
129<FONT color="#0000ff">const</FONT> <FONT color="#0000ff">void</FONT>* vectors[]
130__attribute__ ((section (".vectors"))) =
131<br>
132{
133<br>
134&nbsp;&nbsp;&nbsp; main, <FONT color="#009000">/* Power-on reset */</FONT>
135<br>
136&nbsp;&nbsp;&nbsp; stack, <FONT color="#009000">/* Power-on reset (stack pointer)
137*/</FONT>
138<br>
139&nbsp;&nbsp;&nbsp; main, <FONT color="#009000">/* Manual reset */</FONT>
140<br>
141&nbsp;&nbsp;&nbsp; stack <FONT color="#009000">/* Manual reset (stack pointer) */</FONT>
142<br>
143};
144<br>
145</code>
146
147</TD>
148</TR>
149</TABLE>
150
151<P>
152We need a start-up assembler code:
153
154<P>
155<STRONG>start.asm
156<br>
157</STRONG>
158<TABLE cellSpacing="1" cellPadding="1" width="550" border="1">
159<TR>
160<TD bgcolor="#a0d6e8">
161<code>
162<pre>! note: sh-1 has a "delay cycle" after every branch where you can
163! execute another instruction "for free".
164
165.file"start.asm"
166.section.text.start
167.extern_main
168.extern _vectors
169.extern _stack
170.global _start
171.align 2
172
173_start:
174mov.l1f, r1
175mov.l3f, r3
176mov.l2f, r15
177jmp@r3
178ldcr1, vbr
179nop
180
1811:.long_vectors
1822:.long_stack
1833:.long_main
184.type_start,@function</pre>
185</code>
186</TD>
187</TR>
188</TABLE>
189
190<P>
191(I took this code from Björn's LCDv2 source)
192
193<P>
194Then we need a linker configuration file:
195
196<P>
197<STRONG>linker.cfg</STRONG>
198<BR>
199<TABLE cellSpacing="1" cellPadding="1" width="550" border="1">
200<TR>
201<TD bgcolor="#a0d6e8">
202<P>
203<code>
204<pre>ENTRY(_start)
205OUTPUT_FORMAT(elf32-sh)
206SECTIONS
207{
208 .vectors 0x09000000 :
209 {
210 *(.vectors);
211 . = ALIGN(0x200);
212 *(.text.start)
213 *(.text)
214 *(.rodata)
215 }
216
217 .bss :
218 {
219 _stack = . + 0x1000;
220 }
221
222 .pad 0x0900C800 :
223 {
224 LONG(0);
225 }
226 }</pre>
227</code>
228</TD>
229</TR>
230</TABLE>
231
232<P>
233(This code comes from Börn's LCDv2 as well)
234
235<P>
236Last but not least, we need a batch file to link all this and output a usable
237.mod file (you don't really need a batch file if you want to enter all the
238commands over and over angain :])
239
240<P>
241<STRONG>make.bat</STRONG>
242<BR>
243<TABLE cellSpacing="1" cellPadding="1" width="550" border="1">
244<TR>
245<TD bgcolor="#a0d6e8">
246<P>
247<code>
248<pre>SET INCLUDES=
249SET SOURCEFILES=main.c
250SET OBJECTS=main.o start.o
251
252sh-elf-as start.asm -o start.o -L -a
253sh-elf-gcc -O2 -m1 -o main.o -c -nostdlib %INCLUDES% %SOURCEFILES%
254sh-elf-ld -o main.out %OBJECTS% -Tlinker.cfg
255padit main.out
256scramble main.out archos.mod
257
258PAUSE</pre>
259</code>
260</TD>
261</TR>
262</TABLE>
263
264<P>
265And that's it! I have prepared all those files in a .zip archive for you so you
266don't have to copy'n'paste that much :). I have also prepared a package with
267the LCDv2 code Björn wrote (ready to compile with Windows).
268
269<P>
270<a href="LCDv2Win.zip">empty.zip</a>
271<BR>
272<a href="LCDv2Win.zip">LCDv2Win.zip</a>
273
274<P>
275I hope this tutorial helped you to compile an Archos firmware with windows. If
276you have any questions, comments or corrections, please mail to <A href="mailto:edx@codeforce.d2g.com">
277edx@codeforce.d2g.com</A>
278
279#include "foot.t"
280