From d6023a7adee17628e0ec4bad02e10199c1165bdb Mon Sep 17 00:00:00 2001 From: Björn Stenberg Date: Wed, 27 Mar 2002 11:21:50 +0000 Subject: Initial version git-svn-id: svn://svn.rockbox.org/rockbox/trunk@34 a1c6a512-1295-4272-9138-f99709370657 --- www/codes_new.png | Bin 0 -> 2300 bytes www/codes_old.png | Bin 0 -> 2460 bytes www/docs/Makefile | 9 ++ www/docs/index.t | 36 +++++ www/example/Makefile | 40 +++++ www/example/README | 7 + www/example/app.lds | 23 +++ www/example/main.c | 102 ++++++++++++ www/example/start.s | 23 +++ www/index.cgi | 41 +++++ www/rockbox100.png | Bin 0 -> 4908 bytes www/rockbox400.png | Bin 0 -> 12261 bytes www/schematics/6k_schematic.pdf | Bin 0 -> 42784 bytes www/schematics/Makefile | 9 ++ www/schematics/PCB_composite_print.pdf | Bin 0 -> 45180 bytes www/schematics/PCB_final_print.pdf | Bin 0 -> 48622 bytes www/schematics/index.t | 13 ++ www/schematics/rec_interface.pdf | Bin 0 -> 30626 bytes www/schematics/rec_main.pdf | Bin 0 -> 91899 bytes www/schematics/remoclone_schem.pdf | Bin 0 -> 9712 bytes www/sh-win/LCDv2Win.zip | Bin 0 -> 64119 bytes www/sh-win/Makefile | 9 ++ www/sh-win/empty.zip | Bin 0 -> 62684 bytes www/sh-win/enviro.jpg | Bin 0 -> 37913 bytes www/sh-win/enviro2.jpg | Bin 0 -> 36174 bytes www/sh-win/enviro3.jpg | Bin 0 -> 10242 bytes www/sh-win/index.t | 280 +++++++++++++++++++++++++++++++++ 27 files changed, 592 insertions(+) create mode 100644 www/codes_new.png create mode 100644 www/codes_old.png create mode 100644 www/docs/Makefile create mode 100644 www/docs/index.t create mode 100644 www/example/Makefile create mode 100644 www/example/README create mode 100644 www/example/app.lds create mode 100644 www/example/main.c create mode 100644 www/example/start.s create mode 100755 www/index.cgi create mode 100644 www/rockbox100.png create mode 100644 www/rockbox400.png create mode 100644 www/schematics/6k_schematic.pdf create mode 100644 www/schematics/Makefile create mode 100644 www/schematics/PCB_composite_print.pdf create mode 100644 www/schematics/PCB_final_print.pdf create mode 100644 www/schematics/index.t create mode 100644 www/schematics/rec_interface.pdf create mode 100644 www/schematics/rec_main.pdf create mode 100644 www/schematics/remoclone_schem.pdf create mode 100644 www/sh-win/LCDv2Win.zip create mode 100644 www/sh-win/Makefile create mode 100644 www/sh-win/empty.zip create mode 100644 www/sh-win/enviro.jpg create mode 100644 www/sh-win/enviro2.jpg create mode 100644 www/sh-win/enviro3.jpg create mode 100644 www/sh-win/index.t diff --git a/www/codes_new.png b/www/codes_new.png new file mode 100644 index 0000000000..03cb1deadb Binary files /dev/null and b/www/codes_new.png differ diff --git a/www/codes_old.png b/www/codes_old.png new file mode 100644 index 0000000000..b30a155a32 Binary files /dev/null and b/www/codes_old.png 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 @@ +ACTION=@echo preprocessing $@; rm -f $@; fcpp -WWW -I.. -Uunix -H -C -V -LL >$@ + +SRC := $(wildcard *.t) +OBJS := $(SRC:%.t=%.html) + +all: $(OBJS) + +%.html : %.t + $(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 @@ +#define _PAGE_ Useful data sheets +#include "head.t" + +

