Subversion Repositories HelenOS-historic

Compare Revisions

No changes between revisions

Ignore whitespace Rev 549 → Rev 550

/kernel/trunk/build.ia32
File deleted
\ No newline at end of file
Property changes:
Deleted: svn:special
-*
\ No newline at end of property
/kernel/trunk/build.ia64
File deleted
\ No newline at end of file
Property changes:
Deleted: svn:special
-*
\ No newline at end of property
/kernel/trunk/build.amd64
File deleted
\ No newline at end of file
Property changes:
Deleted: svn:special
-*
\ No newline at end of property
/kernel/trunk/build.sparc64
File deleted
\ No newline at end of file
Property changes:
Deleted: svn:special
-*
\ No newline at end of property
/kernel/trunk/build.mips32
File deleted
\ No newline at end of file
Property changes:
Deleted: svn:special
-*
\ No newline at end of property
/kernel/trunk/build.ppc32
File deleted
\ No newline at end of file
Property changes:
Deleted: svn:special
-*
\ No newline at end of property
/kernel/trunk/kernel.config
1,14 → 1,61
## General configuration directives
 
# Architecture
@ "ia32" Intel IA32
@ "amd64" Intel ET64/AMD64
@ "ia64" Intel IA64
@ "mips32" MIPS 32-bit
@ "ppc32" PowerPC 32-bit
@ "sparc64" Sun UltraSparc 64-bit
! ARCH (choice)
 
%ASKDEFAULT
 
# IA32 Compiler
@ "cross" Cross-compiler
@ "native" Native
! [ARCH=ia32] IA32_COMPILER (choice)
% [ARCH=ia32] SAVEAS IA32_COMPILER COMPILER
 
# AMD64 Compiler
@ "cross" Cross-compiler
@ "native" Native
! [ARCH=amd64] AMD64_COMPILER (choice)
% [ARCH=amd64] SAVEAS AMD64_COMPILER COMPILER
 
# Compiler
@ "cross" Cross-compiler
@ "native" Native
! [(ARCH!=amd64)&(ARCH!=ia32)] OTHER_COMPILER (choice)
% [(ARCH!=amd64)&(ARCH!=ia32)] SAVEAS OTHER_COMPILER COMPILER
 
 
# CPU type
@ "pentium4" Pentium 4
@ "pentium3" Pentium 3
@ "athlon-xp" Athlon XP
@ "athlon-mp" Athlon MP
@ "prescott" Prescott
! [ARCH=ia32] IA32_CPU (choice)
 
# Support for SMP
! CONFIG_SMP (y/n)
 
# Improved support for hyperthreading
! [ARCH=ia32|ARCH=amd64] CONFIG_HT (y/n)
! [(ARCH=ia32|ARCH=amd64)&CONFIG_SMP=y] CONFIG_HT (y/n)
 
# Lazy FPU context switching
! CONFIG_FPU_LAZY (y/n)
 
# MIPS Machine Type
@ "msim" MSIM Simulator
@ "msim4kc" MSIM Simulator with 4kc instruction set
@ "simics" Virtutech Simics simulator
@ "lgxemul" GXEmul Little Endian
@ "bgxemul" GXEmul Big Endian
@ "indy" SGI Indy
! [ARCH=mips32] MIPS_MACHINE (choice)
 
## Debugging configuration directives
 
# General debuging and assert checking
/kernel/trunk/build
0,0 → 1,0
link tools/build
Property changes:
Added: svn:special
+*
\ No newline at end of property
/kernel/trunk/tools/build
2,48 → 2,13
 
function syntax {
echo "Syntax:"
echo " build.<arch> [-compiler <compiler>] [-cpu <cpu>] [-machine <machine>]"
echo " build "
echo
echo "<arch> ... amd64, ia32, ia64, mips32, ppc32, sparc64"
echo "<compiler> ... native, *cross"
echo "<cpu> ... for ia32: athlon-xp, athlon-mp, pentium3, *pentium4, prescott"
echo "<machine> ... for mips32: *msim, msim4kc, simics, lgxemul, bgxemul, indy"
echo
}
 
ARCH="`basename "$0" | awk -F. '{ if (NF > 1) print \$NF }'`"
if [ -z "$ARCH" ]; then
syntax
exit 1
fi
 
