feat: device subsystem rework
[lunaix-os.git] / lunaix-os / link / linker.ld
index 71bc1511ff31a2cca0d01055cf866ab693aa218d..1cc64bb2901a6d3f42b6a594fc33317eebd710dd 100644 (file)
@@ -1,12 +1,5 @@
 ENTRY(start_)
 
-/*
-    FUTURE: Use disk reader
-    A bit of messy here.
-    We will pull our higher half kernel out of this shit
-      and load it separately once we have our disk reader.
-*/
-
 SECTIONS {
     . = 0x100000;
 
@@ -33,7 +26,10 @@ SECTIONS {
     }
     __kexec_boot_end = ALIGN(4K);
 
-    /* Relocation of our higher half kernel */
+    /* ---- boot end ---- */
+
+    /* ---- kernel start ---- */
+
     . += 0xC0000000;
 
     /* 好了,我们的内核…… */
@@ -71,11 +67,55 @@ SECTIONS {
 
         /* ---- */
 
-        PROVIDE(__lga_pci_dev_drivers_start = .);
+        /* align to 8 bytes, so it can cover both 32 and 64 bits address line*/
+        . = ALIGN(8);
+
+        PROVIDE(__lga_devdefs_start = .);
         
-        KEEP(*(.lga.pci_dev_drivers));
+        KEEP(*(.lga.devdefs));
+
+        PROVIDE(__lga_devdefs_end = .);
+
+        /* ---- */
+
+        . = ALIGN(8);
+
+        PROVIDE(__lga_dev_ld_early_start = .);
+        
+        KEEP(*(.lga.devdefs.ld_early));
+
+        PROVIDE(__lga_dev_ld_early_end = .);
+
+        /* ---- */
+
+        . = ALIGN(8);
+
+        PROVIDE(__lga_dev_ld_aftertimer_start = .);
+        
+        KEEP(*(.lga.devdefs.ld_aftertimer));
+
+        PROVIDE(__lga_dev_ld_aftertimer_end = .);
+
+        /* ---- */
+
+        . = ALIGN(8);
+
+        PROVIDE(__lga_dev_ld_post_start = .);
+        
+        KEEP(*(.lga.devdefs.ld_post));
+
+        PROVIDE(__lga_dev_ld_post_end = .);
+
+        /* ---- */
+
+        . = ALIGN(8);
+
+        PROVIDE(__lga_fs_start = .);
+        
+        KEEP(*(.lga.fs));
+
+        PROVIDE(__lga_fs_end = .);
 
-        PROVIDE(__lga_pci_dev_drivers_end = .);
     }
 
     .bss BLOCK(4K) : AT ( ADDR(.bss) - 0xC0000000 ) {