Solved [SOLVED] Kernel Config File CPU Types Request

Good Evening,

FreeBSD 10.0 x64.

I am building a custom kernel becasue I need to enable hardware that is not enabled by default in the generic kernel. I am following the wiki in the FreeBSD handbook. I have looked in the NOTES file...and cannot find a description about cpu types. After copying the GENERIC kernel config to a filename of my choosing, and now I am proceeding to edit it. The option in my file is "cpu HAMMER".

Well...this is an Intel box, core I5. I have checked on wiki.freebsd.org, and also through the docs and faq's on this site....I can't seem to find any documentation that explains to me what my "cpu" options in the kernel config file are available to me.

Can someone please point me to this data?
Or tell me that to remove this line causes the kernel to build "native"?

I have another system I need to build for as well and it is an AMD FX Piledriver (8-core)

This is my first FreeBSD kernel build. I've built lots of kernels for Linux...So I am cutting my kernel teeth in FreeBSD.


Thank you.

Sincerely and respectfully,

Dave
 
Re: Kernel Config File CPU Types Request

This is not the option you're looking for. *subtlehandwavinggesture* :)

The cpu option is... uhm... "documented" in config(5). Specifying cpu HAMMER basically means "any processor that understands amd64 aka x86_64". There is no other value available for amd64, so it's more like a "CPU class" thing.

However, you can tell the compiler to create CPU-specific code (which is probably what you want) by tweaking your /etc/make.conf. This file doesn't exist by default but there's an example one in /usr/share/examples/etc/. Just set CPUTYPE?=native and the compiler will then use this value for its -march flag. Note that CPUTYPE affects everything that uses make.conf(), e.g. world, kernel and ports.
 
Re: Kernel Config File CPU Types Request

Thank you for the reply.

It is documented....but off the radar for Linux users moving to FreeBSD. In my Arch Linux install, man config brings me to an SSL config man page. I had no idea that FreeBSD has a man page for the config file itself.

In defense of a FreeBSD rookie....I double checked the handbook just now, and "man config" is not referenced there. But no worries...You have given me the exact pointer I asked for, and I am appreciative!

The make file options I was already on top of.....

This is what I needed, and I thank you for your post!


Sincerely and respecfully,

Dave
 
Re: Kernel Config File CPU Types Request

Hello All,


I tried worldi's solution with no luck. The "man config" issued at a FreeBSD 10.0 CLI, does not reference the same data that the online man page worldi pointed me to. They both talk about the kernel config file though, but they do not match in content.

Then I went into the source tree at the locations specified by the online man page, and read several options files. They do not contain a list of all my choices in the cpu slot of the kernel config file. They only have one, "HAMMER".

In my logic, a gpu line in the kernel config file is there for a reason. I still cannot find where the documentation is that explains all the choices I have in this slot, showing details on when each option should be used.

So I removed the solved tag, and am resubmitting the original question.


I would sincerely appreciate a pointer to the documentation for this slot.


Sincerely and respectfully,

Dave
 
My first customized kernel built, installed, and booted on the 1st try!

My hat's off to the documentatation in the handbook.....I just encourage adding descriptions of the CPU options to that same document to avoid the cpu option issue.


Sincerly and respectfully,


Dave
 
dcbdbis said:
My first customized kernel built, installed, and booted on the 1st try!

Glad to hear! :beergrin


BTW, to get the man page linked above use man 5 config. Man pages are split into sections numbered 1 to 9. You can use man -k intro | grep "^intro" to get a quick overview of what each section is about. If you do not specify a section number man checks the sections in this order: 1,8,2,3,4,5,6,7,9 (according to man's own man page). This is why you got config(8) instead of config(5) (note the section numbers in upper left and upper right).
 
For my i5, I include the GENERIC kernel but turn off 486 code with
Code:
include GENERIC
nocpu   I486_CPU

Then set the CPU optimization in /etc/make.conf. Possible entries for /etc/make.conf are shown in /usr/share/examples/etc/make.conf.
Code:
CPUTYPE?=core2
I don't know whether these have the same effect on Clang under FreeBSD 10 as they do with GCC on earlier versions.

Hint: do not set CFLAGS. It will cause trouble, not make improvements.
 
Thank you for the reply.

Yeah...I read that dinking around with the make.conf file leads to grief. Mine is unmodified.

Also, as I am setting up a laptop, I am using the binary distribution.....Once it's all setup, I am going to image the entire HDD and deploy it to the other 12 laptops (all of same make.mfg/model).

Again, Thanks!


Sincerely and respectfully,


Dave...
 
Back
Top