Hi
I am trying to get into BSD kernel development but I am having a little bit of trouble porting this code from Linux to FreeBSD.
I am trying to do this without the linuxkpi because I think that's a road to nowhere, so while this will be a bit more difficult to get up and going. It will allow better understanding and a way to actually port Linux code by understanding what the Linux kernel is doing and using equivalent structures and kernel calls in FreeBSD.
With that being said, I have this code below.
http://paste2.org/8AH4wJHf
I am not super familiar with FreeBSD kernel structures and code layout just yet but I am getting there.
I recently downloaded the 4.9 release of the linux kernel and I'm looking around in there to see. A lot of the code seems pretty generic until it gets to things like the memory allocation, virtual memory and some queue type structures in files like slab.h or kworker.
For instance above kthread, kernel, input, dmi, delay, mutex, etc...
I am sure FreeBSD must have an equivalent function to stringify, workerqueue, kthread, etc...
How can I find these equivalent files in FreeBSD?
I am trying to get into BSD kernel development but I am having a little bit of trouble porting this code from Linux to FreeBSD.
I am trying to do this without the linuxkpi because I think that's a road to nowhere, so while this will be a bit more difficult to get up and going. It will allow better understanding and a way to actually port Linux code by understanding what the Linux kernel is doing and using equivalent structures and kernel calls in FreeBSD.
With that being said, I have this code below.
http://paste2.org/8AH4wJHf
I am not super familiar with FreeBSD kernel structures and code layout just yet but I am getting there.
I recently downloaded the 4.9 release of the linux kernel and I'm looking around in there to see. A lot of the code seems pretty generic until it gets to things like the memory allocation, virtual memory and some queue type structures in files like slab.h or kworker.
Code:
// #include <linux/acpi.h>
#include "/home/username/custom_build/linux-4.9/arch/powerpc/boot/stdio.h" //:#define EINVAL 22 /* Invalid argument */
#include <linux/delay.h>
#include <linux/dmi.h>
#include <linux/input.h>
#include <linux/kernel.h>
#include <linux/kthread.h>
#include <linux/leds.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/platform_device.h>
#include <linux/rfkill.h>
#include <linux/stringify.h>
#include <linux/version.h>
#include <linux/workqueue.h>
For instance above kthread, kernel, input, dmi, delay, mutex, etc...
I am sure FreeBSD must have an equivalent function to stringify, workerqueue, kthread, etc...
How can I find these equivalent files in FreeBSD?