All in PDF format. + +

General docs

+ + + +

Player specific

+ + +

Recorder specific

+ + + +#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 @@ +HPATH = /usr/local/sh-gcc/bin +CC = $(HPATH)/sh-elf-gcc +LD = $(HPATH)/sh-elf-ld +AR = $(HPATH)/sh-elf-ar +AS = $(HPATH)/sh-elf-as +OC = $(HPATH)/sh-elf-objcopy + +INCLUDES=-I. + +CFLAGS = -Os -Wall -m1 -nostdlib -Wstrict-prototypes -fomit-frame-pointer -fschedule-insns $(INCLUDES) +AFLAGS += -small -relax + +OBJS= start.o main.o + +%.o: %.s + $(CC) -o $@ $(CFLAGS) $(INCLUDES) $(DEFS) -c $< + + +all : archos.mod # archos.asm + +main.o: main.c + +archos.elf : $(OBJS) app.lds + $(CC) -nostdlib -o archos.elf $(OBJS) -lgcc -Tapp.lds -Wl,-Map,archos.map + +archos.bin : archos.elf + $(OC) -O binary archos.elf archos.bin + +archos.asm: archos.bin + sh2d -sh1 archos.bin > archos.asm + +archos.mod : archos.bin + scramble archos.bin archos.mod + +dist: + tar czvf dist.tar.gz Makefile main.c start.s app.lds + +clean: + -rm -f *.x *.i *.o *.elf *.bin *.map *.mod *.bak *~ + 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 @@ +Rockbox example build +--------------------- + +These files are meant to show how to build a simple program for the Archos. + +Note that the display code only works on older machines (<4.50) so don't +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 @@ +ENTRY(_start) +OUTPUT_FORMAT(elf32-sh) +SECTIONS +{ + .vectors 0x09000000 : + { + *(.vectors); + . = ALIGN(0x200); + *(.text.start) + *(.text) + *(.rodata) + } + + .bss : + { + _stack = . + 0x1000; + } + + .pad 0x0900C800 : + { + LONG(0); + } + } 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 @@ +#define PBDR (*((volatile unsigned short *)0x05FFFFC2)) + +#define DC 1 +#define CS1 2 +#define SDA 4 +#define SCK 8 + +static const unsigned char ascii2lcd[] = { + 0x00,0x01,0x02,0x03,0x00,0x84,0x85,0x89, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xec,0xe3,0xe2,0xe1,0xe0,0xdf,0x15,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x24,0x25,0x26,0x37,0x06,0x29,0x2a,0x2b, + 0x2c,0x2d,0x2e,0x2f,0x30,0x31,0x32,0x33, + 0x34,0x35,0x36,0x37,0x38,0x39,0x3a,0x3b, + 0x3c,0x3d,0x3e,0x3f,0x40,0x41,0x42,0x43, + 0x44,0x45,0x46,0x47,0x48,0x49,0x4a,0x4b, + 0x4c,0x4d,0x4e,0x4f,0x50,0x51,0x52,0x53, + 0x54,0x55,0x56,0x57,0x58,0x59,0x5a,0x5b, + 0x5c,0x5d,0x5e,0xa9,0x33,0xce,0x00,0x15, + 0x00,0x65,0x66,0x67,0x68,0x69,0x6a,0x6b, + 0x6c,0x6d,0x6e,0x6f,0x70,0x71,0x72,0x73, + 0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0x7b, + 0x7c,0x7d,0x7e,0x24,0x24,0x24,0x24,0x24, + 0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24, + 0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24, + 0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24, + 0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24, + 0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24, + 0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24, + 0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24, + 0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24, + 0x45,0x45,0x45,0x45,0x45,0x45,0x24,0x47, + 0x49,0x49,0x49,0x49,0x4d,0x4d,0x4d,0x4d, + 0x48,0x52,0x53,0x53,0x53,0x53,0x53,0x24, + 0x24,0x59,0x59,0x59,0x59,0x5d,0x24,0x24, + 0x65,0x65,0x65,0x65,0x65,0x65,0x24,0x67, + 0x69,0x69,0x69,0x69,0x6d,0x6d,0x6d,0x6d, + 0x73,0x72,0x73,0x73,0x73,0x73,0x73,0x24, + 0x24,0x79,0x79,0x79,0x79,0x7d,0x24,0x7d +}; + +void lcd_write(int byte, int data) +{ + int i; + char on,off; + + PBDR &= ~CS1; /* enable lcd chip select */ + + if ( data ) { + on=~(SDA|SCK); + off=SCK|DC; + } + else { + on=~(SDA|SCK|DC); + off=SCK; + } + /* clock out each bit, MSB first */ + for (i=0x80;i;i>>=1) + { + PBDR &= on; + if (i & byte) + PBDR |= SDA; + PBDR |= off; + } + + PBDR |= CS1; /* disable lcd chip select */ +} + +void lcd_printxy( char x, char y, unsigned char* string, int len ) +{ + int i; + lcd_write(0xb0+y*16+x,0); + for (i=0; string[i] && i + +# redirect is triggered by more than: +$nlim = 10; # accesses in... +$tlim = 10; # seconds +$mirror = "http://rockbox.sourceforge.net/bjorn.haxx.se/rockbox/"; + +open FILE, "+<.load" or die "Can't open .load: $!"; +flock FILE, LOCK_EX; +@a = ; +if ( scalar @a > $nlim ) { + $first = shift @a; +} +else { + $first = $a[0]; +} +$now = time(); +@a = ( @a, "$now\n" ); +truncate FILE, 0; +seek FILE, 0, 0; +for ( @a ) { + print FILE $_; +} +flock FILE, LOCK_UN; +close FILE; + +$diff = $now - $first; +if ( $diff < $tlim ) { + print "Location: $mirror\n\n"; +} +else { + print "Content-Type: text/html\n\n"; + open FILE, "; + close FILE; +} diff --git a/www/rockbox100.png b/www/rockbox100.png new file mode 100644 index 0000000000..4c7cdcb426 Binary files /dev/null and b/www/rockbox100.png differ diff --git a/www/rockbox400.png b/www/rockbox400.png new file mode 100644 index 0000000000..84d940abe9 Binary files /dev/null and b/www/rockbox400.png differ diff --git a/www/schematics/6k_schematic.pdf b/www/schematics/6k_schematic.pdf new file mode 100644 index 0000000000..611e501faf Binary files /dev/null and b/www/schematics/6k_schematic.pdf 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 @@ +ACTION=@echo preprocessing $@; rm -f $@; fcpp -WWW -I.. -Uunix -H -C -V -LL >$@ + +SRC := $(wildcard *.t) +OBJS := $(SRC:%.t=%.html) + +all: $(OBJS) + +%.html : %.t + $(ACTION) $< diff --git a/www/schematics/PCB_composite_print.pdf b/www/schematics/PCB_composite_print.pdf new file mode 100644 index 0000000000..a3deddf6f2 Binary files /dev/null and b/www/schematics/PCB_composite_print.pdf differ diff --git a/www/schematics/PCB_final_print.pdf b/www/schematics/PCB_final_print.pdf new file mode 100644 index 0000000000..69cfd88c47 Binary files /dev/null and b/www/schematics/PCB_final_print.pdf 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 @@ +#define _PAGE_ Schematics +#include "head.t" + +

