summaryrefslogtreecommitdiffhomepage
path: root/dev/ddk/DriverKit
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-08-25 09:50:27 +0200
committerAmlal El Mahrouss <amlal@nekernel.org>2025-08-25 09:50:27 +0200
commita7939c9a20d5f4b83d5df34aa652a88a0764042c (patch)
treed773fa076011ac6a54c1de93755797b09e7bd3ca /dev/ddk/DriverKit
parentd864e0c6281024ce4b9bd654aa83308a50f583d8 (diff)
feat! ddk -> libDDK, use syscall on AMD64.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/ddk/DriverKit')
-rw-r--r--dev/ddk/DriverKit/ddk.h74
-rw-r--r--dev/ddk/DriverKit/dev.h36
-rw-r--r--dev/ddk/DriverKit/io.h18
-rw-r--r--dev/ddk/DriverKit/macros.h48
-rw-r--r--dev/ddk/DriverKit/net.h16
-rw-r--r--dev/ddk/DriverKit/str.h17
6 files changed, 0 insertions, 209 deletions
diff --git a/dev/ddk/DriverKit/ddk.h b/dev/ddk/DriverKit/ddk.h
deleted file mode 100644
index 254137f9..00000000
--- a/dev/ddk/DriverKit/ddk.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/* -------------------------------------------
-
- Copyright Amlal El Mahrouss.
-
- FILE: ddk.h
- PURPOSE: DDK Driver model base header.
-
-------------------------------------------- */
-
-#pragma once
-
-#include <DriverKit/macros.h>
-
-struct DDK_STATUS_STRUCT;
-struct DDK_OBJECT_MANIFEST;
-
-/// \brief Object handle manifest.
-struct DDK_OBJECT_MANIFEST DDK_FINAL {
- char* p_name;
- int32_t p_kind;
- void* p_object;
-};
-
-/// \brief DDK status ping structure.
-struct DDK_STATUS_STRUCT DDK_FINAL {
- int32_t s_action_id;
- int32_t s_issuer_id;
- int32_t s_group_id;
- struct DDK_OBJECT_MANIFEST* s_object;
-};
-
-/// @brief Call Kernel procedure.
-/// @param name the procedure name.
-/// @param cnt number of elements in **dat**
-/// @param dat data argument pointer.
-/// @param sz sz of whole data argument pointer.
-/// @return result of call
-DDK_EXTERN void* ke_call_dispatch(const char* name, int32_t cnt, void* dat, size_t sz);
-
-/// @brief add a system call.
-/// @param slot system call slot id.
-/// @param slotFn, syscall slot.
-DDK_EXTERN void ke_set_syscall(const int32_t slot, void (*slotFn)(void* a0));
-
-/// @brief Allocates an heap ptr.
-/// @param sz size of the allocated struct/type.
-/// @return the pointer allocated or **nil**.
-DDK_EXTERN void* kalloc(size_t sz);
-
-/// @brief Frees an heap ptr.
-/// @param pointer kernel pointer to free.
-DDK_EXTERN void kfree(void* the_ptr);
-
-/// @brief Gets a Kernel object.
-/// @param slot object id (can be 0)
-/// @param name the property's name.
-/// @return DDK_OBJECT_MANIFEST.
-DDK_EXTERN struct DDK_OBJECT_MANIFEST* ke_get_obj(const int slot, const char* name);
-
-/// @brief Set a Kernel object.
-/// @param slot object id (can be 0)
-/// @param name the property's name.
-/// @param ddk_pr pointer to a object's DDK_OBJECT_MANIFEST.
-/// @return returned object.
-DDK_EXTERN void* ke_set_obj(const int32_t slot, const struct DDK_OBJECT_MANIFEST* ddk_pr);
-
-/// @brief The highest API version of the DDK.
-DDK_EXTERN uint32_t kApiVersionHighest;
-
-/// @brief The lowest API version of the DDK.
-DDK_EXTERN uint32_t kApiVersionLowest;
-
-/// @brief API version in BCD.
-DDK_EXTERN uint32_t kApiVersion;
diff --git a/dev/ddk/DriverKit/dev.h b/dev/ddk/DriverKit/dev.h
deleted file mode 100644
index adb1c1d0..00000000
--- a/dev/ddk/DriverKit/dev.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* -------------------------------------------
-
- Copyright Amlal El Mahrouss.
-
- File: dev.h
- Purpose: DDK device support.
-
-------------------------------------------- */
-
-#pragma once
-
-#include <DriverKit/ddk.h>
-
-struct _DDK_DEVICE;
-
-#define DDK_DEVICE_NAME_LEN (255)
-
-/// @brief Kernel Device driver.
-typedef struct _DDK_DEVICE DDK_FINAL {
- char d_name[DDK_DEVICE_NAME_LEN]; // the device name. Could be /./DEVICE_NAME/
- void* (*d_read)(void* arg, int len); // read from device.
- void (*d_write)(void* arg, int len);
- void (*d_wait)(void); // write to device.
- struct _DDK_DEVICE* (*d_open)(const char* path); // open device.
- void (*d_close)(struct _DDK_DEVICE* dev); // close device.
- void (*d_seek)(struct _DDK_DEVICE* dev, size_t off);
- size_t (*d_tell)(struct _DDK_DEVICE* dev);
-} DDK_DEVICE, *DDK_DEVICE_PTR;
-
-/// @brief Open a new device from path.
-/// @param path the device's path.
-DDK_EXTERN DDK_DEVICE_PTR open(const char* path);
-
-/// @brief Close any device.
-/// @param device valid device.
-DDK_EXTERN BOOL close(DDK_DEVICE_PTR device);
diff --git a/dev/ddk/DriverKit/io.h b/dev/ddk/DriverKit/io.h
deleted file mode 100644
index 805696e6..00000000
--- a/dev/ddk/DriverKit/io.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/* -------------------------------------------
-
- Copyright Amlal El Mahrouss.
-
- Purpose: DDK Text I/O.
-
-------------------------------------------- */
-
-#pragma once
-
-#include <DriverKit/str.h>
-
-/// @brief print character into UART.
-DDK_EXTERN void kputc(const char ch);
-
-/// @brief print string to UART.
-/// @param message string to transmit to UART.
-DDK_EXTERN void kprint(const char* message);
diff --git a/dev/ddk/DriverKit/macros.h b/dev/ddk/DriverKit/macros.h
deleted file mode 100644
index 9b7b3d50..00000000
--- a/dev/ddk/DriverKit/macros.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* -------------------------------------------
-
- Copyright 2025 Amlal El Mahrouss.
-
- FILE: ddk.h
- PURPOSE: DDK Driver model base header.
-
-------------------------------------------- */
-
-#pragma once
-
-#include <stddef.h>
-#include <stdint.h>
-
-#if defined(__cplusplus)
-#define BOOL bool
-#define YES true
-#define NO false
-#define DDK_EXTERN extern "C" __declspec(dllexport)
-#define nil nullptr
-#undef NULL
-#define NULL 0
-#define DDK_FINAL final
-#else
-#define BOOL char
-#define YES 1
-#define NO 0
-#define DDK_EXTERN extern __declspec(dllexport)
-#define nil ((void*) 0)
-#undef NULL
-#define NULL ((void*) 0)
-#define DDK_FINAL
-#endif // defined(__cplusplus)
-
-#ifndef __DDK__
-#undef DDK_EXTERN
-#if defined(__cplusplus)
-#define DDK_EXTERN extern "C" __declspec(dllimport)
-#else
-#define DDK_EXTERN __declspec(dllimport)
-#endif
-#endif
-
-#define ATTRIBUTE(X) __attribute__((X))
-
-#ifndef __NEOSKRNL__
-#error !!! Do not include header in EL0/Ring 3 mode !!!
-#endif // __NEOSKRNL__ \ No newline at end of file
diff --git a/dev/ddk/DriverKit/net.h b/dev/ddk/DriverKit/net.h
deleted file mode 100644
index 63f89367..00000000
--- a/dev/ddk/DriverKit/net.h
+++ /dev/null
@@ -1,16 +0,0 @@
-/* -------------------------------------------
-
- Copyright Amlal El Mahrouss.
-
- FILE: net.h
- PURPOSE: Network model base header.
-
-------------------------------------------- */
-
-#pragma once
-
-#include <DriverKit/macros.h>
-
-struct DDK_NET_MANIFEST;
-
-/// @brief IFS hooks to plug into the FileMgr.
diff --git a/dev/ddk/DriverKit/str.h b/dev/ddk/DriverKit/str.h
deleted file mode 100644
index b2c0ce72..00000000
--- a/dev/ddk/DriverKit/str.h
+++ /dev/null
@@ -1,17 +0,0 @@
-/* -------------------------------------------
-
- Copyright Amlal El Mahrouss.
-
- Purpose: DDK Strings.
-
-------------------------------------------- */
-
-#pragma once
-
-#include <DriverKit/ddk.h>
-
-/// @brief DDK equivalent of POSIX's string.h
-/// @file str.h
-
-DDK_EXTERN size_t kstrlen(const char* in);
-DDK_EXTERN int kstrncpy(char* dst, const char* src, size_t len);