summaryrefslogtreecommitdiffhomepage
path: root/dev/hpfs
diff options
context:
space:
mode:
Diffstat (limited to 'dev/hpfs')
-rw-r--r--dev/hpfs/.gitignore3
-rw-r--r--dev/hpfs/EPM/EBS.i29
-rw-r--r--dev/hpfs/EPM/EPM.asm37
-rw-r--r--dev/hpfs/EPM/blob.json6
-rw-r--r--dev/hpfs/ReadMe.md9
-rw-r--r--dev/hpfs/hpfs.json22
-rw-r--r--dev/hpfs/hpfs_specs.hxx15
-rw-r--r--dev/hpfs/src/hpfs_main.cxx20
8 files changed, 141 insertions, 0 deletions
diff --git a/dev/hpfs/.gitignore b/dev/hpfs/.gitignore
new file mode 100644
index 00000000..6f675898
--- /dev/null
+++ b/dev/hpfs/.gitignore
@@ -0,0 +1,3 @@
+*.sys
+*.exe
+*.dll \ No newline at end of file
diff --git a/dev/hpfs/EPM/EBS.i b/dev/hpfs/EPM/EBS.i
new file mode 100644
index 00000000..c137b6f4
--- /dev/null
+++ b/dev/hpfs/EPM/EBS.i
@@ -0,0 +1,29 @@
+;; FILE: EBS.asm
+;; PURPOSE: EXPLICIT BOOT SECTOR STRUCTURE (HPFS RELATED).
+;; AUTHOR: AMLAL EL MAHROUSS
+
+[bits 64]
+
+;; DUMP THIS BLOB TO DISK, WHEN FORMATTING THE SSD.
+
+HPFS_EBS_HEADER:
+ db " HPFS" ;; MAGIC NUMBER OF FILESYSTEM
+ dw 8 ;; MAGIC NUMBER LENGTH.
+ dq 0 ;; RESERVED 4
+ dw 0x0100 ;; VERSION
+ dw 0 ;; PARTITION TYPE
+ dq 0 ;; RESERVED 3
+ dw 0 ;; DISK TYPE (INVALID = 0, CDROM = 1, SSD = 2, USB = 3)
+ dw 0 ;; CHECKSUM OF PARTITION
+ dw 0 ;; IS IT LOCKED? (DISK ENCRYPTION ON?)
+ dq 0 ;; SECTOR COUNT
+ dq 0 ;; RESERVED 2
+ dq 512 ;; SECTOR SZ
+ dq 0 ;; DISK SIZE
+ dq 0 ;; RESERVED 1 SLOT
+ dq 1 ;; LOCKER ON?
+ dq 1 ;; PARTITION MAP TYPE (GPT, MBR, EPM)
+ dq 16 ;; MASTER FILE TABLE
+ dq 80 ;; MASTER TRACE TABLE
+ dq 144 ;; MASTER DIRECTORY TABLE
+ dw 0xFFFF ;; END OF HEADER WORD
diff --git a/dev/hpfs/EPM/EPM.asm b/dev/hpfs/EPM/EPM.asm
new file mode 100644
index 00000000..2197d2cd
--- /dev/null
+++ b/dev/hpfs/EPM/EPM.asm
@@ -0,0 +1,37 @@
+;; FILE: EBS.asm
+;; PURPOSE: EXPLICIT PARTITION MAP BOOT STRUCTURE (HPFS RELATED).
+;; AUTHOR: AMLAL EL MAHROUSS
+
+[bits 64]
+
+HPFS_EPM_HEADER:
+ db "EPMAM", 0
+ db "HPFS ", 0
+HPFS_EPM_UUID:
+ dd 0
+ dw 0
+ db 0
+ db 0
+ db 0
+ db 0
+ db 0
+ db 0
+ db 0
+ db 0
+ dd 0xAD ;; EPM revision
+ dd 0 ;; Number of blocks, set to 0 by default.
+ dd 512 ;; Sector size, HPFS was made with drives in mind, so 512.
+ dd 0
+ dd 0
+ dw 0x1f ;; NewOS (ZKA) present on partition.
+ dd 1
+ db "FileSystem (A:)", 0
+ times 401 db 0
+HPFS_EPM_HEADER_END:
+
+
+%include "EBS.i"
+
+times 16 db 0
+
+;; Here the partition starts
diff --git a/dev/hpfs/EPM/blob.json b/dev/hpfs/EPM/blob.json
new file mode 100644
index 00000000..4ce4fc1c
--- /dev/null
+++ b/dev/hpfs/EPM/blob.json
@@ -0,0 +1,6 @@
+{
+ "compiler_path": "nasm",
+ "sources_path": ["EPM.asm"],
+ "output_name": "hpfs.bin",
+ "compiler_flags": ["-f bin"]
+}
diff --git a/dev/hpfs/ReadMe.md b/dev/hpfs/ReadMe.md
new file mode 100644
index 00000000..999b0d30
--- /dev/null
+++ b/dev/hpfs/ReadMe.md
@@ -0,0 +1,9 @@
+# High Performance File System
+
+Filesystem driver for the HPFS specification.
+
+## Installation
+
+- Use BTB to build filesystem and partition blobs.
+
+###### Copyright ZKA Technologies. All rights reserved.
diff --git a/dev/hpfs/hpfs.json b/dev/hpfs/hpfs.json
new file mode 100644
index 00000000..5f01ab74
--- /dev/null
+++ b/dev/hpfs/hpfs.json
@@ -0,0 +1,22 @@
+{
+ "compiler_path": "x86_64-w64-mingw32-g++",
+ "compiler_std": "c++20",
+ "headers_path": ["../"],
+ "sources_path": ["src/*.cxx"],
+ "output_name": "hpfs.sys",
+ "compiler_flags": [
+ "-fPIC",
+ "-ffreestanding",
+ "-shared",
+ "-fno-rtti",
+ "-fno-exceptions",
+ "-Wl,--subsystem=17"
+ ],
+ "cpp_macros": [
+ "__HPFS_IMPL__",
+ "__NEWOSKRNL__",
+ "cHPFSVersion=0x0100",
+ "cHPFSVersionHighest=0x0100",
+ "cHPFSVersionLowest=0x0100"
+ ]
+}
diff --git a/dev/hpfs/hpfs_specs.hxx b/dev/hpfs/hpfs_specs.hxx
new file mode 100644
index 00000000..4fc24c21
--- /dev/null
+++ b/dev/hpfs/hpfs_specs.hxx
@@ -0,0 +1,15 @@
+/* -------------------------------------------
+
+ Copyright ZKA Technologies.
+
+ FILE: Defines.hxx
+ PURPOSE: HPFS IFS defines.
+
+------------------------------------------- */
+
+#pragma once
+
+typedef __INT32_TYPE__ HPFS_INT32;
+typedef void HPFS_VOID;
+
+#define cHPFSVersion 0x0100
diff --git a/dev/hpfs/src/hpfs_main.cxx b/dev/hpfs/src/hpfs_main.cxx
new file mode 100644
index 00000000..eaa64dc5
--- /dev/null
+++ b/dev/hpfs/src/hpfs_main.cxx
@@ -0,0 +1,20 @@
+/* -------------------------------------------
+
+ Copyright ZKA Technologies.
+
+ FILE: IFSMain.cxx
+ PURPOSE: HPFS IFS entrypoint.
+
+------------------------------------------- */
+
+#include <hpfs/hpfs_specs.hxx>
+#include <ddk/KernelStd.h>
+
+/** @brief HPFS IFS main. */
+HPFS_INT32 ModuleMain(HPFS_VOID)
+{
+ auto ifs_handle = KernelGetObject(0, "IFS_OBJECT");
+ // TODO: Register this IFS with necessary I/O functions...
+
+ return 0;
+}