Jukebox 6000 R3 + +

Jukebox Recorder main board, rev2 +
Jukebox Recorder interface board, rev2.1 + +

Remoclone schematics +
Remoclone PCB composite print +
Remoclone PCB final print + +#include "foot.t" diff --git a/www/schematics/rec_interface.pdf b/www/schematics/rec_interface.pdf new file mode 100644 index 0000000000..803e3521b2 Binary files /dev/null and b/www/schematics/rec_interface.pdf differ diff --git a/www/schematics/rec_main.pdf b/www/schematics/rec_main.pdf new file mode 100644 index 0000000000..5c3fb290a6 Binary files /dev/null and b/www/schematics/rec_main.pdf differ diff --git a/www/schematics/remoclone_schem.pdf b/www/schematics/remoclone_schem.pdf new file mode 100644 index 0000000000..b2620ce476 Binary files /dev/null and b/www/schematics/remoclone_schem.pdf differ diff --git a/www/sh-win/LCDv2Win.zip b/www/sh-win/LCDv2Win.zip new file mode 100644 index 0000000000..33e7872be9 Binary files /dev/null and b/www/sh-win/LCDv2Win.zip 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 @@ +ACTION=@echo preprocessing $@; rm -f $@; fcpp -WWW -I.. -Uunix -H -C -V -LL >$@ + +SRC := $(wildcard *.t) +OBJS := $(SRC:%.t=%.html) + +all: $(OBJS) + +%.html : %.t + $(ACTION) $< diff --git a/www/sh-win/empty.zip b/www/sh-win/empty.zip new file mode 100644 index 0000000000..a1b354fbf7 Binary files /dev/null and b/www/sh-win/empty.zip differ diff --git a/www/sh-win/enviro.jpg b/www/sh-win/enviro.jpg new file mode 100644 index 0000000000..eb90f6d47e Binary files /dev/null and b/www/sh-win/enviro.jpg differ diff --git a/www/sh-win/enviro2.jpg b/www/sh-win/enviro2.jpg new file mode 100644 index 0000000000..706adaff4f Binary files /dev/null and b/www/sh-win/enviro2.jpg differ diff --git a/www/sh-win/enviro3.jpg b/www/sh-win/enviro3.jpg new file mode 100644 index 0000000000..1eb15f8b8b Binary files /dev/null and b/www/sh-win/enviro3.jpg 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 @@ +#define _PAGE_ Setting up an SH-1 compiler for Windows +#include "head.t" +

