added kernel configuration

This commit is contained in:
Morten Delenk 2017-04-23 16:09:42 +00:00
parent 68b3865f61
commit 2ccf881b04
31 changed files with 76 additions and 0 deletions

1
.gitignore vendored
View file

@ -3,3 +3,4 @@ gcc/
binutils/
gawk/
builddir/
config.cmake

43
config.py Executable file
View file

@ -0,0 +1,43 @@
#!/usr/bin/env python3
"This tool is for configuring mtgos"
def get_from_list(p,l):
print("Select one of:")
for i,j in enumerate(l):
print(str(i)+":",j)
if len(l) == 1:
print(p+": 0 (autoselected)")
return l[0]
i=-1
while (i<0) or (i >= len(l)):
x = input(p+": ")
try:
i = int(x)
except:
i = -1
print()
return l[i]
def get_yes_no(p, default=None):
x="a"
defaultstr = "[yn]"
if default:
defaultstr = "[Yn]"
elif default == False:
defaultstr = "[yN]"
while x not in "ynYN":
x = input(p+" "+defaultstr+": ")
if (x == "") and default is not None:
return default
return x in "yY"
config={}
config["ARCH"] = get_from_list("Architecture", ["x86","x86_64","arm"])
exec(open("kernel/arch/"+config["ARCH"]+"/config.py").read())
exec(open("kernel/arch/"+config["ARCH"]+"/"+config["SYSTEM"]+"/config.py").read())
exec(open("kernel/cpu/"+config["ARCH"]+"/"+config["LOWEST_CPU"]+"/config.py").read())
exec(open("kernel/hw/"+config["SYSTEM"]+"/config.py").read())
exec(open("kernel/hw/config.py").read())
with open("config.cmake", "w") as f:
for key, val in config.items():
if val == True:
f.write('SET('+key+' 1)\n')
elif val != False:
f.write('SET('+key+' '+str(val)+')\n')

View file

@ -1 +1,2 @@
ENABLE_LANGUAGE(C CXX ASM-ATT)
INCLUDE(arch/$ARCH/$SYSTEM/config.cmake)

View file

@ -0,0 +1,5 @@
config["LOWEST_CPU"] = "arm11mpcore"
config["ENABLE_HARD"] = get_yes_no("Enable VFP ABI", True)
if not config["ENABLE_HARD"]:
config["ENABLE_THUMB"] = get_yes_no("Enable Thumb")

View file

@ -0,0 +1,3 @@
config["LOWEST_CPU"] = "arm946e-s"
config["ENABLE_THUMB"] = get_yes_no("Enable Thumb", True)

View file

@ -0,0 +1 @@
config["SYSTEM"] = get_from_list("System", ["3ds9","3ds11"])

View file

@ -0,0 +1,6 @@
config["SYSTEM"] = get_from_list("System", ["pc"])
if not get_yes_no("Build for generic x86"):
config["LOWEST_CPU"] = get_from_list("Lowest supported CPU", ["486", "pentium", "pentium2", "pentium3", "pentium4"])
else:
config["LOWEST_CPU"] = "486"

View file

@ -0,0 +1,2 @@
config["ENABLE_FPU"]=get_yes_no("Enable x87 FPU", True)
config["ENABLE_SSE"]=get_yes_no("Enable SSE")

View file

@ -0,0 +1,5 @@
config["SYSTEM"] = get_from_list("System", ["pc"])
if not get_yes_no("Build for generic x86_64"):
config["LOWEST_CPU"] = get_from_list("Lowest supported CPU", ["pentium4", "core2", "nehalem", "westmere", "sandybridge", "ivybridge", "haswell", "broadwell", "skylake", "kabylake"])

View file

@ -0,0 +1,2 @@
config["ENABLE_FPU"] = True
config["ENABLE_SSE"] = get_yes_no("Enable FPU", True)

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

@ -0,0 +1,6 @@
config["ENABLE_N3DS_OVERCLOCK"] = get_yes_no("Enable overclocking on n3ds", True)
config["ENABLE_I2C"] = get_yes_no("Enable i2c driver", True)
if config["ENABLE_I2C"]:
config["PROTECT_MCU"] = get_yes_no("Prevent writes to MCU firmware (Device 3, Register 5)", True)
config["ENABLE_SCREENINIT"] = get_yes_no("Enable screeninit.", True)

1
kernel/hw/3ds9/config.py Normal file
View file

@ -0,0 +1 @@
config["ENABLE_EXTRA_MEMORY"] = get_yes_no("Enable 512KB of memory on n3DS", True)

0
kernel/hw/config.py Normal file
View file

0
kernel/hw/pc/config.py Normal file
View file