For a school project I am analyzing and modifying the process scheduler in FreeBSD. We chose FreeBSD because modifying the kernel is the easiest out of any operating system I have ever used. Currently, I am trying to compile the scheduler (sched_ule.c) outside the kernel source so I can make a test bench of the current and modified scheduler. When I compile now, I get a long list of errors, the first few are here:
I attached the entire output as make_output.txt.
I'm using Clang and I've tried including /usr/src/include as a system header directory, and as a standard header and I still get the same errors. I'm using a simple makefile to build this as it should be a simple project.
I plan to add driver code later to actually test it but first I needed to get this to at least compile. I used svnlite to get the source into /usr/src and I copied sched_ule.c into my testing directory. I also copied opt_sched.h and opt_hwpmc_hooks.h from /usr/obj after performing a
I would like to get this to compile for my own testbench but if there is an existing one floating around, I'll gladly borrow from that. Any help is appreciated.
Code:
In file included from sched_ule.c:45:
/usr/include/sys/systm.h:304:30: error: unknown type name 'uintfptr_t'; did you mean 'uintptr_t'?
void hardclock(int usermode, uintfptr_t pc);
^
/usr/include/sys/_stdint.h:78:22: note: 'uintptr_t' declared here
typedef __uintptr_t uintptr_t;
^
In file included from sched_ule.c:45:
/usr/include/sys/systm.h:311:30: error: unknown type name 'uintfptr_t'; did you mean 'uintptr_t'?
void profclock(int usermode, uintfptr_t pc);
^
I'm using Clang and I've tried including /usr/src/include as a system header directory, and as a standard header and I still get the same errors. I'm using a simple makefile to build this as it should be a simple project.
Code:
CC = clang
SYSINC = /usr/src/include
INC1 = /usr/src/sys/amd64/include
INCDIRS = -isystem${SYSINC} -I${INC1}
CFLAGS = ${INCDIRS}
sched_ece: sched_ule.c opt_sched.h opt_hwpmc_hooks.h
${CC} ${CFLAGS} sched_ule.c -o sched_ece
make buildkernel
. I've been trying to follow the makefiles in the source tree but they are dense and I haven't seen much that has been helpful. I would like to get this to compile for my own testbench but if there is an existing one floating around, I'll gladly borrow from that. Any help is appreciated.