diff --git a/Rsconscript b/Rsconscript index 14f00c3..28a721a 100644 --- a/Rsconscript +++ b/Rsconscript @@ -72,7 +72,7 @@ end hulk_env = env "hulk", use: %w[ldc2 x86_64-elf-gcc] do |env| env["sources"] = glob("src/hulk/**/*.d") env["DFLAGS"] += %w[-mtriple=x86_64-unknown-elf --betterC -release -O3 --wi --enable-cross-module-inlining] - env["D_IMPORT_PATH"] += %w[src/hulk src/common] + env["D_IMPORT_PATH"] += %w[src] env["LD"] = "x86_64-elf-gcc" env["LDFLAGS"] += %w[-nostdlib -Tsrc/hulk/hulk.ld -Wl,-Map,${_TARGET}.map] env["LDCMD"] = %w[${LD} -o ${_TARGET} ${LDFLAGS} ${_SOURCES} ${LIBDIRPREFIX}${LIBPATH} ${LIBLINKPREFIX}${LIBS}] @@ -98,7 +98,7 @@ hello_env = env "hello", use: %w[ldc2 x86_64-w64-mingw32-gcc] do |env| env.depends("^/hulk_bin.o", hulk_env.expand("^/hulk.bin")) env["sources"] << "^/hulk_bin.o" env["DFLAGS"] += %w[-mtriple=x86_64-unknown-windows-coff --betterC -release -O3 --wi --enable-cross-module-inlining] - env["D_IMPORT_PATH"] += %w[src/hello src/hulk uefi-d/source src/common] + env["D_IMPORT_PATH"] += %w[src uefi-d/source] env["LD"] = "x86_64-w64-mingw32-gcc" env["LDFLAGS"] += %w[-nostdlib -Wl,-dll -shared -Wl,--subsystem,10 -e efi_main -Wl,-Map,${_TARGET}.map] env["LDCMD"] = %w[${LD} -o ${_TARGET} ${LDFLAGS} ${_SOURCES} ${LIBDIRPREFIX}${LIBPATH} ${LIBLINKPREFIX}${LIBS}] diff --git a/src/hello/hello.d b/src/hello/hello.d index a8a9979..6d0ac72 100644 --- a/src/hello/hello.d +++ b/src/hello/hello.d @@ -1,6 +1,8 @@ +module hello.hello; + import uefi; -import output; -import scratch; +import hello.output; +import hello.scratch; import hulk.bootinfo; import hos.page_table; import hos.cpu; diff --git a/src/hello/output.d b/src/hello/output.d index c030312..3db33ab 100644 --- a/src/hello/output.d +++ b/src/hello/output.d @@ -1,5 +1,7 @@ +module hello.output; + import uefi; -import hello; +import hello.hello; import core.stdc.stdarg; private size_t format_hex(CHAR16 * s, ulong v, bool ptr) diff --git a/src/hello/scratch.d b/src/hello/scratch.d index dbb5db8..8ee2083 100644 --- a/src/hello/scratch.d +++ b/src/hello/scratch.d @@ -1,3 +1,5 @@ +module hello.scratch; + align(4096) __gshared ubyte[1024 * 1024] scratch; __gshared size_t scratch_used; diff --git a/src/common/hos/cpu.d b/src/hos/cpu.d similarity index 100% rename from src/common/hos/cpu.d rename to src/hos/cpu.d diff --git a/src/common/hos/memory.d b/src/hos/memory.d similarity index 100% rename from src/common/hos/memory.d rename to src/hos/memory.d diff --git a/src/common/hos/page_table.d b/src/hos/page_table.d similarity index 100% rename from src/common/hos/page_table.d rename to src/hos/page_table.d diff --git a/src/hulk/hulk/bootinfo.d b/src/hulk/bootinfo.d similarity index 94% rename from src/hulk/hulk/bootinfo.d rename to src/hulk/bootinfo.d index 11999d9..0777fa9 100644 --- a/src/hulk/hulk/bootinfo.d +++ b/src/hulk/bootinfo.d @@ -1,3 +1,5 @@ +module hulk.bootinfo; + struct BootInfo { struct MemoryRegion diff --git a/src/hulk/hulk.d b/src/hulk/hulk.d index 0ad1555..8911341 100644 --- a/src/hulk/hulk.d +++ b/src/hulk/hulk.d @@ -1,3 +1,5 @@ +module hulk.hulk; + import hulk.bootinfo; import hos.memory; import ldc.attributes;