Skip to content

Commit

Permalink
kernel/fs: Fix initramfs partition device
Browse files Browse the repository at this point in the history
  • Loading branch information
Qwinci committed Nov 30, 2023
1 parent f4669e4 commit af6d9eb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
9 changes: 7 additions & 2 deletions kernel/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@ target_compile_options(crescent PRIVATE
-mgeneral-regs-only -mno-red-zone
-fno-stack-protector
-fno-omit-frame-pointer
-fPIE -Werror=switch -Werror=return-type
-Werror=frame-larger-than=8192>)
-fPIE -Werror=switch -Werror=return-type>)

if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
target_compile_options(crescent PRIVATE $<$<COMPILE_LANGUAGE:C>: -Wframe-larger-than=8192 -Werror=frame-larger-than>)
else()
target_compile_options(crescent PRIVATE $<$<COMPILE_LANGUAGE:C>: -Werror=frame-larger-than=8192>)
endif()

check_c_compiler_flag(-nostdlibinc COMPILER_SUPPORTS_NOSTDLIBINC)
check_c_compiler_flag(-Werror=noderef COMPILER_SUPPORTS_NODEREF)
Expand Down
2 changes: 2 additions & 0 deletions kernel/src/fs/tar.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,10 @@ void tar_initramfs_init() {

PartitionDev* dev = kcalloc(sizeof(PartitionDev));
assert(dev);
dev->vfs = tar_vfs;

memcpy(dev->generic.name, "initramfs", sizeof("initramfs"));

dev_add(&dev->generic, DEVICE_TYPE_PARTITION);
kprintf("[kernel][fs][tar]: initramfs.tar mounted as device 'initramfs'\n");
}
2 changes: 1 addition & 1 deletion kernel/src/sched/mutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ typedef struct {
Task* waiting_tasks;
Task* waiting_tasks_end;
Spinlock task_protector;
bool inner;
atomic_bool inner;
} Mutex;

bool mutex_try_lock(Mutex* self);
Expand Down

0 comments on commit af6d9eb

Please sign in to comment.