ARGS=""
while [ "$#" -gt 0 ]; do
case "$1" in
-compiler)
if [ -z "$2" ]; then
syntax
exit 1
fi
ARGS="$ARGS COMPILER=$2"
shift
;;
-cpu)
if [ -z "$2" ]; then
syntax
exit 1
fi
ARGS="$ARGS CPU=$2"
shift
;;
-machine)
if [ -z "$2" ]; then
syntax
exit 1
fi
ARGS="$ARGS MACHINE=$2"
shift
;;
*)
syntax
exit 1
60,5 → 25,5
TAG="Revision $TAG (built on $TIMESTAMP for $ARCH)"
fi
 
tools/config.py $ARCH default
make all "ARCH=$ARCH" "TAG=$TAG" $ARGS
tools/config.py default
make all "TAG=$TAG" $ARGS
/kernel/trunk/tools/config.py
186,18 → 186,36
f.close()
 
def check_condition(text, defaults):
"Check that the condition specified on input line is True"
result = False
result = True
conds = text.split('&')
for cond in conds:
if cond.startswith('(') and cond.endswith(')'):
cond = cond[1:-1]
if not check_dnf(cond, defaults):
return False
return True
 
def check_dnf(text, defaults):
"""
Check that the condition specified on input line is True
 
only CNF is supported
"""
conds = text.split('|')
for cond in conds:
condname,condval = cond.split('=')
res = re.match(r'^(.*?)(!?=)(.*)$', cond)
if not res:
raise RuntimeError("Invalid condition: %s" % cond)
condname = res.group(1)
oper = res.group(2)
condval = res.group(3)
if not defaults.has_key(condname):
raise RuntimeError("Condition var %s does not exist: %s" % \
(condname,line))
# None means wildcard
if defaults[condname] is None:
(condname,text))
 
if oper=='=' and condval == defaults[condname]:
return True
if condval == defaults[condname]:
if oper == '!=' and condval != defaults[condname]:
return True
return False
 
213,7 → 231,28
comment = ''
default = None
choices = []
for line in f:
for line in f:
if line.startswith('%'):
res = re.match(r'^%\s*(?:\[(.*?)\])?\s*(.*)$', line)
if not res:
raise RuntimeError('Invalid command: %s' % line)
if res.group(1):
if not check_condition(res.group(1), defaults):
continue
args = res.group(2).strip().split(' ')
cmd = args[0].lower()
args = args[1:]
if cmd == 'askdefault':
if isinstance(dlg, DefaultDialog):
continue
res = dlg.noyes('Change kernel configuration')
if res == 'n':
dlg = DefaultDialog(dlg)
elif cmd == 'saveas':
outf.write('%s = %s\n' % (args[1],defaults[args[0]]))
continue
if line.startswith('!'):
# Ask a question
res = re.search(r'!\s*(?:\[(.*?)\])?\s*([^\s]+)\s*\((.*)\)\s*$', line)
228,6 → 267,10
if not check_condition(res.group(1), defaults):
if default is not None:
outf.write('#!# %s = %s\n' % (varname, default))
# Clear cumulated values
comment = ''
default = None
choices = []
continue
 
if vartype == 'y/n':
277,7 → 320,7
f.close()
 
def main():
defaults = {'ARCH':None}
defaults = {}
try:
dlg = Dialog()
except NotImplementedError:
285,9 → 328,7
 
# Default run will update the configuration file
# with newest options
if len(sys.argv) >= 2:
defaults['ARCH'] = sys.argv[1]
if len(sys.argv) == 3 and sys.argv[2]=='default':
if len(sys.argv) == 2 and sys.argv[1]=='default':
dlg = DefaultDialog(dlg)
 
if os.path.exists(OUTPUT):
/kernel/trunk/arch/mips32/Makefile.inc
36,8 → 36,8
## Make some default assumptions
#
 
ifndef MACHINE
MACHINE = msim
ifndef MIPS_MACHINE
MIPS_MACHINE = msim
endif
 
KERNEL_LOAD_ADDRESS = 0x80100000
44,12 → 44,12
INIT_ADDRESS = 0x80110000
INIT_SIZE = 65536
CFLAGS += -mno-abicalls -G 0 -fno-zero-initialized-in-bss
DEFS += -DMACHINE=${MACHINE} -DKERNEL_LOAD_ADDRESS=${KERNEL_LOAD_ADDRESS} -DINIT_ADDRESS=${INIT_ADDRESS} -DINIT_SIZE=${INIT_SIZE}
DEFS += -DMACHINE=${MIPS_MACHINE} -DKERNEL_LOAD_ADDRESS=${KERNEL_LOAD_ADDRESS} -DINIT_ADDRESS=${INIT_ADDRESS} -DINIT_SIZE=${INIT_SIZE}
 
