summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--dev/boot/amd64-desktop.make2
-rw-r--r--dev/ddk/src/ddk_rt_cxx.cc8
-rw-r--r--dev/user/SciCalls.h (renamed from dev/user/Opts.h)0
-rw-r--r--dev/user/src/SystemCalls.cc12
-rw-r--r--public/frameworks/CoreFoundation.fwrk/xml/app.xml2
-rw-r--r--public/frameworks/DiskImage.fwrk/xml/app.xml7
-rw-r--r--public/frameworks/KernelTest.fwrk/xml/app.xml5
-rwxr-xr-xsetup_x64.sh2
-rwxr-xr-xtooling/mk_app.py2
-rwxr-xr-xtooling/mk_fwrk.py17
10 files changed, 36 insertions, 21 deletions
diff --git a/dev/boot/amd64-desktop.make b/dev/boot/amd64-desktop.make
index c660df87..b5e49cb0 100644
--- a/dev/boot/amd64-desktop.make
+++ b/dev/boot/amd64-desktop.make
@@ -76,6 +76,7 @@ KERNEL=krnl.efi
SYSCHK=chk.efi
BOOTNET=net.efi
SCIKIT=user.sys
+DDK=ddk.sys
.PHONY: invalid-recipe
invalid-recipe:
@@ -93,6 +94,7 @@ all: compile-amd64
$(COPY) ./modules/BootNet/$(BOOTNET) src/root/$(BOOTNET)
$(COPY) ../user/$(SCIKIT) src/root/$(SCIKIT)
$(COPY) src/$(BOOTLOADER) src/root/$(BOOTLOADER)
+ $(COPY) ../ddk/$(DDK) src/root/$(DDK)
.PHONY: disk
disk:
diff --git a/dev/ddk/src/ddk_rt_cxx.cc b/dev/ddk/src/ddk_rt_cxx.cc
index 7daf0fcc..3d57e2b9 100644
--- a/dev/ddk/src/ddk_rt_cxx.cc
+++ b/dev/ddk/src/ddk_rt_cxx.cc
@@ -9,17 +9,17 @@
#include <DDKKit/ddk.h>
void* operator new(size_t sz) {
- return kalloc(sz);
+ return ::kalloc(sz);
}
void operator delete(void* ptr) {
- kfree(ptr);
+ ::kfree(ptr);
}
void* operator new[](size_t sz) {
- return kalloc(sz);
+ return ::kalloc(sz);
}
void operator delete[](void* ptr) {
- kfree(ptr);
+ ::kfree(ptr);
}
diff --git a/dev/user/Opts.h b/dev/user/SciCalls.h
index 4b3b63c1..4b3b63c1 100644
--- a/dev/user/Opts.h
+++ b/dev/user/SciCalls.h
diff --git a/dev/user/src/SystemCalls.cc b/dev/user/src/SystemCalls.cc
index f8b6d597..874f607d 100644
--- a/dev/user/src/SystemCalls.cc
+++ b/dev/user/src/SystemCalls.cc
@@ -4,7 +4,7 @@
------------------------------------------- */
-#include <user/Opts.h>
+#include <user/SciCalls.h>
#include <user/SystemCalls.h>
/// @file SystemCalls.cc
@@ -63,15 +63,15 @@ IMPORT_C Void IoCloseFile(_Input Ref desc) {
}
IMPORT_C UInt64 IoSeekFile(_Input Ref desc, _Input UInt64 off) {
- auto ret = (UInt64*) sci_syscall_arg_3(3, reinterpret_cast<VoidPtr>(desc),
- reinterpret_cast<VoidPtr>(&off));
+ auto ret = (volatile UInt64*) sci_syscall_arg_3(3, reinterpret_cast<VoidPtr>(desc),
+ reinterpret_cast<VoidPtr>(&off));
MUST_PASS((*ret) != ~0UL);
return *ret;
}
IMPORT_C UInt64 IoTellFile(_Input Ref desc) {
- auto ret = (UInt64*) sci_syscall_arg_2(4, reinterpret_cast<VoidPtr>(desc));
+ auto ret = (volatile UInt64*) sci_syscall_arg_2(4, reinterpret_cast<VoidPtr>(desc));
return *ret;
}
@@ -80,8 +80,8 @@ IMPORT_C SInt32 PrintOut(_Input IORef desc, const char* fmt, ...) {
va_start(args, fmt);
- auto ret = (UInt64*) sci_syscall_arg_4(5, reinterpret_cast<VoidPtr>(desc),
- reinterpret_cast<VoidPtr>(const_cast<Char*>(fmt)), args);
+ auto ret = (volatile UInt64*) sci_syscall_arg_4(
+ 5, reinterpret_cast<VoidPtr>(desc), reinterpret_cast<VoidPtr>(const_cast<Char*>(fmt)), args);
va_end(args);
diff --git a/public/frameworks/CoreFoundation.fwrk/xml/app.xml b/public/frameworks/CoreFoundation.fwrk/xml/app.xml
index 3a2beac4..fe112a09 100644
--- a/public/frameworks/CoreFoundation.fwrk/xml/app.xml
+++ b/public/frameworks/CoreFoundation.fwrk/xml/app.xml
@@ -1,3 +1,3 @@
<PropertyList/>
-<PLEntry Type="MLString" Name="LibraryName" Len="255" Value="CoreFoundation" />
+<PLEntry Type="CFString" Name="LibraryName" Len="255" Value="CoreFoundation" />
<PLEntry Type="BOOL" Name="CacheLibs" Value="YES" />
diff --git a/public/frameworks/DiskImage.fwrk/xml/app.xml b/public/frameworks/DiskImage.fwrk/xml/app.xml
index 29d6670f..f498d4ab 100644
--- a/public/frameworks/DiskImage.fwrk/xml/app.xml
+++ b/public/frameworks/DiskImage.fwrk/xml/app.xml
@@ -1,3 +1,4 @@
-<PropertyList/>
-<PLEntry Type="MLString" Name="LibraryName" Len="255" Value="DiskImage" />
-<PLEntry Type="BOOL" Name="CacheLibs" Value="YES" />
+<PropertyList>
+ <PLEntry Type="CFString" Name="LibraryName" Len="10" Value="DiskImage" />
+ <PLEntry Type="BOOL" Name="CacheLibs" Value="YES" />
+</PropertyList> \ No newline at end of file
diff --git a/public/frameworks/KernelTest.fwrk/xml/app.xml b/public/frameworks/KernelTest.fwrk/xml/app.xml
index f0c48862..e3ff9424 100644
--- a/public/frameworks/KernelTest.fwrk/xml/app.xml
+++ b/public/frameworks/KernelTest.fwrk/xml/app.xml
@@ -1,3 +1,4 @@
-<PropertyList/>
-<PLEntry Type="MLString" Name="LibraryName" Len="255" Value="KernelTest" />
+<PropertyList>
+<PLEntry Type="CFString" Name="LibraryName" Len="10" Value="KernelTest" />
<PLEntry Type="BOOL" Name="CacheLibs" Value="YES" />
+</PropertyList> \ No newline at end of file
diff --git a/setup_x64.sh b/setup_x64.sh
index 6afc1633..5eeaafde 100755
--- a/setup_x64.sh
+++ b/setup_x64.sh
@@ -9,6 +9,8 @@ cd src
make sci_asm_io_x64
cd ..
btb user.json
+cd ../ddk
+btb ddk.json
cd ../boot
make -f amd64-desktop.make efi
make -f amd64-desktop.make epm-img
diff --git a/tooling/mk_app.py b/tooling/mk_app.py
index ef2b64c9..9418cf05 100755
--- a/tooling/mk_app.py
+++ b/tooling/mk_app.py
@@ -77,4 +77,4 @@ if __name__ == "__main__":
base_path = os.getcwd() # Use the current working directory as the base path
create_directory_structure(base_path, sys.argv[1])
- print("NeKernel Application created successfully.")
+ print("Info: Application created successfully.")
diff --git a/tooling/mk_fwrk.py b/tooling/mk_fwrk.py
index 89857347..3c73e88e 100755
--- a/tooling/mk_fwrk.py
+++ b/tooling/mk_fwrk.py
@@ -12,14 +12,17 @@ def create_directory_structure(base_path_fwrk, project_file_name, project_name):
# Define the directory structure
structure = {
project_name: {
+ "headers": {
+ ".keep": None
+ },
"dist": {
".keep": None
},
"src": {
".keep": None,
- "CommandLine.cc": None,
+ "DylibMain.cc": None,
},
- "vendor": {
+ "xml": {
".keep": None
},
".keep": None,
@@ -65,13 +68,19 @@ def create_directory_structure(base_path_fwrk, project_file_name, project_name):
with open(proj_json_path, 'w') as json_file:
json.dump(manifest, json_file, indent=4)
- proj_cpp_path = os.path.join(base_path_fwrk, project_name, f"src/CommandLine.cc")
+ proj_cpp_path = os.path.join(base_path_fwrk, project_name, f"src/DylibMain.cc")
cpp_file = "#include <user/SystemCalls.h>\n\nSInt32 _DylibAttach(SInt32 argc, Char* argv[]) {\n\treturn EXIT_FAILURE;\n}"
with open(proj_cpp_path, 'w') as cpp_file_io:
cpp_file_io.write(cpp_file)
+ xml_blob = f"<PropertyList>\n<PLEntry Type=\"CFString\" Name=\"LibraryName\" Len=\"{len(project_name)}\" Value=\"{project_name}\" /></PropertyList>"
+ proj_xml_path = os.path.join(base_path_fwrk, project_name, f"xml/app.xml")
+
+ with open(proj_xml_path, 'w') as cpp_file_io:
+ cpp_file_io.write(xml_blob)
+
if __name__ == "__main__":
if len(sys.argv) != 2:
print("Usage: mk_fwrk.py <project_name>")
@@ -80,4 +89,4 @@ if __name__ == "__main__":
base_path = os.getcwd() # Use the current working directory as the base path
create_directory_structure(base_path, sys.argv[1], sys.argv[1] + '.fwrk')
- print("NeKernel Framework created successfully.")
+ print("Info: Framework created successfully.")