tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Linker error (multiple definition) during LD_STAGE 2 with custom scheduler
On Sat, Jun 20, 2026 at 18:57:13 +0500, Тимофей Масленников wrote:
> I've already read the csf(9) and config(5) manuals and configured the
> options and configurations for building the scheduler.
>
> In order for the scheduler algorithm to work with the entire OS
> kernel, I need to follow the sched.h template, right? Implement
> functions with the same names, arguments, and return values.
>
> However, this creates a 'multiple definition of' problem: my kernel
> functions are compiled alongside the base implementation in
> kern_runq.c, and they conflict, causing linking to fail.
>
> The conflicts aren't limited to specific functions, but rather all
> implemented functions (except for static ones, which are needed to
> simplify code reading and algorithm maintenance). sched_init,
> sched_cpuattach, sched_enqueue, sched_dequeue, sched_lwp_fork,
> sched_lwp_collect, sched_tick, sched_nice.
> I definitely need to implement these functions because my scheduler
> works differently than classic MLFQ, and I need to add support for my
> additional structures in each of them.
If you want to completely replace the scheduler, not just write a new
scheduling algorithm _within_ the csf(9) framework, then you need to
also rip out kern_runq.c (and probably some more bits).
> I also wanted to ask about the function set. sched_4bsd and sched_m2
> don't implement the full set of functions declared in sys/sys/sched.h.
> So where do the definitions of the missing functions come from? From
> that same kern_runq.c?
It also seems that csf(9) is rather out of date. You will have to
either RTFS or (and) get hold of someone familiar with the scheduler
and nag them to update the docs. :)
-uwe
Home |
Main Index |
Thread Index |
Old Index