Skip to content
This repository was archived by the owner on Jan 4, 2026. It is now read-only.

Commit 6edc6d3

Browse files
authored
Merge pull request #166 from assembler-0/Development
Development
2 parents dee134c + 6cf5abf commit 6edc6d3

27 files changed

Lines changed: 539 additions & 310 deletions

.github/workflows/main.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ jobs:
4242
cmake .. -G Ninja \
4343
-DCMAKE_BUILD_TYPE=Release \
4444
-DVF_SCHEDULER=EEVDF \
45-
-DVF_CONFIG_HEAP_LANG=RUST \
4645
-DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain/linux-x64.cmake \
4746
-DCMAKE_ASM_NASM_COMPILER=$(which nasm)
4847
cd ..

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ else()
4242
message(STATUS "Using toolchain file: ${CMAKE_TOOLCHAIN_FILE}")
4343
endif()
4444

45+
if(NOT CMAKE_BUILD_TYPE)
46+
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type" FORCE)
47+
message(WARNING "CMAKE_BUILD_TYPE not set. Defaulting to Release.")
48+
endif()
49+
4550
if(CMAKE_GENERATOR STREQUAL "Ninja")
4651
message(STATUS "CMake: Generator: ${CMAKE_GENERATOR}")
4752
else()
@@ -63,7 +68,6 @@ message(STATUS "CMake Current Binary Directory: ${CMAKE_CURRENT_BINARY_DIR}")
6368
message(STATUS "CMake Host System Name: ${CMAKE_HOST_SYSTEM_NAME}")
6469
message(STATUS "CMake Host System Processor: ${CMAKE_HOST_SYSTEM_PROCESSOR}")
6570
message(STATUS "VoidFrame Scheduler: ${VF_SCHEDULER}")
66-
message(STATUS "VoidFrame Heap Management Language: ${VF_CONFIG_HEAP_LANG}")
6771
message(STATUS "CMake sources configured.")
6872

6973
# ============================================================================

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ cd build
6262
cmake .. -DCMAKE_BUILD_TYPE=Release \
6363
-DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain/<linux/windows/macos>-x64.cmake \
6464
-G Ninja \
65-
-DVF_SCHEDULER=<MLFQ/EEVDF> \
66-
-DVF_CONFIG_HEAP_LANG=<C/RUST>
65+
-DVF_SCHEDULER=<MLFQ/EEVDF>
6766
ccmake . # Optinal, tune as needed
6867
ninja -j$(nproc)
6968
ninja run

cmake/cache.cmake

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,3 @@
33
# ============================================================================
44
set(VF_SCHEDULER "EEVDF" CACHE STRING "Scheduler type: MLFQ or EEVDF")
55
set_property(CACHE VF_SCHEDULER PROPERTY STRINGS MLFQ EEVDF)
6-
7-
set(VF_CONFIG_HEAP_LANG "C" CACHE STRING "Heap language: RUST or C")
8-
set_property(CACHE VF_CONFIG_HEAP_LANG PROPERTY STRINGS RUST C)

