Menuconfig Implementation and auto-qemu refactoring (#44)
[lunaix-os.git] / lunaix-os / arch / LConfig
index 30c67b626a5459780e8c85a446a920dba406ce25..7afea85ce59caf5d1bfcf721d14d1dc47f26cf39 100644 (file)
@@ -1,13 +1,44 @@
-include("i386/LConfig")
+include("x86/LConfig")
 
 
-@Collection
+@Collection("Platform")
 def architecture_support():
     """
         Config ISA related features
     """
 
 def architecture_support():
     """
         Config ISA related features
     """
 
-    @Term
+    @Term("Architecture")
     def arch():
     def arch():
-        """ Config ISA support """
-        type(["i386", "x86_64", "aarch64", "rv64"])
-        default("i386")
+        """ 
+            Config ISA support 
+        """
+        # type(["i386", "x86_64", "aarch64", "rv64"])
+        type(["i386", "x86_64"])
+        default("x86_64")
+
+        env_val = env("ARCH")
+        if env_val:
+            set_value(env_val)
+
+    @Term("Base operand size")
+    @ReadOnly
+    def arch_bits():
+        """ 
+            Defines the base size of a general register of the 
+            current selected ISA.
+
+            This the 'bits' part when we are talking about a CPU
+        """
+
+        type(["64", "32"])
+        match v(arch):
+            case "i386": 
+                default("32")
+            case "aarch64": 
+                default("64")
+            case "rv64": 
+                default("64")
+            case "x86_64": 
+                default("64")
+            case _:
+                default("32")
+        
\ No newline at end of file