+by Felix Arends, 1/8/2002 +
+ +

+NOTE: THIS COMPILER DOES NOT YET WORK WITH WINDOWS XP!!! + +

+I have spent a long time figuring out how to compile SH1 code in windows (using +the sh-elf-gcc compiler) and when I finally compiled the first OS for my +Jukebox I decided to write a little tutorial explaining the setup process. + +

+The GNU-SH Tool Chain for Windows +

+

+This is actually all you need to download. It includes the binutils, gcc and +newlib. The complete GNUSH Tool Chain (currently v0101) is 117MB but for you it +is enough to download the GNUSH Tool Chain for ELF format (45 MB). + +

+The GNUSH website can be found at +http://www.kpit.com/download/downloadgnu.htm (source code is also +available there) and the direct link to the file you need is +http://www.kpit.com/download/elf.zip. It uses the cygwin dll to emulate +a linux layer but you do not have to care about that. + +

+Setting up the Compiler +

+

+Install the GNUSH Tool Chain (nothing you really have to care about during the +installation process). After that you should add some paths to your PATH system +environment variable. If you have Windows 95/98/Me you can do that by modifying +your autoexec.bat: + +

+Add the following line to your autoexec.bat: + +

+ + + + + + +
+SET PATH=%PATH%;C:\Programs\kpit\GNU-SH v0101 +[ELF]\Sh-elf\bin\;C:\Programs\kpit\GNU-SH v0101 +[ELF]\Sh-elf\lib\gcc-lib\sh-elf\2.9-GNU-SH-v0101\;C:\Programs\kpit\GNU-SH v0101 +[ELF]\Other Utilities +
+ +

+(Note: This is just one single line) + +

+Replace the beginning of the paths with the path-name you chose to installt the +tools in. Reboot. + +

+In Windows 2000 it is a bit different. You can find the PATH-environment +variable if you right-click the "My Computer" icon on your desktop and choose +"Properties" in the popup-menu. Go to the "Advanced" tab and click +"Environment-Variables": + +