## Accepted MACHINEs
#
 
ifeq ($(MACHINE),indy)
ifeq ($(MIPS_MACHINE),indy)
# GCC 4.0.1 compiled for mipsEL has problems compiling in
# BigEndian mode with the swl/swr/lwl/lwr instructions.
# We have to compile it with mips-sgi-irix5 to get it right.
61,12 → 61,12
KERNEL_LOAD_ADDRESS = 0x88002000
CFLAGS += -EB -DBIG_ENDIAN -DHAVE_FPU -march=r4600
endif
ifeq ($(MACHINE),lgxemul)
ifeq ($(MIPS_MACHINE),lgxemul)
BFD_NAME=elf32-tradlittlemips
BFD = ecoff-littlemips
CFLAGS += -DHAVE_FPU -mips3
endif
ifeq ($(MACHINE),bgxemul)
ifeq ($(MIPS_MACHINE),bgxemul)
BFD_NAME=elf32-bigmips
BFD = ecoff-bigmips
TARGET = mips-sgi-irix5
73,7 → 73,7
TOOLCHAIN_DIR = /usr/local/mips/bin
CFLAGS += -EB -DBIG_ENDIAN -DHAVE_FPU -mips3
endif
ifeq ($(MACHINE),msim4kc)
ifeq ($(MIPS_MACHINE),msim4kc)
# MSIM needs lwl/swl patch & 4kc instruction patch to work
# otherwise add -mmemcpy -mips3
81,7 → 81,7
BFD = binary
CFLAGS += -mhard-float -march=4kc
endif
ifeq ($(MACHINE),simics)
ifeq ($(MIPS_MACHINE),simics)
# SIMICS 4kc emulation is broken, although for instructions
# that do not bother us
89,17 → 89,12
BFD = elf32-tradlittlemips
CFLAGS += -mhard-float -mips3
endif
ifeq ($(MACHINE),msim)
ifeq ($(MIPS_MACHINE),msim)
BFD_NAME = elf32-tradlittlemips
BFD = binary
CFLAGS += -mhard-float -mips3
endif
 
## Own configuration directives
#
 
CONFIG_OFW = y
 
## Accepted configuration directives
#
 
/kernel/trunk/arch/ia32/Makefile.inc
38,36 → 38,36
## Make some default assumptions
#
 
ifndef CPU
CPU = pentium4
ifndef IA32_CPU
IA32_CPU = pentium4
endif
 
DEFS += -D_CPU=${CPU}
DEFS += -D_CPU=${IA32_CPU}
 
## Accepted CPUs
#
 
ifeq ($(CPU),athlon-xp)
ifeq ($(IA32_CPU),athlon-xp)
CFLAGS += -march=athlon-xp -mmmx -msse -m3dnow
DEFS += -DCONFIG_FENCES_P3
CONFIG_SMP = n
CONFIG_HT = n
endif
ifeq ($(CPU),athlon-mp)
ifeq ($(IA32_CPU),athlon-mp)
CFLAGS += -march=athlon-mp -mmmx -msse -m3dnow
DEFS += -DCONFIG_FENCES_P3
CONFIG_HT = n
endif
ifeq ($(CPU),pentium3)
ifeq ($(IA32_CPU),pentium3)
CFLAGS += -march=pentium3 -mmmx -msse
DEFS += -DCONFIG_FENCES_P3
CONFIG_HT = n
endif
ifeq ($(CPU),prescott)
ifeq ($(IA32_CPU),prescott)
CFLAGS += -march=pentium4 -mfpmath=sse -mmmx -msse -msse2 -msse3
DEFS += -DCONFIG_FENCES_P4
endif
ifeq ($(CPU),pentium4)
ifeq ($(IA32_CPU),pentium4)
CFLAGS += -march=pentium4 -mfpmath=sse -mmmx -msse -msse2
DEFS += -DCONFIG_FENCES_P4
endif
/kernel/trunk/Makefile
36,12 → 36,10
NAME = Dawn
RELEASE = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 
## Make some default assumptions
## Include configuration
#
 
ifndef ARCH
ARCH = ia32
endif
include Makefile.config
 
## Common compiler flags
#
58,7 → 56,6
## Setup kernel configuration
#
 
include Makefile.config
include arch/$(ARCH)/Makefile.inc
include genarch/Makefile.inc