compile and bootfreebsd kernel for ryzen zen3 5500GT cpu.

Hi I am Rupesh from India and I have brought new pc with ryzen 5500GT cpu and Asus prime b450 motherboard and installed freebsd 14.1 release os. I want to compile freebsd kernel for my particular cpu.

I have followed all the steps suggested in configuring freebsd kernel and succeeded in compiling and installation but I can't boot new kernel.

The steps I followed are as follows

# cd /usr/src/sys/amd64/conf
# mkdir /root/kernels
# cp GENERIC /root/kernels/MYKERNEL
# ln -s /root/kernels/MYKERNEL


After that I have tried to change cpu entry in MYKERNEL to znver3 but I got error as znver3 not found and so I have restored this entry to original as HAMMER.

I have copied the make.conf from /usr/share/examples to /etc and changed cputype entry to znver3.

I have built and installed successfully through the following commands


# cd /usr/src
# make buildkernel KERNCONF=MYKERNEL
# make installkernel KERNCONF=MYKERNEL

After that I have rebooted and after logging to my system I have issued the following command

# uname -a

But I am not able to see the word MYKERNEL from the above command.

After that I have navigated to /boot directory and I am able to see entries as

kernel
kernel-old etc.,

Now my question is how to know whether the recently compiled kernel is booted.

How to know whether my kernel was built which is optimised for my particular cpu ie., znver3.

If you think I have done something wrong please suggest what I have done wrong and suggest how to compile and load the kernel which is optimised for my ryzen zen3 processor.

Regards,
Rupesh.
 
"znver3" is not a valid CPU class. For amd64 there is *only* HAMMER as there are no other variants of that architecture.

Why would you want to use a custom kernel anyways?
 
I used to have a stripped amd64 kernel to boot faster, but everything got more efficient and modular. My GENERIC kernel boots now in +/- 3 seconds. I believe they still could improve the hardware init. The USB-stack isn't fully operational after this and network configuration takes longer than technically should be required.
But what config settings do you use for a specific amd64 cpu model? I'm curious, is there anything I can do to still improve my new 13900K system? (before it goes south, according to the latest news ?)
 
Hi from the freebsd command line I issued the following command

gcc -march=native -Q --help=target | grep March

I got the result as

-march= znver3
Known valid arguments for -march= option:

From the above output I can say that I can provide value for CPUTYPE? option in /etc/make.conf as znver3.
 
GCC can be used on a FreeBSD system; that's why it is in ports. However, FreeBSD has switched to use the llvm tool chain for its own source code of the OS.

Because FreeBSD now relies on and develops its OS with clang & llvm, using GCC for its OS & kernel & userland is not supported. Trying to use GCC for that ranges from impractable to practically impossible (more likely).
 
GCC can be used on a FreeBSD system; that's why it is in ports. However, FreeBSD has switched to use the llvm tool chain for its own source code of the OS.

Because FreeBSD now relies on and develops its OS with clang & llvm, using GCC for its OS & kernel & userland is not supported. Trying to use GCC for that ranges from impractable to practically impossible (more likely).
I'm not using / have no experience, though, external toolchain is supported at least for cross building.
 
Is there any way to find the current CPU type through llvm clang.
`clang --print-supported-cpus` starts you down that route. Just because clang supports it does not mean it is tested and properly functioning for an OS build but it would be good to get bugs related to it reported/fixed. The main documentation leading people to /usr/share/examples/etc/make.conf gives people a tested, but currently inaccurate, list of values. These are values you change only in /etc/make.conf and not in your kernel configuration file

Following the handbook also guides you in how to create a kernel config that brings in generic instead of needing to make a copy of it in its entirety. Doing so minimizes how much there is to review after an update and makes displaying what you changed simple even without diff syntax.

I'd start out trying to just get a build of the generic kernel to run successfully before worrying about changing it. Any change you make could be reasons to have it fail such as leaving out devices that are needed or exposing an issue with the attempted compiler tweaks. Even "supported" tweaks can lead to you running into bugs so you may want to test the impact of the changes when working to decide which ones you want the risk of using. Your command should have worked to put you on your new kernel. If I recall, uname -a will not report the filename you used to build the kernel and requires IDENT as cracauer@ asked about; that is also in the taught steps for importing GENERIC into your configuration as I spoke of earlier.
 
Back
Top