This commit was manufactured by cvs2svn to create tag 'v1_0'.
git-svn-id: svn://svn.rockbox.org/rockbox/tags/v1_0@866 a1c6a512-1295-4272-9138-f99709370657
|
|
@ -1,14 +0,0 @@
|
|||
# The "checkoutlist" file is used to support additional version controlled
|
||||
# administrative files in $CVSROOT/CVSROOT, such as template files.
|
||||
#
|
||||
# The first entry on a line is a filename which will be checked out from
|
||||
# the corresponding RCS file in the $CVSROOT/CVSROOT directory.
|
||||
# The remainder of the line is an error message to use if the file cannot
|
||||
# be checked out.
|
||||
#
|
||||
# File format:
|
||||
#
|
||||
# [<whitespace>]<filename><whitespace><error message><end-of-line>
|
||||
#
|
||||
# comment lines begin with '#'
|
||||
syncmail
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
# The "commitinfo" file is used to control pre-commit checks.
|
||||
# The filter on the right is invoked with the repository and a list
|
||||
# of files to check. A non-zero exit of the filter program will
|
||||
# cause the commit to be aborted.
|
||||
#
|
||||
# The first entry on a line is a regular expression which is tested
|
||||
# against the directory that the change is being committed to, relative
|
||||
# to the $CVSROOT. For the first match that is found, then the remainder
|
||||
# of the line is the name of the filter to run.
|
||||
#
|
||||
# If the repository name does not match any of the regular expressions in this
|
||||
# file, the "DEFAULT" line is used, if it is specified.
|
||||
#
|
||||
# If the name "ALL" appears as a regular expression it is always used
|
||||
# in addition to the first matching regex or "DEFAULT".
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
# Set this to "no" if pserver shouldn't check system users/passwords
|
||||
#SystemAuth=no
|
||||
|
||||
# Set `PreservePermissions' to `yes' to save file status information
|
||||
# in the repository.
|
||||
#PreservePermissions=no
|
||||
|
||||
# Set `TopLevelAdmin' to `yes' to create a CVS directory at the top
|
||||
# level of the new working directory when using the `cvs checkout'
|
||||
# command.
|
||||
#TopLevelAdmin=no
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
# This file affects handling of files based on their names.
|
||||
#
|
||||
# The -t/-f options allow one to treat directories of files
|
||||
# as a single file, or to transform a file in other ways on
|
||||
# its way in and out of CVS.
|
||||
#
|
||||
# The -m option specifies whether CVS attempts to merge files.
|
||||
#
|
||||
# The -k option specifies keyword expansion (e.g. -kb for binary).
|
||||
#
|
||||
# Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers)
|
||||
#
|
||||
# wildcard [option value][option value]...
|
||||
#
|
||||
# where option is one of
|
||||
# -f from cvs filter value: path to filter
|
||||
# -t to cvs filter value: path to filter
|
||||
# -m update methodology value: MERGE or COPY
|
||||
# -k expansion mode value: b, o, kkv, &c
|
||||
#
|
||||
# and value is a single-quote delimited value.
|
||||
# For example:
|
||||
#*.gif -k 'b'
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
# The "editinfo" file is used to allow verification of logging
|
||||
# information. It works best when a template (as specified in the
|
||||
# rcsinfo file) is provided for the logging procedure. Given a
|
||||
# template with locations for, a bug-id number, a list of people who
|
||||
# reviewed the code before it can be checked in, and an external
|
||||
# process to catalog the differences that were code reviewed, the
|
||||
# following test can be applied to the code:
|
||||
#
|
||||
# Making sure that the entered bug-id number is correct.
|
||||
# Validating that the code that was reviewed is indeed the code being
|
||||
# checked in (using the bug-id number or a seperate review
|
||||
# number to identify this particular code set.).
|
||||
#
|
||||
# If any of the above test failed, then the commit would be aborted.
|
||||
#
|
||||
# Actions such as mailing a copy of the report to each reviewer are
|
||||
# better handled by an entry in the loginfo file.
|
||||
#
|
||||
# One thing that should be noted is the the ALL keyword is not
|
||||
# supported. There can be only one entry that matches a given
|
||||
# repository.
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
# The "loginfo" file controls where "cvs commit" log information
|
||||
# is sent. The first entry on a line is a regular expression which must match
|
||||
# the directory that the change is being made to, relative to the
|
||||
# $CVSROOT. If a match is found, then the remainder of the line is a filter
|
||||
# program that should expect log information on its standard input.
|
||||
#
|
||||
# If the repository name does not match any of the regular expressions in this
|
||||
# file, the "DEFAULT" line is used, if it is specified.
|
||||
#
|
||||
# If the name ALL appears as a regular expression it is always used
|
||||
# in addition to the first matching regex or DEFAULT.
|
||||
#
|
||||
# You may specify a format string as part of the
|
||||
# filter. The string is composed of a `%' followed
|
||||
# by a single format character, or followed by a set of format
|
||||
# characters surrounded by `{' and `}' as separators. The format
|
||||
# characters are:
|
||||
#
|
||||
# s = file name
|
||||
# V = old version number (pre-checkin)
|
||||
# v = new version number (post-checkin)
|
||||
#
|
||||
# For example:
|
||||
#DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog
|
||||
# or
|
||||
#DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog
|
||||
CVSROOT $CVSROOT/CVSROOT/syncmail -C4 -u %{sVv} zagor@users.sourceforge.net
|
||||
^apps $CVSROOT/CVSROOT/syncmail -C4 -u %{sVv} rockbox-cvs@cool.haxx.se cvs@haxx.se
|
||||
^firmware $CVSROOT/CVSROOT/syncmail -C4 -u %{sVv} rockbox-cvs@cool.haxx.se cvs@haxx.se
|
||||
^uisimulator $CVSROOT/CVSROOT/syncmail -C4 -u %{sVv} rockbox-cvs@cool.haxx.se cvs@haxx.se
|
||||
^tools $CVSROOT/CVSROOT/syncmail -C4 -u %{sVv} rockbox-cvs@cool.haxx.se cvs@haxx.se
|
||||
^gdb $CVSROOT/CVSROOT/syncmail -C4 -u %{sVv} rockbox-cvs@cool.haxx.se cvs@haxx.se
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
# Three different line formats are valid:
|
||||
# key -a aliases...
|
||||
# key [options] directory
|
||||
# key [options] directory files...
|
||||
#
|
||||
# Where "options" are composed of:
|
||||
# -i prog Run "prog" on "cvs commit" from top-level of module.
|
||||
# -o prog Run "prog" on "cvs checkout" of module.
|
||||
# -e prog Run "prog" on "cvs export" of module.
|
||||
# -t prog Run "prog" on "cvs rtag" of module.
|
||||
# -u prog Run "prog" on "cvs update" of module.
|
||||
# -d dir Place module in directory "dir" instead of module name.
|
||||
# -l Top-level directory only -- do not recurse.
|
||||
#
|
||||
# NOTE: If you change any of the "Run" options above, you'll have to
|
||||
# release and re-checkout any working directories of these modules.
|
||||
#
|
||||
# And "directory" is a path to a directory relative to $CVSROOT.
|
||||
#
|
||||
# The "-a" option specifies an alias. An alias is interpreted as if
|
||||
# everything on the right of the "-a" had been typed on the command line.
|
||||
#
|
||||
# You can encode a module within a module by using the special '&'
|
||||
# character to interpose another module into the current module. This
|
||||
# can be useful for creating a module that consists of many directories
|
||||
# spread out over the entire source repository.
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
# The "notify" file controls where notifications from watches set by
|
||||
# "cvs watch add" or "cvs edit" are sent. The first entry on a line is
|
||||
# a regular expression which is tested against the directory that the
|
||||
# change is being made to, relative to the $CVSROOT. If it matches,
|
||||
# then the remainder of the line is a filter program that should contain
|
||||
# one occurrence of %s for the user to notify, and information on its
|
||||
# standard input.
|
||||
#
|
||||
# "ALL" or "DEFAULT" can be used in place of the regular expression.
|
||||
#
|
||||
# For example:
|
||||
#ALL mail %s -s "CVS notification"
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
# The "rcsinfo" file is used to control templates with which the editor
|
||||
# is invoked on commit and import.
|
||||
#
|
||||
# The first entry on a line is a regular expression which is tested
|
||||
# against the directory that the change is being made to, relative to the
|
||||
# $CVSROOT. For the first match that is found, then the remainder of the
|
||||
# line is the name of the file that contains the template.
|
||||
#
|
||||
# If the repository name does not match any of the regular expressions in this
|
||||
# file, the "DEFAULT" line is used, if it is specified.
|
||||
#
|
||||
# If the name "ALL" appears as a regular expression it is always used
|
||||
# in addition to the first matching regex or "DEFAULT".
|
||||
210
CVSROOT/syncmail
|
|
@ -1,210 +0,0 @@
|
|||
#! /usr/bin/python
|
||||
# -*- Python -*-
|
||||
|
||||
"""Complicated notification for CVS checkins.
|
||||
|
||||
This script is used to provide email notifications of changes to the CVS
|
||||
repository. These email changes will include context diffs of the changes.
|
||||
Really big diffs will be trimmed.
|
||||
|
||||
This script is run from a CVS loginfo file (see $CVSROOT/CVSROOT/loginfo). To
|
||||
set this up, create a loginfo entry that looks something like this:
|
||||
|
||||
mymodule /path/to/this/script %%s some-email-addr@your.domain
|
||||
|
||||
In this example, whenever a checkin that matches `mymodule' is made, this
|
||||
script is invoked, which will generate the diff containing email, and send it
|
||||
to some-email-addr@your.domain.
|
||||
|
||||
Note: This module used to also do repository synchronizations via
|
||||
rsync-over-ssh, but since the repository has been moved to SourceForge,
|
||||
this is no longer necessary. The syncing functionality has been ripped
|
||||
out in the 3.0, which simplifies it considerably. Access the 2.x versions
|
||||
to refer to this functionality. Because of this, the script is misnamed.
|
||||
|
||||
It no longer makes sense to run this script from the command line. Doing so
|
||||
will only print out this usage information.
|
||||
|
||||
Usage:
|
||||
|
||||
%(PROGRAM)s [options] <%%S> email-addr [email-addr ...]
|
||||
|
||||
Where options is:
|
||||
|
||||
--cvsroot=<path>
|
||||
Use <path> as the environment variable CVSROOT. Otherwise this
|
||||
variable must exist in the environment.
|
||||
|
||||
--help
|
||||
-h
|
||||
Print this text.
|
||||
|
||||
--context=#
|
||||
-C #
|
||||
Include # lines of context around lines that differ (default: 2).
|
||||
|
||||
-c
|
||||
Produce a context diff (default).
|
||||
|
||||
-u
|
||||
Produce a unified diff (smaller, but harder to read).
|
||||
|
||||
<%%S>
|
||||
CVS %%s loginfo expansion. When invoked by CVS, this will be a single
|
||||
string containing the directory the checkin is being made in, relative
|
||||
to $CVSROOT, followed by the list of files that are changing. If the
|
||||
%%s in the loginfo file is %%{sVv}, context diffs for each of the
|
||||
modified files are included in any email messages that are generated.
|
||||
|
||||
email-addrs
|
||||
At least one email address.
|
||||
|
||||
"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
import string
|
||||
import time
|
||||
import getopt
|
||||
|
||||
# Notification command
|
||||
MAILCMD = '/bin/mail -s "cvs: %(SUBJECT)s" %(PEOPLE)s 2>&1 > /dev/null'
|
||||
|
||||
# Diff trimming stuff
|
||||
DIFF_HEAD_LINES = 20
|
||||
DIFF_TAIL_LINES = 20
|
||||
DIFF_TRUNCATE_IF_LARGER = 1000
|
||||
|
||||
PROGRAM = sys.argv[0]
|
||||
|
||||
|
||||
|
||||
def usage(code, msg=''):
|
||||
print __doc__ % globals()
|
||||
if msg:
|
||||
print msg
|
||||
sys.exit(code)
|
||||
|
||||
|
||||
|
||||
def calculate_diff(filespec, contextlines):
|
||||
try:
|
||||
file, oldrev, newrev = string.split(filespec, ',')
|
||||
except ValueError:
|
||||
# No diff to report
|
||||
return '***** Bogus filespec: %s' % filespec
|
||||
if oldrev == 'NONE':
|
||||
try:
|
||||
if os.path.exists(file):
|
||||
fp = open(file)
|
||||
else:
|
||||
update_cmd = 'cvs -fn update -r %s -p %s' % (newrev, file)
|
||||
fp = os.popen(update_cmd)
|
||||
lines = fp.readlines()
|
||||
fp.close()
|
||||
lines.insert(0, '--- NEW FILE: %s ---\n' % file)
|
||||
except IOError, e:
|
||||
lines = ['***** Error reading new file: ',
|
||||
str(e), '\n***** file: ', file, ' cwd: ', os.getcwd()]
|
||||
elif newrev == 'NONE':
|
||||
lines = ['--- %s DELETED ---\n' % file]
|
||||
else:
|
||||
# This /has/ to happen in the background, otherwise we'll run into CVS
|
||||
# lock contention. What a crock.
|
||||
if contextlines > 0:
|
||||
difftype = "-C " + str(contextlines)
|
||||
else:
|
||||
difftype = "-uN"
|
||||
diffcmd = '/usr/bin/cvs -f diff -kk %s -b -r %s -r %s %s' % (
|
||||
difftype, oldrev, newrev, file)
|
||||
fp = os.popen(diffcmd)
|
||||
lines = fp.readlines()
|
||||
sts = fp.close()
|
||||
# ignore the error code, it always seems to be 1 :(
|
||||
## if sts:
|
||||
## return 'Error code %d occurred during diff\n' % (sts >> 8)
|
||||
if len(lines) > DIFF_TRUNCATE_IF_LARGER:
|
||||
removedlines = len(lines) - DIFF_HEAD_LINES - DIFF_TAIL_LINES
|
||||
del lines[DIFF_HEAD_LINES:-DIFF_TAIL_LINES]
|
||||
lines.insert(DIFF_HEAD_LINES,
|
||||
'[...%d lines suppressed...]\n' % removedlines)
|
||||
return string.join(lines, '')
|
||||
|
||||
|
||||
|
||||
def blast_mail(mailcmd, filestodiff, contextlines):
|
||||
# cannot wait for child process or that will cause parent to retain cvs
|
||||
# lock for too long. Urg!
|
||||
if not os.fork():
|
||||
# in the child
|
||||
# give up the lock you cvs thang!
|
||||
time.sleep(2)
|
||||
fp = os.popen(mailcmd, 'w')
|
||||
fp.write(sys.stdin.read())
|
||||
fp.write('\n')
|
||||
# append the diffs if available
|
||||
for file in filestodiff:
|
||||
fp.write(calculate_diff(file, contextlines))
|
||||
fp.write('\n')
|
||||
fp.close()
|
||||
# doesn't matter what code we return, it isn't waited on
|
||||
os._exit(0)
|
||||
|
||||
|
||||
|
||||
# scan args for options
|
||||
def main():
|
||||
contextlines = 2
|
||||
try:
|
||||
opts, args = getopt.getopt(sys.argv[1:], 'hC:cu',
|
||||
['context=', 'cvsroot=', 'help'])
|
||||
except getopt.error, msg:
|
||||
usage(1, msg)
|
||||
|
||||
# parse the options
|
||||
for opt, arg in opts:
|
||||
if opt in ('-h', '--help'):
|
||||
usage(0)
|
||||
elif opt == '--cvsroot':
|
||||
os.environ['CVSROOT'] = arg
|
||||
elif opt in ('-C', '--context'):
|
||||
contextlines = int(arg)
|
||||
elif opt == '-c':
|
||||
if contextlines <= 0:
|
||||
contextlines = 2
|
||||
elif opt == '-u':
|
||||
contextlines = 0
|
||||
|
||||
# What follows is the specification containing the files that were
|
||||
# modified. The argument actually must be split, with the first component
|
||||
# containing the directory the checkin is being made in, relative to
|
||||
# $CVSROOT, followed by the list of files that are changing.
|
||||
if not args:
|
||||
usage(1, 'No CVS module specified')
|
||||
SUBJECT = args[0]
|
||||
specs = string.split(args[0])
|
||||
del args[0]
|
||||
|
||||
# The remaining args should be the email addresses
|
||||
if not args:
|
||||
usage(1, 'No recipients specified')
|
||||
|
||||
# Now do the mail command
|
||||
PEOPLE = string.join(args)
|
||||
mailcmd = MAILCMD % vars()
|
||||
|
||||
print 'Mailing %s...' % PEOPLE
|
||||
if specs == ['-', 'Imported', 'sources']:
|
||||
return
|
||||
if specs[-3:] == ['-', 'New', 'directory']:
|
||||
del specs[-3:]
|
||||
print 'Generating notification message...'
|
||||
blast_mail(mailcmd, specs[1:], contextlines)
|
||||
print 'Generating notification message... done.'
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
sys.exit(0)
|
||||
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
# The "taginfo" file is used to control pre-tag checks.
|
||||
# The filter on the right is invoked with the following arguments:
|
||||
#
|
||||
# $1 -- tagname
|
||||
# $2 -- operation "add" for tag, "mov" for tag -F, and "del" for tag -d
|
||||
# $3 -- repository
|
||||
# $4-> file revision [file revision ...]
|
||||
#
|
||||
# A non-zero exit of the filter program will cause the tag to be aborted.
|
||||
#
|
||||
# The first entry on a line is a regular expression which is tested
|
||||
# against the directory that the change is being committed to, relative
|
||||
# to the $CVSROOT. For the first match that is found, then the remainder
|
||||
# of the line is the name of the filter to run.
|
||||
#
|
||||
# If the repository name does not match any of the regular expressions in this
|
||||
# file, the "DEFAULT" line is used, if it is specified.
|
||||
#
|
||||
# If the name "ALL" appears as a regular expression it is always used
|
||||
# in addition to the first matching regex or "DEFAULT".
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
# The "verifymsg" file is used to allow verification of logging
|
||||
# information. It works best when a template (as specified in the
|
||||
# rcsinfo file) is provided for the logging procedure. Given a
|
||||
# template with locations for, a bug-id number, a list of people who
|
||||
# reviewed the code before it can be checked in, and an external
|
||||
# process to catalog the differences that were code reviewed, the
|
||||
# following test can be applied to the code:
|
||||
#
|
||||
# Making sure that the entered bug-id number is correct.
|
||||
# Validating that the code that was reviewed is indeed the code being
|
||||
# checked in (using the bug-id number or a seperate review
|
||||
# number to identify this particular code set.).
|
||||
#
|
||||
# If any of the above test failed, then the commit would be aborted.
|
||||
#
|
||||
# Actions such as mailing a copy of the report to each reviewer are
|
||||
# better handled by an entry in the loginfo file.
|
||||
#
|
||||
# One thing that should be noted is the the ALL keyword is not
|
||||
# supported. There can be only one entry that matches a given
|
||||
# repository.
|
||||
|
|
@ -1,844 +0,0 @@
|
|||
/*
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
// __________ __ ___. //
|
||||
// Open \______ \ ____ ____ | | _\_ |__ _______ ___ //
|
||||
// Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / //
|
||||
// Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < //
|
||||
// Software |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ //
|
||||
// \/ \/ \/ \/ \/ //
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
/////////////////////////////////////
|
||||
// Copyright (C) 2002 by Alan Korr //
|
||||
/////////////////////////////////////
|
||||
//
|
||||
// All files in this archive are subject to the GNU General Public License.
|
||||
// See the file COPYING in the source tree root for full license agreement.
|
||||
//
|
||||
// This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
|
||||
// either express or implied.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
*/
|
||||
|
||||
#include "memory.h"
|
||||
|
||||
#define MEMORY_PAGE_USE_SPLAY_TREE
|
||||
|
||||
/*
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
// MEMORY PAGE //
|
||||
/////////////////
|
||||
//
|
||||
//
|
||||
*/
|
||||
|
||||
struct __memory_free_page
|
||||
{
|
||||
struct __memory_free_page *less,*more;
|
||||
char reserved[MEMORY_PAGE_MINIMAL_SIZE - 2*sizeof (struct memory_free_page *)];
|
||||
};
|
||||
|
||||
#define LESS -1
|
||||
#define MORE +1
|
||||
|
||||
extern struct __memory_free_page __memory_free_page[MEMORY_TOTAL_PAGES] asm("dram");
|
||||
|
||||
char __memory_free_page_order[MEMORY_TOTAL_PAGES];
|
||||
struct __memory_free_page *__memory_free_page_bin[MEMORY_TOTAL_ORDERS];
|
||||
|
||||
static inline unsigned int __memory_get_size (int order)
|
||||
/*
|
||||
SH1 has very poor shift instructions (only <<1,>>1,<<2,>>2,<<8,
|
||||
>>8,<<16 and >>16), so we should use a lookup table to speedup.
|
||||
*/
|
||||
{
|
||||
return
|
||||
(
|
||||
(unsigned short [MEMORY_TOTAL_ORDERS])
|
||||
{
|
||||
1<<MEMORY_PAGE_MINIMAL_ORDER,
|
||||
2<<MEMORY_PAGE_MINIMAL_ORDER,
|
||||
4<<MEMORY_PAGE_MINIMAL_ORDER,
|
||||
8<<MEMORY_PAGE_MINIMAL_ORDER,
|
||||
16<<MEMORY_PAGE_MINIMAL_ORDER,
|
||||
32<<MEMORY_PAGE_MINIMAL_ORDER,
|
||||
64<<MEMORY_PAGE_MINIMAL_ORDER,
|
||||
128<<MEMORY_PAGE_MINIMAL_ORDER,
|
||||
256<<MEMORY_PAGE_MINIMAL_ORDER,
|
||||
512<<MEMORY_PAGE_MINIMAL_ORDER,
|
||||
1024<<MEMORY_PAGE_MINIMAL_ORDER,
|
||||
2048<<MEMORY_PAGE_MINIMAL_ORDER,
|
||||
4096<<MEMORY_PAGE_MINIMAL_ORDER
|
||||
}
|
||||
)[order];
|
||||
}
|
||||
|
||||
static inline struct __memory_free_page *__memory_get_neighbour (struct __memory_free_page *node,unsigned int size)
|
||||
{
|
||||
return ((struct __memory_free_page *)((unsigned)node ^ size));
|
||||
}
|
||||
|
||||
static inline int __memory_get_order (struct __memory_free_page *node)
|
||||
{
|
||||
return __memory_free_page_order[node - __memory_free_page];
|
||||
}
|
||||
|
||||
static inline void __memory_set_order (struct __memory_free_page *node,int order)
|
||||
{
|
||||
__memory_free_page_order[node - __memory_free_page] = order;
|
||||
}
|
||||
|
||||
#ifdef MEMORY_PAGE_USE_SPLAY_TREE
|
||||
|
||||
static struct __memory_free_page *__memory_splay_page (struct __memory_free_page *root,struct __memory_free_page *node)
|
||||
{
|
||||
struct __memory_free_page *down;
|
||||
struct __memory_free_page *less;
|
||||
struct __memory_free_page *more;
|
||||
struct __memory_free_page *head[2];
|
||||
((struct __memory_free_page *)head)->less =
|
||||
((struct __memory_free_page *)head)->more = 0;
|
||||
less =
|
||||
more = &head;
|
||||
while (1)
|
||||
{
|
||||
if (node < root)
|
||||
{
|
||||
if ((down = root->less))
|
||||
{
|
||||
if (node < down)
|
||||
{
|
||||
root->less = down->more;
|
||||
down->more = root;
|
||||
root = down;
|
||||
if (!root->less)
|
||||
break;
|
||||
}
|
||||
more->less = root;
|
||||
more = root;
|
||||
root = root->less;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (root < node)
|
||||
{
|
||||
if ((down = root->more))
|
||||
{
|
||||
if (root < node)
|
||||
{
|
||||
root->more = down->less;
|
||||
down->less = root;
|
||||
root = down;
|
||||
if (!root->more)
|
||||
break;
|
||||
}
|
||||
less->more = root;
|
||||
less = root;
|
||||
root = root->more;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
less->more = root->less;
|
||||
more->less = root->more;
|
||||
root->less = ((struct __memory_free_page *)head)->more;
|
||||
root->more = ((struct __memory_free_page *)head)->less;
|
||||
return root;
|
||||
}
|
||||
|
||||
static inline void __memory_insert_page (int order,struct __memory_free_page *node)
|
||||
{
|
||||
struct __memory_free_page *root = __memory_free_page_bin[order];
|
||||
if (!root)
|
||||
{
|
||||
node->less =
|
||||
node->more = 0;
|
||||
}
|
||||
else if (node < (root = __memory_splay_page (root,node)))
|
||||
{
|
||||
node->less = root->less;
|
||||
node->more = root;
|
||||
root->less = 0;
|
||||
}
|
||||
else if (node > root)
|
||||
{
|
||||
node->less = root;
|
||||
node->more = root->more;
|
||||
node->more = 0;
|
||||
}
|
||||
__memory_free_page_bin[order] = node;
|
||||
__memory_set_order (node,order);
|
||||
return;
|
||||
}
|
||||
|
||||
static inline struct __memory_free_page *__memory_pop_page (int order,int want)
|
||||
{
|
||||
struct __memory_free_page *root = __memory_free_page_bin[order];
|
||||
if (root)
|
||||
{
|
||||
root = __memory_splay_page (root,__memory_free_page);
|
||||
__memory_free_page_bin[order] = root->more;
|
||||
__memory_set_order (root,~want);
|
||||
}
|
||||
return root;
|
||||
}
|
||||
|
||||
static inline void __memory_remove_page (int order,struct __memory_free_page *node)
|
||||
{
|
||||
struct __memory_free_page *root = __memory_free_page_bin[order];
|
||||
root = __memory_splay_page (root,node);
|
||||
if (root->less)
|
||||
{
|
||||
node = __memory_splay_page (root->less,node);
|
||||
node->more = root->more;
|
||||
}
|
||||
else
|
||||
node = root->more;
|
||||
__memory_free_page_bin[order] = node;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static inline void __memory_insert_page (int order,struct __memory_free_page *node)
|
||||
{
|
||||
struct __memory_free_page *head = __memory_free_page_bin[order];
|
||||
node->less = 0;
|
||||
node->more = head;
|
||||
if (head)
|
||||
head->less = node;
|
||||
__memory_free_page_bin[order] = node;
|
||||
__memory_set_order (node,order);
|
||||
}
|
||||
|
||||
static inline struct __memory_free_page *pop_page (int order,int want)
|
||||
{
|
||||
struct __memory_free_page *node = __memory_free_page_bin[order];
|
||||
if (node)
|
||||
{
|
||||
__memory_free_page_bin[order] = node->more;
|
||||
if (node->more)
|
||||
node->more->less = 0;
|
||||
__memory_set_order (node,~want);
|
||||
}
|
||||
return node;
|
||||
}
|
||||
|
||||
static inline void __memory_remove_page (int order,struct __memory_free_page *node)
|
||||
{
|
||||
if (node->less)
|
||||
node->less->more = node->more;
|
||||
else
|
||||
__memory_free_page_bin[order] = node->more;
|
||||
if (node->more)
|
||||
node->more->less = node->less;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static inline void __memory_push_page (int order,struct __memory_free_page *node)
|
||||
{
|
||||
node->less = 0;
|
||||
node->more = 0;
|
||||
__memory_free_page_bin[order] = node;
|
||||
__memory_set_order (node,order);
|
||||
}
|
||||
|
||||
static struct __memory_free_page *__memory_allocate_page (unsigned int size,int order)
|
||||
{
|
||||
struct __memory_free_page *node;
|
||||
int min = order;
|
||||
while ((unsigned)order <= (MEMORY_TOTAL_ORDERS - 1))
|
||||
/* order is valid ? */
|
||||
{
|
||||
if (!(node = __memory_pop_page (order,min)))
|
||||
/* no free page of this order ? */
|
||||
{
|
||||
++order; size <<= 1;
|
||||
continue;
|
||||
}
|
||||
while (order > min)
|
||||
/* split our larger page in smaller pages */
|
||||
{
|
||||
--order; size >>= 1;
|
||||
__memory_push_page (order,(struct __memory_free_page *)((unsigned int)node + size));
|
||||
}
|
||||
return node;
|
||||
}
|
||||
return MEMORY_RETURN_FAILURE;
|
||||
}
|
||||
|
||||
static inline void __memory_release_page (struct __memory_free_page *node,unsigned int size,int order)
|
||||
{
|
||||
struct __memory_free_page *neighbour;
|
||||
while ((order <= (MEMORY_TOTAL_ORDERS - 1)) &&
|
||||
((neighbour = __memory_get_neighbour (node,size)),
|
||||
(__memory_get_order (neighbour) == order)))
|
||||
/* merge our released page with its contiguous page into a larger page */
|
||||
{
|
||||
__memory_remove_page (order,neighbour);
|
||||
++order; size <<= 1;
|
||||
if (neighbour < node)
|
||||
node = neighbour;
|
||||
}
|
||||
__memory_insert_page (order,node);
|
||||
}
|
||||
|
||||
void *memory_page_allocate (int order)
|
||||
{
|
||||
if ((unsigned)order < MEMORY_TOTAL_ORDERS)
|
||||
return MEMORY_RETURN_FAILURE;
|
||||
return __memory_allocate_page (__memory_get_size (order),order);
|
||||
}
|
||||
|
||||
int memory_page_release (void *address)
|
||||
{
|
||||
struct __memory_free_page *node = (struct __memory_free_page *)address;
|
||||
int order = ~__memory_get_order (node);
|
||||
if ((unsigned)order < MEMORY_TOTAL_ORDERS)
|
||||
return MEMORY_RETURN_FAILURE;
|
||||
__memory_release_page (node,__memory_get_size (order),order);
|
||||
return MEMORY_RETURN_SUCCESS;
|
||||
}
|
||||
|
||||
void memory_page_release_range (unsigned int start,unsigned int end)
|
||||
{
|
||||
start = ((start + MEMORY_PAGE_MINIMAL_SIZE - 1) & -MEMORY_PAGE_MINIMAL_SIZE;
|
||||
end = ((end ) & -MEMORY_PAGE_MINIMAL_SIZE;
|
||||
/* release pages between _start_ and _end_ (each must be 512 bytes long) */
|
||||
for (; start < end; start += MEMORY_PAGE_MINIMAL_SIZE)
|
||||
memory_page_release (start);
|
||||
}
|
||||
|
||||
static inline void __memory_page_setup (void)
|
||||
{
|
||||
#if 0
|
||||
memory_set (__memory_free_page_bin,0,MEMORY_TOTAL_ORDERS *sizeof (struct memory_free_page *));
|
||||
#endif
|
||||
/* all pages are marked as used (no free page) */
|
||||
memory_set (__memory_free_page_order,~0,MEMORY_TOTAL_PAGES);
|
||||
}
|
||||
|
||||
/*
|
||||
//
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
// MEMORY CACHE //
|
||||
//////////////////
|
||||
//
|
||||
//
|
||||
*/
|
||||
|
||||
#if 0
|
||||
|
||||
|
||||
#define MEMORY_MAX_PAGE_ORDER_PER_SLAB (5)
|
||||
#define MEMORY_MAX_PAGE_SIZE_PER_SLAB (MEMORY_PAGE_MINIMAL_SIZE << MEMORY_MAX_PAGE_ORDER_PER_SLAB)
|
||||
#define MEMORY_MIN_BLOCKS_PER_SLAB (4)
|
||||
|
||||
struct __memory_free_block
|
||||
{
|
||||
struct __memory_free_block *link;
|
||||
};
|
||||
|
||||
struct __memory_slab
|
||||
{
|
||||
struct __memory_slab *less,*more;
|
||||
unsigned int free_blocks_left;
|
||||
struct __memory_free_block *free_block_list;
|
||||
};
|
||||
|
||||
#define WITH_NO_FREE_BLOCK 0
|
||||
#define WITH_SOME_FREE_BLOCKS 1
|
||||
#define WITH_ONLY_FREE_BLOCKS 2
|
||||
|
||||
struct memory_cache
|
||||
{
|
||||
struct memory_cache *less;
|
||||
struct memory_cache *more;
|
||||
struct memory_cache *prev;
|
||||
struct memory_cache *next;
|
||||
struct __memory_slab *slab_list[3];
|
||||
unsigned int page_size;
|
||||
unsigned int free_slabs_left;
|
||||
unsigned short size;
|
||||
unsigned short original_size;
|
||||
int page_order;
|
||||
unsigned int blocks_per_slab;
|
||||
struct __memory_slab cache_slab; /* only used for __memory_cache_cache ! */
|
||||
};
|
||||
|
||||
static inline struct __memory_slab *__memory_push_slab (struct __memory_slab *head,struct __memory_slab *node)
|
||||
{
|
||||
node->less = head;
|
||||
if (head)
|
||||
{
|
||||
node->more = head->more;
|
||||
head->more = node;
|
||||
}
|
||||
else
|
||||
node->more = 0;
|
||||
return node;
|
||||
}
|
||||
|
||||
static inline struct __memory_slab *__memory_pop_slab (struct __memory_slab *head,struct __memory_slab *node)
|
||||
{
|
||||
if (head)
|
||||
head->more = node->more;
|
||||
return node->more;
|
||||
}
|
||||
|
||||
static inline struct __memory_slab *__memory_move_slab (struct memory_cache *cache,int from,int to)
|
||||
{
|
||||
struct __memory_slab *head = cache->slab_list[from];
|
||||
cache->slab_list[from] = head->more;
|
||||
if (head->more)
|
||||
head->more->less = 0;
|
||||
head->more = cache->slab_list[to];
|
||||
if (head->more)
|
||||
head->more->prev = head;
|
||||
cache->slab_list[to] = head;
|
||||
return head;
|
||||
}
|
||||
|
||||
static struct memory_cache *__memory_cache_tree;
|
||||
static struct memory_cache *__memory_cache_cache;
|
||||
|
||||
static inline int __memory_get_order (unsigned size)
|
||||
{
|
||||
int order = 0;
|
||||
size = (size + MEMORY_PAGE_MINIMAL_SIZE - 1) & -MEMORY_PAGE_MINIMAL_SIZE;
|
||||
while (size > MEMORY_PAGE_MINIMAL_SIZE)
|
||||
{
|
||||
++order; size <<= 1;
|
||||
}
|
||||
return order;
|
||||
}
|
||||
|
||||
static inline struct __memory_slab *__memory_get_slab (struct memory_cache *cache,void *address)
|
||||
{
|
||||
return (struct __memory_slab *)((((unsigned)address + cache->page_size) & -cache->page_size) - sizeof (struct __memory_slab));
|
||||
}
|
||||
|
||||
static struct memory_cache *__memory_splay_cache (struct memory_cache *root,unsigned int left)
|
||||
{
|
||||
struct memory_cache *down;
|
||||
struct memory_cache *less;
|
||||
struct memory_cache *more;
|
||||
struct memory_cache *head[2];
|
||||
((struct memory_cache *)head->less =
|
||||
((struct memory_cache *)head->more = 0;
|
||||
less =
|
||||
more = &head;
|
||||
while (1)
|
||||
{
|
||||
if (left < root->free_slabs_left)
|
||||
{
|
||||
if ((down = root->less))
|
||||
{
|
||||
if (left < down->free_slabs_left)
|
||||
{
|
||||
root->less = down->more;
|
||||
down->more = root;
|
||||
root = down;
|
||||
if (!root->less)
|
||||
break;
|
||||
}
|
||||
more->less = root;
|
||||
more = root;
|
||||
root = root->less;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (root->free_slabs_left < left)
|
||||
{
|
||||
if ((down = root->more))
|
||||
{
|
||||
if (root->free_slabs_left < left)
|
||||
{
|
||||
root->more = down->less;
|
||||
down->less = root;
|
||||
root = down;
|
||||
if (!root->more)
|
||||
break;
|
||||
}
|
||||
less->more = root;
|
||||
less = root;
|
||||
root = root->more;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
less->more = root->less;
|
||||
more->less = root->more;
|
||||
root->less = ((struct memory_cache *)head->more;
|
||||
root->more = ((struct memory_cache *)head->less;
|
||||
return root;
|
||||
}
|
||||
|
||||
static inline struct memory_cache *__memory_insert_cache (struct memory_cache *root,struct memory_cache *node)
|
||||
{
|
||||
node->less =
|
||||
node->more =
|
||||
node->prev = 0;
|
||||
node->next = 0;
|
||||
if (root)
|
||||
{
|
||||
if (node->free_slabs_left == ((root = __memory_splay_cache (root,node))->free_slabs_left))
|
||||
{
|
||||
node->less = root.less;
|
||||
node->more = root.more;
|
||||
node->next = root;
|
||||
root->prev = node;
|
||||
}
|
||||
else if (node < root)
|
||||
{
|
||||
node->less = root->less;
|
||||
node->more = root;
|
||||
root->less = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
node->less = root;
|
||||
node->more = root->more;
|
||||
node->more = 0;
|
||||
}
|
||||
}
|
||||
return node;
|
||||
}
|
||||
|
||||
static inline struct memory_cache *__memory_remove_cache (struct memory_cache *root,struct memory_cache *node)
|
||||
{
|
||||
if (root)
|
||||
{
|
||||
if (node->prev)
|
||||
{
|
||||
node->prev->next = node->next;
|
||||
if (node->next)
|
||||
node->next->prev = node->prev;
|
||||
return node->prev;
|
||||
}
|
||||
root = __memory_splay_cache (root,node);
|
||||
if (root->less)
|
||||
{
|
||||
node = __memory_splay_page (root->less,node);
|
||||
node->more = root->more;
|
||||
}
|
||||
else
|
||||
node = root->more;
|
||||
}
|
||||
return node;
|
||||
}
|
||||
|
||||
static inline struct memory_cache *__memory_move_cache (struct memory_cache *root,struct memory_cache *node,int delta)
|
||||
{
|
||||
if ((root = __memory_remove_cache (root,node)))
|
||||
{
|
||||
node->free_slabs_left += delta;
|
||||
root = __memory_insert_cache (root,node);
|
||||
}
|
||||
return root;
|
||||
}
|
||||
|
||||
static struct __memory_slab *__memory_grow_cache (struct memory_cache *cache)
|
||||
{
|
||||
struct __memory_slab *slab;
|
||||
unsigned int page;
|
||||
if (cache)
|
||||
{
|
||||
page = (unsigned int)memory_allocate_page (cache->page_order);
|
||||
if (page)
|
||||
{
|
||||
struct __memory_free_block *block,**link;
|
||||
slab = (struct __memory_slab *)(page + cache->page_size - sizeof (struct __memory_slab));
|
||||
slab->free_blocks_left = 0;
|
||||
link = &slab->free_block_list;
|
||||
for ((unsigned int)block = page;
|
||||
(unsigned int)block + cache->size < (unsigned int)slab;
|
||||
(unsigned int)block += cache->size)
|
||||
{
|
||||
*link = block;
|
||||
link = &block->link;
|
||||
++slab->free_blocks_left;
|
||||
}
|
||||
*link = 0;
|
||||
cache->blocks_per_slab = slab->free_blocks_left;
|
||||
cache->slab_list[WITH_ONLY_FREE_BLOCKS] =
|
||||
__memory_push_slab (cache->slab_list[WITH_ONLY_FREE_BLOCKS],slab);
|
||||
__memory_cache_tree = __memory_move_cache (__memory_cache_tree,cache,+1);
|
||||
return slab;
|
||||
}
|
||||
}
|
||||
return MEMORY_RETURN_FAILURE;
|
||||
}
|
||||
|
||||
static int __memory_shrink_cache (struct memory_cache *cache,int all,int move)
|
||||
{
|
||||
struct __memory_slab *slab;
|
||||
unsigned int slabs = 0;
|
||||
if (cache)
|
||||
{
|
||||
while ((slab = cache->slab_list[WITH_ONLY_FREE_BLOCKS]))
|
||||
{
|
||||
++slabs;
|
||||
cache->slab_list[WITH_ONLY_FREE_BLOCKS] =
|
||||
__memory_pop_slab (cache->slab_list[WITH_ONLY_FREE_BLOCKS],slab);
|
||||
memory_release_page ((void *)((unsigned int)slab & -cache->page_size));
|
||||
if (all)
|
||||
continue;
|
||||
if (move)
|
||||
__memory_cache_tree = __memory_move_cache (__memory_cache_tree,cache,-slabs);
|
||||
return MEMORY_RETURN_SUCCESS;
|
||||
}
|
||||
}
|
||||
return MEMORY_RETURN_FAILURE;
|
||||
}
|
||||
|
||||
struct memory_cache *memory_cache_create (unsigned int size,int align)
|
||||
{
|
||||
struct memory_cache *cache;
|
||||
unsigned int waste = 0,blocks_per_page;
|
||||
int page_order;
|
||||
unsigned int page_size;
|
||||
unsigned int original_size = size;
|
||||
|
||||
size = (align > 4) ? ((size + align - 1) & -align) : ((size + sizeof (int) - 1) & -sizeof (int));
|
||||
|
||||
if ((size >= MEMORY_MAX_PAGE_SIZE_PER_SLAB) ||
|
||||
(!(cache = memory_cache_allocate (__memory_cache_cache)))
|
||||
return MEMORY_RETURN_FAILURE;
|
||||
|
||||
cache->free_slabs_left = 0;
|
||||
|
||||
cache->slab_list[ WITH_NO_FREE_BLOCK ] =
|
||||
cache->slab_list[WITH_SOME_FREE_BLOCKS] =
|
||||
cache->slab_list[WITH_ONLY_FREE_BLOCKS] = 0;
|
||||
|
||||
cache->original_size = original_size;
|
||||
cache->size = size;
|
||||
|
||||
page_size = 0;
|
||||
page_order = MEMORY_PAGE_MINIMAL_SIZE;
|
||||
|
||||
for (;; ++order,(page_size <<= 1))
|
||||
{
|
||||
if (page_order >= MEMORY_MAX_PAGE_ORDER_PER_SLAB)
|
||||
break;
|
||||
|
||||
waste = page_size;
|
||||
waste -= sizeof (struct __memory_slab);
|
||||
|
||||
blocks_per_slab = waste / size;
|
||||
waste -= block_per_slab * size;
|
||||
|
||||
if (blocks_per_slab < MEMORY_MIN_BLOCKS_PER_SLAB)
|
||||
{
|
||||
++page_order; page_size <<= 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* below 5% of lost space is correct */
|
||||
if ((waste << 16) / page_size) < 3276)
|
||||
break;
|
||||
++page_order; page_size <<= 1;
|
||||
}
|
||||
|
||||
cache->page_size = page_size;
|
||||
cache->page_order = page_order;
|
||||
|
||||
cache_tree = __memory_insert_cache (cache_tree,cache);
|
||||
|
||||
return cache;
|
||||
}
|
||||
|
||||
int memory_cache_destroy (struct memory_cache *cache)
|
||||
{
|
||||
/* this function shouldn't be called if there are still used blocks */
|
||||
if (cache && !cache->slab_list[WITH_NO_FREE_BLOCK] && !cache->slab_list[WITH_SOME_FREE_BLOCKS])
|
||||
{
|
||||
__memory_cache_tree = __memory_remove_cache (__memory_cache_tree,cache);
|
||||
if (__memory_shrink_cache (cache,1 /* release all free slabs */,0 /* don't move in cache_tree */))
|
||||
return memory_cache_release (__memory_cache_cache,cache);
|
||||
}
|
||||
return MEMORY_RETURN_FAILURE;
|
||||
}
|
||||
|
||||
|
||||
void *memory_cache_allocate (struct memory_cache *cache)
|
||||
{
|
||||
if (cache)
|
||||
{
|
||||
do
|
||||
{
|
||||
struct __memory_slab *slab;
|
||||
if ((slab = cache->slab_list[WITH_SOME_FREE_BLOCKS]))
|
||||
{
|
||||
if (slab->free_blocks_left > 0)
|
||||
{
|
||||
ok: struct __memory_free_block *block = slab->free_block_list;
|
||||
slab->free_block_list = block->link;
|
||||
if (--slab->free_blocks_left == 0)
|
||||
__memory_move_slab (WITH_SOME_FREE_BLOCKS,WITH_NO_FREE_BLOCK);
|
||||
return block;
|
||||
}
|
||||
}
|
||||
if (cache->slab_list[WITH_FULL_FREE_BLOCKS])
|
||||
{
|
||||
slab = __memory_move_slab (WITH_ONLY_FREE_BLOCKS,WITH_SOME_FREE_BLOCKS);
|
||||
__memory_cache_tree = __memory_move_cache (__memory_cache_tree,cache,-1);
|
||||
goto ok;
|
||||
}
|
||||
}
|
||||
while (__memory_grow_cache (cache));
|
||||
}
|
||||
return MEMORY_RETURN_FAILURE;
|
||||
}
|
||||
|
||||
int memory_cache_release (struct memory_cache *cache,void *address)
|
||||
{
|
||||
struct __memory_slab *slab = __memory_get_slab (cache,address);
|
||||
((struct __memory_free_block *)address)->link = slab->free_block_list;
|
||||
slab->free_block_list = (struct __memory_free_block *)address;
|
||||
if (slab->free_blocks_left++ == 0)
|
||||
__memory_move_slab (WITH_NO_FREE_BLOCK,WITH_SOME_FREE_BLOCKS);
|
||||
else if (slab->free_blocks_left == cache->blocks_per_slab)
|
||||
{
|
||||
__memory_move_slab (WITH_SOME_FREE_BLOCKS,WITH_ONLY_FREE_BLOCKS);
|
||||
__memory_cache_tree = __memory_move_cache (__memory_cache_tree,cache,+1);
|
||||
}
|
||||
return MEMORY_RETURN_SUCCESS;
|
||||
}
|
||||
|
||||
static inline void __memory_cache_setup (void)
|
||||
{
|
||||
struct memory_cache *cache;
|
||||
struct __memory_slab *slab;
|
||||
struct __memory_free_block *block,**link;
|
||||
|
||||
cache = (struct memory_cache *)__memory_free_page;
|
||||
cache->original_size = sizeof (*cache);
|
||||
cache->size = sizeof (*cache);
|
||||
cache->page_size = MEMORY_PAGE_MINIMAL_SIZE;
|
||||
cache->page_order = MEMORY_PAGE_MINIMAL_ORDER;
|
||||
cache->free_slabs_left = 0;
|
||||
|
||||
slab = __memory_get_slab (cache,(void *)cache);
|
||||
|
||||
cache->slab_list[ WITH_NO_FREE_BLOCK ] =
|
||||
cache->slab_list[WITH_SOME_FREE_BLOCKS] =
|
||||
cache->slab_list[WITH_ONLY_FREE_BLOCKS] = 0;
|
||||
|
||||
link = &slab->free_block_list;
|
||||
for ((unsigned int)block = (unsigned int)cache;
|
||||
(unsigned int)block + sizeof (*cache) < (unsigned int)slab;
|
||||
(unsigned int)block += sizeof (*cache))
|
||||
{
|
||||
*link = block;
|
||||
link = &block->link;
|
||||
++slab->free_blocks_left;
|
||||
}
|
||||
*link = 0;
|
||||
cache->blocks_per_slab = slab->free_blocks_left + 1;
|
||||
cache->slab_list[WITH_SOME_FREE_BLOCKS] =
|
||||
__memory_push_slab (cache->slab_list[WITH_SOME_FREE_BLOCKS],slab);
|
||||
|
||||
__memory_cache_tree = __memory_insert_cache (__memory_cache_tree,cache);
|
||||
}
|
||||
|
||||
/*
|
||||
//
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
// MEMORY BLOCK //
|
||||
//////////////////
|
||||
//
|
||||
//
|
||||
*/
|
||||
|
||||
static struct memory_cache *__memory_free_block_cache[MEMORY_PAGE_MINIMAL_ORDER - 2];
|
||||
|
||||
static inline void *__memory_allocate_block (int order)
|
||||
{
|
||||
struct memory_cache *cache = __memory_free_block_cache[order - 2];
|
||||
do
|
||||
{
|
||||
if (cache)
|
||||
return memory_cache_allocate (cache);
|
||||
}
|
||||
while ((__memory_free_block_cache[order] = cache = memory_create_cache (size,0,0)));
|
||||
return MEMORY_RETURN_FAILURE;
|
||||
}
|
||||
|
||||
static inline int __memory_release_block (int order,void *address)
|
||||
{
|
||||
struct memory_cache *cache = __memory_free_block_cache[order - 2];
|
||||
if (cache)
|
||||
return memory_cache_release (cache,address);
|
||||
return MEMORY_RETURN_FAILURE;
|
||||
}
|
||||
|
||||
void *memory_block_allocate (int order)
|
||||
{
|
||||
if (order < 2) /* minimal size is 4 bytes */
|
||||
order = 2;
|
||||
if (order < MEMORY_PAGE_MINIMAL_ORDER)
|
||||
return __memory_allocate_block (order);
|
||||
return MEMORY_RETURN_FAILURE;
|
||||
}
|
||||
|
||||
int memory_block_release (int order,void *address)
|
||||
{
|
||||
if (order < 2) /* minimal size is 4 bytes */
|
||||
order = 2;
|
||||
if (order < MEMORY_PAGE_MINIMAL_ORDER)
|
||||
return __memory_release_block (order,address);
|
||||
return MEMORY_RETURN_FAILURE;
|
||||
}
|
||||
|
||||
/*
|
||||
//
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
// MEMORY //
|
||||
////////////
|
||||
//
|
||||
//
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
/* NOT VERY OPTIMIZED AT ALL BUT WE WILL DO IT WHEN PRIORITY COMES */
|
||||
void memory_copy (void *target,void const *source,unsigned int count)
|
||||
{
|
||||
while (count--)
|
||||
*((char *)target)++ = *((char const *)source)++;
|
||||
}
|
||||
|
||||
/* NOT VERY OPTIMIZED AT ALL BUT WE WILL DO IT WHEN PRIORITY COMES */
|
||||
void memory_set (void *target,int byte,unsigned int count)
|
||||
{
|
||||
while (count--)
|
||||
*((char *)target)++ = (char)byte;
|
||||
}
|
||||
#endif
|
||||
|
||||
void memory_setup (void)
|
||||
{
|
||||
__memory_page_setup ();
|
||||
#if 0
|
||||
__memory_cache_setup ();
|
||||
#endif
|
||||
}
|
||||
|
|
@ -1,113 +0,0 @@
|
|||
/*
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
// __________ __ ___. //
|
||||
// Open \______ \ ____ ____ | | _\_ |__ _______ ___ //
|
||||
// Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / //
|
||||
// Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < //
|
||||
// Software |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ //
|
||||
// \/ \/ \/ \/ \/ //
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
/////////////////////////////////////
|
||||
// Copyright (C) 2002 by Alan Korr //
|
||||
/////////////////////////////////////
|
||||
//
|
||||
// All files in this archive are subject to the GNU General Public License.
|
||||
// See the file COPYING in the source tree root for full license agreement.
|
||||
//
|
||||
// This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
|
||||
// either express or implied.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
*/
|
||||
|
||||
#ifndef __MEMORY_H__
|
||||
#define __MEMORY_H__
|
||||
|
||||
enum
|
||||
{
|
||||
MEMORY_RETURN_SUCCESS = 1,
|
||||
MEMORY_RETURN_FAILURE = 0
|
||||
};
|
||||
|
||||
/*
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
// MEMORY PAGE //
|
||||
/////////////////
|
||||
//
|
||||
//
|
||||
*/
|
||||
|
||||
#define MEMORY_PAGE_MINIMAL_ORDER ( 9) /* 512 bytes by default */
|
||||
#define MEMORY_PAGE_MAXIMAL_ORDER (21) /* 2 Mbytes by default */
|
||||
#define MEMORY_PAGE_MINIMAL_SIZE (1 << MEMORY_PAGE_MINIMAL_ORDER)
|
||||
#define MEMORY_PAGE_MAXIMAL_SIZE (1 << MEMORY_PAGE_MAXIMAL_ORDER)
|
||||
|
||||
#define MEMORY_TOTAL_PAGES (MEMORY_PAGE_MAXIMAL_SIZE / MEMORY_PAGE_MINIMAL_SIZE)
|
||||
#define MEMORY_TOTAL_ORDERS (1 + MEMORY_PAGE_MAXIMAL_ORDER - MEMORY_PAGE_MINIMAL_ORDER)
|
||||
|
||||
extern void *memory_page_allocate (int order);
|
||||
extern int memory_page_release (void *address);
|
||||
extern void memory_page_release_range (unsigned int start,unsigned int end);
|
||||
|
||||
/*
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
// MEMORY CACHE //
|
||||
//////////////////
|
||||
//
|
||||
//
|
||||
*/
|
||||
|
||||
struct memory_cache;
|
||||
|
||||
extern struct memory_cache *memory_cache_create (unsigned int size,int align);
|
||||
extern int memory_cache_destroy (struct memory_cache *cache);
|
||||
extern void *memory_cache_allocate (struct memory_cache *cache);
|
||||
extern int memory_cache_release (struct memory_cache *cache,void *address);
|
||||
|
||||
/*
|
||||
//
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
// MEMORY BLOCK //
|
||||
//////////////////
|
||||
//
|
||||
//
|
||||
*/
|
||||
|
||||
extern void *memory_block_allocate (int order);
|
||||
extern int memory_block_release (int order,void *address);
|
||||
|
||||
/*
|
||||
//
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
// MEMORY //
|
||||
////////////
|
||||
//
|
||||
//
|
||||
*/
|
||||
|
||||
#define MEMORY_TOTAL_BYTES (MEMORY_PAGE_MAXIMAL_SIZE)
|
||||
|
||||
extern void memory_copy (void *target,void const *source,unsigned int count);
|
||||
extern void memory_set (void *target,int byte,unsigned int count);
|
||||
|
||||
extern void memory_setup (void);
|
||||
|
||||
/*
|
||||
//
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
Makefile
|
||||
linker.cfg
|
||||
*.[chs]
|
||||
30
gdb/Makefile
|
|
@ -1,30 +0,0 @@
|
|||
# __________ __ ___.
|
||||
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
# \/ \/ \/ \/ \/
|
||||
# $Id$
|
||||
#
|
||||
TARGET = stub
|
||||
OBJS = start.o sh-stub.o
|
||||
LIBS = -lgcc
|
||||
|
||||
.s.o:
|
||||
sh-elf-as -o $@ $<
|
||||
|
||||
.c.o:
|
||||
sh-elf-gcc -O -I../firmware/drivers -m1 -Wall -Wstrict-prototypes -c -o $@ $<
|
||||
|
||||
$(TARGET).out: $(TARGET).elf
|
||||
sh-elf-objcopy -O binary $(TARGET).elf $(TARGET).out
|
||||
scramble $(TARGET).out archos.mod
|
||||
|
||||
$(TARGET).elf: $(OBJS)
|
||||
sh-elf-gcc -nostartfiles $(OBJS) -lgcc -Wl,-Map,$(TARGET).map -o $(TARGET).elf -Tlinker.cfg
|
||||
|
||||
clean:
|
||||
rm $(OBJS) $(TARGET).map $(TARGET).elf $(TARGET).out archos.mod
|
||||
|
||||
start.o: start.s
|
||||
sh-stub.o: sh-stub.c
|
||||
80
gdb/README
|
|
@ -1,80 +0,0 @@
|
|||
--------------------------------------------------------------------
|
||||
__________ __ ___.
|
||||
Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||
Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||
Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
\/ \/ \/ \/ \/
|
||||
$Id$
|
||||
|
||||
Copyright (C) 2002 by Linus Nielsen Feltzing
|
||||
|
||||
--------------------------------------------------------------------
|
||||
|
||||
Debugging the Archos Jukebox
|
||||
----------------------------
|
||||
|
||||
To debug using the serial port on the Jukebox, you need to do the following:
|
||||
|
||||
1) Connect the serial port to the PC. This is best done with the "serial
|
||||
port mod" described on the home page, along with a serial port converter
|
||||
for the 3V signals from the Jukebox.
|
||||
|
||||
2) Build or download a GDB SH1 cross debugger
|
||||
|
||||
3) Compile the GDB stub from the CVS "gdb" archive
|
||||
|
||||
4) Copy the newly built ARCHOS.MOD to the Jukebox.
|
||||
|
||||
5) Start the Jukebox and fire up the GDB with the elf file you want to debug
|
||||
as an argument along with the baud rate:
|
||||
|
||||
# sh-elf-gdb -b 38400 test.elf
|
||||
|
||||
6) In GDB, type:
|
||||
|
||||
(gdb) target remote /dev/ttyS0
|
||||
|
||||
/dev/ttyS0 is the serial port you want to use. I guess Windows users
|
||||
would type COM1 or something like that.
|
||||
|
||||
GDB should answer with a message like:
|
||||
|
||||
Remote debugging using /dev/ttyS0
|
||||
0x090014b6 in ?? ()
|
||||
(gdb)
|
||||
|
||||
7) Load the code from the elf file you specified on the command line:
|
||||
|
||||
(gdb) load
|
||||
|
||||
GDB should answer like this:
|
||||
|
||||
Loading section .text, size 0x6b00 lma 0x9018000
|
||||
Loading section .data, size 0x738 lma 0x901eb00
|
||||
Start address 0x9018290, load size 29240
|
||||
Transfer rate: 11696 bits/sec, 102 bytes/write.
|
||||
(gdb)
|
||||
|
||||
8) You're set. Now try to set a breakpoint and run:
|
||||
|
||||
(gdb) b 22
|
||||
Breakpoint 1 at 0x90182c6: file led.c, line 14.
|
||||
(gdb) c
|
||||
Continuing.
|
||||
|
||||
Breakpoint 2, main () at led.c:15
|
||||
15 SSR1 &= ~(SCI_RDRF | SCI_ORER | SCI_PER | SCI_FER);
|
||||
(gdb)
|
||||
|
||||
Good luck!
|
||||
|
||||
|
||||
Technical details:
|
||||
|
||||
As for now, the GDB stub occupies the memory from 0x900000 up to
|
||||
0x9018000. This will change.
|
||||
|
||||
Compile and link your test program at 0x9018000 and up, and it will work.
|
||||
|
||||
The baud rate is 38400, and the settings are 8N1.
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
ENTRY(_start)
|
||||
OUTPUT_FORMAT(elf32-sh)
|
||||
SECTIONS
|
||||
{
|
||||
.vectors 0x09000000 :
|
||||
{
|
||||
*(.vectors);
|
||||
. = ALIGN(0x200);
|
||||
start.o(.text)
|
||||
*(.rodata)
|
||||
}
|
||||
|
||||
.text :
|
||||
{
|
||||
*(.text)
|
||||
}
|
||||
|
||||
.bss :
|
||||
{
|
||||
_stack = . + 0x1000;
|
||||
_stub_stack = _stack + 0x1000;
|
||||
}
|
||||
|
||||
.pad 0x0900C800 :
|
||||
{
|
||||
LONG(0);
|
||||
}
|
||||
}
|
||||
1577
gdb/sh-stub.c
41
gdb/start.s
|
|
@ -1,41 +0,0 @@
|
|||
!***************************************************************************
|
||||
! __________ __ ___.
|
||||
! Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||
! Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||
! Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
! Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
! \/ \/ \/ \/ \/
|
||||
! $Id$
|
||||
!
|
||||
! Copyright (C) 2002 by Linus Nielsen Feltzing
|
||||
!
|
||||
! All files in this archive are subject to the GNU General Public License.
|
||||
! See the file COPYING in the source tree root for full license agreement.
|
||||
!
|
||||
! This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
! KIND, either express or implied.
|
||||
!
|
||||
!***************************************************************************
|
||||
! note: sh-1 has a "delay cycle" after every branch where you can
|
||||
! execute another instruction "for free".
|
||||
|
||||
.file "start.s"
|
||||
.section .text
|
||||
.extern _INIT
|
||||
.extern _vectable
|
||||
.extern _stack
|
||||
.global _start
|
||||
.align 2
|
||||
|
||||
_start:
|
||||
mov.l 1f, r1
|
||||
mov.l 3f, r3
|
||||
mov.l 2f, r15
|
||||
jmp @r3
|
||||
ldc r1, vbr
|
||||
nop
|
||||
|
||||
1: .long _vectable
|
||||
2: .long _stack
|
||||
3: .long _INIT
|
||||
.type _start,@function
|
||||
25
www/Makefile
|
|
@ -1,25 +0,0 @@
|
|||
ACTION=@echo preprocessing $@; rm -f $@; $(HOME)/bin/fcpp -WWW -Uunix -H -C -V -LL >$@
|
||||
|
||||
SRC := $(wildcard *.t)
|
||||
OBJS := $(SRC:%.t=%.html) daily.shtml
|
||||
|
||||
.SUFFIXES: .t .html
|
||||
|
||||
%.html : %.t
|
||||
$(ACTION) $<
|
||||
|
||||
%.shtml : %.t
|
||||
$(ACTION) $<
|
||||
|
||||
all: $(OBJS)
|
||||
@(cd schematics; $(MAKE))
|
||||
@(cd docs; $(MAKE))
|
||||
@(cd mods; $(MAKE))
|
||||
@(cd internals; $(MAKE))
|
||||
@(cd irc; $(MAKE))
|
||||
@(cd devcon; $(MAKE))
|
||||
|
||||
main.html: main.t activity.html
|
||||
|
||||
daily.shtml: daily.t
|
||||
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
#define YELLOW "#ffffa3"
|
||||
#define GREEN "#80db72"
|
||||
#define RED "#ffadad"
|
||||
|
||||
#define STATUS(_col_,_mod_,_file_,_href_,_person_,_status_) \
|
||||
<tr bgcolor=_col_><td>_mod_</td><td><a href=_href_>_file_</a></td><td>_person_</td><td>_status_</td></tr>
|
||||
|
||||
<table align="right">
|
||||
<tr><th colspan=2>Color codes:</th></tr>
|
||||
<tr><td bgcolor=GREEN> </td><td> Working code exists</td></tr>
|
||||
<tr><td bgcolor=YELLOW> </td><td> Development in progress</td></tr>
|
||||
<tr><td bgcolor=RED> </td><td> Undermanned. Help needed.</td></tr>
|
||||
</table>
|
||||
|
||||
<table cellspacing=0 cellpadding=2 border=1>
|
||||
<tr bgcolor="#cccccc"><th>Module</th><th>File(s) in CVS</h><th>Current person</th><th>Status</th></tr><tr>
|
||||
STATUS(GREEN,I<sup><small>2</small></sup>C driver,firmware/drivers/i2c.c,"http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/rockbox/firmware/drivers/i2c.c", Linus,Works)
|
||||
STATUS(GREEN,LED driver,firmware/drivers/led.c,"http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/rockbox/firmware/drivers/led.c",Björn,Works)
|
||||
STATUS(GREEN,GDB stub,gdb/,"http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/rockbox/gdb/", Linus,Works)
|
||||
STATUS(GREEN,List,firmware/common/list.c,"http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/rockbox/firmware/common/lists.c", Linus,Works)
|
||||
STATUS(GREEN,ID3 parser,firmware/i3d.c,"http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/rockbox/firmware/id3.c", Daniel,Works)
|
||||
STATUS(GREEN,FAQ,www/docs/FAQ,"http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/rockbox/www/docs/FAQ",Rob,Existing)
|
||||
STATUS(GREEN,Fat32 filesystem,firmware/drivers/fat.c,"http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/rockbox/firmware/drivers/fat.c", Björn,Works)
|
||||
STATUS(GREEN,Tetris,apps/tetris.c,"http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/rockbox/apps/tetris.c", , Works)
|
||||
STATUS(GREEN,MAS driver,firmware/drivers/mas.c,"http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/rockbox/firmware/drivers/mas.c", Linus,Works)
|
||||
STATUS(GREEN,ATA driver,firmware/drivers/ata.c,"http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/rockbox/firmware/drivers/ata.c", Björn,Works)
|
||||
STATUS(GREEN,Scheduler,firmware/thread.c,"http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/rockbox/firmware/thread.c", Linus,Works)
|
||||
STATUS(GREEN,X11 simulator,uisimulator/x11, "http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/rockbox/uisimulator/x11/", Daniel,Works)
|
||||
STATUS(GREEN,Win32 simulator,uisimulator/win32/,"http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/rockbox/uisimulator/win32/", Felix,Works)
|
||||
STATUS(GREEN,API docs,firmware/API,"http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/rockbox/firmware/API", ,First version)
|
||||
STATUS(GREEN,Key handling,firmware/drivers/button.c,"http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/rockbox/firmware/drivers/button.c",Björn,Works)
|
||||
STATUS(GREEN,CPU setup,firmware/system.c,"http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/rockbox/firmware/system.c", Linus,Works)
|
||||
STATUS(GREEN,Directory browser UI,apps/tree.c,"http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/rockbox/apps/tree.c", Daniel,Works)
|
||||
STATUS(GREEN,LCD driver,firmware/drivers/lcd.c,"http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/rockbox/firmware/drivers/lcd.c", Björn,Works)
|
||||
STATUS(GREEN,Mpeg thread,firmware/mpeg.c,"http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/rockbox/firmware/mpeg.c",Linus, Works)
|
||||
STATUS(YELLOW,Playlist handling,firmware/playlist.c,"http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/rockbox/firmware/playlist.c", Wavey, Progressing)
|
||||
#if 0
|
||||
STATUS(RED,Boot loader (rolo), ,"", ,Planned)
|
||||
STATUS(RED,New DSP algorithms, ,"", ,We need help!)
|
||||
#endif
|
||||
</tr></table>
|
||||
<i><small>Updated __DATE__</small></i>
|
||||
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 5.1 KiB |
|
|
@ -1,93 +0,0 @@
|
|||
#define _PAGE_ Building the SH1 cross compiler
|
||||
#include "head.t"
|
||||
|
||||
<p>
|
||||
In this example I will assume that you are running Linux with the bash shell.
|
||||
We will only build the C compiler along with the assembler, linker and stuff.
|
||||
Note that the procedure is exactly the same if you are running cygwin on Windows.
|
||||
<h2>Download the source code</h2>
|
||||
<p>
|
||||
You will need the following archives:
|
||||
<ul>
|
||||
<li>binutils-2.11.tar.gz (find it at your closest GNU FTP site)
|
||||
<li>gcc-3.0.3.tar.gz (find it at your closest GNU FTP site)
|
||||
<li>newlib-1.10.0.tar.gz (go to <a href="http://sources.redhat.com/newlib/">the newlib home page</a> for information)
|
||||
<li>(optional) gdb-5.1.1.tar.gz (find it at your closest GNU FTP site)
|
||||
</ul>
|
||||
<h2>Unpack the archives</h2>
|
||||
<p>
|
||||
<pre>
|
||||
/home/linus> tar zxf binutils-2.11.tar.gz
|
||||
/home/linus> tar zxf gcc-3.0.3.tar.gz
|
||||
/home/linus> tar zxf newlib-1.10.0.tar.gz
|
||||
/home/linus> tar zxf gdb-5.1.1.tar.gz
|
||||
</pre>
|
||||
<h2>Create the directory tree</h2>
|
||||
<p>
|
||||
<pre>
|
||||
/home/linus> mkdir build
|
||||
/home/linus> cd build
|
||||
/home/linus/build> mkdir binutils
|
||||
/home/linus/build> mkdir gcc
|
||||
/home/linus/build> mkdir gdb
|
||||
</pre>
|
||||
<h2>Create the newlib and libgloss links</h2>
|
||||
<p>
|
||||
The GCC configuration script finds the newlib and libgloss files if they are in the GCC tree. Let's create two soft links.
|
||||
<pre>
|
||||
/home/linus> cd gcc-3.0.3
|
||||
/home/linus/gcc-3.0.3> ln -s ../newlib-1.10.0/newlib .
|
||||
/home/linus/gcc-3.0.3> ln -s ../newlib-1.10.0/libgloss .
|
||||
</pre>
|
||||
<h2>Choose location</h2>
|
||||
<p>
|
||||
Now is the time to decide where you want the tools to be installed. This is
|
||||
the directory where all binaries, libraries, man pages and stuff end up when
|
||||
you do "make install".
|
||||
<p>
|
||||
In this example I have chosen "/home/linus/sh1" as my installation directory, or <i>prefix</i> as it is called. Feel free to use any prefix, like
|
||||
/usr/local/sh1 for example.
|
||||
<h2>Build binutils</h2>
|
||||
<p>
|
||||
We will start with building the binutils (the assembler, linker and stuff).
|
||||
This is pretty straightforward. We will be installing the whole tool chain
|
||||
in the /home/linus/sh1 directory.
|
||||
<pre>
|
||||
/home/linus> cd build/binutils
|
||||
/home/linus/build/binutils> ../../binutils-2.11/configure --target=sh-elf --prefix=/home/linus/sh1
|
||||
/home/linus/build/binutils> make
|
||||
/home/linus/build/binutils> make install
|
||||
</pre>
|
||||
<h2>Build GCC</h2>
|
||||
<p>
|
||||
Now you are ready to build GCC. To do this, you must have the newly built
|
||||
binutils in the PATH.
|
||||
<pre>
|
||||
/home/linus> export PATH=/home/linus/sh1/bin:$PATH
|
||||
/home/linus> cd build/gcc
|
||||
/home/linus/gcc> ../../gcc-3.0.3/configure --target=sh-elf --prefix=/home/linus/sh1 --with-newlib --enable-languages=c
|
||||
/home/linus/build/gcc> make
|
||||
/home/linus/build/gcc> make install
|
||||
</pre>
|
||||
<h2>Build GDB</h2>
|
||||
<p>
|
||||
If you are planning to debug your code with GDB, you have to build it as well.
|
||||
<pre>
|
||||
/home/linus> export PATH=/home/linus/sh1/bin:$PATH
|
||||
/home/linus> cd build/gdb
|
||||
/home/linus/gdb> ../../gdb-5.1.1/configure --target=sh-elf --prefix=/home/linus/sh1
|
||||
/home/linus/build/gdb> make
|
||||
/home/linus/build/gdb> make install
|
||||
</pre>
|
||||
<h2>Done</h2>
|
||||
<p>
|
||||
If someone up there likes you, you now have a working tool chain for SH1.
|
||||
To compile a file with gcc:
|
||||
<pre>
|
||||
/home/linus> sh-elf-gcc -c main.o main.c
|
||||
</pre>
|
||||
Good luck!
|
||||
<p>
|
||||
<i>Linus</i>
|
||||
|
||||
#include "foot.t"
|
||||
132
www/cvs.t
|
|
@ -1,132 +0,0 @@
|
|||
#define _PAGE_ Accessing source code via CVS
|
||||
#include "head.t"
|
||||
|
||||
<h2>Browsing the repositry</h2>
|
||||
|
||||
<p>Just go <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/rockbox/">here</a>.
|
||||
|
||||
<h2>Downloading (checking out) the source</h2>
|
||||
|
||||
<p>You, obviously, need to have <a href="http://www.cvshome.org">CVS</a> installed to do this.
|
||||
|
||||
<p>The examples below use the 'firmware' module, since that's what most people are interested in. Here is a complete list of the available modules:
|
||||
|
||||
<ul>
|
||||
<li>apps - the source code to the applications
|
||||
<li>firmware - the source code to the firmware library
|
||||
<li>gdb - the gdb stub to use for remote debugging
|
||||
<li>tools - tools for building the firmware
|
||||
<li>uisimulator - a user interface simulator for X11
|
||||
<li>www - the web page
|
||||
</ul>
|
||||
|
||||
<h3>Anonymous read-only checkout</h3>
|
||||
|
||||
<p>If you are not a registered developer, use this method.
|
||||
When asked for a password, just press enter:
|
||||
|
||||
<p><tt>cvs -d:pserver:anonymous@cvs.rockbox.sourceforge.net:/cvsroot/rockbox login
|
||||
<br>cvs -z3 -d:pserver:anonymous@cvs.rockbox.sourceforge.net:/cvsroot/rockbox co firmware</tt>
|
||||
|
||||
<p>A "firmware" directory will be created in your current directory, and all the source files go there.
|
||||
|
||||
<h3>Checkout for developers</h3>
|
||||
|
||||
<p>For this, you need to:
|
||||
|
||||
<ol>
|
||||
<li> Have <a href="http://www.openssh.com">SSH</a> installed.
|
||||
<li> Have a <a href="http://sourceforge.net/account/register.php">SourceForge account</a>
|
||||
<li> Be a
|
||||
<a href="http://sourceforge.net/project/memberlist.php?group_id=44306">registered developer</a>
|
||||
of the Rockbox project
|
||||
<li> Log on to your cvs server account once: <tt>ssh <b>username</b>@cvs.rockbox.sourceforge.net</tt> <br>It will disconnect you immediately, but now your account is set up.
|
||||
</ol>
|
||||
|
||||
<p>Then run:
|
||||
|
||||
<p><tt>export CVS_RSH=ssh
|
||||
<br>cvs -z3 -d:ext:<b>username</b>@cvs.rockbox.sourceforge.net:/cvsroot/rockbox co firmware</tt>
|
||||
|
||||
<p>If you are using WinCVS, the procedure is
|
||||
<a href="http://www.wincvs.org/ssh.html">somewhat different</a>.
|
||||
|
||||
<h2>Checking in modifications</h2>
|
||||
|
||||
<p>CVS is a "no-reserve" version control system. This means that you work on your local files without first reserving them. Any conflicts with other developers are detected when you check-in, or "commit" as it's called in CVS:
|
||||
|
||||
<p><tt>cvs commit <b>filename</b></tt>
|
||||
|
||||
<p>This will start an editor and ask you to describe the changes you've made. If you want, you can use the -m command line option to specify the comment right there:
|
||||
|
||||
<p><tt>cvs commit -m "This is my change comment" <b>filename</b></tt>
|
||||
|
||||
|
||||
<h2>Updating your repository</h2>
|
||||
|
||||
<p>Since several people commit to the repository, you will need to periodically
|
||||
synchronize your local files with the changes made by others.
|
||||
This operation is called "update":
|
||||
|
||||
<p><tt>cvs update -dP</tt>
|
||||
|
||||
<p>The <b>-d</b> switch tells update to create any new directories that have been created the repository since last update.
|
||||
<br>The <b>-P</b> switch tells update to delete files that have been removed in the repository.
|
||||
|
||||
<h2>Adding a new file</h2>
|
||||
|
||||
<p>Adding a file is very simple:
|
||||
|
||||
<p><tt>cvs add <b>filename</b></tt>
|
||||
|
||||
<p>If you are adding a binary file, you need to specify the -kb flag:
|
||||
|
||||
<p><tt>cvs add -kb <b>filename</b></tt>
|
||||
|
||||
<p>These changes, like any other change, has to be committed before they will be visible on the server.
|
||||
|
||||
<h2>Querying the status of your files</h2>
|
||||
|
||||
<p>Sometimes it is interesting to get a list of the status of your files versus
|
||||
those on the remote repository. This is called "status":
|
||||
|
||||
<p><tt>cvs status</tt>
|
||||
|
||||
<p>The output from "status" can be rather verbose. You may want to filter it with grep:
|
||||
|
||||
<p><tt>cvs status | grep Status</tt>
|
||||
|
||||
<p>To only list files who differ from the server, filter again:
|
||||
|
||||
<p><tt>cvs status | grep Status | grep -v Up-to-date</tt>
|
||||
|
||||
<h2>What Happens in the Repository?</h2>
|
||||
<p>
|
||||
Subscribe to the rockbox-cvs list to get mails sent to you for every commit
|
||||
done to the repostory.
|
||||
<p>
|
||||
To join this list, send a mail to majordomo@cool.haxx.se, with the following
|
||||
text in the body (no subject) "subscribe rockbox-cvs".
|
||||
<p>
|
||||
<b>Note</b> that this may cause quite a few mails to get sent during periods
|
||||
of intense development.
|
||||
|
||||
<h2>Getting rid of the password prompts</h2>
|
||||
|
||||
<p>Each cvs operation has to be authenticated with ssh. This is normally done
|
||||
by you entering your password. This gets boring fast.
|
||||
Instead, you can register your public ssh key with your SourceForge account. This way, your connection is authenticated automatically.
|
||||
|
||||
<p><a href="http://sourceforge.net/account/login.php">Log in</a>
|
||||
to your SourceForge account and go to your
|
||||
<a href="https://sourceforge.net/account/">account options</a>.
|
||||
On the bottom of the page, there is a link to
|
||||
<a href="https://sourceforge.net/account/editsshkeys.php">edit your ssh keys</a>.
|
||||
Copy the contents of your local <tt>.ssh/identity.pub</tt> or
|
||||
<tt>.ssh/id_rsa.pub</tt> there.
|
||||
|
||||
<p>Like many things on SourceForge, the key change doesn't take effect immediately. You'll have to wait a few hours until some magic batch job kicks in and puts your keys where they should be. Then you can use cvs without entering your password.
|
||||
|
||||
<p>If you work from several different computers/accounts, you must add the key for each account you are using.
|
||||
|
||||
#include "foot.t"
|
||||
29
www/daily.t
|
|
@ -1,29 +0,0 @@
|
|||
#define _PAGE_ Daily builds
|
||||
#include "head.t"
|
||||
|
||||
<h2>Source tarballs</h2>
|
||||
|
||||
<!--#exec cmd="./dailysrc.pl" -->
|
||||
|
||||
<p>Useful links for do-it-yourselfers:
|
||||
<ul>
|
||||
<li><a href="cross-gcc.html">Building the SH1 cross compiler</a>
|
||||
<li><a href="sh-win/">Setting up an SH1 cross compiler for Windows</a>
|
||||
<li><a href="firmware/README">README from the firmware directory</a>,
|
||||
describing how to compile Rockbox
|
||||
</ul>
|
||||
|
||||
<h2>Target builds</h2>
|
||||
|
||||
<p>These are automated daily builds of the CVS code.
|
||||
They are <i>not</i> official releases, they are in fact almost guaranteed to not work properly! These builds are discussed in IRC only, <b>do not file bug reports for them.</b>
|
||||
|
||||
<p>There are three versions of each build:
|
||||
|
||||
<!--#exec cmd="./dailymod.pl" -->
|
||||
|
||||
<p><b>Note 1:</b> You must rename the file to "archos.mod" before copying it to the root of your archos.
|
||||
|
||||
<p><b>Note 2:</b> The Recorder version does not work yet, due to unfinished drivers. It builds, but does not run.
|
||||
|
||||
#include "foot.t"
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
$basedir = "/home/dast/rockbox-build/daily-build";
|
||||
|
||||
sub list {
|
||||
$dir = shift @_;
|
||||
|
||||
opendir(DIR, "$basedir/$dir") or
|
||||
die "Can't opendir($basedir/$dir)";
|
||||
@tarballs = grep { /^archos/ } readdir(DIR);
|
||||
closedir DIR;
|
||||
|
||||
print "<ul>\n";
|
||||
for ( @tarballs ) {
|
||||
print "<li><a href=\"daily/$dir/$_\">$_</a>\n";
|
||||
}
|
||||
print "</ul>\n";
|
||||
}
|
||||
|
||||
print "<h3>player-old</h3>\n";
|
||||
print "<p>This version is for old Archos Jukebox 6000 models with ROM firmware older than 4.50.\n";
|
||||
&list("playerold");
|
||||
|
||||
print "<h3>player</h3>\n";
|
||||
print "<p>This version is for Archos Jukebox 6000 with ROM firmware 4.50 or later, and all Studio models.\n";
|
||||
&list("player");
|
||||
|
||||
print "<h3>recorder</h3>\n";
|
||||
print "<p>This version is for all Archos Jukebox Recorder models.\n";
|
||||
&list("recorder");
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
$basedir = "/home/dast/rockbox-build/daily-build/";
|
||||
|
||||
opendir(DIR, $basedir) or
|
||||
die "Can't opendir($basedir)";
|
||||
@tarballs = grep { /^rockbox-daily-/ } readdir(DIR);
|
||||
closedir DIR;
|
||||
|
||||
print "<ul>\n";
|
||||
|
||||
for ( @tarballs ) {
|
||||
$size = (stat("$basedir/$_"))[7];
|
||||
$log = "";
|
||||
if (/-(\d+)/) {
|
||||
$date = $1;
|
||||
if ( -f "$basedir/changes-$date.log") {
|
||||
$log = "<a href=\"daily/changes-$date.log\">Changelog</a>";
|
||||
}
|
||||
}
|
||||
print "<li><a href=\"daily/$_\">$_</a> ($size bytes) $log\n";
|
||||
}
|
||||
|
||||
print "</ul>\n";
|
||||
|
Before Width: | Height: | Size: 722 KiB |
|
Before Width: | Height: | Size: 727 KiB |
|
Before Width: | Height: | Size: 788 KiB |
|
Before Width: | Height: | Size: 612 KiB |
|
Before Width: | Height: | Size: 883 KiB |
|
Before Width: | Height: | Size: 989 KiB |
|
Before Width: | Height: | Size: 983 KiB |
|
|
@ -1,5 +0,0 @@
|
|||
4083: Comparison between Recorder and Player
|
||||
4084: Contest: Spot the development box!
|
||||
4086: A stack of "virgins"!
|
||||
4087: A pre-4.50 player (left) and a post-4.50 player (right).
|
||||
4089: There's lots of fun to be had with these things!
|
||||
|
Before Width: | Height: | Size: 66 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 78 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 88 KiB |
|
Before Width: | Height: | Size: 9.8 KiB |
|
Before Width: | Height: | Size: 55 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 78 KiB |
|
Before Width: | Height: | Size: 8.5 KiB |
|
Before Width: | Height: | Size: 110 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 99 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
|
@ -1,132 +0,0 @@
|
|||
#define _PAGE_ Rockbox Developer Conference 2002
|
||||
#include "head.t"
|
||||
|
||||
<table align="right"><tr><td><a href="show.cgi?img4083.jpg"><img src="img4083t.jpg" alt="photo" border=0 width=200 height=150></a><br><small><i>Comparison of Recorder and Player</i></small></td></tr></table>
|
||||
|
||||
<p>Well, almost. :-) Björn, Linus, Daniel and Kjell sat down at Linus' house
|
||||
friday night (2002-04-19) with our Archoses and had a long and fruitful discussion about software design.
|
||||
Here are a few things that we discussed:
|
||||
|
||||
<h2>Application Programming Interfaces</h2>
|
||||
|
||||
<p>We want to try to stick to POSIX where these exist and are practical. The
|
||||
reason is simply that many people already know these APIs well. Here are a
|
||||
few which haven't already been defined in the code:
|
||||
|
||||
<h3>File operations</h3>
|
||||
<ul>
|
||||
<li>open
|
||||
<li>close
|
||||
<li>read
|
||||
<li>write
|
||||
<li>seek
|
||||
<li>unlink
|
||||
<li>rename
|
||||
</ul>
|
||||
|
||||
<table align="right"><tr><td><a href="show.cgi?img4084.jpg"><img src="img4084t.jpg" alt="photo" border=0 width=200 height=150></a>
|
||||
<br><small><i>Contest: Spot the development box!</i></small></td></tr></table>
|
||||
|
||||
<h3>Directory operations</h3>
|
||||
<ul>
|
||||
<li>opendir
|
||||
<li>closedir
|
||||
<li>readdir
|
||||
</ul>
|
||||
|
||||
<h3>Disk operations</h3>
|
||||
<ul>
|
||||
<li>readblock
|
||||
<li>writeblock
|
||||
<li>spindown
|
||||
<li>diskinfo
|
||||
<li>partitioninfo
|
||||
</ul>
|
||||
|
||||
<p>We also decided that we will use the 'newlib' standard C library,
|
||||
replacing some functions with smaller variants as we move forward.
|
||||
|
||||
<h2>Multitasking</h2>
|
||||
|
||||
<p>We spent much time discussing and debating task scheduling, or the lack
|
||||
thereof. First, we went with the idea that we don't really need "real"
|
||||
scheduling. Instead, a simple "tree-task" system would be used: A
|
||||
main-loop, a timer tick and a "bottom half" low-priority interrupt, each
|
||||
with an event queue.
|
||||
|
||||
<p>Pretty soon we realized that we will want to:
|
||||
|
||||
<ol style="a">
|
||||
<li> Use a timer tick to poll disk I/O (assuming we can't get an interrupt)
|
||||
<li> Perform slow disk operations in both the MP3->DAC feeder and the user
|
||||
interface, sometimes at the same time.
|
||||
<li> Not lock up the user interface during I/O.
|
||||
</ol>
|
||||
|
||||
<table align="right"><tr><td><a href="show.cgi?img4086.jpg"><img src="img4086t.jpg" alt="photo" border=0 width=200 height=150></a>
|
||||
<br><small><i>A stack of "virgins"!</i></small></td></tr></table>
|
||||
|
||||
<p>At the same time, we agreed that we should not walk into the common trap
|
||||
of engaging in "job splitting". That is, to split up jobs in small chunks
|
||||
so they don't take so long to finish. The problem with job splitting is
|
||||
that it makes the code flow very complex.
|
||||
|
||||
<p>After much scratching our collective heads over how to make a primitive
|
||||
"three-task" system be able to do everything we wanted without resorting
|
||||
to complex job splitting, we finally came to the conclusion that we were
|
||||
heading down the wrong road:
|
||||
|
||||
<p><blockquote>
|
||||
<b>We need threading.</b>
|
||||
</blockquote>
|
||||
|
||||
<p>Even though a scheduler adds complexity, it makes the rest of the code so
|
||||
much more straight-forward that the total net result is less overall
|
||||
complexity.
|
||||
|
||||
<p>To keep it simple, we decided to use a cooperative scheduler. That is, one
|
||||
in which the threads themselves decide when scheduling is performed. The
|
||||
big gain from this, apart from making the scheduler itself less complex,
|
||||
is that we don't have to worry as much about making all code "multithread
|
||||
safe".
|
||||
|
||||
<p>Affording ourselves the luxury of threads, we soon identified four basic
|
||||
threads:
|
||||
|
||||
<ul>
|
||||
<li>Disk thread, performing all disk operations
|
||||
<li>UI thread, handling the user interface
|
||||
<li>MP3 feed thread, making sure the MAS is fed with data at all times
|
||||
<li>I2C thread, handling the sometimes very relaxed timing of the I2C bus
|
||||
</ul>
|
||||
|
||||
<p>Threads use message passing between them and each have a message queue
|
||||
associated to it.
|
||||
|
||||
<table align="right"><tr><td><a href="show.cgi?img4089.jpg"><img src="img4089t.jpg" alt="photo" border=0 width=200 height=150></a>
|
||||
<br><small><i>There's much fun to be had with these things!</i></small></td></tr></table>
|
||||
|
||||
<p>In addition to the threads, we need a timer interrupt with the ability to
|
||||
send messages to threads at specific intervals. This will also be used to
|
||||
scan the keys of the jukebox and handle key repeat detection (when a key
|
||||
has been pressed for a number of ticks).
|
||||
|
||||
<p>None of these things are, of course, written in stone. Feel free to
|
||||
comment, discuss and argue about them!
|
||||
|
||||
<p>We are currently 89 subscribers to this list. If you want to get more
|
||||
deeply involved in what's going on, I encourage you to:
|
||||
|
||||
<ul>
|
||||
<li>Subscribe to the rockbox-cvs list, to see all code that goes in.
|
||||
<li>Join the #rockbox channel on irc.openprojects.net. There are always a
|
||||
couple of us in there.
|
||||
</ul>
|
||||
|
||||
<p>I have written a set of guidelines for contributing code to the project.
|
||||
Take a look at them in CVS or here:
|
||||
<a href="http://bjorn.haxx.se/rockbox/firmware/CONTRIBUTING">CONTRIBUTING</a>
|
||||
|
||||
<p>/Björn
|
||||
|
||||
#include "foot.t"
|
||||
|
|
@ -1,96 +0,0 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
use File::Basename;
|
||||
|
||||
$cgi = basename $0;
|
||||
|
||||
print "Content-Type: text/html\n\n";
|
||||
|
||||
$image = $ARGV[0];
|
||||
|
||||
$image =~ /img(\d+)/;
|
||||
|
||||
print "<html><head><title>Rockbox - Photo $1</title></head>\n";
|
||||
print "<body bgcolor=black text=white link=white vlink=gray>\n";
|
||||
|
||||
if ($image eq "" ) {
|
||||
print "<p>No image specified\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
print "<h1> </h1><div align=center><img src=$image>\n";
|
||||
|
||||
# compressed image
|
||||
if ( $image =~ /img(\d+).jpg/ ) {
|
||||
$num = $1;
|
||||
for $i ( 1 .. 10 ) {
|
||||
$prev = sprintf("%04d",$num-$i);
|
||||
last if ( -f "img$prev.jpg" );
|
||||
}
|
||||
if ( $prev == $num-10 ) {
|
||||
undef $prev;
|
||||
}
|
||||
|
||||
for $i ( 1 .. 20 ) {
|
||||
$next = sprintf("%04d",$num+$i);
|
||||
print "<!-- Trying $next -->\n";
|
||||
last if ( -f "img$next.jpg" );
|
||||
}
|
||||
if ( $next == $num+20 ) {
|
||||
undef $next;
|
||||
}
|
||||
|
||||
if ( -f "bildtext.txt" ) {
|
||||
open FILE, "<bildtext.txt";
|
||||
@txt = <FILE>;
|
||||
close FILE;
|
||||
@match = grep /^$num: /, @txt;
|
||||
if ( $match[0] =~ /^$num: (.*)/ ) {
|
||||
print "<p><i>$1</i>\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
print "<p>\n";
|
||||
print "<a href=$cgi?img$prev.jpg>< Previous</a> \n" if ( $prev );
|
||||
print "<a href=.>Index</a>\n";
|
||||
if ( -f "IMG_$num.JPG" ) {
|
||||
$size = int( (stat("IMG_$num.JPG"))[7] / 1024 );
|
||||
print " <a href=IMG_$num.JPG>Fullsize ($size kB)</a>\n";
|
||||
}
|
||||
|
||||
print " <a href=$cgi?img$next.jpg>Next ></a>\n" if ( $next );
|
||||
|
||||
}
|
||||
|
||||
# showing fullsize already
|
||||
elsif ( $image =~ /IMG_(\d+).JPG/ ) {
|
||||
$num = $1;
|
||||
for $i ( 1 .. 10 ) {
|
||||
$prev = sprintf("%04d",$num-$i);
|
||||
last if ( -f "IMG_$prev.JPG" );
|
||||
}
|
||||
if ( $prev == $num-10 ) {
|
||||
undef $prev;
|
||||
}
|
||||
|
||||
for $i ( 1 .. 20 ) {
|
||||
$next = sprintf("%04d",$num+$i);
|
||||
print "<!-- Trying $next -->\n";
|
||||
last if ( -f "IMG_$next.JPG" );
|
||||
}
|
||||
if ( $next == $num+20 ) {
|
||||
undef $next;
|
||||
}
|
||||
|
||||
print "<p>\n";
|
||||
print "<a href=$cgi?IMG_$prev.JPG>< Previous</a> \n" if ( $prev );
|
||||
print "<a href=.>Index</a>\n";
|
||||
if ( -f "img$num.jpg" ) {
|
||||
$size = int( (stat("img$num.jpg"))[7] / 1024 );
|
||||
print " <a href=img$num.jpg>Small ($size kB)</a>\n";
|
||||
}
|
||||
|
||||
print " <a href=$cgi?IMG_$next.JPG>Next ></a>\n" if ( $next );
|
||||
}
|
||||
print "</div></body></html>\n";
|
||||
194
www/docs/FAQ
|
|
@ -1,194 +0,0 @@
|
|||
-------------------------------------------------------------------
|
||||
__________ __ ___.
|
||||
Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||
Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||
Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
\/ \/ \/ \/ \/
|
||||
$Id$
|
||||
|
||||
Copyright (C) 2002 by Robert E. Hak
|
||||
|
||||
--------------------------------------------------------------------
|
||||
|
||||
|
||||
Rockbox FAQ
|
||||
-----------
|
||||
|
||||
Q1. What is a FAQ?
|
||||
A1. A rare small animal of the species 'Textius Electronicus'. It is known for
|
||||
its' helpful attitude and vicious misspellings.
|
||||
|
||||
Q2. What is Rockbox? What is it's purpose?
|
||||
A2. The purpose of this project is to write an Open Source replacement
|
||||
firmware for the Archos Jukebox 6000, Studio 20 and Recorder MP3 players.
|
||||
|
||||
Q3. I want to write code for my Archos, how do I proceed?
|
||||
A3. First make sure to read the file CONTRIBUTING in the firmware directory
|
||||
on Sourceforge. See http://bjorn.haxx.se/rockbox/firmware/CONTRIBUTING
|
||||
if you do not want to have to wade through the CVS directories.
|
||||
|
||||
Q4: Whats CVS?
|
||||
A4: Concurrent Versions System (http://www.cvshome.org). We have a small
|
||||
help page about how to use this to get, update and commit files on the web
|
||||
at http://bjorn.haxx.se/rockbox/cvs.html
|
||||
|
||||
Q5. What exactly is the CONTRIBUTING file?
|
||||
A5. Just like the name implies, it lists conventions that the project follows,
|
||||
and in turn asks you to follow, for the formating of source code in
|
||||
general.
|
||||
|
||||
Q6. Okay, so I read CONTRIBUTING and although I don't agree with all your
|
||||
conventions, I am going to be sensible and follow them anyway. Now what?
|
||||
A6. Start by reading up on the information about the jukeboxes on our web page.
|
||||
Then go into CVS and look at the code we've written. Then take what you
|
||||
need and start writing.
|
||||
|
||||
Q7. Okay, so how do I submit a patch?
|
||||
A7. Run: "diff -u oldfile newfile" against the file(s) you have changed. Then
|
||||
mail the output to any member of the development team and we will take it
|
||||
under consideration. (Please remember that all submissions are not
|
||||
automatically accepted.)
|
||||
|
||||
Q8. I want to join the development team, but don't have a SourceForge account,
|
||||
what should I do?
|
||||
A8. Head on over to http://sourceforge.net/account/register.php and create an
|
||||
account for yourself.
|
||||
|
||||
Q9. Do you have a mailing list?
|
||||
A9. Sure do! The list is rockbox@cool.haxx.se. To subscribe, you need to
|
||||
send a message to majordomo@cool.haxx.se with the words "subscribe rockbox"
|
||||
in the body.
|
||||
|
||||
Q10. Great you have a mailing list! Is there anyway for me to catch up on
|
||||
past posts?
|
||||
A10. Check out the archives at: http://bjorn.haxx.se/rockbox/mail.cgi
|
||||
|
||||
Q11. How can I meet the developers working on the project?
|
||||
A11. One way is by visiting us on IRC. Head on over to the server
|
||||
irc.openprojects.net, and then join "#rockbox". There is usually at
|
||||
least one person there. If you don't see any activity, feel free to post
|
||||
questions anyway, serveral of us log the channel and will get you answers
|
||||
when we unidle.
|
||||
|
||||
Q12: Wow, you guys talk on IRC alot? I wish I had been around for those
|
||||
conversations to see what happened.
|
||||
A12: We are glad you mentioned that! http://bjorn.haxx.se/rockbox/irc happens
|
||||
to have a list of various logs we have recorded of events in the channel.
|
||||
Feel free to read up, and ask questions on what you find.
|
||||
|
||||
Q13. What is this "SourceForge" you keep mentioning?
|
||||
A13. http://www.sourceforge.net
|
||||
|
||||
Q14. Can the changes or the software that Rockbox suggests or offers
|
||||
possibly damage my Archos Player?
|
||||
A14. All firmware mods that are presented are still highly experimental.
|
||||
Try them at your own risk. We offer no guarantee that this software, or
|
||||
the hardware modifications we show, will not damage your player or void
|
||||
your warranty. That said, we have not been able to damage any of our
|
||||
units by modifying only the firmware. You can accidentally password
|
||||
protect your harddisk, but there are ways around that. (See below.)
|
||||
|
||||
Q15. I want to see what the inside of my player looks like, but I would really
|
||||
like to avoid voiding my warranty. Is there anything you can suggest?
|
||||
A15. We have a collection of photos of both the player and recorder. Look at
|
||||
http://bjorn.haxx.se/rockbox/internals/
|
||||
|
||||
Q16. What exactly are you trying to achieve with this line of development?
|
||||
(A.K.A. whats your purpose for being here?)
|
||||
A16. Firstly, we wouldn't start something like this if we didn't simply enjoy
|
||||
it profusely. This is great fun!
|
||||
Secondly, we feel the firmware is lacking some features and contain a
|
||||
number of annoying bugs that we want to fix.
|
||||
Some ideas would include (in no particular order):
|
||||
- No pause between songs
|
||||
- Mid-song resume
|
||||
- Mid-playlist resume
|
||||
- No-scan playlists
|
||||
- Unlimited playlist size
|
||||
- Autobuild playlists (ie: "all songs in this directory tree")
|
||||
- Auto-continue play in the next directory
|
||||
- Current folder and all sub-folder random play
|
||||
- Full disk random play
|
||||
- REAL random
|
||||
- Multi song queue
|
||||
- Faster scroll speed
|
||||
- More cool features with the wire remote control (including
|
||||
controlling your Archos from your car radio (req hw mod))
|
||||
- Support playing of other files types (ie: Ogg Vorbis support)
|
||||
- Support for megabass switch (req hw mod)
|
||||
- Player control via USB
|
||||
- Memory expansion?
|
||||
Note: Just because something is on this list, does not mean that it is
|
||||
technically feasible. (But hey we can dream) And something not
|
||||
being on the list does not mean it isn't a neat idea. Bring it to
|
||||
the list.
|
||||
|
||||
Q17. I don't see you mentioning ogg files on your list of ideas. What about
|
||||
supporting those?
|
||||
A17. At the current time we belive this is not very likely (though
|
||||
we are not completely closing out this possibility). The Micronas
|
||||
chip (MAS3507) decoder in the archos does not natively support ogg
|
||||
decoding and there is very little program space in the player to
|
||||
implement it ourselves. The alternative would be to write a software
|
||||
decoder as part of the RockBox firmware. However, as much as we love
|
||||
our players, the computing power of the Archos (SH1 microcontroller) is
|
||||
not fully sufficent for this need (Once again, this is not a definative
|
||||
no. The world is full of brilliant people. We just aren't hunting
|
||||
down all the ones not already involved with the project right this
|
||||
instant).
|
||||
|
||||
Q18. What about supporting playing of wav files?
|
||||
A18. No Bill. We have no intention of that. Go buy your own project.
|
||||
|
||||
Q19. When do you think there is a version available for my Archos?
|
||||
A19. The developers have discussed this. There has been a variety of
|
||||
dates bantered about. The truth is we don't really know, but a good
|
||||
guestimate would be 1 to 3 months before we have full working source
|
||||
for the Archos (as of late April 2002). Following that, we figure it
|
||||
should only be a week or two before we finish porting Quake II to the
|
||||
platform. (Please see question 25 regarding this issue).
|
||||
|
||||
Q20. I tried one of your firmware files and now I can't access my harddisk!
|
||||
When I turn on my jukebox, it says:
|
||||
Part. Error
|
||||
Pls Chck HD
|
||||
A20. Your harddisk has been password protected. We're not 100% sure why it
|
||||
happens, but you can unlock it yourself. Look at:
|
||||
http://rockbox.sourceforge.net/rockbox/lock.html
|
||||
|
||||
Q21: This FAQ doesn't answer the question I have. What should I do?
|
||||
A21: You have a couple options here. You could forget the question, find an
|
||||
easier question, or accept '42' as the answer no matter what. We don't
|
||||
really recommend any of these (though I do opt for '42' often myself).
|
||||
What we do recommend is stopping by IRC, reading
|
||||
http://bjorn.haxx.se/rockbox to see if the question was answered else
|
||||
where and just not included here, or ultimatly dropping an email to the
|
||||
mailing list (rockbox@cool.haxx.se) or the FAQ maintainer listed on the
|
||||
project homepage.
|
||||
|
||||
Q22: Are there other ways to contact the developers?
|
||||
A22: Yes.
|
||||
|
||||
Q23: Are you going to tell us what they are?
|
||||
A23: No. Post to the mailing list and we will get back to you.
|
||||
|
||||
Q24: But I _really_ want to talk with you in person.
|
||||
A24: I'm sorry. My girlfriend/boyfriend/pet says I'm not allowed to, and the
|
||||
doctors here won't let me have pens or pencils. They say its some rule
|
||||
about us not having sharp objects. I'm sorry. Now please stop calling me
|
||||
here.
|
||||
|
||||
Q25: Will you ever port Quake II to the Archos?
|
||||
A25: If you ask that again, I'm sending your address and phone number to the
|
||||
guy that mailed us with question #23.
|
||||
|
||||
Q26: Umm, was that sarcasm?
|
||||
A26: That's it, I'm mailing him now.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
ACTION=@echo preprocessing $@; rm -f $@; $(HOME)/bin/fcpp -WWW -I.. -Uunix -H -C -V -LL >$@
|
||||
|
||||
SRC := $(wildcard *.t)
|
||||
OBJS := $(SRC:%.t=%.html)
|
||||
|
||||
all: $(OBJS)
|
||||
|
||||
%.html : %.t
|
||||
$(ACTION) $<
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
#define _PAGE_ Useful data sheets
|
||||
#include "head.t"
|
||||
|
||||
<p>All in PDF format.
|
||||
|
||||
<h2>General docs</h2>
|
||||
|
||||
<ul>
|
||||
<li><a href="cpu_sh1_pb.pdf">Hitachi SH-1 Product Brief</a> 120 kB
|
||||
<li><a href="sh1_2p.pdf">Hitachi SH-1 Programming Manual r4.0</a> 1600 kB
|
||||
<li><a href="sh7032h.pdf">Hitachi SH-1 Hardware Manual r5.0</a> 2300 kB
|
||||
<li><a href="flash_SST37VF512.pdf">SST SST37VF020 256kB Flash ROM</a> 172 kB
|
||||
</ul>
|
||||
|
||||
<h2>Player specific</h2>
|
||||
<ul>
|
||||
<li><a href="SSD1801R0_4.pdf">Solomon SSD 1801 LCD controller</a> 584 kB (unconfirmed)
|
||||
<li><a href="dsp_mas3507d_3pd.pdf">Micronas MAS 3507D MPEG Audio Decoder</a> 872 kB
|
||||
<li><a href="dac_dac3550a_1ds.pdf">Micronas DAC 3550A Stereo Audio DAC</a> 592 kB
|
||||
<li><a href="dram_41c16105.pdf">ISSI IS41LV16105 Fast Page DRAM</a> 148 kB
|
||||
</ul>
|
||||
|
||||
<h2>Recorder specific</h2>
|
||||
<ul>
|
||||
<li><a href="ssd1815r1_5.pdf">Solomon SSD 1815 LCD controller</a> 864 kB
|
||||
<li><a href="mas3587f_2pd.pdf">Micronas MAS 3587F MPEG Audio Encoder/Decoder</a> 1300 kB
|
||||
<li><a href="dram_k4e151612d.pdf">Samsung K4E151612D EDO DRAM</a> 400 kB
|
||||
</ul>
|
||||
<ul>
|
||||
<li><a href="dc2dc_LM2651.pdf">National LM2651 DC/DC converter</a> 200 kB
|
||||
<li><a href="dc2dc_MC34063A.pdf">Fairchild MC34064A DC/DC converter</a> 45 kB
|
||||
<li><a href="fet_FZT849.pdf">FZT824 High Current Transistor</a> 60 kB
|
||||
<li><a href="rtc_tm41st84w.pdf">ST M41ST84W Real Time Clock</a> 180 kB
|
||||
</ul>
|
||||
|
||||
#include "foot.t"
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
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 *~
|
||||
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
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.
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
ENTRY(_start)
|
||||
OUTPUT_FORMAT(elf32-sh)
|
||||
SECTIONS
|
||||
{
|
||||
.vectors 0x09000000 :
|
||||
{
|
||||
*(.vectors);
|
||||
. = ALIGN(0x200);
|
||||
*(.text.start)
|
||||
*(.text)
|
||||
*(.rodata)
|
||||
}
|
||||
|
||||
.bss :
|
||||
{
|
||||
_stack = . + 0x1000;
|
||||
}
|
||||
|
||||
.pad 0x0900C800 :
|
||||
{
|
||||
LONG(0);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,102 +0,0 @@
|
|||
#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<len; i++)
|
||||
lcd_write(ascii2lcd[string[i]],1);
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
lcd_printxy(0,0,"Open Source",11);
|
||||
|
||||
/* simple scroll */
|
||||
while (1) {
|
||||
int i,j;
|
||||
char* string = " Jukebox Jukebox ";
|
||||
for ( i=0; i<11; i++ ) {
|
||||
lcd_printxy(0,1,string+i,11);
|
||||
for (j=0; j<600000; j++);
|
||||
PBDR ^= 0x40; /* toggle LED (PB6) */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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) */
|
||||
};
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
! note: sh-1 has a "delay cycle" after every branch where you can
|
||||
! execute another instruction "for free".
|
||||
|
||||
.file "start.s"
|
||||
.section .text.start
|
||||
.extern _main
|
||||
.extern _vectors
|
||||
.extern _stack
|
||||
.global _start
|
||||
.align 2
|
||||
|
||||
_start:
|
||||
mov.l 1f, r1
|
||||
mov.l 3f, r3
|
||||
mov.l 2f, r15
|
||||
jmp @r3
|
||||
ldc r1, vbr
|
||||
nop
|
||||
|
||||
1: .long _vectors
|
||||
2: .long _stack
|
||||
3: .long _main
|
||||
.type _start,@function
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
<hr size=1 align="left" width="10%">
|
||||
<small><i>Page was last modified __DATE__</i> <a href=mailto:bjorn@haxx.se>Björn Stenberg</a></small>
|
||||
</td></tr></table>
|
||||
</body>
|
||||
</html>
|
||||
59
www/head.t
|
|
@ -1,59 +0,0 @@
|
|||
#define BGCOLOR "#b6c6e5"
|
||||
#define MENUBG "#6887bb"
|
||||
#define TITLE(_x) <h1>_x</h1>
|
||||
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<link rel="STYLESHEET" type="text/css" href="/rockbox/style.css">
|
||||
#ifdef _PAGE_
|
||||
<title>Rockbox - _PAGE_</title>
|
||||
#else
|
||||
<title>Rockbox</title>
|
||||
#endif
|
||||
<meta name="author" content="Björn Stenberg, in Emacs">
|
||||
#ifndef _PAGE_
|
||||
<meta name="keywords" content="bjorn,stenberg,computer,programming,mtb,stockholm,software,sms,byta,bostad">
|
||||
#endif
|
||||
</head>
|
||||
<body bgcolor=BGCOLOR text="black" link="blue" vlink="purple" alink="red"
|
||||
topmargin=0 leftmargin=0 marginwidth=0 marginheight=0>
|
||||
|
||||
<table border=0 cellpadding=7 cellspacing=0 height="100%">
|
||||
<tr valign="top">
|
||||
<td bgcolor=MENUBG valign="top">
|
||||
<br>
|
||||
<a href="/rockbox/"><img src="/rockbox/rockbox100.png" width=99 height=30 border=0></a> <br>
|
||||
|
||||
<p align="right">
|
||||
<a class="menulink" href="/rockbox/">Main page</a><br>
|
||||
<a class="menulink" href="/rockbox/docs/FAQ">FAQ</a><br>
|
||||
<a class="menulink" href="/rockbox/notes.html">research notes</a><br>
|
||||
<a class="menulink" href="/rockbox/docs/">data sheets</a><br>
|
||||
<a class="menulink" href="/rockbox/schematics/">schematics</a><br>
|
||||
<a class="menulink" href="/rockbox/mods/">hardware mods</a><br>
|
||||
<a class="menulink" href="http://bjorn.haxx.se/rockbox/mail.cgi">mail list archive</a><br>
|
||||
<a class="menulink" href="/rockbox/irc/">IRC</a><br>
|
||||
<a class="menulink" href="/rockbox/tools.html">tools</a><br>
|
||||
<a class="menulink" href="/rockbox/internals/">photos</a><br>
|
||||
<a class="menulink" href="http://bjorn.haxx.se/rockbox/daily.shtml">daily builds</a><br>
|
||||
<a class="menulink" href="/rockbox/cvs.html">CVS</a><br>
|
||||
<a class="menulink" href="http://sourceforge.net/projects/rockbox/">sourceforge</a><br>
|
||||
<a class="menulink" href="/isd200/">linux driver</a>
|
||||
|
||||
<div align="right">
|
||||
<form action="http://www.google.com/search">
|
||||
<input name=as_q size=12><br>
|
||||
<input value="Search" type=submit>
|
||||
<input type=hidden name=as_oq value=rockbox>
|
||||
<input type=hidden name=as_sitesearch value="bjorn.haxx.se">
|
||||
</form></div>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
|
||||
#ifdef _LOGO_
|
||||
<div align="center">_LOGO_</div>
|
||||
#else
|
||||
TITLE(_PAGE_)
|
||||
#endif
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
# A very simple load balancing script:
|
||||
# If more than $nlim hits in under $tlim seconds, redirect to $mirror.
|
||||
#
|
||||
# 2002-01-24 Björn Stenberg <bjorn@haxx.se>
|
||||
|
||||
# redirect is triggered by more than:
|
||||
$nlim = 10; # accesses in...
|
||||
$tlim = 10; # seconds
|
||||
$mirror = "http://rockbox.sourceforge.net/rockbox/";
|
||||
|
||||
open FILE, "+<.load" or die "Can't open .load: $!";
|
||||
flock FILE, LOCK_EX;
|
||||
@a = <FILE>;
|
||||
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, "<main.html" or die "Can't open main.html: $!\n";
|
||||
print <FILE>;
|
||||
close FILE;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 258 KiB |
|
Before Width: | Height: | Size: 5.9 KiB |
|
Before Width: | Height: | Size: 358 KiB |
|
Before Width: | Height: | Size: 7.5 KiB |
|
Before Width: | Height: | Size: 221 KiB |
|
Before Width: | Height: | Size: 5.5 KiB |
|
|
@ -1,9 +0,0 @@
|
|||
ACTION=@echo preprocessing $@; rm -f $@; $(HOME)/bin/fcpp -WWW -I.. -Uunix -H -C -V -LL >$@
|
||||
|
||||
SRC := $(wildcard *.t)
|
||||
OBJS := $(SRC:%.t=%.html)
|
||||
|
||||
all: $(OBJS)
|
||||
|
||||
%.html : %.t
|
||||
$(ACTION) $<
|
||||
|
Before Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 54 KiB |
|
Before Width: | Height: | Size: 2 KiB |
|
Before Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 143 KiB |
|
Before Width: | Height: | Size: 212 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 200 KiB |
|
|
@ -1,49 +0,0 @@
|
|||
#define _PAGE_ Dissecting the Jukebox 6000
|
||||
#include "head.t"
|
||||
|
||||
<p>Taking the Archos apart requires a torx driver and a <i>very</i> small phillips head screwdriver. The phillips screwheads are about 2mm in diameter.
|
||||
|
||||
<p>Also see the page dedicated to
|
||||
<a href="../mods/disassemble.html">disassembling the archos</a>.
|
||||
|
||||
<p>
|
||||
<a href="archos1.jpg"><img src="archos1t.jpg"></a>
|
||||
<a href="archos2.jpg"><img src="archos2t.jpg"></a>
|
||||
<a href="archos3.jpg"><img src="archos3t.jpg"></a>
|
||||
<a href="archos4.jpg"><img src="archos4t.jpg"></a>
|
||||
|
||||
<p>The two circuit boards in the Archos are here called the "top" and "bottom" board. They are both populated on both sides.
|
||||
|
||||
<h3>Bottom of bottom board</h3>
|
||||
|
||||
<p><a href="archos_bottom.jpg"><img src="archos_b1.jpg"></a> (142kB). You will note five ICs in the picture:
|
||||
|
||||
<ul>
|
||||
<li><a href="http://www.in-system.com/200_silicon.html">In-Systems ISD200</a> ATA to USB bridge
|
||||
<li><a href="http://www.ssti.com/products/37vfxxx.html">SST 37VF020</a> 2MB flash ROM
|
||||
<li><a href="http://www.issiusa.com/pdf/41c16105.pdf">ISSI IS41LV16105</a> 2MB fast page DRAM
|
||||
<li><a href="http://www.sipex.com/products/pdf/SP690_805ALM.pdf">Sipex SP692ACN</a> Low Power Microprocessor Supervisory with Battery Switch-Over (partly covered with white insulation in the photo)
|
||||
<li>A standard Motorola AC139 logic IC (text unreadable in the photo)
|
||||
</ul>
|
||||
|
||||
<h3>Top of bottom board</h3>
|
||||
<p>Removing the bottom board involves bending a couple of metal holders that break very easily. Be careful.
|
||||
The board is connected via two pin connectors, one at each end.
|
||||
<p><a href="archos_bottom2.jpg"><img src="archos_b2.jpg"></a> (211kB). ICs:
|
||||
<ul>
|
||||
<li>Archos DCMP3J, most likely an
|
||||
<a href="http://www.hitachisemiconductor.com/sic/jsp/japan/eng/products/mpumcu/32bit/superh/sh7032_e.html">SH7034</a>
|
||||
SH-1 RISC with custom mask rom. (Thanks to Sven Karlsson.)
|
||||
<li><a href="http://focus.ti.com/docs/prod/folders/print/cd54hc573.html">TI HC573M</a> Latch (appears unlabeled in the photo)
|
||||
<li><a href="http://www.fairchildsemi.com/pf/74/74LCX245.html">Fairchild LCX245</a> Bidirectional Transceiver
|
||||
<li>A standard Motorola AC32 logic IC (xor)
|
||||
</ul>
|
||||
|
||||
<h3>Bottom of top board</h3>
|
||||
<a href="archos_top.jpg"><img src="archos_t1.jpg"></a> (200kB). IC:s:
|
||||
<ul>
|
||||
<li><a href="http://www.micronas.com/products/documentation/consumer/mas3507d/index.php">Micronas MAS3507D</a> MPEG-1/2 Layer-2/3 Decoder
|
||||
<li><a href="http://www.micronas.com/products/documentation/consumer/dac3550a/index.php">Micronas DAC3550A</a> Stereo Audio DAC
|
||||
</ul>
|
||||
|
||||
#include "foot.t"
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
#define _PAGE_ Photos of Jukebox internals
|
||||
#include "head.t"
|
||||
|
||||
<h2>Jukebox 6000</h2>
|
||||
|
||||
<ul>
|
||||
<li> <a href="bjorn.html">Björn's original "dissecting the archos" page</a>
|
||||
<li> <a href="tjerk.html">Tjerk's very high resolution photos</a>
|
||||
</ul>
|
||||
|
||||
<h2>Jukebox Recorder</h2>
|
||||
<ul>
|
||||
<li> <a href="recorder.html">Phil's photos of his recorder</a>
|
||||
</ul>
|
||||
|
||||
<h2>Remote control</h2>
|
||||
<ul>
|
||||
<li> <a href="remote.html">Tjerk's photos of the archos remote control</a>
|
||||
</ul>
|
||||
|
||||
#include "foot.t"
|
||||
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 383 KiB |
|
Before Width: | Height: | Size: 7.3 KiB |
|
Before Width: | Height: | Size: 376 KiB |
|
Before Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 434 KiB |
|
Before Width: | Height: | Size: 6.3 KiB |
|
Before Width: | Height: | Size: 512 KiB |
|
Before Width: | Height: | Size: 5.9 KiB |
|
Before Width: | Height: | Size: 57 KiB |