Compare commits

...

2 Commits

Author SHA1 Message Date
Bananymous fa900df5a7 Kernel: Add signals for threads after IRQs
This allows signals to be called even if the process does no syscalls
The old scheduler did signal handling but I feel like it should be
enough to handle them only after syscalls and IRQs. ISRs already
handle signals that caused the ISR and there is no other route to
kernel space.
2024-04-03 15:07:18 +03:00
Bananymous 414f0f6cd9 Userspace: Don't link with libc
This fixes bug where sometimes cmake does not find libc from sysroot

LibC is linked per program in its own CMakeLists.txt
2024-04-03 14:46:18 +03:00
2 changed files with 6 additions and 1 deletions

View File

@ -362,6 +362,10 @@ done:
dprintln("no handler for irq 0x{2H}", irq);
}
auto& current_thread = Thread::current();
if (current_thread.can_add_signal_to_execute())
current_thread.handle_signal();
Scheduler::get().reschedule_if_idling();
ASSERT(Thread::current().state() != Thread::State::Terminated);

View File

@ -56,7 +56,8 @@ add_subdirectory(aoc2023)
foreach(USERSPACE_PROJECT ${USERSPACE_PROJECTS})
target_compile_options(${USERSPACE_PROJECT} PRIVATE -g)
add_dependencies(${USERSPACE_PROJECT} libc-install ban-install)
add_dependencies(userspace ${USERSPACE_PROJECT})
add_dependencies(userspace-install ${USERSPACE_PROJECT}-install)
target_link_options(${USERSPACE_PROJECT} PRIVATE -nolibc)
endforeach()