# Kernel Option



## mfarrag (Jul 7, 2011)

Hello guys,

   I want to make a new scheduler for my kernel. I have removed ule_scheduler from my kernel tree and created new one. I made a patch but I don't know how to apply it to my kernel. Can I add my new scheduler as a new option in the kernel?

Regards,

Mohammed


----------



## graudeejs (Jul 7, 2011)

That's interesting. Someone who can write new scheduler for FreeBSD, don't know how to apply patch...
Even more, I wonder how did you made that patch (you didn't test it?).

Well back to topic: check out from which directory the patch was made, and *cd* to it, then simply `# patch < /path/to/mysterious/FreeBSD/new/scheduler.diff`

The patch is probably against the /usr/src directory.

After that you need to rebuild kernel, reboot and cross fingers.


----------



## mfarrag (Jul 8, 2011)

First of all, thanks for your reply.

Second, my question was clearly about how to build the kernel with my scheduler from scratch. I don't mean to build the kernel with ULE_SCHEDULER and then apply the patch. What I need is to compile the kernel with the new scheduler from scratch without using patches. It seems exhaustive but I want to have a kernel indepenedent of the ULE. 

Regards,

Mohammed


----------



## mfarrag (Jul 8, 2011)

What I mean is having the new scheduler in the configuration file too.


----------



## mfarrag (Jul 9, 2011)

Sorry for misunderstanding. Here is the sequence apply the patch, *modify kernel configuration file with the kernel scheduler name*, rebuild kernel and reboot
Check that http://bbs.chinaunix.net/archiver/?tid-1123367.html
Thanks


----------



## graudeejs (Jul 9, 2011)

Well in kernel config, you remove

```
options SCHED_ULE
```
 and add 
	
	



```
options SCHED_yoursched
```
then recompile kernel
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-building.html


----------

