From 155971914073bedfa585a0be4d14a40bd23e3b8f Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sat, 20 Apr 2024 23:13:11 +0200 Subject: MHR-9: Driver toolkit, initial commit. Signed-off-by: Amlal El Mahrouss --- Public/Developer/SystemLib/Sources/App.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Public/Developer/SystemLib/Sources') diff --git a/Public/Developer/SystemLib/Sources/App.c b/Public/Developer/SystemLib/Sources/App.c index 9d390795..36e53c7e 100644 --- a/Public/Developer/SystemLib/Sources/App.c +++ b/Public/Developer/SystemLib/Sources/App.c @@ -11,7 +11,7 @@ ApplicationRef kSharedApplication = NullPtr; /// @brief Gets the app arguments count. /// @param void no arguments. -/// @return +/// @return The number of arguments given to the application. CA_EXTERN_C SizeType RtGetAppArgumentsCount(VoidType) { CA_MUST_PASS(kSharedApplication); @@ -23,7 +23,7 @@ CA_EXTERN_C SizeType RtGetAppArgumentsCount(VoidType) { /// @return CA_EXTERN_C CharacterTypeUTF8** RtGetAppArgumentsPtr(VoidType) { CA_MUST_PASS(kSharedApplication); - + return (CharacterTypeUTF8**)kSharedApplication->Invoke(kSharedApplication, kCallGetArgsPtr); } -- cgit v1.2.3 From bc4f32c10a34c6bded98f378004f7435deede43b Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sun, 21 Apr 2024 07:55:20 +0200 Subject: MHR-5: Fix: not using buggy wildcard anymore. Signed-off-by: Amlal El Mahrouss --- Private/Drivers/Bonjour/Bonjour.c | 18 ++++++++++++++++++ Private/Drivers/Bonjour/SampleDriver.c | 18 ------------------ Private/Drivers/Bonjour/makefile | 2 +- Private/Drivers/SampleDriver/makefile | 2 +- Private/NewBoot/Source/makefile | 5 ++--- Private/makefile | 3 +-- Public/Developer/DriverLib/.gitkeep | 0 Public/Developer/SystemLib/Sources/File.c | 3 ++- 8 files changed, 25 insertions(+), 26 deletions(-) create mode 100644 Private/Drivers/Bonjour/Bonjour.c delete mode 100644 Private/Drivers/Bonjour/SampleDriver.c delete mode 100644 Public/Developer/DriverLib/.gitkeep (limited to 'Public/Developer/SystemLib/Sources') diff --git a/Private/Drivers/Bonjour/Bonjour.c b/Private/Drivers/Bonjour/Bonjour.c new file mode 100644 index 00000000..dba649c9 --- /dev/null +++ b/Private/Drivers/Bonjour/Bonjour.c @@ -0,0 +1,18 @@ +/* ------------------------------------------- + + Copyright Mahrouss Logic + +------------------------------------------- */ + +#include +#include + +int __ImageStart(void) { + kernelPrintStr("Bonjour: Starting up zeroconf...\r\n"); + return 0; +} + +int __ImageEnd(void) { + kernelPrintStr("Bonjour: Shutting down zeroconf...\r\n"); + return 0; +} diff --git a/Private/Drivers/Bonjour/SampleDriver.c b/Private/Drivers/Bonjour/SampleDriver.c deleted file mode 100644 index 8289fcbc..00000000 --- a/Private/Drivers/Bonjour/SampleDriver.c +++ /dev/null @@ -1,18 +0,0 @@ -/* ------------------------------------------- - - Copyright Mahrouss Logic - -------------------------------------------- */ - -#include -#include - -int __ImageStart(void) { - kernelPrintStr("SampleDriver: Starting up...\r\n"); - return 0; -} - -int __ImageEnd(void) { - kernelPrintStr("SampleDriver: Shutting down...\r\n"); - return 0; -} diff --git a/Private/Drivers/Bonjour/makefile b/Private/Drivers/Bonjour/makefile index e1cdba67..b98d9ff9 100644 --- a/Private/Drivers/Bonjour/makefile +++ b/Private/Drivers/Bonjour/makefile @@ -24,7 +24,7 @@ EMU_FLAGS=-net none -smp 4 -m 4G -M q35 -bios OVMF.fd -device piix3-ide,id=ide - LD_FLAGS=-e __ImageStart --subsystem=17 -OBJ=$(wildcard *.o) $(wildcard HEL/AMD64/*.obj) +OBJ=*.o REM=rm diff --git a/Private/Drivers/SampleDriver/makefile b/Private/Drivers/SampleDriver/makefile index 637be18d..2433aa51 100644 --- a/Private/Drivers/SampleDriver/makefile +++ b/Private/Drivers/SampleDriver/makefile @@ -24,7 +24,7 @@ EMU_FLAGS=-net none -smp 4 -m 4G -M q35 -bios OVMF.fd -device piix3-ide,id=ide - LD_FLAGS=-e __ImageStart --subsystem=17 -OBJ=$(wildcard *.o) $(wildcard HEL/AMD64/*.obj) +OBJ=*.o REM=rm diff --git a/Private/NewBoot/Source/makefile b/Private/NewBoot/Source/makefile index 03bb9248..25eb04c0 100644 --- a/Private/NewBoot/Source/makefile +++ b/Private/NewBoot/Source/makefile @@ -24,8 +24,7 @@ EMU_FLAGS=-net none -smp 4 -m 4G -M q35 -bios OVMF.fd -device piix3-ide,id=ide - LD_FLAGS=-e Main --subsystem=10 -OBJ=$(wildcard *.o) $(wildcard HEL/AMD64/*.obj) - +OBJ=*.o REM=rm REM_FLAG=-f @@ -68,7 +67,7 @@ download-edk: .PHONY: clean clean: - $(REM) $(REM_FLAG) $(OBJ) NewBoot.exe NewKernel.exe OVMF.fd + $(REM) $(REM_FLAG) $(OBJ) NewBoot.exe NewKernel.exe OVMF.fd $(IMG) $(IMG_2) .PHONY: help help: diff --git a/Private/makefile b/Private/makefile index b166990e..4d871c82 100644 --- a/Private/makefile +++ b/Private/makefile @@ -39,7 +39,7 @@ SCRIPT = --script=Linker/Platforms/PC.lds .PHONY: error error: - @echo "Use a specific target." + @echo "=> Use a specific target." MOVEALL=./MoveAll.sh WINDRES=x86_64-w64-mingw32-windres @@ -58,7 +58,6 @@ OBJCOPY=x86_64-w64-mingw32-objcopy .PHONY: link-amd64-epm link-amd64-epm: - $(SLEEP) $(LD) $(LDFLAGS) $(LDOBJ) -o $(KERNEL) $(COPY) $(KERNEL) Root/Boot diff --git a/Public/Developer/DriverLib/.gitkeep b/Public/Developer/DriverLib/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/Public/Developer/SystemLib/Sources/File.c b/Public/Developer/SystemLib/Sources/File.c index 39a4aff0..6e4a7440 100644 --- a/Public/Developer/SystemLib/Sources/File.c +++ b/Public/Developer/SystemLib/Sources/File.c @@ -25,7 +25,8 @@ CA_EXTERN_C FSRef FsOpenFile(const CharacterTypeUTF8* path, CA_MUST_PASS(path && FsIsValidPath(path) == Yes); CA_MUST_PASS(rest); - return kSharedApplication->Invoke(kSharedApplication, kCallOpenFile, path, rest); + return kSharedApplication->Invoke(kSharedApplication, kCallOpenFile, path, + rest); } /// @brief Closes the file and flushes it to the said file. -- cgit v1.2.3