cmake/features.cmake

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ add_compile_definitions(
1414
VF_CONFIG_ENABLE_NVME
1515
VF_CONFIG_ENABLE_GENERIC_SOUND
1616
VF_CONFIG_RTC_CENTURY
17-
VF_CONFIG_LOAD_MB_MODULES
1817
VF_CONFIG_ENFORCE_MEMORY_PROTECTION
1918
VF_CONFIG_VM_HOST
2019
VF_CONFIG_SNOOZE_ON_BOOT
@@ -34,6 +33,7 @@ add_compile_definitions(
3433
# VF_CONFIG_CERBERUS_THREAT_REPORTING
3534
# VF_CONFIG_PROCINFO_AUTO_CLEANUP
3635
# VF_CONFIG_PANIC_OVERRIDE
36+
# VF_CONFIG_LOAD_MB_MODULES
3737
)
3838

3939
if(EXCLUDE_EXTRA_OBJECTS)
@@ -50,12 +50,4 @@ elseif(VF_SCHEDULER STREQUAL "EEVDF")
5050
add_compile_definitions(VF_CONFIG_SCHED_EEVDF)
5151
else()
5252
message(FATAL_ERROR "Invalid scheduler: ${VF_SCHEDULER}. Did you pass: -DVF_SCHEDULER=<MLFQ/EEVDF>?")
53-
endif()
54-
55-
if(VF_CONFIG_HEAP_LANG STREQUAL "RUST")
56-
add_compile_definitions(VF_CONFIG_HEAP_RUST)
57-
elseif(VF_CONFIG_HEAP_LANG STREQUAL "C")
58-
add_compile_definitions(VF_CONFIG_HEAP_C)
59-
else()
60-
message(FATAL_ERROR "Invalid heap language: ${VF_CONFIG_HEAP_LANG}. Did you pass: -DVF_CONFIG_HEAP_LANG=<RUST/C>?")
61-
endif()
53+
endif()

cmake/source.cmake

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,14 @@ set(ASM_SOURCES
1717
set(KERNEL_CORE_SOURCES
1818
kernel/core/Kernel.c
1919
kernel/core/Panic.c
20-
vfcompositor/Compositor.c
2120
kernel/core/InitRD.c
2221
)
2322

23+
set(VFC_SOURCES
24+
vfcompositor/Compositor.c
25+
vfcompositor/app/GUIShell.c
26+
)
27+
2428
set(SCHED_SOURCES
2529
kernel/sched/MLFQ.c
2630
kernel/sched/EEVDF.c
@@ -57,6 +61,7 @@ set(MM_SOURCES
5761
mm/MemPool.c
5862
mm/trace/StackTrace.c
5963
mm/security/Cerberus.c
64+
mm/dynamic/c/Magazine.c
6065
mm/PageFaultHandler.c
6166
)
6267

@@ -128,7 +133,6 @@ set(OBJ_SOURCES)
128133
# ============================================================================
129134
include_directories(
130135
.
131-
vfcompositor
132136
include
133137
kernel/atomic
134138
kernel/core
@@ -175,16 +179,13 @@ include_directories(
175179
arch/x86_64/idt
176180
arch/x86_64/interrupts
177181
arch/x86_64/syscall
182+
vfcompositor
183+
vfcompositor/app
178184
)
179185

180186
# ============================================================================
181187
# Sources Configuration
182188
# ============================================================================
183-
if (VF_CONFIG_HEAP_LANG STREQUAL "C")
184-
list(APPEND MM_SOURCES
185-
mm/dynamic/c/Magazine.c
186-
)
187-
endif()
188189

189190
if(NOT EXCLUDE_EXTRA_OBJECTS)
190191
set(OBJ_SOURCES
@@ -207,4 +208,5 @@ set(C_SOURCES
207208
${DRIVER_SOURCES}
208209
${ARCH_SOURCES}
209210
${INCLUDE_SOURCES}
211+
${VFC_SOURCES}
210212
)

docs/DEVELOPMENT.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ Here are the commands to install the required dependencies on various platforms.
2929

3030
```bash
3131
# Update package list and install dependencies
32-
sudo pacman -Syu cmake ninja clang nasm qemu-full dosfstools e2fsprogs grub xorriso mtools
32+
sudo pacman -Syu cmake ninja clang nasm qemu-full dosfstools e2fsprogs grub xorriso mtools rustup
33+
rustup target add x86_64-unknown-none
34+
rustup toolchain install nightly
3335
```
3436

3537
</details>
@@ -41,6 +43,10 @@ sudo pacman -Syu cmake ninja clang nasm qemu-full dosfstools e2fsprogs grub xorr
4143
# Update package list and install dependencies
4244
sudo apt update
4345
sudo apt install -y cmake ninja-build clang nasm qemu-system-x86 dosfstools e2fsprogs grub-pc-bin xorriso mtools
46+
curl --proto '=https' --tlsv1.3 https://sh.rustup.rs -sSf | sh -s -- -y
47+
source ~/.cargo/env
48+
rustup toolchain install nightly
49+
rustup target add x86_64-unknown-none
4450
```
4551

4652
</details>
@@ -51,6 +57,10 @@ sudo apt install -y cmake ninja-build clang nasm qemu-system-x86 dosfstools e2fs
5157
```bash
5258
# Install dependencies
5359
sudo dnf install -y cmake ninja-build clang nasm qemu-system-x86 dosfstools e2fsprogs grub2-tools-extra xorriso mtools
60+
curl --proto '=https' --tlsv1.3 https://sh.rustup.rs -sSf | sh -s -- -y
61+
source ~/.cargo/env
62+
rustup toolchain install nightly
63+
rustup target add x86_64-unknown-none
5464
```
5565

5666
</details>

include/Scheduler.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
///@brief Unified wrapper for multiple scheduler implementations
33
#ifndef VOIDFRAME_SCHEDULER_H
44
#define VOIDFRAME_SCHEDULER_H
5+
#include "MLFQ.h"
56

67
#if defined(VF_CONFIG_SCHED_MLFQ)
78
#include "MLFQ.h"
@@ -39,6 +40,16 @@ static inline __attribute__((always_inline)) uint32_t CreateProcess(const char *
3940
#endif
4041
}
4142

43+
static inline __attribute__((always_inline)) uint32_t CreateSecureProcess(const char * name, void (*entry_point)(), uint8_t priv, uint8_t flag) {
44+
#if defined(VF_CONFIG_SCHED_MLFQ)
45+
return MLFQCreateSecureProcess(name, entry_point, priv, flag);
46+
#elif defined(VF_CONFIG_SCHED_EEVDF)
47+
return EEVDFCreateSecureProcess(name, entry_point, priv, flag);
48+
#elif defined(VF_CONFIG_SCHED_CFS)
49+
return 0; // not implemented
50+
#endif
51+
}
52+
4253
static inline __attribute__((always_inline)) CurrentProcessControlBlock* GetCurrentProcess() {
4354
#if defined(VF_CONFIG_SCHED_MLFQ)
4455
return MLFQGetCurrentProcess();

include/Window.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ struct Window {
3131

3232
// Window state
3333
bool minimized;
34+
uint32_t owner_pid; // PID of the process that created this window
3435
};
3536

3637
#endif // WINDOW_H

kernel/core/InitRD.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
#include "Multiboot2.h"
33
#include "Console.h"
44
#include "VFS.h"
5-
#include "KernelHeap.h"
6-
#include "MemOps.h"
7-
85
extern uint32_t g_multiboot_info_addr;
96

107
void InitRDLoad(void) {

0 commit comments

Comments
 (0)