added kernel configuration
This commit is contained in:
parent
68b3865f61
commit
2ccf881b04
31 changed files with 76 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -3,3 +3,4 @@ gcc/
|
||||||
binutils/
|
binutils/
|
||||||
gawk/
|
gawk/
|
||||||
builddir/
|
builddir/
|
||||||
|
config.cmake
|
||||||
|
|
43
config.py
Executable file
43
config.py
Executable 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')
|
|
@ -1 +1,2 @@
|
||||||
ENABLE_LANGUAGE(C CXX ASM-ATT)
|
ENABLE_LANGUAGE(C CXX ASM-ATT)
|
||||||
|
INCLUDE(arch/$ARCH/$SYSTEM/config.cmake)
|
||||||
|
|
5
kernel/arch/arm/3ds11/config.py
Normal file
5
kernel/arch/arm/3ds11/config.py
Normal 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")
|
||||||
|
|
3
kernel/arch/arm/3ds9/config.py
Normal file
3
kernel/arch/arm/3ds9/config.py
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
config["LOWEST_CPU"] = "arm946e-s"
|
||||||
|
config["ENABLE_THUMB"] = get_yes_no("Enable Thumb", True)
|
||||||
|
|
1
kernel/arch/arm/config.py
Normal file
1
kernel/arch/arm/config.py
Normal file
|
@ -0,0 +1 @@
|
||||||
|
config["SYSTEM"] = get_from_list("System", ["3ds9","3ds11"])
|
6
kernel/arch/x86/config.py
Normal file
6
kernel/arch/x86/config.py
Normal 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"
|
||||||
|
|
2
kernel/arch/x86/pc/config.py
Normal file
2
kernel/arch/x86/pc/config.py
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
config["ENABLE_FPU"]=get_yes_no("Enable x87 FPU", True)
|
||||||
|
config["ENABLE_SSE"]=get_yes_no("Enable SSE")
|
5
kernel/arch/x86_64/config.py
Normal file
5
kernel/arch/x86_64/config.py
Normal 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"])
|
||||||
|
|
||||||
|
|
2
kernel/arch/x86_64/pc/config.py
Normal file
2
kernel/arch/x86_64/pc/config.py
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
config["ENABLE_FPU"] = True
|
||||||
|
config["ENABLE_SSE"] = get_yes_no("Enable FPU", True)
|
0
kernel/cpu/arm/arm11mpcore/config.py
Normal file
0
kernel/cpu/arm/arm11mpcore/config.py
Normal file
0
kernel/cpu/arm/arm946e-s/config.py
Normal file
0
kernel/cpu/arm/arm946e-s/config.py
Normal file
0
kernel/cpu/x86/486/config.py
Normal file
0
kernel/cpu/x86/486/config.py
Normal file
0
kernel/cpu/x86/pentium/config.py
Normal file
0
kernel/cpu/x86/pentium/config.py
Normal file
0
kernel/cpu/x86/pentium2/config.py
Normal file
0
kernel/cpu/x86/pentium2/config.py
Normal file
0
kernel/cpu/x86/pentium3/config.py
Normal file
0
kernel/cpu/x86/pentium3/config.py
Normal file
0
kernel/cpu/x86/pentium4/config.py
Normal file
0
kernel/cpu/x86/pentium4/config.py
Normal file
0
kernel/cpu/x86_64/broadwell/config.py
Normal file
0
kernel/cpu/x86_64/broadwell/config.py
Normal file
0
kernel/cpu/x86_64/core2/config.py
Normal file
0
kernel/cpu/x86_64/core2/config.py
Normal file
0
kernel/cpu/x86_64/haswell/config.py
Normal file
0
kernel/cpu/x86_64/haswell/config.py
Normal file
0
kernel/cpu/x86_64/ivybridge/config.py
Normal file
0
kernel/cpu/x86_64/ivybridge/config.py
Normal file
0
kernel/cpu/x86_64/kabylake/config.py
Normal file
0
kernel/cpu/x86_64/kabylake/config.py
Normal file
0
kernel/cpu/x86_64/nehalem/config.py
Normal file
0
kernel/cpu/x86_64/nehalem/config.py
Normal file
0
kernel/cpu/x86_64/pentium4/config.py
Normal file
0
kernel/cpu/x86_64/pentium4/config.py
Normal file
0
kernel/cpu/x86_64/sandybridge/config.py
Normal file
0
kernel/cpu/x86_64/sandybridge/config.py
Normal file
0
kernel/cpu/x86_64/skylake/config.py
Normal file
0
kernel/cpu/x86_64/skylake/config.py
Normal file
0
kernel/cpu/x86_64/westmere/config.py
Normal file
0
kernel/cpu/x86_64/westmere/config.py
Normal file
6
kernel/hw/3ds11/config.py
Normal file
6
kernel/hw/3ds11/config.py
Normal 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
1
kernel/hw/3ds9/config.py
Normal 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
0
kernel/hw/config.py
Normal file
0
kernel/hw/pc/config.py
Normal file
0
kernel/hw/pc/config.py
Normal file
Loading…
Reference in a new issue