Reorganize D modules a bit

This commit is contained in:
Josh Holtrop 2022-03-19 22:39:12 -04:00
parent 163ef9f79e
commit 79b34477ed
9 changed files with 15 additions and 5 deletions

View File

@ -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}]

View File

@ -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;

View File

@ -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)

View File

@ -1,3 +1,5 @@
module hello.scratch;
align(4096) __gshared ubyte[1024 * 1024] scratch;
__gshared size_t scratch_used;

View File

@ -1,3 +1,5 @@
module hulk.bootinfo;
struct BootInfo
{
struct MemoryRegion

View File

@ -1,3 +1,5 @@
module hulk.hulk;
import hulk.bootinfo;
import hos.memory;
import ldc.attributes;