+ + +

+(Note: There is also a PATH-variable in the "System variables" list, it does +not matter which one you edit) + +

+To the value the PATH-variable already has, add: + +

+ + + + +
+;C:\Programs\kpit\GNU-SH v0101 [ELF]\Sh-elf\bin\;C:\Programs\kpit\GNU-SH +v0101 [ELF]\Sh-elf\lib\gcc-lib\sh-elf\2.9-GNU-SH-v0101\;C:\Programs\kpit\GNU-SH +v0101 [ELF]\Other Utilities +
+ +

+Replace the program path with the path you chose for the program. You do not +have to reboot. + +

+An "empty" System +

+

+First of all, I'll explain what to do to compile an "empty" system. It just +initializes and calls the main function, but does not do anything +else. You can add some code to the main function and simply recompile. +It is actually like this: You don't have to care about any of those files, +because you won't have to change much of them (except the main.cpp of +course!!). + +

+main.cpp: +
+
+ + + + +
+

+int __main(void){} +
+
+int main(void) +
+{ +
+    // add code here +
+} +
+
+extern const +void stack(void); +
+
+const void* vectors[] +__attribute__ ((section (".vectors"))) = +
+{ +
+    main, /* Power-on reset */ +
+    stack, /* Power-on reset (stack pointer) +*/ +
+    main, /* Manual reset */ +
+    stack /* Manual reset (stack pointer) */ +
+}; +
+
+ +

+ +

+We need a start-up assembler code: + +

+start.asm +
+
+ + + + +
+ +
! note: sh-1 has a "delay cycle" after every branch where you can
+! execute another instruction "for free".
+
+.file"start.asm"
+.section.text.start
+.extern_main
+.extern _vectors
+.extern _stack
+.global _start
+.align  2
+
+_start:
+mov.l1f, r1
+mov.l3f, r3
+mov.l2f, r15
+jmp@r3
+ldcr1, vbr
+nop
+
+1:.long_vectors
+2:.long_stack
+3:.long_main
+.type_start,@function
+
+
+ +

+(I took this code from Björn's LCDv2 source) + +

+Then we need a linker configuration file: + +

+linker.cfg +
+ + + + +
+

+ +

ENTRY(_start)
+OUTPUT_FORMAT(elf32-sh)
+SECTIONS
+{
+    .vectors 0x09000000 :
+    {
+        *(.vectors);
+        . = ALIGN(0x200);
+        *(.text.start)
+        *(.text)
+        *(.rodata)
+    }
+
+    .bss :
+    {
+       _stack = . + 0x1000;
+    }
+
+    .pad 0x0900C800 :
+    {
+        LONG(0);
+    }
+  }
+ +
+ +

+(This code comes from Börn's LCDv2 as well) + +

+Last but not least, we need a batch file to link all this and output a usable +.mod file (you don't really need a batch file if you want to enter all the +commands over and over angain :]) + +

+make.bat +
+ + + + +
+

+ +

SET INCLUDES=
+SET SOURCEFILES=main.c
+SET OBJECTS=main.o start.o
+
+sh-elf-as start.asm -o start.o -L -a
+sh-elf-gcc -O2 -m1 -o main.o -c -nostdlib %INCLUDES% %SOURCEFILES%
+sh-elf-ld -o main.out %OBJECTS% -Tlinker.cfg
+padit main.out
+scramble main.out archos.mod
+
+PAUSE
+ +
+ +

+And that's it! I have prepared all those files in a .zip archive for you so you +don't have to copy'n'paste that much :). I have also prepared a package with +the LCDv2 code Björn wrote (ready to compile with Windows). + +

+empty.zip +
+LCDv2Win.zip + +

+I hope this tutorial helped you to compile an Archos firmware with windows. If +you have any questions, comments or corrections, please mail to +edx@codeforce.d2g.com + +#include "foot.t" + -- cgit v1.2.3