diff options
author | Björn Stenberg <bjorn@haxx.se> | 2002-03-27 11:21:50 +0000 |
---|---|---|
committer | Björn Stenberg <bjorn@haxx.se> | 2002-03-27 11:21:50 +0000 |
commit | d6023a7adee17628e0ec4bad02e10199c1165bdb (patch) | |
tree | ff133f4507b5c388094401093c224fff22215395 /www | |
parent | e8c6b2052b11d85b8836a0c07e493b9562dd11eb (diff) | |
download | rockbox-d6023a7adee17628e0ec4bad02e10199c1165bdb.tar.gz rockbox-d6023a7adee17628e0ec4bad02e10199c1165bdb.zip |
Initial version
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@34 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'www')
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 @@ | |||
1 | ACTION=@echo preprocessing $@; rm -f $@; fcpp -WWW -I.. -Uunix -H -C -V -LL >$@ | ||
2 | |||
3 | SRC := $(wildcard *.t) | ||
4 | OBJS := $(SRC:%.t=%.html) | ||
5 | |||
6 | all: $(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 @@ | |||
1 | HPATH = /usr/local/sh-gcc/bin | ||
2 | CC = $(HPATH)/sh-elf-gcc | ||
3 | LD = $(HPATH)/sh-elf-ld | ||
4 | AR = $(HPATH)/sh-elf-ar | ||
5 | AS = $(HPATH)/sh-elf-as | ||
6 | OC = $(HPATH)/sh-elf-objcopy | ||
7 | |||
8 | INCLUDES=-I. | ||
9 | |||
10 | CFLAGS = -Os -Wall -m1 -nostdlib -Wstrict-prototypes -fomit-frame-pointer -fschedule-insns $(INCLUDES) | ||
11 | AFLAGS += -small -relax | ||
12 | |||
13 | OBJS= start.o main.o | ||
14 | |||
15 | %.o: %.s | ||
16 | $(CC) -o $@ $(CFLAGS) $(INCLUDES) $(DEFS) -c $< | ||
17 | |||
18 | |||
19 | all : archos.mod # archos.asm | ||
20 | |||
21 | main.o: main.c | ||
22 | |||
23 | archos.elf : $(OBJS) app.lds | ||
24 | $(CC) -nostdlib -o archos.elf $(OBJS) -lgcc -Tapp.lds -Wl,-Map,archos.map | ||
25 | |||
26 | archos.bin : archos.elf | ||
27 | $(OC) -O binary archos.elf archos.bin | ||
28 | |||
29 | archos.asm: archos.bin | ||
30 | sh2d -sh1 archos.bin > archos.asm | ||
31 | |||
32 | archos.mod : archos.bin | ||
33 | scramble archos.bin archos.mod | ||
34 | |||
35 | dist: | ||
36 | tar czvf dist.tar.gz Makefile main.c start.s app.lds | ||
37 | |||
38 | clean: | ||
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 @@ | |||
1 | Rockbox example build | ||
2 | --------------------- | ||
3 | |||
4 | These files are meant to show how to build a simple program for the Archos. | ||
5 | |||
6 | Note that the display code only works on older machines (<4.50) so don't | ||
7 | look 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 @@ | |||
1 | ENTRY(_start) | ||
2 | OUTPUT_FORMAT(elf32-sh) | ||
3 | SECTIONS | ||
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 | |||
8 | static 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 | |||
43 | void 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 | |||
70 | void 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 | |||
78 | int 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 | |||
94 | extern const void stack(void); | ||
95 | |||
96 | const 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 | |||
20 | 1: .long _vectors | ||
21 | 2: .long _stack | ||
22 | 3: .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 | |||
13 | open FILE, "+<.load" or die "Can't open .load: $!"; | ||
14 | flock FILE, LOCK_EX; | ||
15 | @a = <FILE>; | ||
16 | if ( scalar @a > $nlim ) { | ||
17 | $first = shift @a; | ||
18 | } | ||
19 | else { | ||
20 | $first = $a[0]; | ||
21 | } | ||
22 | $now = time(); | ||
23 | @a = ( @a, "$now\n" ); | ||
24 | truncate FILE, 0; | ||
25 | seek FILE, 0, 0; | ||
26 | for ( @a ) { | ||
27 | print FILE $_; | ||
28 | } | ||
29 | flock FILE, LOCK_UN; | ||
30 | close FILE; | ||
31 | |||
32 | $diff = $now - $first; | ||
33 | if ( $diff < $tlim ) { | ||
34 | print "Location: $mirror\n\n"; | ||
35 | } | ||
36 | else { | ||
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 @@ | |||
1 | ACTION=@echo preprocessing $@; rm -f $@; fcpp -WWW -I.. -Uunix -H -C -V -LL >$@ | ||
2 | |||
3 | SRC := $(wildcard *.t) | ||
4 | OBJS := $(SRC:%.t=%.html) | ||
5 | |||
6 | all: $(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 @@ | |||
1 | ACTION=@echo preprocessing $@; rm -f $@; fcpp -WWW -I.. -Uunix -H -C -V -LL >$@ | ||
2 | |||
3 | SRC := $(wildcard *.t) | ||
4 | OBJS := $(SRC:%.t=%.html) | ||
5 | |||
6 | all: $(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> | ||
4 | by <A href="mailto:edx@codeforce.d2g.com">Felix Arends</A>, 1/8/2002 | ||
5 | <BR> | ||
6 | |||
7 | <P> | ||
8 | NOTE: THIS COMPILER DOES NOT YET WORK WITH WINDOWS XP!!! | ||
9 | |||
10 | <P> | ||
11 | I have spent a long time figuring out how to compile SH1 code in windows (using | ||
12 | the sh-elf-gcc compiler) and when I finally compiled the first OS for my | ||
13 | Jukebox I decided to write a little tutorial explaining the setup process. | ||
14 | |||
15 | <H2> | ||
16 | The GNU-SH Tool Chain for Windows | ||
17 | </H2> | ||
18 | <P> | ||
19 | This is actually all you need to download. It includes the binutils, gcc and | ||
20 | newlib. The complete GNUSH Tool Chain (currently v0101) is 117MB but for you it | ||
21 | is enough to download the GNUSH Tool Chain for ELF format (45 MB). | ||
22 | |||
23 | <P> | ||
24 | The GNUSH website can be found at <a href="http://www.kpit.com/download/downloadgnu.htm"> | ||
25 | http://www.kpit.com/download/downloadgnu.htm</a> (source code is also | ||
26 | available there) and the direct link to the file you need is <a href="http://www.kpit.com/download/elf.zip"> | ||
27 | http://www.kpit.com/download/elf.zip</a>. It uses the cygwin dll to emulate | ||
28 | a linux layer but you do not have to care about that. | ||
29 | |||
30 | <H2> | ||
31 | Setting up the Compiler | ||
32 | </H2> | ||
33 | <P> | ||
34 | Install the GNUSH Tool Chain (nothing you really have to care about during the | ||
35 | installation process). After that you should add some paths to your PATH system | ||
36 | environment variable. If you have Windows 95/98/Me you can do that by modifying | ||
37 | your autoexec.bat: | ||
38 | |||
39 | <P> | ||
40 | Add 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> | ||
60 | Replace the beginning of the paths with the path-name you chose to installt the | ||
61 | tools in. Reboot. | ||
62 | |||
63 | <P> | ||
64 | In Windows 2000 it is a bit different. You can find the PATH-environment | ||
65 | variable 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 | ||
74 | not matter which one you edit) | ||
75 | |||
76 | <P> | ||
77 | To 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 | ||
84 | v0101 [ELF]\Sh-elf\lib\gcc-lib\sh-elf\2.9-GNU-SH-v0101\;C:\Programs\kpit\GNU-SH | ||
85 | v0101 [ELF]\Other Utilities</code> | ||
86 | </TD> | ||
87 | </TR> | ||
88 | </TABLE> | ||
89 | |||
90 | <P> | ||
91 | Replace the program path with the path you chose for the program. You do not | ||
92 | have to reboot. | ||
93 | |||
94 | <H2> | ||
95 | An "empty" System | ||
96 | </H2> | ||
97 | <P> | ||
98 | First of all, I'll explain what to do to compile an "empty" system. It just | ||
99 | initializes and calls the <EM>main</EM> function, but does not do anything | ||
100 | else. You can add some code to the <EM>main</EM> function and simply recompile. | ||
101 | It is actually like this: You don't have to care about any of those files, | ||
102 | because you won't have to change much of them (except the main.cpp of | ||
103 | course!!). | ||
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"> // 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"> | ||
126 | void</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 | main, <FONT color="#009000">/* Power-on reset */</FONT> | ||
135 | <br> | ||
136 | stack, <FONT color="#009000">/* Power-on reset (stack pointer) | ||
137 | */</FONT> | ||
138 | <br> | ||
139 | main, <FONT color="#009000">/* Manual reset */</FONT> | ||
140 | <br> | ||
141 | 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> | ||
152 | We 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: | ||
174 | mov.l1f, r1 | ||
175 | mov.l3f, r3 | ||
176 | mov.l2f, r15 | ||
177 | jmp@r3 | ||
178 | ldcr1, vbr | ||
179 | nop | ||
180 | |||
181 | 1:.long_vectors | ||
182 | 2:.long_stack | ||
183 | 3:.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> | ||
194 | Then 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) | ||
205 | OUTPUT_FORMAT(elf32-sh) | ||
206 | SECTIONS | ||
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> | ||
236 | Last 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 | ||
238 | commands 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= | ||
249 | SET SOURCEFILES=main.c | ||
250 | SET OBJECTS=main.o start.o | ||
251 | |||
252 | sh-elf-as start.asm -o start.o -L -a | ||
253 | sh-elf-gcc -O2 -m1 -o main.o -c -nostdlib %INCLUDES% %SOURCEFILES% | ||
254 | sh-elf-ld -o main.out %OBJECTS% -Tlinker.cfg | ||
255 | padit main.out | ||
256 | scramble main.out archos.mod | ||
257 | |||
258 | PAUSE</pre> | ||
259 | </code> | ||
260 | </TD> | ||
261 | </TR> | ||
262 | </TABLE> | ||
263 | |||
264 | <P> | ||
265 | And that's it! I have prepared all those files in a .zip archive for you so you | ||
266 | don't have to copy'n'paste that much :). I have also prepared a package with | ||
267 | the 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> | ||
275 | I hope this tutorial helped you to compile an Archos firmware with windows. If | ||
276 | you have any questions, comments or corrections, please mail to <A href="mailto:edx@codeforce.d2g.com"> | ||
277 | edx@codeforce.d2g.com</A> | ||
278 | |||
279 | #include "foot.t" | ||
280 | |||